/* ==========================================================================
   Acadify AI — Editorial Research & Engineering Design System
   Aesthetic: Light, Calm, Human-Designed, Typographic, Enterprise-Grade
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Canvas & Surfaces (Warm Paper & Linen) */
    --bg-body: #faf9f5;
    --bg-surface: #ffffff;
    --bg-subtle: #f3f1eb;
    --bg-inset: #ebe8e1;

    /* Typography (Charcoal & Ink) */
    --text-main: #141413;
    --text-secondary: #40403e;
    --text-muted: #6f6e69;
    --text-inverse: #ffffff;

    /* Editorial Dividers & Hairline Rules */
    --border-color: #e5e3da;
    --border-subtle: #eeece5;
    --border-dark: #141413;

    /* Restrained Earthy Accent (Terracotta/Rust) */
    --primary-color: #b85233;
    --primary-hover: #9e4329;
    --primary-subtle: rgba(184, 82, 51, 0.08);

    /* Status Indicators (Understated) */
    --status-success: #1e6b43;
    --status-warning: #995200;
    --status-danger: #a32222;

    /* Typography Scale */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --line-height-body: 1.7;
    --header-height: 72px;

    /* Bootstrap Overrides */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-main);
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 184, 82, 51;
}

/* --------------------------------------------------------------------------
   Base Styles & Reset
   -------------------------------------------------------------------------- */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    font-family: var(--font-sans) !important;
    line-height: var(--line-height-body);
    margin: 0;
    padding: 0;
    padding-top: var(--header-height);
    background-image: none !important;
}

/* Selection */
::selection {
    background: #eadecf;
    color: #141413;
}

/* --------------------------------------------------------------------------
   Typography Hierarchy
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-main);
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-top: 0;
}

h1, .display-4, .display-5 {
    font-weight: 700;
    letter-spacing: -0.035em;
}

p {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

p.lead {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-main);
    font-weight: 400;
}

small, .small {
    font-size: 0.875rem;
    line-height: 1.5;
}

a {
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--border-color);
    transition: all 0.15s ease;
}

a:hover {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.font-monospace, code {
    font-family: var(--font-mono) !important;
    font-size: 0.85em;
}

code {
    background: var(--bg-subtle);
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

/* Section Kickers / Labels */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */

.site-header {
    background-color: rgba(250, 249, 245, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.site-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.site-brand:hover {
    color: var(--text-main);
    text-decoration: none;
}

.site-brand-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
}

.nav-link-custom {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    transition: color 0.15s ease;
}

.nav-link-custom:hover {
    color: var(--text-main);
    text-decoration: none;
}

.nav-dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(20, 20, 19, 0.06);
    padding: 0.75rem 0;
    min-width: 260px;
    margin-top: 0.5rem;
}

.nav-dropdown-item {
    padding: 0.5rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Buttons & Links
   -------------------------------------------------------------------------- */

.btn-editorial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    line-height: 1.4;
    border: 1px solid transparent;
}

.btn-editorial-primary {
    background-color: var(--text-main);
    color: var(--bg-body);
    border-color: var(--text-main);
}

.btn-editorial-primary:hover {
    background-color: #2b2b29;
    color: var(--bg-body);
    text-decoration: none;
}

.btn-editorial-secondary {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--border-dark);
}

.btn-editorial-secondary:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
    text-decoration: none;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.15s ease;
}

.link-arrow:hover {
    color: var(--primary-hover);
    gap: 0.65rem;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Editorial Layout Primitives
   -------------------------------------------------------------------------- */

.editorial-section {
    padding: 5.5rem 0;
    border-top: 1px solid var(--border-color);
}

.editorial-section:first-of-type {
    border-top: none;
}

.editorial-section-subtle {
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Asymmetric Split Layout */
.editorial-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .editorial-split {
        grid-template-columns: 320px 1fr;
        gap: 4rem;
    }
}

.editorial-split-meta {
    position: relative;
}

@media (min-width: 992px) {
    .editorial-split-sticky {
        position: sticky;
        top: calc(var(--header-height) + 2rem);
    }
}

/* Numbered Sequential Entries (01, 02, 03) */
.editorial-entry {
    padding: 2.25rem 0;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    transition: background-color 0.15s ease;
}

@media (min-width: 768px) {
    .editorial-entry {
        grid-template-columns: 80px 1fr auto;
        align-items: baseline;
        gap: 2rem;
    }
}

.editorial-entry:last-child {
    border-bottom: 1px solid var(--border-color);
}

.editorial-num {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.editorial-entry-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.editorial-entry-desc {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 0;
    max-width: 680px;
}

/* --------------------------------------------------------------------------
   Editorial Tables (Evaluation Reports & Matrices)
   -------------------------------------------------------------------------- */

.editorial-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.75rem;
    margin: 2rem 0;
}

.editorial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--text-main);
}

.editorial-table th {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-dark);
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
}

.editorial-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.editorial-table tr:last-child td {
    border-bottom: none;
}

.editorial-table .text-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.editorial-table .metric-delta-pos {
    color: var(--status-success);
    font-weight: 600;
    font-family: var(--font-mono);
}

.editorial-table .metric-delta-neg {
    color: var(--status-danger);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Sample Data Disclosure & Notices
   -------------------------------------------------------------------------- */

.disclosure-notice {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-muted);
    padding: 0.85rem 1.25rem;
    background-color: var(--bg-subtle);
    border-left: 2px solid var(--primary-color);
    margin-top: 1.5rem;
    border-radius: 0 2px 2px 0;
}

.badge-editorial-sample {
    font-size: 0.68rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
    background: var(--primary-subtle);
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Corporate & Legal Document View (Privacy, Terms, Responsible AI)
   -------------------------------------------------------------------------- */

.legal-document {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 0 5rem 0;
}

.legal-document h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legal-document .document-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.legal-document h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.legal-document p, .legal-document li {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.legal-document ul, .legal-document ol {
    padding-left: 1.35rem;
    margin-bottom: 1.5rem;
}

.legal-document li {
    margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Editorial Accordion (FAQ)
   -------------------------------------------------------------------------- */

.accordion-editorial {
    border-top: 1px solid var(--border-color);
}

.accordion-editorial-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-editorial-trigger {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.5rem 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.15s ease;
}

.accordion-editorial-trigger:hover {
    color: var(--primary-color);
}

.accordion-editorial-trigger i {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.accordion-editorial-trigger[aria-expanded="true"] i {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.accordion-editorial-content {
    padding-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Forms & Inputs
   -------------------------------------------------------------------------- */

.form-editorial-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-editorial-input,
.form-editorial-select,
.form-editorial-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-editorial-input:focus,
.form-editorial-select:focus,
.form-editorial-textarea:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 0 1px var(--text-main);
}

.form-editorial-input::placeholder,
.form-editorial-textarea::placeholder {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    padding: 5rem 0 3rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.site-footer h6 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li {
    margin-bottom: 0.65rem;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.site-footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive Helpers
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }
    .editorial-section {
        padding: 3.5rem 0;
    }
    h1, .display-4, .display-5 {
        font-size: 2.25rem;
    }
}
