/* ================================================================
   CASE STUDY — Shared styles for all case study pages
   Link: <link rel="stylesheet" href="../assets/case-study.css">
   ================================================================ */

/* ── Uppercase label pattern (shared da h2 sezione, results-hero-label, key-result-label) ── */
.case-study-content h2,
.results-hero-label,
.cs-key-result-label {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--soft-mauve);
    font-weight: 600;
}
.case-study-content h2 { font-family: var(--font-body); }

/* ── Meta tag bar ── */
.cs-meta-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.cs-tag {
    white-space: nowrap;
    text-align: center;
    background: rgba(61,42,110,0.08);
    color: var(--mid-purple);
    border: 1px solid rgba(61,42,110,0.15);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Results hero strip ── */
.results-hero {
    background: linear-gradient(135deg, rgba(61,42,110,0.07) 0%, rgba(139,106,174,0.05) 100%);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    margin-bottom: 3.5rem;
    border: 1px solid rgba(61,42,110,0.10);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.results-hero-label {
    text-align: center;
    margin-bottom: 2rem;
}
.results-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.results-single {
    max-width: 280px;
    margin: 0 auto;
}

/* ── Key result (single highlight) ── */
.cs-key-result {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(61,42,110,0.06) 0%, rgba(139,106,174,0.04) 100%);
    border-radius: 16px;
    border: 1px solid rgba(61,42,110,0.08);
}
.cs-key-result-label {
    margin-bottom: 0.75rem;
}
.cs-key-result-number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--mid-purple);
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}
.cs-key-result-desc {
    font-size: 1rem;
    color: var(--muted-text);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .results-trio { grid-template-columns: 1fr; }
}

/* ── Metric cards ── */
.metric-card {
    background: white;
    border-radius: 14px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    border-left: 4px solid var(--mid-purple);
    box-shadow: 0 2px 12px rgba(61,42,110,0.06);
}
.metric-card.accent { border-left-color: var(--soft-mauve); }
.metric-number {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: var(--mid-purple);
    line-height: 1;
    margin-bottom: 0.6rem;
    display: block;
}
.metric-label {
    font-size: 0.92rem;
    color: var(--muted-text);
    line-height: 1.5;
}

/* ── Section wrapper (generic) ── */
.cs-section {
    max-width: 720px;
    margin: 0 auto 3.5rem;
}
.cs-section h2 {
    text-align: left;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}
.cs-section h2::after {
    left: 0;
    transform: none;
}
.cs-section p {
    color: var(--body-text);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1rem;
    max-width: none;
}
.cs-section p strong {
    color: var(--dark-text);
}
.cs-section ul {
    margin: 1rem 0;
    padding-left: 2rem;
}
.cs-section ul li {
    color: var(--body-text);
    line-height: 1.65;
    margin-bottom: 0.35rem;
}

/* ── Narrative section (alias) ── */
.cs-narrative {
    max-width: 720px;
    margin: 0 auto 3.5rem;
}
.cs-narrative h2 {
    text-align: center;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}
.cs-narrative h2::after,
.phases h2::after,
.tech-section h2::after {
    left: 50%;
    transform: translateX(-50%);
}
.cs-narrative p {
    color: var(--body-text);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    max-width: none;
}
.cs-narrative p strong {
    color: var(--dark-text);
}

/* ── Context bullet list ── */
.cs-context-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cs-context-list li {
    font-size: 1rem;
    color: var(--body-text);
    line-height: 1.65;
    padding: 0.15rem 0 0.15rem 1.2rem;
    position: relative;
}
.cs-context-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--soft-mauve);
}

/* ── Centered context list ── */
.cs-context-centered {
    text-align: center;
    align-items: center;
}
.cs-context-centered li {
    padding-left: 0 !important;
}
.cs-context-centered li::before {
    position: static;
    margin-right: 0.4rem;
}

/* ── Pull quote ── */
.pull-quote {
    border-left: 3px solid var(--soft-mauve);
    padding: 1rem 1.5rem;
    margin: 1.75rem 0;
    background: rgba(139,106,174,0.05);
    border-radius: 0 10px 10px 0;
}
.pull-quote p {
    font-size: 1.05rem !important;
    color: var(--mid-purple) !important;
    font-style: italic;
    margin: 0 !important;
    line-height: 1.7;
}

/* ── Phase steps ── */
.phases { max-width: 720px; margin: 0 auto 3.5rem; }
.phases h2 {
    text-align: center;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}
.phases > p {
    font-size: 1rem;
    color: var(--muted-text);
    margin-bottom: 1.75rem;
    max-width: none;
}

.phase-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.phase-list-trio {
    grid-template-columns: repeat(3, 1fr);
}
.phase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--off-white);
    border-radius: 14px;
    padding: 2rem 1.5rem 1.75rem;
    border: 1px solid rgba(61,42,110,0.06);
    transition: box-shadow 0.2s;
}
.phase-item:hover { box-shadow: 0 4px 16px rgba(61,42,110,0.08); }
.phase-num {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--mid-purple), var(--soft-mauve));
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
    margin-bottom: 1rem;
}
.phase-body {
    width: 100%;
}
.phase-body strong {
    display: block;
    color: var(--dark-text);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}
.phase-body p {
    font-size: 0.78rem;
    color: var(--muted-text);
    line-height: 1.45;
    margin: 0;
}
.phase-body ul {
    list-style: none;
    padding: 0; margin: 0;
}
.phase-body ul li {
    font-size: 0.92rem;
    color: var(--muted-text);
    line-height: 1.55;
    padding: 0;
}

/* ── Light CTA strip ── */
.cs-cta-light {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(61,42,110,0.05) 0%, rgba(139,106,174,0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(61,42,110,0.08);
}
.cs-cta-light p {
    color: var(--deep-navy);
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 1.6rem;
    max-width: none;
}
.cs-cta-light .btn {
    min-width: 220px;
    justify-content: center;
}

/* ── Tech stack cards ── */
.tech-section { max-width: 720px; margin: 0 auto 3.5rem; }
.tech-section h2 {
    text-align: center;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.tech-card {
    background: none;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}
.tech-icon {
    width: 44px; height: 44px;
    background: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.tech-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.tech-card strong { display: block; font-size: 0.95rem; color: var(--dark-text); margin-bottom: 0.15rem; }
.tech-card span { font-size: 0.85rem; color: var(--muted-text); line-height: 1.4; }

/* ── Results box (for older-style case studies) ── */
.cs-results-box {
    background: linear-gradient(135deg, rgba(61,42,110,0.08), rgba(139,106,174,0.06));
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 3rem;
}
.cs-results-box h2 {
    text-align: center;
    margin-bottom: 2rem;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}
.result-item { text-align: center; }
.result-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--mid-purple);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.result-item p {
    color: var(--muted-text);
    font-size: 0.95rem;
    line-height: 1.5;
}
.result-arrow {
    margin: 0.5rem 0;
    color: #999;
    font-size: 1.5rem;
}

/* ── Summary box ── */
.cs-summary-box {
    background: linear-gradient(135deg, rgba(61,42,110,0.06), rgba(139,106,174,0.04));
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--mid-purple);
    margin-bottom: 3rem;
}
.cs-summary-box h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* ── Contact form (case study) ── */
.contact-form-section {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.cs-contact-form {
    max-width: 600px;
    margin: 0 auto;
}
.cs-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.cs-form-input:focus {
    outline: none;
    border-color: var(--mid-purple);
}
.cs-form-subtitle {
    text-align: center;
    color: var(--muted-text);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ── Back link ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mid-purple);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: gap 0.2s;
}
.back-link:hover { gap: 0.75rem; color: var(--mid-purple); }

/* ── Utilities ── */
.cs-back-wrapper {
    display: none;
}
.phases-subtitle {
    font-size: 1rem;
    color: var(--muted-text);
    margin-bottom: 1.75rem;
    max-width: none;
}
.metric-detail {
    color: var(--muted-text);
    font-size: 0.82rem;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
    .results-hero {
        padding: 2rem 1.25rem;
    }
    .phase-list-trio {
        grid-template-columns: 1fr;
    }
    .phase-item {
        padding: 1.25rem;
    }
    .tech-grid {
        grid-template-columns: 1fr;
    }
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
@media (max-width: 600px) {
    .phase-list {
        grid-template-columns: 1fr;
    }
}

/* ── SEO intro block ── */
.cs-intro {
    max-width: 720px;
    margin: 2rem auto 2.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted-text);
}
.cs-intro p { margin-bottom: 1rem; }

/* ── Key result note ── */
.cs-key-result-note {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--muted-text);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ── FAQ accordion ── */
.cs-faq {
    max-width: 720px;
    margin: 3rem auto 2.5rem;
}
.cs-faq > h2 {
    margin-bottom: 1.5rem;
}
.faq-item {
    border-bottom: 1px solid rgba(61,42,110,0.1);
    padding: 0.25rem 0;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 0.25rem;
    list-style: none;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
    content: "+";
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mid-purple);
    flex-shrink: 0;
}
.faq-item[open] summary::before { content: "−"; }
.faq-item p {
    padding: 0.25rem 0.25rem 1rem 1.8rem;
    color: var(--muted-text);
    line-height: 1.6;
    margin: 0;
}

/* ── Related links box ── */
.cs-related {
    max-width: 720px;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    background: rgba(61,42,110,0.04);
    border-left: 3px solid var(--mid-purple);
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    color: var(--body-text);
    line-height: 1.6;
}
.cs-related p { margin: 0; }
.cs-related a { color: var(--mid-purple); font-weight: 500; text-decoration: underline; }
.cs-related a:hover { color: var(--soft-mauve); }

/* CTA finale scura con bottone oro */
.cs-cta-feature {
    margin: 3rem 0 2rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #1a0f2e 0%, #2d1b4e 50%, #3d2870 100%);
    border-radius: 16px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 40px rgba(45, 27, 78, 0.25);
}
.cs-cta-feature p.cs-cta-feature-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 0.6rem;
    color: #fff;
}
.cs-cta-feature p.cs-cta-feature-sub {
    font-size: 0.95rem;
    margin: 0 0 1.6rem;
    color: rgba(255, 255, 255, 0.75);
}
.btn-gold {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    background: linear-gradient(135deg, #d4af6c 0%, #c9a961 50%, #b8924a 100%);
    color: #1a0f2e;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(201, 169, 97, 0.35);
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 97, 0.5);
    color: #1a0f2e;
}
@media (max-width: 600px) {
    .cs-cta-feature { padding: 2rem 1.2rem; }
    .cs-cta-feature p.cs-cta-feature-title { font-size: 1.3rem; }
    .cs-cta-light p { font-size: 1.3rem; }
}
