/**
 * Gutenberg Blocks Custom Styling - MagicNet
 * Synchronized with theme aesthetic: Clean, modern cards with subtle dividers.
 */

/* ==========================================================================
   1. TABLE BLOCK (wp-block-table)
   ========================================================================== */

figure.wp-block-table,
.inner-page figure.wp-block-table,
figure.wp-block-table.table,
figure.wp-block-table.table-bordered {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02) !important;
    overflow: hidden !important;
    margin-top: 28px !important;
    margin-bottom: 32px !important;
    padding: 0 !important;
}

/* Frontend: take full width of .container */
.inner-page figure.wp-block-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Gutenberg Editor: keep Gutenberg's .wp-block container max-width */
.editor-styles-wrapper .wp-block[data-type="core/table"],
.editor-styles-wrapper [data-type="core/table"] > figure,
.editor-styles-wrapper figure.wp-block-table,
.editor-styles-wrapper .wp-block-table,
.block-editor-block-list__block[data-type="core/table"] {
    box-sizing: border-box !important;
}

.editor-styles-wrapper figure.wp-block-table table {
    width: 100% !important;
    table-layout: fixed !important;
}

figure.wp-block-table table,
.inner-page figure.wp-block-table table,
figure.wp-block-table table.table-bordered,
figure.wp-block-table .has-fixed-layout {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: none !important;
    margin: 0 !important;
    background: transparent !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Header */
figure.wp-block-table thead,
.inner-page figure.wp-block-table thead {
    background: #f8fafc !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

figure.wp-block-table thead tr,
.inner-page figure.wp-block-table thead tr {
    background: transparent !important;
    border: none !important;
}

figure.wp-block-table thead th,
.inner-page figure.wp-block-table thead th,
figure.wp-block-table thead th[data-align="center"],
figure.wp-block-table thead th[data-align="left"],
figure.wp-block-table thead th.has-text-align-center,
figure.wp-block-table thead th.has-text-align-left {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #475569 !important;
    padding: 16px 20px !important;
    line-height: 1.4 !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    background: #f8fafc !important;
    vertical-align: middle !important;
}

/* First Column: № */
figure.wp-block-table thead th:first-child,
.inner-page figure.wp-block-table thead th:first-child,
figure.wp-block-table thead th.has-text-align-center:first-child {
    width: 75px !important;
    max-width: 75px !important;
    text-align: center !important;
    border-right: 1px solid #edf2f7 !important;
}

/* Second Column: Name */
figure.wp-block-table thead th:nth-child(2),
.inner-page figure.wp-block-table thead th:nth-child(2),
figure.wp-block-table thead th.has-text-align-left:nth-child(2) {
    text-align: left !important;
    padding-left: 24px !important;
}

/* Body */
figure.wp-block-table tbody,
.inner-page figure.wp-block-table tbody {
    border: none !important;
}

figure.wp-block-table tbody tr,
.inner-page figure.wp-block-table tbody tr {
    background: #ffffff !important;
    border: none !important;
    transition: background-color 0.15s ease !important;
}

figure.wp-block-table tbody tr:nth-child(even),
.inner-page figure.wp-block-table tbody tr:nth-child(even) {
    background-color: #fafbfc !important;
}

figure.wp-block-table tbody tr:hover,
.inner-page figure.wp-block-table tbody tr:hover,
figure.wp-block-table tbody tr:nth-child(even):hover,
.inner-page figure.wp-block-table tbody tr:nth-child(even):hover {
    background-color: #f1f5f9 !important;
}

figure.wp-block-table tbody td,
.inner-page figure.wp-block-table tbody td {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #1e293b !important;
    padding: 16px 20px !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

/* Number cell */
figure.wp-block-table tbody td:first-child,
.inner-page figure.wp-block-table tbody td:first-child,
figure.wp-block-table tbody td.has-text-align-center:first-child {
    width: 75px !important;
    max-width: 75px !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: #64748b !important;
    border-right: 1px solid #edf2f7 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Name cell */
figure.wp-block-table tbody td:nth-child(2),
.inner-page figure.wp-block-table tbody td:nth-child(2) {
    text-align: left !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    padding-left: 24px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Last row has no bottom border */
figure.wp-block-table tbody tr:last-child td,
.inner-page figure.wp-block-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Reset any inline border interference from Gutenberg */
.wp-block-table td,
.wp-block-table th {
    border: none !important;
}
.wp-block-table thead {
    border-bottom: 2px solid #e2e8f0 !important;
}


/* ==========================================================================
   2. HEADINGS & PARAGRAPHS IN INNER-PAGE
   ========================================================================== */

.inner-page h1 {
    font-family: 'Bitter', serif !important;
    font-size: 40px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 24px !important;
    letter-spacing: -0.01em !important;
    line-height: 1.25 !important;
}

.inner-page h3.wp-block-heading,
.inner-page h3 {
    font-family: 'Bitter', serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-top: 36px !important;
    margin-bottom: 18px !important;
    letter-spacing: -0.01em !important;
    line-height: 1.35 !important;
}

.inner-page p.wp-block-paragraph,
.inner-page .container > p {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.75 !important;
    color: #334155 !important;
    margin-bottom: 18px !important;
}

.inner-page p.wp-block-paragraph em {
    color: #64748b !important;
    font-size: 14px !important;
    font-style: italic !important;
    display: inline-block !important;
    line-height: 1.6 !important;
}

.inner-page p.wp-block-paragraph strong {
    font-weight: 600 !important;
    color: #0f172a !important;
}


/* ==========================================================================
   3. MOBILE RESPONSIVENESS
   ========================================================================== */

@media (max-width: 767px) {
    .inner-page h1 {
        font-size: 28px !important;
        margin-bottom: 18px !important;
    }

    .inner-page h3.wp-block-heading,
    .inner-page h3 {
        font-size: 19px !important;
        margin-top: 26px !important;
        margin-bottom: 14px !important;
    }

    .inner-page p.wp-block-paragraph,
    .inner-page .container > p {
        font-size: 14px !important;
        line-height: 1.65 !important;
        margin-bottom: 14px !important;
    }

    figure.wp-block-table,
    .inner-page figure.wp-block-table {
        border-radius: 10px !important;
        margin: 20px 0 24px !important;
    }

    figure.wp-block-table thead th,
    .inner-page figure.wp-block-table thead th,
    figure.wp-block-table tbody td,
    .inner-page figure.wp-block-table tbody td {
        padding: 12px 14px !important;
        font-size: 13px !important;
    }

    figure.wp-block-table thead th:first-child,
    .inner-page figure.wp-block-table thead th:first-child,
    figure.wp-block-table tbody td:first-child,
    .inner-page figure.wp-block-table tbody td:first-child {
        width: 48px !important;
        max-width: 48px !important;
        padding: 12px 8px !important;
    }

    figure.wp-block-table thead th:nth-child(2),
    .inner-page figure.wp-block-table thead th:nth-child(2),
    figure.wp-block-table tbody td:nth-child(2),
    .inner-page figure.wp-block-table tbody td:nth-child(2) {
        padding-left: 14px !important;
    }
}
