/* ========================================================================
   L'Autoscuola di Massimo — Tema custom
   ======================================================================== */

:root {
    /* Palette allineata al logo del marchio: rosso #e30613 + nero, su bianco. */
    --color-primary: #e30613;        /* rosso del marchio — link, voce di menù attiva, sottolineature, icone, focus */
    --color-primary-dark: #1f1c1b;   /* nero "caldo" del logo — titoli, header, sfondi scuri (footer, barra avvisi, popup) */
    --color-accent: #e30613;         /* rosso del marchio — bottoni primari, barra avvisi, dettagli */
    --color-accent-dark: #b00510;    /* rosso scuro — hover di bottoni e link, testo "attenzione" */
    --color-text: #211d1c;           /* testo corrente — quasi-nero caldo */
    --color-muted: #6b6360;          /* grigio caldo per testi secondari */
    --color-bg: #ffffff;
    --color-bg-alt: #f7f4f3;         /* grigino caldo per sezioni alternate */
    --color-border: #e7e1df;         /* bordo neutro caldo */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .05);
    --radius: 10px;
    --radius-sm: 6px;
    --container: 1180px;
    --container-narrow: 760px;
    --space: 1rem;
    --header-h: 76px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg-alt);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover, a:focus { color: var(--color-accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--color-primary-dark); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 2.5vw + .5rem, 2.4rem); }
h2 { font-size: clamp(1.35rem, 1.5vw + .5rem, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: var(--container-narrow); }

.skip-link { position: absolute; top: -40px; left: 0; background: var(--color-primary); color: #fff; padding: .5rem 1rem; z-index: 9999; }
.skip-link:focus { top: 0; }

/* ========== HEADER ========== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 1rem;
}
.site-header__brand a {
    display: flex;
    flex-direction: column;
    color: var(--color-primary-dark);
    text-decoration: none;
}
.site-header__brand a:hover { color: var(--color-accent); }
.site-header__title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .2px;
}
.site-header__tagline {
    font-size: .8rem;
    color: var(--color-muted);
    font-weight: 400;
}
.site-header__logo {
    height: 44px;
    width: auto;
    display: block;
}
.site-header__brand a:hover .site-header__logo,
.site-header__brand a:focus .site-header__logo { opacity: .82; }
@media (max-width: 880px) {
    .site-header__logo { height: 34px; }
}

.site-header__toggle {
    display: none;
    background: none;
    border: 0;
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}
.site-header__toggle span {
    display: block;
    height: 2px;
    background: var(--color-primary-dark);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
.site-header__toggle.is-open span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.site-header__toggle.is-open span:nth-child(2) { opacity: 0; }
.site-header__toggle.is-open span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: .25rem;
    align-items: center;
}
.site-nav__list li a, .site-nav__list a {
    display: inline-block;
    padding: .55rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.site-nav__list li a:hover,
.site-nav__list li a:focus,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
    background: var(--color-primary);
    color: #fff;
}

@media (max-width: 880px) {
    .site-header__toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }
    .site-nav.is-open { max-height: 500px; }
    .site-nav__list { flex-direction: column; align-items: stretch; padding: .5rem 1.25rem 1rem; }
    .site-nav__list li a { padding: .85rem 1rem; border-radius: var(--radius-sm); }
}

/* ========== HERO ========== */
.hero {
    position: relative;
    background: var(--color-primary-dark);
    overflow: hidden;
}
.hero__media { position: relative; height: clamp(260px, 34vw, 420px); overflow: hidden; }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: center 50%; display: block; }
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .10) 35%, rgba(18, 16, 15, .80) 100%);
    display: flex;
    align-items: flex-end;
    padding-bottom: 1.75rem;
}
.hero__title {
    color: var(--color-primary);   /* rosso del marchio */
    font-weight: 600;               /* peso medio: il rosso pesa meno che in grassetto */
    margin: 0 0 .25rem;
    font-size: clamp(1.6rem, 2.6vw + .4rem, 2.2rem);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .45);
}
.hero__subtitle {
    color: rgba(255, 255, 255, .92);
    margin: 0;
    font-size: 1rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

@media (max-width: 600px) {
    .hero__media { height: 240px; }
}

/* ========== SECTIONS / CARDS ========== */
.page-section { padding: 2.5rem 0; }
.page-header { margin-bottom: 1.75rem; }
.page-header__intro {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 700px;
}

.content-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.content-card + .content-card { margin-top: 1.25rem; }

.content-body p:last-child { margin-bottom: 0; }
.content-body--bordered {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.content-card ul {
    padding-left: 1.2rem;
}
.content-card li { margin-bottom: .35rem; }

/* ========== ORARI ========== */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
@media (max-width: 720px) {
    .schedule-grid { grid-template-columns: 1fr; }
}
.schedule-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.schedule-card__title {
    margin: 0 0 1rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary-dark);
}
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th, .schedule-table td {
    padding: .55rem .25rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: .95rem;
    vertical-align: top;
}
.schedule-table th { width: 100px; font-weight: 600; color: var(--color-text); }
.schedule-table tr:last-child th, .schedule-table tr:last-child td { border-bottom: 0; }

.schedule-card__note { margin-top: 1rem; font-size: .92rem; color: var(--color-muted); }
.schedule-card__note strong { color: var(--color-accent-dark); }
.schedule-card__cta { margin-top: 1rem; margin-bottom: 0; }

/* ========== MEZZI ========== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.vehicle-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.vehicle-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.vehicle-card__media {
    aspect-ratio: 4 / 3;
    background: var(--color-bg-alt);
    overflow: hidden;
}
.vehicle-card__img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card__body { padding: 1rem 1.25rem 1.25rem; }
.vehicle-card__title { margin: 0 0 .5rem; font-size: 1.1rem; }
.vehicle-card__cats {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: .35rem;
}
.vehicle-card__cats li {
    background: var(--color-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 999px;
    letter-spacing: .3px;
}

/* ========== INFO ========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
@media (max-width: 720px) {
    .info-grid { grid-template-columns: 1fr; }
}
.info-grid .content-card { padding: 1.5rem; }
.info-grid .content-card + .content-card { margin-top: 0; }
.info-grid h2 { color: var(--color-primary-dark); margin-top: 0; }
.info-grid address { font-style: normal; line-height: 1.6; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: .65rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s, transform .1s;
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1.2;
    font-size: .95rem;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-accent); color: #fff !important; }
.btn--primary:hover { background: var(--color-accent-dark); color: #fff !important; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--color-primary) !important; border-color: var(--color-primary); }
.btn--ghost:hover { background: var(--color-primary); color: #fff !important; text-decoration: none; }

/* ========== PRENOTA ========== */
.form-placeholder {
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}
.contact-fallback {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.contact-fallback__numbers {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 0;
}

/* ========== HOME — sezioni compatte ========== */
.page-section--intro { padding-bottom: 1.25rem; }
.page-section--intro + .page-section { padding-top: 1.25rem; }

.services-card { padding: 1.5rem 1.75rem; }
.services-card__title {
    text-align: center;
    margin: 0 0 1.25rem;
    padding-bottom: .65rem;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary-dark);
}
.services-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}
.services-list li {
    padding: .35rem 0 .35rem 1.4rem;
    position: relative;
    break-inside: avoid;
    font-size: .96rem;
    line-height: 1.55;
}
.services-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(.35rem + .775em); /* padding-top + metà altezza-riga */
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
}
@media (max-width: 640px) {
    .services-list { columns: 1; }
}

/* ========== OFFICE GALLERY (HOME) ========== */
.office-section { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.office-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
}
.office-card {
    margin: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.office-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.office-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

@media (max-width: 720px) {
    .office-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== CTA ROW (HOME) — sobrio: card bianche, icone colorate ========== */
.cta-section { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.cta-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    transition: border-color .15s, transform .15s, box-shadow .2s;
    min-height: 72px;
}
.cta:hover, .cta:focus {
    color: var(--color-text);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.cta__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}
.cta__body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.cta__label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--color-muted);
}
.cta__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Colori icona per ogni CTA (riconoscibili dai brand) */
.cta--whatsapp .cta__icon { color: #25D366; }
.cta--phone .cta__icon    { color: var(--color-primary); }
.cta--email .cta__icon    { color: var(--color-accent); }
.cta--social .cta__icon   { color: var(--color-muted); }

/* Hover: bordo si tinge del colore del brand */
.cta--whatsapp:hover { border-color: #25D366; }
.cta--phone:hover    { border-color: var(--color-primary); }
.cta--email:hover    { border-color: var(--color-accent); }

.cta--social { cursor: default; }
.cta--social:hover { transform: none; box-shadow: none; border-color: var(--color-border); }

.cta__socials {
    display: flex;
    gap: .5rem;
    margin-top: .35rem;
}
.cta__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
}
.cta__social:hover, .cta__social:focus {
    text-decoration: none;
    transform: scale(1.08);
    opacity: .9;
}
.cta__social--facebook {
    background: #1877F2;
    color: #fff !important;
}
.cta__social--instagram {
    background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
    color: #fff !important;
}

@media (max-width: 640px) {
    .cta-row { grid-template-columns: 1fr; }
    .cta__value { white-space: normal; }
}

/* Variante ridotta (es. fallback contatti in pagina prenota) */
.cta-row--small {
    grid-template-columns: repeat(3, 1fr);
    gap: .65rem;
    margin-top: .75rem;
}
.cta-row--small .cta {
    padding: .65rem .8rem;
    gap: .7rem;
    min-height: 56px;
}
.cta-row--small .cta__icon { width: 32px; height: 32px; }
.cta-row--small .cta__label { font-size: .68rem; letter-spacing: .6px; }
.cta-row--small .cta__value { font-size: .9rem; }
@media (max-width: 560px) {
    .cta-row--small { grid-template-columns: 1fr; }
}

/* ========== FOOTER (riga unica) ========== */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, .85);
    padding: .85rem 0;
    font-size: .82rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--color-accent); }

.site-footer__line {
    margin: 0;
    text-align: center;
    line-height: 1.7;
}
.site-footer__line .sep {
    color: rgba(255, 255, 255, .35);
    margin: 0 .15rem;
}
.site-footer__admin {
    display: inline-flex;
    align-items: center;
    opacity: .55;
    transition: opacity .15s;
    vertical-align: -2px;
}
.site-footer__admin:hover { opacity: 1; }

/* Striscia di segnaletica stradale, attaccata sopra il footer.
   Fondo trasparente (mostra lo sfondo pagina) e nessun bordo: si fonde col resto. */
.site-footer__signals {
    height: 64px;
    margin-top: 2.5rem;
    background-image: url('../img/signals.svg');
    background-repeat: repeat-x;
    background-position: bottom center;
    background-size: auto 100%;
    line-height: 0;
}
@media (max-width: 600px) {
    .site-footer__signals { height: 46px; }
}

/* ========== Mappa pagina Info ========== */
.content-card__map {
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    line-height: 0;
}
.content-card__map iframe { display: block; width: 100%; }

/* ========== Modulo Contact Form 7 (Prenota visita medica) ========== */
.wpcf7 form { margin: 0; }
.wpcf7 .form-row { margin-bottom: 1rem; }
.wpcf7 .form-row label {
    display: block;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: .92rem;
    margin-bottom: .35rem;
}
.wpcf7 .form-row--two { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .wpcf7 .form-row--two { grid-template-columns: 1fr; } }

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
}
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, .18);
}
.wpcf7 textarea { resize: vertical; min-height: 110px; }

.wpcf7 .form-consent {
    font-size: .88rem;
    color: var(--color-muted);
    margin: 1rem 0;
}
.wpcf7 .form-consent .wpcf7-list-item { margin: 0; display: inline; }
.wpcf7 .form-consent input[type="checkbox"] { margin-right: .35rem; }

.wpcf7 .wpcf7-spinner { vertical-align: middle; margin-left: .5rem; }
.wpcf7 .wpcf7-response-output {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: .7rem .9rem;
    margin: 1rem 0 0;
    font-size: .9rem;
    background: var(--color-bg-alt);
}
.wpcf7 form.sent .wpcf7-response-output { border-color: #2f9e44; background: #e6f7ea; color: #1f6b2c; }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output { border-color: #c9302c; background: #fdecea; color: #8a1f1c; }
.wpcf7 .wpcf7-not-valid-tip { color: #c9302c; font-size: .85rem; margin-top: .25rem; display: block; }
.wpcf7 .wpcf7-not-valid { border-color: #c9302c; }

/* ========== Avvisi: barra in alto ========== */
.lam-banner {
    background: var(--color-accent);
    color: #fff;
    font-size: .92rem;
    line-height: 1.45;
    border-bottom: 1px solid var(--color-accent-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.lam-banner.is-visible { max-height: 240px; }
.lam-banner__inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
}
.lam-banner__text { flex: 1; }
.lam-banner__title { margin-right: .35rem; }
.lam-banner__body { display: inline; }
.lam-banner__body p { display: inline; margin: 0; }
.lam-banner a, .lam-banner__cta {
    color: #fff;
    text-decoration: underline;
    margin-left: .5rem;
    font-weight: 600;
}
.lam-banner__cta:hover { text-decoration: none; }
.lam-banner__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .15rem .4rem;
    border-radius: 4px;
    opacity: .8;
    transition: opacity .15s, background .15s;
}
.lam-banner__close:hover { opacity: 1; background: rgba(0, 0, 0, .15); }

/* ========== Avvisi: popup centrale ========== */
.lam-popup { position: fixed; inset: 0; z-index: 9999; }
.lam-popup[hidden] { display: none; }
.lam-popup__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    transition: opacity .2s ease;
}
.lam-popup.is-open .lam-popup__backdrop { opacity: 1; }
.lam-popup__dialog {
    position: relative;
    background: #fff;
    color: var(--color-text);
    max-width: 480px;
    width: calc(100% - 2rem);
    margin: 8vh auto 0;
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px) scale(.98);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}
.lam-popup.is-open .lam-popup__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.lam-popup__title {
    margin: 0 0 .6rem;
    color: var(--color-primary-dark);
    padding-right: 2rem;
}
.lam-popup__body p:last-child { margin-bottom: 0; }
.lam-popup__close {
    position: absolute;
    top: .5rem; right: .65rem;
    background: transparent;
    border: 0;
    color: var(--color-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: .25rem .5rem;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.lam-popup__close:hover { color: var(--color-text); background: var(--color-bg-alt); }
.lam-popup__actions { margin: 1.25rem 0 0; }

@media (max-width: 600px) {
    .lam-banner__inner { padding: .55rem .9rem; gap: .5rem; }
    .lam-banner { font-size: .88rem; }
    .lam-popup__dialog { margin-top: 5vh; padding: 1.25rem 1.25rem 1rem; }
}
