/* =====================================================
 * Property Description Section (Single Property)
 * ===================================================== */

.property-description-wrap {
    max-width: 1270px;
    margin: 0 auto;
}

.property-description-wrap .description-content .houzez-more-content {
    margin-top: 1rem;
}

.property-description-wrap .description-content [id] {
    scroll-margin-top: 140px;
}

/* "Read Full Property Details" expander button */
.houzez-read-more-link {
    display: inline-block;
    background-color: #0b6230;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    margin-top: 10px;
}

.houzez-read-more-link:hover,
.houzez-read-more-link:focus {
    background-color: #094d26;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(11, 98, 48, 0.25);
}

/* Property Documents Download Block */
.property-description-wrap .block-title-property-doc {
    margin-top: 30px;
    margin-bottom: 15px;
}

.property-description-wrap .block-title-property-doc h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.property-description-wrap .property-documents {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 18px;
    transition: all 0.2s ease;
}

.property-description-wrap .property-documents:hover {
    border-color: #0b6230;
    box-shadow: 0 2px 8px rgba(11, 98, 48, 0.08);
}

.property-description-wrap .property-document-title {
    font-size: 15px;
    font-weight: 500;
    color: #222222;
}

.property-description-wrap .property-document-title i {
    color: #0b6230;
}

.property-description-wrap .property-document-link a {
    color: #0b6230;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.property-description-wrap .property-document-link a:hover {
    color: #094d26;
    text-decoration: underline;
}

/* ==========================================================================
   Property Content Redesign — .description-content
   Dynamic CSS variables injected via assets.php
   ========================================================================== */

.description-content {
    font-size: 18px;
    line-height: 32px;
}

/* --- Headings --- */
.description-content h2 {
    font-size: 24px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--property-heading-color, #222222);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--property-primary, #0b6230);
    position: relative;
}

.description-content h3 {
    font-size: 20px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--property-heading-color, #222222);
    margin: 1.75rem 0 0.75rem;
    position: relative;
}

.description-content h4 {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--property-text, #222222);
    margin: 1.5rem 0 0.5rem;
    position: relative;
}

.description-content > h2:first-child,
.description-content > h3:first-child,
.description-content > h4:first-child {
    margin-top: 0;
}

/* Override child theme's flat .wp-block-heading size */
.description-content h2.wp-block-heading { font-size: 24px; }
.description-content h3.wp-block-heading { font-size: 20px; }
.description-content h4.wp-block-heading { font-size: 18px; }

/* --- Tables & Gutenberg wp-block-table --- */
.description-content .wp-block-table,
.description-content figure.wp-block-table {
    margin: 1.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--property-radius, 8px);
    box-shadow: var(--property-shadow, 0 2px 12px rgba(0, 0, 0, 0.04));
    border: 1px solid var(--property-border, #dce0e0);
    background: var(--property-bg, #ffffff);
}

.description-content table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    background: var(--property-bg, #ffffff);
    border-radius: var(--property-radius, 8px);
    overflow: hidden;
}

.description-content table thead {
    background: var(--property-primary, #0b6230);
    color: #fff;
}

.description-content table thead th {
    padding: 12px 16px;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.description-content table tbody tr {
    border-bottom: 1px solid var(--property-border, #dce0e0);
}

.description-content table tbody tr:last-child {
    border-bottom: none;
}

.description-content table tbody tr:nth-child(even) {
    background: var(--property-accent-light, rgba(11, 98, 48, 0.05));
}

.description-content table td,
.description-content table th {
    padding: 10px 16px;
    vertical-align: middle;
}

.description-content table td:first-child {
    font-weight: 600;
    color: var(--property-heading-color, #222222);
}

.description-content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Blockquotes --- */
.description-content blockquote {
    margin: 1.5rem 0;
    padding: 20px 24px;
    background: var(--property-accent-light, rgba(11, 98, 48, 0.06));
    border-left: 4px solid var(--property-primary, #0b6230);
    border-right: 1px solid var(--property-border, #dce0e0);
    border-radius: 0 var(--property-radius, 8px) var(--property-radius, 8px) 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--property-heading-color, #222222);
    font-style: italic;
}

.description-content blockquote p:last-child {
    margin-bottom: 0;
}

.description-content blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 14px;
    font-style: normal;
    color: #636363;
}

.description-content blockquote cite:before {
    content: "— ";
}

/* --- Lists --- */
.description-content ul,
.description-content ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.description-content ul {
    list-style: none;
    list-style-position: outside;
}

.description-content ul li {
    position: relative;
    padding-left: 0.25rem;
    margin-bottom: 0.5rem;
}

.description-content ul li:before {
    content: "";
    position: absolute;
    left: -1.25rem;
    top: 0.65em;
    width: 6px;
    height: 6px;
    background: var(--property-primary, #0b6230);
    border-radius: 50%;
}

.description-content ol {
    list-style: none;
    counter-reset: property-list;
}

.description-content ol li {
    counter-increment: property-list;
    position: relative;
    padding-left: 0.25rem;
    margin-bottom: 0.5rem;
}

.description-content ol li:before {
    content: counter(property-list);
    position: absolute;
    left: -1.75rem;
    top: 0;
    width: 22px;
    height: 22px;
    background: var(--property-primary, #0b6230);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
}

.description-content ul ul,
.description-content ol ol,
.description-content ul ol,
.description-content ol ul {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.95em;
}

/* --- Paragraphs & Inline --- */
.description-content p {
    margin: 0 0 1.25rem;
    line-height: 1.8;
}

.description-content strong {
    font-weight: 700;
    color: var(--property-heading-color, #222222);
}

.description-content a {
    color: var(--property-primary, #0b6230);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.description-content a:hover {
    color: var(--property-heading-color, #222222);
}

.description-content code {
    background: var(--property-accent-light, rgba(11, 98, 48, 0.06));
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--property-primary, #0b6230);
}

.description-content hr {
    border: none;
    border-top: 1px solid var(--property-border, #dce0e0);
    margin: 2rem 0;
}

/* --- Info Box --- */
.description-content .info-box {
    border-left: 4px solid var(--property-primary, #0b6230);
    background: var(--property-accent-light, rgba(11, 98, 48, 0.06));
    padding: 16px 20px;
}

/* --- Figures, Images, Captions --- */
.description-content figure,
.description-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--property-radius, 8px);
    margin: 1.5rem 0;
}

.description-content figure img {
    margin: 0;
}

.description-content figcaption {
    font-size: 0.9em;
    color: #636363;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Gutenberg Compatibility --- */
.description-content .wp-block-group,
.description-content .wp-block-column,
.description-content .wp-block-cover {
    margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
    .description-content .wp-block-columns {
        flex-direction: column;
        gap: 0;
    }
    .description-content .wp-block-column {
        margin-left: 0;
    }
}

/* --- Layout Mode Patches --- */
.content-wrap-style-minimal .description-content table,
.content-wrap-style-minimal .description-content blockquote {
    background: #fff;
}

.content-wrap-style-minimal .description-content h2 {
    padding-bottom: 0.5rem;
}

.content-wrap-style-minimal .description-content .info-box {
    background: #fff;
}

/* --- Responsive Overrides --- */
@media (max-width: 767.98px) {
    .description-content {
        font-size: 16px;
        line-height: 28px;
    }

    .description-content h2 { font-size: 20px; }
    .description-content h3 { font-size: 18px; }
    .description-content h4 { font-size: 16px; }

    /* --- Responsive Tables (Mobile) --- */
    .description-content .wp-block-table,
    .description-content figure.wp-block-table {
        margin: 1.25rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--property-radius, 8px);
        border: 1px solid var(--property-border, #dce0e0);
        box-shadow: var(--property-shadow, 0 2px 10px rgba(0, 0, 0, 0.04));
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .description-content table,
    .description-content table.has-fixed-layout,
    .description-content .wp-block-table.has-fixed-layout table {
        display: table !important;
        width: 100% !important;
        min-width: 100%;
        border-collapse: collapse;
        table-layout: auto !important;
        font-size: 13.5px;
        line-height: 1.5;
        margin: 0;
        border: none;
        background: var(--property-bg, #ffffff);
    }

    .description-content table thead {
        display: table-header-group !important;
        background: var(--property-primary, #0b6230);
        color: #ffffff;
    }

    .description-content table thead th {
        padding: 10px 12px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #ffffff !important;
        border: none;
        vertical-align: middle;
    }

    .description-content table tbody {
        display: table-row-group !important;
    }

    .description-content table tbody tr {
        display: table-row !important;
        margin-bottom: 0;
        border: none;
        border-bottom: 1px solid var(--property-border, #dce0e0);
        border-radius: 0;
    }

    .description-content table tbody tr:last-child {
        border-bottom: none;
    }

    .description-content table tbody tr:nth-child(even) {
        background: var(--property-accent-light, rgba(11, 98, 48, 0.05));
    }

    .description-content table td {
        display: table-cell !important;
        padding: 9px 12px;
        vertical-align: middle;
        border: none;
        border-bottom: 1px solid var(--property-border, #dce0e0);
        word-break: break-word;
        overflow-wrap: break-word;
    }

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

    .description-content table td:first-child {
        font-weight: 600;
        color: var(--property-heading-color, #222222);
    }

    .description-content table td:before {
        display: none !important;
        content: none !important;
    }

    /* Ensure headings are consistent everywhere */
    .description-content h2 {
        font-size: 24px;
        padding-bottom: 0.75rem;
        border-bottom: 3px solid var(--property-primary, #0b6230);
        margin: 2.5rem 0 1.25rem;
    }

    .description-content h3 {
        font-size: 20px;
        margin: 2rem 0 1rem;
        color: var(--property-heading-color, #222222);
    }

    /* Stronger info boxes for dense content pages */
    .description-content .info-box,
    .description-content blockquote {
        border-left: 5px solid var(--property-primary, #0b6230);
        background: var(--property-accent-light, rgba(11, 98, 48, 0.06));
        padding: 1.5rem 1.75rem;
        margin: 1.75rem 0;
        border-radius: 0 var(--property-radius, 8px) var(--property-radius, 8px) 0;
    }

    /* Better list spacing for long specs */
    .description-content ul li,
    .description-content ol li {
        margin-bottom: 0.75rem;
        line-height: 1.75;
    }
}

/* =============================================
   RankMath Table of Contents — Styled
   Primary: #0b6230
   ============================================= */
.wp-block-rank-math-toc-block {
    position: relative;
    background: #ffffff;
    border: 1px solid #c6ddd0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.wp-block-rank-math-toc-block h2 {
    background: #0b6230;
    color: #ffffff !important;
    padding: 12px 16px 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
    letter-spacing: 0.02em;
}
.wp-block-rank-math-toc-block h2 * {
    color: #ffffff !important;
}

.wp-block-rank-math-toc-block h2 button.rank-math-toc-toggle-button {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #ffffff !important;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-align: left;
    outline: none;
}

.wp-block-rank-math-toc-block h2 button.rank-math-toc-toggle-button:focus-visible {
    outline: 2px solid #36aa71;
    outline-offset: 4px;
}

.wp-block-rank-math-toc-block h2:hover {
    background: #0a5429;
}

.wp-block-rank-math-toc-block h2:before {
    display: inline-block;
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #ffffff;
    margin-right: 10px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

/* Rotate arrow when expanded */
.wp-block-rank-math-toc-block.is-open h2:before,
.wp-block-rank-math-toc-block input:checked + h2:before {
    transform: rotate(90deg);
}

.wp-block-heading {
    font-size: 20px;
}

.wp-block-rank-math-toc-block nav {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    background: #f7fbf9;
    border-top: 0 solid #c6ddd0;
    transition: max-height 0.3s ease, padding 0.2s ease, border-top-width 0.2s ease;
}

.wp-block-rank-math-toc-block.is-open nav,
.wp-block-rank-math-toc-block input:checked + h2 ~ nav {
    padding: 14px 18px;
    max-height: 100vh;
    overflow: auto;
    visibility: visible;
    pointer-events: auto;
    border-top-width: 1px;
}

/* TOC link styling */
.wp-block-rank-math-toc-block nav a {
    color: #0b6230;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.7;
    transition: color 0.15s ease;
}

.wp-block-rank-math-toc-block nav a:hover {
    color: #36aa71;
    text-decoration: underline;
}

/* List layout */
.wp-block-rank-math-toc-block nav ol,
.wp-block-rank-math-toc-block nav ul {
    padding-left: 18px;
    margin: 0;
}

.wp-block-rank-math-toc-block nav li {
    margin-bottom: 6px;
}

.wp-block-rank-math-toc-block nav li:last-child {
    margin-bottom: 0;
}

.wp-block-rank-math-toc-block nav > :first-child {
    margin-top: 0;
}

.wp-block-rank-math-toc-block nav > :last-child {
    margin-bottom: 0;
}
