/**
 * NGT BioPharma Consultants — Default CMS Content Page Stylesheet
 * 
 * Reusable stylesheet for legal and informational CMS pages:
 * - Terms of Use
 * - Privacy Policy
 * - Cookie Policy
 * - Copyright Policy
 * - Accessibility Statement
 * - Future WordPress CMS pages
 */

/* ==========================================================================
   1. CMS Hero Banner Section
   ========================================================================== */

.cms-hero {
    padding-top: calc(3 * var(--section-padding));
    padding-bottom: 73px;
    background-color: var(--color-black, #030832);
    position: relative;
    overflow: hidden;
}

.cms-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.cms-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
}

.cms-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 8, 50, 0.92) 0%, rgba(3, 8, 50, 0.98) 100%);
}

.cms-hero .container {
    position: relative;
    z-index: 2;
}

.cms-hero-content {
    max-width: 1100px;
}

.cms-hero-title {
    font-weight: var(--font-weight-bold);
    font-size: 44px;
    line-height: 1.3181;
    color: var(--color-white);
}

.cms-hero-meta {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-p3);
    line-height: var(--line-height-p1);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 20px;
}

/* Optional Breadcrumb for CMS Hero */
.cms-breadcrumb {
    margin-bottom: 16px;
    font-family: var(--font-sans, "Inter", sans-serif);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
}

.cms-breadcrumb a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cms-breadcrumb a:hover {
    color: var(--color-primary, #C48E2A);
}

.cms-breadcrumb-separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   2. Main CMS Page Layout
   ========================================================================== */

.cms-page-section {
    padding-top: 60px;
    padding-bottom: calc(60px + var(--radius-xl, 40px));
    background-color: var(--color-white);
    position: relative;
}

.cms-layout {
    display: grid;
    grid-template-columns: 446px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
    position: relative;
}

/* ==========================================================================
   3. Table of Contents Sidebar (Sticky)
   ========================================================================== */

.cms-sidebar {
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background-color: var(--color-offwhite, #F9F8F3);
    border-radius: var(--radius-md);
    padding: 30px;
}

/* Custom Slim Scrollbar for Sidebar */
.cms-sidebar::-webkit-scrollbar {
    width: 5px;
}

.cms-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.cms-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(3, 8, 50, 0.15);
    border-radius: 4px;
}

.cms-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(3, 8, 50, 0.3);
}

.cms-sidebar-title {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-p3);
    line-height: var(--line-height-p3);
    color: var(--color-black, #030832);
    margin: 0 0 20px 0;
}

.cms-sidebar nav {
    width: 100%;
}

.cms-sidebar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cms-sidebar nav ul li {
    position: relative;
    padding-left: 20px;
    font-size: var(--font-size-p3);
    line-height: var(--line-height-p3);
}

/* Bullet Marker (Per Figma design: list disc) */
.cms-sidebar nav ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-black);
    transition: all 0.2s ease;
}

/* Sub-heading Indentation (h3, h4, etc.) */
.cms-toc-item-h3 {
    padding-left: 32px;
}

.cms-toc-item-h3::before {
    left: 18px;
    width: 5px;
    height: 5px;
}

.cms-toc-item-h4 {
    padding-left: 44px;
}

.cms-toc-item-h4::before {
    left: 30px;
    width: 4px;
    height: 4px;
}

.cms-toc-link {
    display: block;
    font-family: var(--font-sans, "Inter", sans-serif);
    font-size: var(--font-size-p4);
    line-height: 1.625;
    color: var(--color-black, #030832);
    text-decoration: none;
    font-weight: var(--font-weight-regular0);
    transition: color 0.2s ease, font-weight 0.15s ease;
}

.cms-toc-link:hover {
    color: var(--color-primary, #C48E2A);
}

/* Active State (Per Figma: bold black font & highlighted bullet) */
.cms-toc-link.active {
    font-weight: 700;
}

.cms-toc-item:has(.cms-toc-link.active)::before {
    background-color: var(--color-primary, #C48E2A);
}

/* Fallback for browsers not supporting :has */
.cms-toc-item.is-active::before {
    background-color: var(--color-primary, #C48E2A);
    transform: scale(1.4);
}

/* ==========================================================================
   4. Main CMS Content Area
   ========================================================================== */

.cms-content {
    max-width: 920px;
    width: 100%;
}

/* Headings with Header Offset */
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6 {
    color: var(--color-black, #030832);
    scroll-margin-top: 110px;
    /* Offset for sticky header */
}

/* Automatic divider line between sections without needing <hr> or extra classes */
.cms-content h2 {
    margin-bottom: 20px;
    font-weight: var(--font-weight-regular);
}

.cms-content h2:not(:first-child) {
    border-top: 1px solid var(--color-black);
    padding-top: 20px;
    margin-top: 20px;
}

.cms-content h3 {
    font-weight: var(--font-weight-bold);
    font-family: var(--font-primary);
}

.cms-content h4 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 14px;
}

.cms-content h5 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.cms-content h6 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Paragraphs */
.cms-content p,
.cms-content ul,
.cms-content ol,
.cms-content h3 {
    font-size: var(--font-size-p4);
    line-height: var(--line-height-h6);
    color: var(--color-black, #030832);
    margin-bottom: 20px;
}

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

/* Inline text elements */
.cms-content strong,
.cms-content b {
    font-weight: 700;
    color: var(--color-black, #030832);
}

.cms-content span {
    line-height: inherit;
}

/* Links */
.cms-content a {
    color: var(--color-black, #030832);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.cms-content a:hover {
    color: var(--color-primary, #C48E2A);
}

/* Lists */

.cms-content ul,
.cms-content ol {
    padding-left: 20px;
}

.cms-content ul {
    list-style-type: disc;
}

.cms-content ol {
    list-style-type: decimal;
}

.cms-content li {
    margin-bottom: var(--space-xs);
    list-style-position: outside;
}

.cms-content li:last-child {
    margin-bottom: 0;
}

/* Tables (WordPress CMS support) */
.cms-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-family: var(--font-sans, "Inter", sans-serif);
    font-size: 15px;
    line-height: 1.5;
}

.cms-content th,
.cms-content td {
    padding: 12px 16px;
    border: 1px solid rgba(3, 8, 50, 0.12);
    text-align: left;
}

.cms-content th {
    background-color: var(--color-offwhite, #F9F8F3);
    font-weight: 600;
    color: var(--color-black, #030832);
}

/* Blockquotes */
.cms-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--color-primary, #C48E2A);
    background-color: var(--color-offwhite, #F9F8F3);
    font-style: italic;
    color: var(--color-black, #030832);
    border-radius: 0 4px 4px 0;
}

/* ==========================================================================
   5. Responsive Breakpoints
   ========================================================================== */

/* Tablet Landscape (max-width: 1199px) */
@media screen and (max-width: 1199px) {
    .cms-layout {
        grid-template-columns: 360px minmax(0, 1fr);
        gap: 26px;
    }

    .cms-hero-title {
        font-size: 36px;
    }

    .cms-sidebar {
        padding: 26px;
    }

    .cms-content h2,
    .cms-content p,
    .cms-content ul,
    .cms-content ol,
    .cms-content h3 {
        margin-bottom: 18px;
    }

    .cms-content h2:not(:first-child) {
        margin-top: 18px;
        padding-top: 18px;
    }

    .cms-content ul,
    .cms-content ol {
        padding-left: 18px;
    }

    .cms-hero-meta {
        margin-top: 18px;
    }
}

/* Tablet Portrait (max-width: 991px) */
@media screen and (max-width: 991px) {
    .cms-hero {
        padding-bottom: 50px;
    }

    .cms-hero-title {
        font-size: 32px;
    }

    .cms-page-section {
        padding-top: 50px;
        padding-bottom: calc(50px + var(--radius-xl, 20px));
    }

    .cms-layout {
        grid-template-columns: 300px minmax(0, 1fr);
        gap: 24px;
    }

    .cms-sidebar {
        padding: 24px;
    }

    .cms-content h2,
    .cms-content p,
    .cms-content ul,
    .cms-content ol,
    .cms-content h3 {
        margin-bottom: 16px;
    }

    .cms-content h2:not(:first-child) {
        margin-top: 16px;
        padding-top: 16px;
    }

    .cms-content ul,
    .cms-content ol {
        padding-left: 16px;
    }

    .cms-hero-meta {
        margin-top: 16px;
    }
}

/* Mobile Devices (max-width: 768px) */
@media screen and (max-width: 767px) {
    .cms-hero {
        padding-bottom: 40px;
    }

    .cms-hero-title {
        font-size: 26px;
    }

    .cms-page-section {
        padding-top: 40px;
        padding-bottom: calc(40px + var(--radius-xl, 14px));
    }

    .cms-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .cms-sidebar {
        position: sticky;
        top: 90px;
        z-index: 5;
        width: 100%;
        max-height: calc(100vh - 110px);
        padding: 14px 18px;
        overflow: visible;
        overscroll-behavior: contain;
    }

    .cms-toc-disclosure {
        width: 100%;
    }

    .cms-toc-disclosure > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0;
        cursor: pointer;
        list-style: none;
    }

    .cms-toc-disclosure > summary::-webkit-details-marker {
        display: none;
    }

    .cms-toc-disclosure > summary::after {
        content: '+';
        font: 700 22px/1 sans-serif;
        color: var(--color-primary, #C48E2A);
    }

    .cms-toc-disclosure[open] > summary::after {
        content: '−';
    }

    .cms-toc-disclosure .cms-toc {
        max-height: min(45vh, 320px);
        overflow-y: auto;
        overscroll-behavior: contain;
        margin-top: 12px;
    }

    .cms-content {
        max-width: 100%;
    }

    .cms-divider {
        margin: 20px 0;
    }
}


/* =========================================================
   Figma legal pages (1736:1410 / 1631 / 1537 / 1815 / 1941)
   Solid navy 328px banner, medium-weight title, optional numbering.
   ========================================================= */
.cms-hero {
    min-height: 328px;
    padding-top: 170px;
    padding-bottom: 60px;
}

.cms-hero-title {
    font-weight: var(--font-weight-medium);
    line-height: 56px;
}

.cms-hero-meta {
    margin: 16px 0 0;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-p3);
    color: rgba(255, 255, 255);
}

.cms-content h2:not(:first-child) {
    border-top-color: rgba(3, 8, 50, 0.15);
}

/* Numbered TOC (Cookie Policy): number column instead of bullets */
.cms-toc-item.is-numbered {
    padding-left: 0;
}

.cms-toc-item.is-numbered::before {
    display: none;
}

.cms-toc-item.is-numbered .cms-toc-link {
    display: grid;
    grid-template-columns: 26px 1fr;
}

.cms-toc-item-h3.is-numbered .cms-toc-link {
    grid-template-columns: 30px 1fr;
    padding-left: 26px;
}

@media (max-width: 991px) {
    .cms-hero {
        min-height: 0;
        padding-top: 150px;
        padding-bottom: 40px;
    }

    .cms-hero-title {
        font-size: 34px;
        line-height: 1.3;
    }
}

@media (max-width: 575px) {
    .cms-hero-title {
        font-size: 28px;
    }
}