/**
 * CASE STUDY PAGE STYLES
 * Styles for /case-study/*.html pages
 *
 * @author Ettore Stani
 * @version 1.0.0
 *
 * Requires: styles.css (design tokens + base)
 */


/* ═══════════════════════════════════════════════════════
   HEADER — Dark sticky nav per pagine editoriali
   Il header rimane dark per tutta la pagina:
   coerente col dark hero, riconoscibile come "article mode"
═══════════════════════════════════════════════════════ */

.case-study-page #header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.case-study-page #header.scrolled {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Back button */
.cs-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: var(--transition-base);
    white-space: nowrap;
}

.cs-back-home:hover {
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateX(-2px);
}

/* Language + Theme toggle sul dark header */
.case-study-page .language-toggle,
.case-study-page .theme-toggle {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.15);
}

.case-study-page .language-toggle:hover,
.case-study-page .theme-toggle:hover {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.case-study-page .current-lang {
    color: #94a3b8;
}

.case-study-page .language-dropdown {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

.case-study-page .language-option {
    color: #94a3b8;
}

.case-study-page .language-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.case-study-page .language-option.active {
    background: var(--color-accent);
    color: white;
}


/* ═══════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════ */

.cs-hero {
    background: #0f172a;
    color: #e2e8f0;
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 5rem;
    position: relative;
    overflow: hidden;
}

.cs-hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.09) 0%, transparent 65%);
    pointer-events: none;
}

.cs-hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.05) 0%, transparent 65%);
    pointer-events: none;
}

.cs-hero .container {
    position: relative;
    z-index: 1;
}

/* Page nav: breadcrumb in header + tags */
.cs-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cs-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.28rem 0.75rem;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.22);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Hero breadcrumb link (dentro il hero, non nell'header) */
.cs-breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cs-breadcrumb-link:hover {
    color: #94a3b8;
}

/* Hero title */
.cs-hero h1 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: #f1f5f9;
    margin-bottom: 1.25rem;
    max-width: 820px;
    letter-spacing: -0.025em;
}

.cs-hero-description {
    font-size: 1.0625rem;
    color: #94a3b8;
    line-height: 1.75;
    max-width: 620px;
    margin-bottom: 3rem;
}

/* Stats grid — riusa le classi della homepage */
.cs-hero .case-study-stats {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════
   CONTENT — Lettura editoriale
═══════════════════════════════════════════════════════ */

.cs-content {
    background: var(--color-bg);
    padding: 5rem 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cs-content .container {
    max-width: 740px;
}

/* Sezione con separatore superiore — pattern "capitoli" */
.cs-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
    border-top: 1px solid var(--color-border);
}

.cs-section:first-child {
    padding-top: 0;
    border-top: none;
}

/* Label di sezione: chip accent */
.cs-section-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    background: rgba(99, 102, 241, 0.08);
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.cs-section h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.875rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.cs-section p {
    font-size: 1.125rem; /* 18px */
    color: var(--color-text-light);
    line-height: 1.85;
    margin-bottom: 1.25rem;
}

.cs-section p:last-child {
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════
   BULLET LIST
═══════════════════════════════════════════════════════ */

.cs-bullet-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cs-bullet-list li {
    position: relative;
    padding-left: 1.375rem;
    font-size: 1.125rem; /* 18px */
    color: var(--color-text-light);
    line-height: 1.7;
}

.cs-bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}


/* ═══════════════════════════════════════════════════════
   RESULTS TABLE
═══════════════════════════════════════════════════════ */

.cs-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0 1rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem; /* 16px — table leggermente più piccola del body */
}

.cs-table thead tr {
    background: var(--color-card-bg);
    border-bottom: 2px solid var(--color-border);
}

.cs-table thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.cs-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

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

.cs-table tbody tr:hover {
    background: var(--color-card-bg);
}

.cs-table td {
    padding: 1rem 1.25rem;
    color: var(--color-text);
    vertical-align: middle;
    line-height: 1.5;
}

.cs-table td:first-child {
    font-weight: 600;
}

.cs-table td.cs-value {
    font-weight: 700;
    color: var(--color-accent);
    font-size: 1.0625rem;
    white-space: nowrap;
}

.cs-table td.cs-detail {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.cs-table-note {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.875rem;
    line-height: 1.65;
    font-style: italic;
}


/* ═══════════════════════════════════════════════════════
   LESSON BOX — callout di chiusura
═══════════════════════════════════════════════════════ */

.cs-lesson-box {
    background: var(--color-card-bg);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 10px 10px 0;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
}

.cs-lesson-box p {
    color: var(--color-text);
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 0 !important;
}


/* ═══════════════════════════════════════════════════════
   BOTTOM CTA
═══════════════════════════════════════════════════════ */

.cs-cta-section {
    background: #0f172a;
    color: #e2e8f0;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cs-cta-section::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 65%);
    pointer-events: none;
}

.cs-cta-section .container {
    position: relative;
    z-index: 1;
}

.cs-cta-section h2 {
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.cs-cta-description {
    font-size: 1.0625rem;
    color: #94a3b8;
    max-width: 460px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.cs-cta-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cs-cta-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: var(--transition-base);
}

.cs-cta-ghost:hover {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.35);
}


/* ═══════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════ */

[data-theme="dark"] .cs-table-wrapper {
    border-color: var(--color-border);
}

[data-theme="dark"] .cs-table thead tr,
[data-theme="dark"] .cs-table tbody tr:hover {
    background: #111111;
}

[data-theme="dark"] .cs-lesson-box {
    background: #111111;
}

[data-theme="dark"] .cs-section-label {
    background: rgba(99, 102, 241, 0.15);
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .cs-hero {
        padding-top: calc(var(--header-height) + 2.5rem);
        padding-bottom: 3.5rem;
    }

    .cs-page-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .cs-hero .case-study-stats {
        grid-template-columns: 1fr;
    }

    .cs-content {
        padding: 3.5rem 0;
    }

    .cs-section {
        padding-top: 2.5rem;
    }

    .cs-table {
        font-size: 0.9rem;
    }

    .cs-table td,
    .cs-table thead th {
        padding: 0.75rem 1rem;
    }



    .cs-lesson-box {
        padding: 1.25rem 1.5rem;
    }

    .cs-cta-section {
        padding: 3.5rem 0;
    }

    .cs-cta-ghost {
        width: 100%;
        justify-content: center;
    }
}
