/* ============================================
   SAV — manens.css
   Restyling ispirato a manens.com/progetti
   Caricato DOPO template.css: sovrascrive font, colori,
   header, hero, griglia progetti e footer.
   ============================================ */

:root {
    --sav-teal:      #004f59;   /* colore logo SAV */
    --sav-teal-dark: #00323a;
    --sav-navy:      #153243;
    --sav-accent:    #26ac8d;
    --sav-light:     #f3f9fb;
    --sav-text:      #3a3a3a;
    --font-cond:     'Maven Pro', sans-serif;
    --font-body:     'Maven Pro', sans-serif;
    --header-h:      76px;
    --cat-h:         46px;
    --mp-border-soft: 1px solid #e3ecef;
}

html { font-size: 16px; }

body.mp-body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--sav-text);
    line-height: 1.65;
}

a:hover { text-decoration: none; }

/* ── HEADER: barra bianca fissa, voci maiuscole, voce attiva piena ── */
.mp-header,
.mp-header--solid,
.mp-header--transparent {
    background: #fff;
    border-bottom: 1px solid #e3ecef;
    box-shadow: 0 2px 12px rgba(0, 50, 58, 0.06);
}
.mp-header-inner {
    height: var(--header-h);
    padding: 0 40px;
    gap: 32px;
}
.mp-logo a { align-items: center; }
.mp-logo-img { height: 56px; }
.mp-logo-sub {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--sav-teal);
}
.mp-header--solid .mp-logo-sub { color: var(--sav-teal); }

.mp-topnav { margin-left: auto; height: 100%; }
.mp-topnav ul { list-style: none; display: flex; height: 100%; }
.mp-topnav li { display: flex; }
.mp-topnav a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sav-teal-dark);
    transition: background 0.2s, color 0.2s;
}
.mp-topnav a:hover,
.mp-topnav li.is-active a {
    background: var(--sav-teal);
    color: #fff;
}

.mp-header-right { margin-left: 0; }
/* Il pallino/overlay resta solo per il mobile */
.mp-studio-toggle { display: none; }
.mp-hamburger { display: none !important; }
.mp-toggle-ring { stroke: var(--sav-teal); fill: none; }
.mp-toggle-dot  { fill: var(--sav-teal); }
.mp-studio-toggle:hover .mp-toggle-dot,
.mp-header--solid .mp-studio-toggle:hover .mp-toggle-dot { fill: var(--sav-accent); }

/* ── BARRA CATEGORIE: striscia chiara con voci maiuscole ── */
.mp-categories {
    height: var(--cat-h);
    background: var(--sav-light);
    border-top: 1px solid #e3ecef;
    padding: 0 40px;
}
.mp-categories-inner { justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
.mp-sep { display: none; }
.mp-cat,
.mp-header--solid .mp-cat {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--sav-teal);
    padding: 6px 14px;
    border-bottom: none;
    border-radius: 2px;
    opacity: 0.8;
}
.mp-cat:hover,
.mp-header--solid .mp-cat:hover {
    color: var(--sav-teal-dark);
    background: #e3f0f3;
    border-bottom: none;
    opacity: 1;
}
.mp-cat.active,
.mp-header--solid .mp-cat.active {
    background: var(--sav-teal);
    color: #fff;
    padding: 6px 14px;
    opacity: 1;
}

/* ── HERO: fascia con titolo centrato ── */
.mp-hero {
    margin-top: calc(var(--header-h) + var(--cat-h));
    padding: 80px 24px 64px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(0, 50, 58, 0.94), rgba(21, 50, 67, 0.88)),
        var(--sav-teal);
}
.mp-hero__title {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    letter-spacing: 2.5px;
    color: #fff;
    line-height: 1.15;
}

/* Il contenuto ora parte sotto l'hero: niente padding extra */
.mp-main,
.mp-main--portfolio,
.mp-main--grid,
.mp-main--people,
.mp-main--contatti { padding-top: 0; }

/* ── GRIGLIA PROGETTI: 3 colonne, schede con gradiente laterale ── */
.mp-grid-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 8px;
}
.mp-grid-breadcrumb {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: capitalize;
    color: var(--sav-accent);
}
.mp-grid-sep { color: #b9cdd2; }

.mp-project-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 64px;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.mp-grid-card,
.mp-grid-card:nth-child(4n),
.mp-grid-card:nth-child(3n),
.mp-grid-card:nth-child(2n) {
    border: none;
    background: var(--sav-teal-dark);
    aspect-ratio: 3 / 2;
}
.mp-grid-card__img { filter: none; }
.mp-grid-card__link:hover .mp-grid-card__img {
    transform: scale(1.05);
    filter: brightness(0.85);
}
.mp-grid-card__info {
    top: 0;
    padding: 16px 18px;
    justify-content: flex-end;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.62), rgba(255, 255, 255, 0));
}
.mp-grid-card__rif {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: var(--sav-accent);
}
.mp-grid-card__title {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: #fff;
    max-width: 85%;
}

@media (max-width: 1000px) {
    .mp-project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .mp-project-grid { grid-template-columns: 1fr; padding: 12px 16px 40px; }
    .mp-grid-card__rif   { font-size: 0.75rem; }
    .mp-grid-card__title { font-size: 0.95rem; }
}

/* Paginazione */
.mp-pagination { border-top: 1px solid #e3ecef; }
.mp-pagination a, .mp-pagination span {
    font-family: var(--font-body);
    border: 1px solid #e3ecef;
    color: var(--sav-teal);
}
.mp-pagination a:hover,
.mp-pagination .active span,
.mp-pagination .current { background: var(--sav-teal); color: #fff; }

/* ── ELENCO PORTFOLIO (home) ── */
.portfolio-item__media { height: 62vh; background-color: var(--sav-teal-dark); }
.portfolio-item__title,
.portfolio-item__title-inner { font-family: var(--font-body); font-weight: 600; letter-spacing: 2.5px; }
.portfolio-item__category,
.portfolio-item__meta { color: #fff; letter-spacing: 0.14em; }
.portfolio-item__text h2,
.portfolio-item__text h3 { font-family: var(--font-body); color: var(--sav-teal-dark); letter-spacing: 1px; }
.portfolio-item__text p { font-weight: 400; color: var(--sav-text); }

/* ── Overlay mobile ── */
.mp-studio-overlay__nav a:hover { color: var(--sav-teal); }

/* ── FOOTER: blocchi su fondo petrolio scuro ── */
.mp-footer {
    background: var(--sav-teal-dark);
    border-top: none;
    padding: 0;
    color: #fff;
}
.mp-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 24px 40px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.mp-footer-logo {
    height: 54px;
    width: auto;
    background: #fff;
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 18px;
}
.mp-footer h6 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 14px;
}
.mp-footer p,
.mp-footer li { font-size: 14px; font-weight: 300; color: rgba(255, 255, 255, 0.85); line-height: 1.8; }
.mp-footer ul { list-style: none; }
.mp-footer a { color: #fff; }
.mp-footer a:hover { color: var(--sav-accent); }
.mp-footer-col p + p { margin-top: 10px; }
.mp-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 18px 24px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.65);
}

/* ── Responsive header/footer ── */
@media (max-width: 1000px) {
    .mp-header-inner { padding: 0 20px; }
    .mp-topnav { display: none; }
    .mp-studio-toggle { display: block; margin-left: auto; }
    .mp-categories { padding: 0 20px; overflow-x: auto; }
    .mp-hero { padding: 56px 20px 44px; }
    .mp-footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 20px 28px; }
}

/* ── Fascia titolo compatta (categorie diverse da "progetti") ── */
.mp-hero--compact {
    padding: 26px 24px 22px;
}
.mp-hero--compact .mp-hero__title {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: 2px;
}

/* ── Home senza fascia titolo: il contenuto parte sotto header + categorie ── */
.mp-main.mp-main--nohero {
    padding-top: calc(var(--header-h) + var(--cat-h));
}
@media (max-width: 1000px) {
    .mp-hero--compact { padding: 20px 20px 18px; }
}

/* ── Testata articolo compatta (categoria "sav-ingegneria") ── */
.proj-hero.proj-hero--compact {
    height: auto;
    min-height: 0;
    max-height: none;
    background-color: var(--sav-teal-dark);
}
.proj-hero--compact.proj-hero {
    /* con immagine: fascia bassa e larga; senza immagine: solo il titolo */
    min-height: 120px;
}
.proj-hero--compact .proj-hero__content {
    position: relative;
    padding: 1.6rem 3.5rem;
}
.proj-hero--compact .proj-hero__title {
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
    font-weight: 600;
    letter-spacing: 2px;
    line-height: 1.2;
}
.proj-hero--compact .proj-hero__zoom { bottom: 1.2rem; right: 2rem; }
@media (max-width: 800px) {
    .proj-hero--compact .proj-hero__content { padding: 1.2rem 1.5rem; }
}

/* ── Layout testuale (categoria "sav-ingegneria") ── */
.mp-testo { background: #fff; }
.mp-testo__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 72px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--sav-text);
}
.mp-testo__inner p { margin-bottom: 1.2em; }
.mp-testo__inner h2,
.mp-testo__inner h3 {
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--sav-teal-dark);
    margin: 1.6em 0 0.6em;
}
.mp-testo__inner h2 { font-size: 1.5rem; }
.mp-testo__inner h3 { font-size: 1.2rem; }
.mp-testo__inner ul,
.mp-testo__inner ol { margin: 0 0 1.2em 1.4em; }
.mp-testo__inner a { color: var(--sav-teal); text-decoration: underline; }
.mp-testo__inner img { max-width: 100%; height: auto; margin: 1.5em 0; }

/* Contatti: la mappa riempie lo spazio sotto la fascia titolo compatta */
.mp-contatti { min-height: calc(100vh - var(--header-h) - var(--cat-h) - 110px); }

/* ── Scheda progetto: colonne separate da linea grigia verticale, etichette grigie ── */
.proj-data-bar { background: #fff; border-bottom: 1px solid #d0d0d0; }
.proj-data-bar__item { border-right: 1px solid #d0d0d0; }
.proj-data-bar__item:last-child,
.proj-data-bar__item--desc { border-right: none; }
.proj-data-bar__label { color: #999; font-weight: 600; letter-spacing: 0.18em; }
.proj-data-bar__value { color: var(--sav-teal-dark); font-weight: 500; }
.proj-data-bar__value--desc { color: #444; font-weight: 400; }
.proj-data-bar__activities li::before { color: #bbb; }
.proj-data-bar__link { color: var(--sav-teal-dark); border-bottom-color: var(--sav-teal-dark); }

/* ── Scheda progetto: 5 colonne, più righe per colonna (solo spazio bianco tra le righe) ── */
.proj-data-bar__inner { align-items: flex-start; }
.proj-data-bar__item {
    flex-direction: column;
    gap: 1.6rem;                 /* spazio bianco tra una riga e l'altra */
    align-self: stretch;         /* la linea verticale copre tutta l'altezza della fascia */
    min-width: 150px;
}
.proj-data-bar__group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.proj-data-bar__item--wide { flex: 1; min-width: 220px; }
.proj-data-bar__item--desc { flex: 2; min-width: 280px; }
@media (max-width: 800px) {
    .proj-data-bar__item { border-right: none; padding: 1.4rem 1.5rem; width: 100%; }
}

/* ============================================
   MOBILE — header e menu progetti su due righe
   ============================================ */
@media (max-width: 1000px) {
    :root { --header-h: 64px; }

    /* l'header segue il flusso della pagina (sticky): altezza variabile, niente margini calcolati */
    .mp-header { position: sticky; top: 0; }
    .mp-hero { margin-top: 0; }
    .mp-main.mp-main--nohero { padding-top: 0; }

    /* menu progetti: va a capo su più righe invece di scorrere fuori schermo */
    .mp-categories {
        height: auto;
        min-height: 0;
        padding: 8px 16px;
        overflow: visible;
    }
    .mp-categories-inner {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 6px;
    }
    .mp-cat,
    .mp-header--solid .mp-cat {
        font-size: 12px;
        padding: 5px 10px;
        white-space: normal;
    }
    .mp-cat.active,
    .mp-header--solid .mp-cat.active { padding: 5px 10px; }
    .mp-logo-img { height: 44px; }
    .mp-logo-sub { display: inline; font-size: 11px; letter-spacing: 0.1em; }
}
