/**
 * NatureDoc Custom Patterns - Styles
 *
 * Theme-agnostic styles for custom block patterns.
 * Uses increased specificity to override theme defaults.
 */

/* Content Box */
.entry-content .naturedoc-box,
.naturedoc-box {
    border: 1px solid #c13c7a;
    border-radius: 7px;
    margin: 0 0 20px 0;
    padding: 0;
    overflow: hidden;
}

.entry-content .naturedoc-box .naturedoc-box-title,
.naturedoc-box .naturedoc-box-title {
    display: block;
    padding: 0.5em 1em;
    font-weight: 400;
    font-size: 1.1em;
    background-color: #c13c7a;
    color: #ffffff;
    margin: 0;
    border-radius: 0;
}

.entry-content .naturedoc-box .naturedoc-box-content,
.naturedoc-box .naturedoc-box-content {
    padding: 0;
}

/* Add margin to direct children except tables */
.entry-content .naturedoc-box .naturedoc-box-content > *,
.naturedoc-box .naturedoc-box-content > * {
    margin-left: 1em;
    margin-right: 1em;
}

.entry-content .naturedoc-box .naturedoc-box-content > *:first-child,
.naturedoc-box .naturedoc-box-content > *:first-child {
    margin-top: 1em;
}

.entry-content .naturedoc-box .naturedoc-box-content > *:last-child,
.naturedoc-box .naturedoc-box-content > *:last-child {
    margin-bottom: 1em;
}

/* Tables go edge-to-edge */
.entry-content .naturedoc-box .naturedoc-box-content > .naturedoc-table,
.naturedoc-box .naturedoc-box-content > .naturedoc-table {
    margin-left: 0;
    margin-right: 0;
}

.entry-content .naturedoc-box .naturedoc-box-content > .naturedoc-table:first-child,
.naturedoc-box .naturedoc-box-content > .naturedoc-table:first-child {
    margin-top: 0;
}

.entry-content .naturedoc-box .naturedoc-box-content > .naturedoc-table:last-child,
.naturedoc-box .naturedoc-box-content > .naturedoc-table:last-child {
    margin-bottom: 0;
}

/* Table styling within content box */
.entry-content .naturedoc-box .naturedoc-box-content table,
.naturedoc-box .naturedoc-box-content table {
    width: 100%;
    margin: 0;
}

/* Data Table */
.entry-content .naturedoc-table table,
.naturedoc-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Table inside content box - square top, rounded bottom */
.entry-content .naturedoc-box .naturedoc-box-content .naturedoc-table table,
.naturedoc-box .naturedoc-box-content .naturedoc-table table {
    border-radius: 0 0 6px 6px;
}

.entry-content .naturedoc-table thead th,
.naturedoc-table thead th {
    background-color: #fafafa;
    font-weight: 700;
    color: #51585a;
    text-align: left;
    padding: 0.5em 1em;
    border: none;
    border-bottom: 1px solid #e0e0e0;
}

.entry-content .naturedoc-table tbody td,
.naturedoc-table tbody td {
    padding: 0.5em 1em;
    color: #51585a;
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

.entry-content .naturedoc-table tbody tr:last-child td,
.naturedoc-table tbody tr:last-child td {
    border-bottom: none;
}

.entry-content .naturedoc-table tbody td:first-child,
.naturedoc-table tbody td:first-child {
    font-weight: 700;
}

/* Remove default WordPress table figure margins */
.entry-content figure.naturedoc-table,
figure.naturedoc-table {
    margin: 0;
}
