/* ============================================================
   RERUM HUMANARUM — Foglio di stile principale
   Sobrio, istituzionale, mobile-first.
   ============================================================ */

@import url('https://fonts.bunny.net/css?family=cinzel:400,500,600,700|cormorant-garamond:400,400i,500,500i,600,600i|inter:300,400,500,600,700&display=swap');

:root {
    /* Palette derivata dal logo */
    --rh-verde:        #1F3A2F;   /* verde profondo silhouette */
    --rh-verde-scuro:  #14271F;
    --rh-verde-medio:  #2D4A2F;
    --rh-salvia:       #6B8A6E;   /* verde foglie tenui */
    --rh-oro:          #B8914E;   /* oro brunito cerchio */
    --rh-oro-chiaro:   #D4B47A;
    --rh-oro-tenue:    rgba(184,145,78,0.35);
    --rh-avorio:       #F4EFE2;   /* base sfondo */
    --rh-crema:        #FAF6EC;
    --rh-nero:         #1A1A1A;
    --rh-grigio:       #6B6B6B;
    --rh-grigio-chiaro:#A8A39D;
    --rh-bianco:       #FEFCF6;

    /* Tipografia */
    --rh-font-titolo:   'Cinzel', 'Trajan Pro', Georgia, serif;
    --rh-font-corpo:    'Inter', -apple-system, system-ui, sans-serif;
    --rh-font-italic:   'Cormorant Garamond', Georgia, serif;

    /* Sizing */
    --rh-max:           1180px;
    --rh-max-stretto:   720px;
    --rh-radius:        4px;
}

/* Reset minimo --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--rh-font-corpo);
    font-weight: 400;
    line-height: 1.65;
    color: var(--rh-nero);
    background: var(--rh-avorio);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rh-verde); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--rh-oro); }

/* Tipografia ----------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--rh-font-titolo);
    font-weight: 600;
    color: var(--rh-verde-scuro);
    line-height: 1.25;
    letter-spacing: 0.01em;
    margin: 0 0 1rem;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); font-weight: 500; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; color: var(--rh-oro); }
p { margin: 0 0 1.2rem; }
.lead { font-size: 1.15rem; line-height: 1.7; color: #303030; }
.italic { font-family: var(--rh-font-italic); font-style: italic; font-weight: 400; }

/* Eyebrow (etichette dorate) */
.eyebrow {
    font-family: var(--rh-font-corpo);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rh-oro);
    margin: 0 0 1rem;
}

/* Contenitori e griglie ------------------------------------------ */
.container { max-width: var(--rh-max); margin: 0 auto; padding: 0 1.5rem; }
.container-stretto { max-width: var(--rh-max-stretto); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--rh-crema); }
.section-scuro { background: var(--rh-verde-scuro); color: var(--rh-avorio); }
.section-scuro h1, .section-scuro h2, .section-scuro h3 { color: var(--rh-bianco); }
.section-scuro .eyebrow { color: var(--rh-oro-chiaro); }

@media (min-width: 720px) {
    .section { padding: 6rem 0; }
}

/* Ornamento dorato decorativo ------------------------------------ */
.ornamento {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2.5rem auto;
    max-width: 240px;
    color: var(--rh-oro);
}
.ornamento::before,
.ornamento::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rh-oro-tenue), transparent);
}
.ornamento-glyph {
    font-size: 0.85rem;
    line-height: 1;
    color: var(--rh-oro);
    opacity: 0.85;
}

/* ============================================================
   HEADER ISTITUZIONALE — fascia banner + fascia menu
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--rh-avorio);
    border-bottom: 1px solid var(--rh-oro-tenue);
    transition: all 0.3s ease;
}

/* Fascia banner superiore (logo + nome + claim, centrato) */
.header-banner {
    background: linear-gradient(180deg, var(--rh-crema) 0%, var(--rh-avorio) 100%);
    text-align: center;
    padding: 1.8rem 1.5rem 1.4rem;
    transition: padding 0.3s ease;
    border-bottom: 1px solid var(--rh-oro-tenue);
}
.brand-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--rh-verde-scuro);
}
.brand-block:hover { color: var(--rh-verde); }
.brand-logo {
    width: 230px;
    height: 230px;
    transition: width 0.3s ease, height 0.3s ease, margin-right 0.3s ease;
    display: block;
}
.brand-eyebrow {
    font-family: var(--rh-font-corpo);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--rh-oro);
    margin: 0.4rem 0 0.2rem;
    line-height: 1;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
    opacity: 1;
    max-height: 1.4rem;
    overflow: hidden;
}
.brand-name {
    font-family: var(--rh-font-titolo);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    color: var(--rh-verde-scuro);
    line-height: 1.1;
    transition: font-size 0.3s ease, letter-spacing 0.3s ease;
}
.brand-claim {
    font-family: var(--rh-font-italic);
    font-style: italic;
    font-size: 0.96rem;
    color: var(--rh-grigio);
    margin-top: 0.1rem;
    line-height: 1.4;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
    opacity: 1;
    max-height: 2rem;
    overflow: hidden;
}

@media (min-width: 720px) {
    .header-banner { padding: 2.4rem 1.5rem 1.8rem; }
    .brand-logo { width: 263px; height: 263px; }
    .brand-name { font-size: 1.7rem; letter-spacing: 0.38em; }
    .brand-claim { font-size: 1.05rem; }
}

/* Fascia menu inferiore */
.header-nav {
    background: var(--rh-avorio);
    padding: 0;
}
.header-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: var(--rh-max);
    margin: 0 auto;
}
.header-nav-list li {
    position: relative;
}
.header-nav-list li + li::before {
    content: '·';
    position: absolute;
    left: -0.1em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rh-oro);
    opacity: 0.55;
    font-size: 1rem;
    pointer-events: none;
}
.header-nav-list a {
    display: block;
    padding: 0.95rem 1.4rem;
    font-family: var(--rh-font-titolo);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--rh-verde-scuro);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.header-nav-list a:hover { color: var(--rh-oro); }
.header-nav-list a.active { color: var(--rh-oro); }

/* Hamburger mobile (per fascia nav) */
.header-nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    padding: 0.9rem 1.5rem;
    color: var(--rh-verde-scuro);
    font-family: var(--rh-font-titolo);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    justify-content: center;
    border-top: 1px solid transparent;
}
.header-nav-toggle svg { width: 18px; height: 18px; }

/* Menu mobile a tutto schermo */
.header-nav-mobile {
    display: none;
    flex-direction: column;
    padding: 0.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--rh-oro-tenue);
    background: var(--rh-avorio);
}
.header-nav-mobile.open { display: flex; }
.header-nav-mobile > a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--rh-oro-tenue);
    font-family: var(--rh-font-titolo);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rh-verde-scuro);
}
.header-nav-mobile > a:hover { color: var(--rh-oro); }

.nav-mobile-sub {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0 0.6rem 0.8rem;
    border-bottom: 1px dashed var(--rh-oro-tenue);
}
.nav-mobile-sub a {
    padding: 0.45rem 0;
    font-family: var(--rh-font-corpo);
    font-size: 0.88rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--rh-grigio);
}
.nav-mobile-sub a:hover { color: var(--rh-oro); }

@media (min-width: 880px) {
    .header-nav-list { display: flex; }
    .header-nav-toggle { display: none; }
    .header-nav-mobile { display: none !important; }
}

/* Modalità compatta su scroll ---------------------------------- */
.header.is-compact .header-banner {
    padding: 0.5rem 1.5rem 0.45rem;
}
.header.is-compact .brand-block {
    flex-direction: row;
    gap: 0.75rem;
}
.header.is-compact .brand-logo {
    width: 38px;
    height: 38px;
}
.header.is-compact .brand-name {
    font-size: 1rem;
    letter-spacing: 0.22em;
}
.header.is-compact .brand-claim,
.header.is-compact .brand-eyebrow {
    opacity: 0;
    max-height: 0;
    margin: 0;
}
@media (min-width: 720px) {
    .header.is-compact .brand-logo { width: 42px; height: 42px; }
    .header.is-compact .brand-name { font-size: 1.05rem; letter-spacing: 0.24em; }
}
.header.is-compact .header-nav-list a {
    padding: 0.65rem 1.2rem;
    font-size: 0.74rem;
}
.header.is-compact .header-nav-toggle {
    padding: 0.65rem 1.5rem;
}

/* Hero ----------------------------------------------------------- */
.hero {
    padding: 3rem 0 2.5rem;
    text-align: center;
    background: var(--rh-avorio);
}
@media (min-width: 720px) {
    .hero { padding: 4.5rem 0 4rem; }
}
.hero-sub {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.34em;
    color: var(--rh-oro);
    font-weight: 500;
    margin-bottom: 1.5rem;
}
.hero-frase {
    font-family: var(--rh-font-titolo);
    font-size: clamp(1.5rem, 3.6vw, 2.6rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--rh-verde-scuro);
    line-height: 1.35;
    margin: 0 auto 0;
    max-width: 720px;
}

/* Vecchie classi hero — conservate per compatibilità ------------ */
.hero-logo {
    width: clamp(180px, 30vw, 280px);
    margin: 0 auto 2rem;
}
.hero-title {
    font-family: var(--rh-font-titolo);
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--rh-verde-scuro);
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}
.hero-claim {
    font-family: var(--rh-font-italic);
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    color: var(--rh-grigio);
    margin: 0 auto 2rem;
    max-width: 600px;
    line-height: 1.5;
}

/* Bottoni -------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    font-family: var(--rh-font-corpo);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--rh-radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 44px;
}
.btn-primary {
    background: var(--rh-verde);
    color: var(--rh-avorio);
}
.btn-primary:hover {
    background: var(--rh-verde-medio);
    color: var(--rh-avorio);
}
.btn-secondary {
    background: transparent;
    color: var(--rh-verde);
    border-color: var(--rh-verde);
}
.btn-secondary:hover {
    background: var(--rh-verde);
    color: var(--rh-avorio);
}
.btn-oro {
    background: var(--rh-oro);
    color: var(--rh-bianco);
}
.btn-oro:hover {
    background: var(--rh-oro-chiaro);
    color: var(--rh-nero);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Card ----------------------------------------------------------- */
.card-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin-top: 2.5rem;
}
@media (min-width: 720px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}
@media (min-width: 980px) {
    .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: var(--rh-bianco);
    border: 1px solid var(--rh-oro-tenue);
    border-radius: var(--rh-radius);
    padding: 2rem 1.75rem;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(31,58,47,0.08);
    border-color: var(--rh-oro);
}
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rh-crema);
    border: 1.5px solid var(--rh-oro-tenue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rh-verde);
    margin-bottom: 1.25rem;
}
.card h3 {
    margin-bottom: 0.6rem;
    color: var(--rh-verde-scuro);
}
.card p {
    color: #4a4a4a;
    font-size: 0.96rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}
.card-link {
    font-family: var(--rh-font-corpo);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--rh-oro);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.card-link::after {
    content: '→';
    transition: transform 0.2s;
}
.card-link:hover { color: var(--rh-verde); }
.card-link:hover::after { transform: translateX(3px); }

/* Cornice istituzionale ------------------------------------------ */
.cornice {
    border: 1px solid var(--rh-oro);
    padding: 3rem 2rem;
    position: relative;
    background: var(--rh-bianco);
    text-align: center;
}
.cornice::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--rh-oro-tenue);
    pointer-events: none;
}

/* Citazione ------------------------------------------------------ */
.citazione {
    font-family: var(--rh-font-italic);
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    line-height: 1.5;
    color: var(--rh-verde-scuro);
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}
.citazione::before,
.citazione::after {
    content: '"';
    font-family: var(--rh-font-titolo);
    font-size: 3rem;
    color: var(--rh-oro);
    opacity: 0.5;
    line-height: 0.5;
    display: block;
}
.citazione::before { margin-bottom: 1rem; }
.citazione::after { margin-top: 1rem; }
.citazione-fonte {
    display: block;
    font-family: var(--rh-font-corpo);
    font-style: normal;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--rh-grigio);
    margin-top: 1.25rem;
}

/* Form ----------------------------------------------------------- */
.form {
    background: var(--rh-bianco);
    padding: 2.5rem;
    border: 1px solid var(--rh-oro-tenue);
    border-radius: var(--rh-radius);
}
.form-row {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
    .form-row-2 { grid-template-columns: 1fr 1fr; }
}
.form-field { display: flex; flex-direction: column; }
.form-field label {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--rh-verde-scuro);
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}
.form-field label .req { color: var(--rh-oro); }
.form-field input,
.form-field select,
.form-field textarea {
    font-family: var(--rh-font-corpo);
    font-size: 1rem;
    padding: 0.75rem 0.85rem;
    background: var(--rh-crema);
    border: 1px solid var(--rh-oro-tenue);
    border-radius: var(--rh-radius);
    color: var(--rh-nero);
    transition: border-color 0.2s, background 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--rh-oro);
    background: var(--rh-bianco);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.88rem;
    color: #4a4a4a;
    margin-bottom: 1rem;
    line-height: 1.45;
}
.form-checkbox input { margin-top: 0.2rem; }
.form-checkbox a { color: var(--rh-oro); text-decoration: underline; }

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Footer --------------------------------------------------------- */
.footer {
    background: var(--rh-verde-scuro);
    color: var(--rh-avorio);
    padding: 4rem 0 1.5rem;
    font-size: 0.92rem;
}
.footer a { color: var(--rh-avorio); }
.footer a:hover { color: var(--rh-oro-chiaro); }
.footer-grid {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr;
    margin-bottom: 2.5rem;
}
@media (min-width: 720px) {
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.footer-brand img { width: 56px; height: 56px; filter: brightness(1.4); }
.footer-brand-name {
    font-family: var(--rh-font-titolo);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.footer-brand-sub {
    font-family: var(--rh-font-italic);
    font-style: italic;
    font-size: 0.88rem;
    color: var(--rh-oro-chiaro);
    margin-top: 2px;
}
.footer h4 {
    color: var(--rh-oro-chiaro);
    font-size: 0.78rem;
    margin-bottom: 1rem;
}
.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer ul li { margin-bottom: 0.55rem; }
.footer-legal {
    border-top: 1px solid rgba(212,180,122,0.2);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #c5c0b3;
    line-height: 1.7;
}
.footer-legal a { color: #c5c0b3; }

/* Tabella semplice ---------------------------------------------- */
.tabella {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.tabella th, .tabella td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--rh-oro-tenue);
    text-align: left;
}
.tabella th {
    font-family: var(--rh-font-corpo);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rh-oro);
    background: var(--rh-crema);
}

/* Lista istituzionale ------------------------------------------- */
ul.istituzionale {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
ul.istituzionale li {
    padding: 0.8rem 0 0.8rem 1.5rem;
    border-bottom: 1px dashed var(--rh-oro-tenue);
    position: relative;
}
ul.istituzionale li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0.85rem;
    color: var(--rh-oro);
    font-size: 0.7rem;
}
ul.istituzionale li:last-child { border-bottom: none; }

/* Stato page banner --------------------------------------------- */
.stato-banner {
    background: var(--rh-crema);
    border-left: 3px solid var(--rh-oro);
    padding: 1rem 1.25rem;
    margin: 2rem 0;
    font-size: 0.9rem;
    color: #4a4a4a;
    line-height: 1.6;
    border-radius: 0 var(--rh-radius) var(--rh-radius) 0;
}
.stato-banner strong { color: var(--rh-verde-scuro); }

/* Utility ------------------------------------------------------- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 2rem !important; }
.mt-3 { margin-top: 3rem; }
