/* =========================================================================
   Dramakam Legal, Policy, Age & Support Pages Stylesheet
   ========================================================================= */
:root {
    --bg-pure: #ffffff;
    --bg-subtle: #fbfbfd;
    --bg-elevated: #f5f5f7;
    --bg-studio: #090a0f;

    --text-primary: #111215;
    --text-secondary: #4a4c53;
    --text-tertiary: #6b6d76;
    --text-on-dark: #f5f5f7;
    --text-muted-dark: #9ca3af;

    --border-subtle: rgba(17, 18, 21, 0.09);
    --border-strong: rgba(17, 18, 21, 0.16);
    --border-focus: #0066cc;

    --accent-blue: #0066cc;
    --accent-blue-hover: #0052a3;
    --accent-gold-bright: #ffd60a;
    --accent-green: #1f9d45;

    --shadow-card: 0 12px 32px rgba(15, 18, 28, 0.06), 0 2px 6px rgba(15, 18, 28, 0.03);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --container-max: 1120px;
    interpolate-size: allow-keywords;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-pure);
    color: var(--text-primary);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    text-align: start;
    overflow-wrap: break-word;
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-blue-hover);
}

:focus-visible {
    outline: 3px solid var(--border-focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 9999;
    padding: 0.625rem 1.125rem;
    border-radius: 999px;
    background: var(--text-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    color: #ffffff;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Sticky Frosted Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-block-size: 4rem;
    padding-block: 0.5rem;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6875rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    text-decoration: none;
}

.brand:hover {
    color: var(--text-primary);
}

.brand-icon {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.subnav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
}

.subnav-links a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
}

.subnav-links a:hover,
.subnav-links a[aria-current="page"] {
    color: var(--text-primary);
}

.subnav-links a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--text-primary);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
}

.btn-header:hover {
    background: #272930;
    color: #ffffff;
}

/* Page Hero Banner */
.page-hero {
    background: linear-gradient(180deg, #ffffff 0%, #f5f6fa 100%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 3.5rem 0 2.75rem;
}

.kicker-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: balance;
    max-width: 28ch;
    margin-bottom: 0.85rem;
}

.page-hero h1:focus {
    outline: none;
}

.page-meta {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 65ch;
    text-wrap: pretty;
}

/* Main Document Layout */
main {
    flex: 1;
    padding: 3rem 0 4.5rem;
}

.doc-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    gap: 3rem;
    align-items: start;
}

.doc-article {
    background: var(--bg-pure);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 1rem + 2vw, 3rem);
    box-shadow: var(--shadow-card);
}

.prose {
    max-width: 65ch;
}

.prose h2 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 1.1rem + 0.75vw, 1.65rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-wrap: balance;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.prose h2:first-child {
    margin-top: 0;
}

.prose h3 {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.prose p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.prose ul,
.prose ol {
    margin: 0.75rem 0 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    color: var(--text-secondary);
}

.prose li {
    text-wrap: pretty;
}

.prose strong {
    color: var(--text-primary);
    font-weight: 700;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-elevated);
    padding: 0.12rem 0.4rem;
    border-radius: 0.35rem;
    color: var(--text-primary);
}

.callout-box {
    margin: 1.5rem 0;
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius-md);
    background: #f0f7ff;
    border: 1px solid rgba(0, 102, 204, 0.22);
    color: var(--text-primary);
}

.callout-box p:last-child {
    margin-bottom: 0;
}

/* Summary Cards & Support Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
    margin: 1.5rem 0 2rem;
}

.info-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 800;
}

.info-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Sidebar Contact / Quick Links Card */
.doc-sidebar {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.side-card {
    background: var(--bg-pure);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
}

.side-card.dark {
    background: var(--bg-studio);
    color: var(--text-on-dark);
    border-color: rgba(255, 255, 255, 0.12);
}

.side-card h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.55rem;
}

.side-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-wrap: pretty;
}

.side-card.dark p {
    color: var(--text-muted-dark);
}

.side-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.88rem;
}

.side-list a {
    text-decoration: none;
    font-weight: 600;
}

.side-list a:hover {
    text-decoration: underline;
}

.btn-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-block-size: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: var(--accent-gold-bright);
    color: #111215;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.btn-email:hover {
    background: #ffe142;
    color: #111215;
}

/* Native Details/Summary Accordion for Support Page */
.faq-stack {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-pure);
    margin-top: 1rem;
}

.faq-item + .faq-item {
    border-top: 1px solid var(--border-subtle);
}

.faq-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary::before {
    content: "";
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.faq-item[open] > .faq-summary::before {
    transform: rotate(45deg);
}

.faq-item::details-content {
    display: block;
    block-size: 0;
    overflow: clip;
    contain: layout;
}

.faq-item[open]::details-content {
    block-size: auto;
}

@media (prefers-reduced-motion: no-preference) {
    .faq-item::details-content {
        transition: block-size 0.22s ease, content-visibility 0.22s ease;
        transition-behavior: allow-discrete;
    }
}

.faq-body {
    padding: 0 1.25rem 1.2rem 2.65rem;
    font-size: 0.93rem;
    color: var(--text-secondary);
}

/* Semantic Table */
.spec-table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0 1.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
    font-size: 0.9rem;
}

.spec-table caption {
    padding: 0.9rem 1.1rem;
    font-family: var(--font-display);
    font-weight: 800;
    text-align: start;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.spec-table th,
.spec-table td {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}

.spec-table thead th {
    background: var(--bg-subtle);
    font-weight: 700;
    color: var(--text-primary);
}

.spec-table tbody th {
    font-weight: 600;
    color: var(--text-primary);
}

.spec-table td {
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background: #06070b;
    color: #9ca3af;
    padding: 2.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-inline-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-inline-links a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-inline-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 920px) {
    .doc-shell {
        grid-template-columns: minmax(0, 1fr);
    }
    .doc-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .container {
        padding: 0 1.125rem;
    }
}
