/**
 * Accademia dei Selvatici — Design System
 * Estratto da home.php e centralizzato qui.
 * Includere in ogni pagina tramite layout default.php.
 */

/* ============================================================
   1. CSS Variables
   ============================================================ */
:root {
    --gold: #C9A227;
    --gold-light: #E8D48B;
    --gold-dark: #A68419;
    --brown: #5D4E37;
    --brown-dark: #3D2E1F;
    --brown-light: #8B7355;
    --cream: #FFFDF8;
    --cream-dark: #F5F0E6;

    /* Scala tipografica minima */
    --font-xs: 0.75rem;    /* badge/pill decorativi */
    --font-sm: 0.875rem;   /* label form, metadati */
    --font-md: 0.95rem;    /* body secondario */
}

/* ============================================================
   2. Base / Reset
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* offset per fixed navbar */
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--brown-dark);
    background-color: var(--cream);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
}

/* Padding-top su main per pagine interiori (fixed navbar) */
body:not(.has-hero) main {
    padding-top: 80px;
}

/* ============================================================
   3. Navbar
   ============================================================ */
.navbar {
    padding: 1.5rem 0;
    transition: all 0.4s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 253, 248, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 30px rgba(0,0,0,0.08);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold) !important;
    letter-spacing: 2px;
}

.navbar.scrolled .navbar-brand {
    color: var(--brown-dark) !important;
}

.nav-link {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--cream) !important;
    letter-spacing: 1px;
    padding: 0.5rem 1.25rem !important;
    transition: color 0.3s;
}

.navbar.scrolled .nav-link {
    color: var(--brown) !important;
}

.nav-link:hover {
    color: var(--gold) !important;
}

/* Hamburger icon color quando navbar è opaca */
.navbar.scrolled .navbar-toggler i {
    color: var(--brown-dark) !important;
}

/* Dropdown menu */
.navbar .dropdown-menu {
    border: 1px solid var(--cream-dark);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.navbar .dropdown-item:hover {
    background-color: var(--cream-dark);
    color: var(--brown-dark);
}

/* ============================================================
   4. Bottoni
   ============================================================ */
.btn-gold {
    background: var(--gold);
    color: var(--brown-dark);
    border: none;
    border-radius: 12px;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-gold:hover {
    background: var(--gold-light);
    color: var(--brown-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(201, 162, 39, 0.3);
}

.btn-outline-light {
    border: 1px solid var(--cream);
    color: var(--cream);
    border-radius: 12px;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: transparent;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-light:hover {
    background: var(--cream);
    color: var(--brown-dark);
}

.btn-dark {
    background: var(--brown-dark);
    color: var(--cream);
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-dark:hover {
    background: var(--brown);
    color: var(--cream);
    transform: translateY(-3px);
}

/* ============================================================
   5. Utilità Sezioni
   ============================================================ */
section {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    color: var(--brown-dark);
}

.section-title strong {
    font-weight: 600;
}

.section-line {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 1.5rem auto 0;
}

/* ============================================================
   6. Hero (homepage)
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--brown-dark);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('/img/apollo-muse.jpg') center/cover;
    opacity: 0.4;
    transform: scale(1.1);
    animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1.1); }
    to   { transform: scale(1); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--cream);
    padding: 2rem;
    max-width: 900px;
}

.hero-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--gold);
    border-radius: 30px;
}

.hero h1 {
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 3px;
}

.hero h1 span {
    font-weight: 600;
    color: var(--gold);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-style: italic;
    font-weight: 400;
    opacity: 0.9;
    max-width: none;
    margin: 0 auto 3rem;
}

.hero-dates-block {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 3.5rem;
}

.hero-date-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1rem;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    backdrop-filter: blur(4px);
}

.hero-date-pill--upcoming {
    background: rgba(201, 162, 39, 0.18);
    border-color: rgba(201, 162, 39, 0.6);
    color: #fff;
}

.hero-date-pill--closing {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.85);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 2rem;
    color: var(--gold);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40%  { transform: translateX(-50%) translateY(-10px); }
    60%  { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================================
   7. About Section
   ============================================================ */
.about-section {
    background: var(--cream);
}

.about-image-wrapper {
    position: relative;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 3px solid var(--gold);
}

.about-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: transform 0.6s ease;
    border-radius: 17px;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-content {
    padding: 2rem 0 2rem 3rem;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about-content h2 span {
    color: var(--gold);
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--brown);
}

.about-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--cream-dark);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--brown-light);
    margin-top: 0.5rem;
}

/* ============================================================
   8. Courses Section
   ============================================================ */
.courses-section {
    background: var(--brown-dark);
    color: var(--cream);
}

.courses-section .section-title {
    color: var(--cream);
}

.course-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.course-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
    height: 100%;
}

.course-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-10px);
    border-color: var(--gold);
}

.course-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--gold);
    transition: all 0.3s;
}

.course-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    transition: all 0.3s;
}
.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-card:hover .course-image {
    border-color: var(--gold-light);
    transform: scale(1.05);
}

.course-card:hover .course-icon {
    background: var(--gold);
    color: var(--brown-dark);
}

.course-card h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--cream);
}

.course-card p {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

/* Posti disponibili — barra di riempimento */
.course-spots {
    padding-top: 4px;
}
.spots-bar {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.spots-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    transition: width 0.6s ease;
}
.spots-label {
    font-size: 0.8rem;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}
.spots-label .bi-fire {
    color: #e85d3a;
}

/* Sold Out badge */
.course-soldout {
    text-align: center;
}
.soldout-badge {
    display: inline-block;
    padding: 5px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brown-dark);
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 20px;
    opacity: 0.9;
}

/* ============================================================
   9. Schedule Section
   ============================================================ */
.schedule-section {
    background: var(--cream-dark);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.schedule-item {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    position: relative;
    transition: all 0.3s;
    overflow: hidden;
}

.schedule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold);
    border-radius: 4px 0 0 4px;
    transform: scaleY(0);
    transition: transform 0.3s;
}

.schedule-item:hover::before {
    transform: scaleY(1);
}

.schedule-item:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.schedule-time {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 1rem;
}

.schedule-item h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.schedule-item p {
    color: var(--brown-light);
    font-size: 1rem;
}

/* ============================================================
   10. Teachers Section
   ============================================================ */
.teachers-section {
    background: white;
}

.teacher-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    transition: all 0.3s;
}

.teacher-card:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.teacher-image {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border-radius: 50%;
}

.teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.teacher-card:hover .teacher-image img {
    transform: scale(1.1);
}

.teacher-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid var(--gold);
    border-radius: 50%;
    opacity: 0;
    transform: scale(1.1);
    transition: all 0.3s;
}

.teacher-card:hover .teacher-image::after {
    opacity: 1;
    transform: scale(1);
}

.teacher-card h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.teacher-instrument {
    font-style: italic;
    color: var(--gold);
    margin-bottom: 1rem;
}

.teacher-card p {
    font-size: 0.95rem;
    color: var(--brown-light);
}

/* ============================================================
   11. Location Section
   ============================================================ */
.location-section {
    position: relative;
    padding: 0;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.location-bg {
    position: absolute;
    inset: 0;
    background: url('/img/palazzo-cesi.jpg') center/cover;
}

.location-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--brown-dark) 0%, rgba(61,46,31,0.8) 50%, transparent 100%);
}

.location-content {
    position: relative;
    z-index: 2;
    color: var(--cream);
    padding: 5rem 0;
    max-width: 550px;
}

.location-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.location-content h2 span {
    color: var(--gold);
}

.location-content p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.location-features {
    margin-top: 2rem;
}

.location-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.location-feature i {
    color: var(--gold);
    font-size: 1.25rem;
}

/* ============================================================
   12. CTA Section
   ============================================================ */
.cta-section {
    background: var(--gold);
    text-align: center;
    padding: 6rem 0;
}

.cta-section h2 {
    font-size: 2.5rem;
    color: var(--brown-dark);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    color: var(--brown);
    margin-bottom: 2rem;
}

.cta-edition-dates {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brown-dark) !important;
    margin-bottom: 0.75rem !important;
    letter-spacing: 0.02em;
}

/* ============================================================
   13. Footer
   ============================================================ */
.footer {
    background: var(--brown-dark);
    color: var(--cream);
    padding: 5rem 0 2rem;
}

.footer-brand {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
}

.footer p {
    opacity: 0.7;
    max-width: 300px;
}

.footer h5 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--cream);
    text-decoration: none;
    opacity: 0.7;
    transition: all 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--gold);
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: var(--cream);
    font-size: 1.25rem;
    transition: all 0.3s;
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--brown-dark);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ============================================================
   14. Animazioni scroll
   ============================================================ */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   15. Responsive
   ============================================================ */
@media (max-width: 991px) {
    .about-content {
        padding: 3rem 0 0 0;
    }

    .location-bg::after {
        background: rgba(61,46,31,0.9);
    }

    .location-content {
        max-width: 100%;
        text-align: center;
    }
}

@media (max-width: 767px) {
    section {
        padding: 5rem 0;
    }

    .about-stats {
        justify-content: center;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
}

/* ============================================================
   16. Utility Classes (design system)
   Usare sempre queste classi invece di stili inline ripetuti.
   ============================================================ */

/* ── Pannelli / Card ─────────────────────────────────────── */

/* Pannello con bordo sinistro gold — info block, KPI, trasferimento, alloggio */
.card-gold {
    background: rgba(201,162,39,.06);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
}

/* Alert/panel gold tintato — messaggi informativi, stati vuoti, notice */
.alert-gold {
    background: rgba(201,162,39,.08);
    border: 1px solid rgba(201,162,39,.3);
    border-radius: 8px;
    color: var(--brown-dark);
}

/* ── Badge ───────────────────────────────────────────────── */

/* Badge gold su sfondi chiari — stato, categoria, tag */
.badge-gold {
    background: rgba(201,162,39,.12);
    color: var(--gold-dark);
    border: 1px solid rgba(201,162,39,.3);
    font-size: var(--font-xs);
    font-weight: 500;
    padding: 0.3em 0.75em;
    border-radius: 12px;
    display: inline-block;
    vertical-align: middle;
}

/* Badge gold su sfondi scuri — sidebar, topbar */
.badge-gold-dark {
    background: rgba(201,162,39,.25);
    color: var(--gold);
    border: 1px solid rgba(201,162,39,.4);
    font-size: var(--font-xs);
    font-weight: 500;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Label tipografiche ──────────────────────────────────── */

/* Label uppercase per metriche e KPI — card dashboard admin */
.label-metric {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brown-light);
    font-weight: 600;
}

/* Label uppercase per sezioni form/sidebar — wizard, sidebar riepilogo */
.label-section {
    font-size: 0.78rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--brown-light);
}

/* Testo secondario/muted standard */
.text-meta {
    font-size: var(--font-sm);
    color: var(--brown-light);
}

/* ── Bottoni ─────────────────────────────────────────────── */

/* Pulsante outline gold — azioni secondarie nelle card */
.btn-outline-gold {
    border: 1px solid rgba(201,162,39,.5);
    color: var(--brown);
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    transition: background .2s, color .2s;
}
.btn-outline-gold:hover {
    background: rgba(201,162,39,.08);
    color: var(--brown-dark);
}

/* ── Tabelle ─────────────────────────────────────────────── */

/* Header tabella tintato gold */
.table-head-gold th {
    background: rgba(201,162,39,.08);
    color: var(--brown-dark);
    font-weight: 600;
    border-bottom: 1px solid rgba(201,162,39,.3);
}

/* ── Riferimenti traduzioni ──────────────────────────────── */

/* Box riferimento IT per form traduzioni multilingua */
.ref-box {
    background: rgba(201,162,39,.06);
    border-left: 3px solid var(--gold);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: var(--font-sm);
    color: var(--brown);
}

/* ── Markdown body ───────────────────────────────────────── */

/* Rendering testi markdown (privacy, termini, modal iscrizioni) */
.sv-markdown-body h1,
.sv-markdown-body h2,
.sv-markdown-body h3 {
    color: var(--brown-dark);
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.sv-markdown-body h1 { font-size: 2.2rem; margin-top: 0; }
.sv-markdown-body h2 { font-size: 1.4rem; }
.sv-markdown-body h3 { font-size: 1.1rem; }
.sv-markdown-body p  { margin-bottom: 1rem; }
.sv-markdown-body ul,
.sv-markdown-body ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.sv-markdown-body li { margin-bottom: 0.25rem; }
.sv-markdown-body hr {
    border: none;
    border-top: 1px solid var(--cream-dark);
    margin: 2.5rem 0;
}
.sv-markdown-body em  { color: var(--gold); font-style: italic; }
.sv-markdown-body strong { color: var(--brown-dark); }
.sv-markdown-body a   { color: var(--gold); }
.sv-markdown-body a:hover { color: var(--gold-dark); }
