/* 3Lions — Editorial Atelier design system */

/* ─────────────────────────────────────────────────────────
   Base
   ───────────────────────────────────────────────────────── */
body { font-family: 'Inter', sans-serif; }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
    overflow-x: hidden;
}

::selection { background-color: #FFBF00; color: #261a00; }

/* ─────────────────────────────────────────────────────────
   Accessibility
   ───────────────────────────────────────────────────────── */

/* Skip link — visible only on keyboard focus */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: 12px 20px;
    background: #0a0e14;
    color: #FFBF00;
    font-weight: 700;
    font-size: 14px;
    border-radius: 0 0 12px 0;
    z-index: 100;
    transform: translateY(-110%);
    transition: transform 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #FFBF00;
    outline-offset: 2px;
}

/* Consistent focus ring */
:focus-visible {
    outline: 2px solid #FFBF00;
    outline-offset: 2px;
    border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #FFBF00;
    outline-offset: 2px;
}

/* Form validation feedback */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    outline: 2px solid #e11d48;
    outline-offset: 0;
}
.field-error {
    display: block;
    color: #e11d48;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    min-height: 0;
}
form.dark-form .field-error { color: #ff8a9b; }

/* TOC — active section highlight (legal pages) */
.toc-link {
    border-left: 2px solid transparent;
    margin-left: -1rem;
    padding-left: calc(1rem - 2px);
    border-radius: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-active {
    color: var(--md-sys-color-primary, #8C5A00) !important;
    border-left-color: #FFBF00;
}
.toc-active span:first-child {
    color: #8C5A00 !important;
}

/* Anchor offset for sticky header */
:target, [id^="sec-"], #processori, #trasferimenti {
    scroll-margin-top: 110px;
}

/* Reduced motion — honour OS setting */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-video { display: none; }
    .ticker { animation: none !important; }
}

/* ─────────────────────────────────────────────────────────
   Country chip — label con colori bandiera
   ───────────────────────────────────────────────────────── */
.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #0a0e14;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

.country-chip .flag-bars {
    display: inline-flex;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.country-chip .flag-bars span {
    flex: 1;
    display: block;
}

/* Italia: verde bianco rosso */
.country-chip.flag-it .flag-bars span:nth-child(1) { background: #009246; }
.country-chip.flag-it .flag-bars span:nth-child(2) { background: #ffffff; }
.country-chip.flag-it .flag-bars span:nth-child(3) { background: #ce2b37; }

/* Germania: nero rosso oro */
.country-chip.flag-de .flag-bars span:nth-child(1) { background: #000000; }
.country-chip.flag-de .flag-bars span:nth-child(2) { background: #dd0000; }
.country-chip.flag-de .flag-bars span:nth-child(3) { background: #ffce00; }

/* Romania: blu giallo rosso */
.country-chip.flag-ro .flag-bars span:nth-child(1) { background: #002b7f; }
.country-chip.flag-ro .flag-bars span:nth-child(2) { background: #fcd116; }
.country-chip.flag-ro .flag-bars span:nth-child(3) { background: #ce1126; }

/* ─────────────────────────────────────────────────────────
   Editorial typography
   ───────────────────────────────────────────────────────── */
.display-italic {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 0.95;
}

.serif-italic {
    font-family: 'Fraunces', serif;
    font-style: italic;
}

/* ─────────────────────────────────────────────────────────
   Signature surfaces
   ───────────────────────────────────────────────────────── */
.mechanical-gradient {
    background: linear-gradient(135deg, #795900 0%, #FFBF00 100%);
}

.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ambient-glow {
    box-shadow: 0px 20px 40px rgba(26, 28, 28, 0.06);
}

.btn-primary-hero {
    background: linear-gradient(135deg, #FFBF00 0%, #ffcf3d 100%);
    box-shadow: 0 10px 40px -10px rgba(255, 191, 0, 0.5);
}

.split-panel {
    background-image: radial-gradient(ellipse at top right, rgba(255, 191, 0, 0.08), transparent 50%);
}

/* Grainy film texture — use on dark sections */
.grain {
    position: relative;
}
.grain::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    opacity: 0.06;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ─────────────────────────────────────────────────────────
   Hero video
   ───────────────────────────────────────────────────────── */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(10%) brightness(0.85) contrast(1.05);
}

/* ─────────────────────────────────────────────────────────
   Animated country ticker
   ───────────────────────────────────────────────────────── */
.ticker {
    animation: ticker 40s linear infinite;
}
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────────────────────
   Interactive cards / gallery
   ───────────────────────────────────────────────────────── */
.car-card img {
    transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.car-card:hover img {
    transform: scale(1.05);
}

.reveal-line {
    position: relative;
    overflow: hidden;
}
.reveal-line::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFBF00 50%, transparent);
    opacity: 0.4;
}

/* ─────────────────────────────────────────────────────────
   Accordions (FAQ)
   ───────────────────────────────────────────────────────── */
details > summary {
    list-style: none;
    cursor: pointer;
}
details > summary::-webkit-details-marker { display: none; }
details[open] summary .chev {
    transform: rotate(45deg);
}
.chev {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────
   Mobile menu
   ───────────────────────────────────────────────────────── */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
#mobile-menu.open {
    max-height: 500px;
}

/* ─────────────────────────────────────────────────────────
   Active nav link
   ───────────────────────────────────────────────────────── */
.nav-active {
    color: #0a0e14 !important;
    font-weight: 600;
    position: relative;
}
.nav-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: #FFBF00;
    border-radius: 2px;
}
#mobile-menu .nav-active::after {
    display: none;
}
#mobile-menu .nav-active {
    border-left: 3px solid #FFBF00;
    padding-left: 12px;
}
