/* =========================================================================
   Agenzia Funebre Marinoni — Design system
   Sobrio ed elegante. Mobile-first, accessibile, prefers-reduced-motion.
   ========================================================================= */

:root {
    /* Colore — palette ripresa dal biglietto da visita:
       crema avorio, verde bosco, nero inciso */
    --ivory:        #faf7f0;
    --ivory-2:      #f4efe3;
    --surface:      #ffffff;
    --ink:          #1d1b17;
    --ink-soft:     #45423b;
    --muted:        #6f695d;
    --line:         #e5dfd0;
    --line-soft:    #eee9dc;
    --accent:       #1e7a44;   /* verde del biglietto */
    --accent-dark:  #145c32;
    --accent-soft:  #d8e9dd;
    --accent-tint:  #eef5ef;
    --dark:         #142019;   /* verde-nero per topbar, footer, cta */
    --danger:       #9b3b35;
    --success:      #1e7a44;
    --focus:        #2f6fb0;

    /* Tipografia */
    --display: "Cinzel", "Cormorant Garamond", Georgia, serif;
    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Spazi e raggi */
    --container: 1160px;
    --radius:    6px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(35,33,29,.06), 0 1px 2px rgba(35,33,29,.04);
    --shadow:    0 6px 24px rgba(35,33,29,.08);
    --shadow-lg: 0 18px 48px rgba(35,33,29,.14);
    --ease: cubic-bezier(.22,.61,.36,1);
}

/* Reset essenziale ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--ivory);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .2px; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
p { margin: 0 0 1rem; }
a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s var(--ease); }
a:hover { color: var(--ink); }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
blockquote { margin: 0; }

/* Accessibilità ---------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 1000;
    background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
    text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; color: #fff; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout ----------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.container--narrow { max-width: 760px; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tint { background: var(--ivory-2); }
.section--elegant {
    background: linear-gradient(135deg, rgba(222,239,225,.35) 0%, rgba(250,247,240,.1) 50%, rgba(255,255,255,0) 100%), 
                linear-gradient(to bottom, var(--ivory) 0%, var(--surface) 100%);
    position: relative;
}
.section--elegant::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(to bottom, var(--accent) 0%, rgba(30,122,68,0) 100%);
    border-radius: 3px;
}
.section--ink { background: var(--ink); color: #d9d4c9; }
.section--ink h2, .section--ink h3 { color: #fff; }
.eyebrow {
    font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 .9rem; display: inline-block;
}
.section-head { max-width: 680px; margin-bottom: 2.6rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }

/* Bottoni ---------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: .55rem; justify-content: center;
    font-family: var(--sans); font-weight: 600; font-size: .98rem; line-height: 1;
    padding: .9rem 1.5rem; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; transition: all .3s var(--ease); white-space: nowrap;
    position: relative; overflow: hidden;
}
.btn--primary { background: var(--accent-dark); color: #fff; box-shadow: 0 4px 12px rgba(30,122,68,.2); }
.btn--primary:hover { background: #0f4626; color: #fff; box-shadow: 0 8px 24px rgba(30,122,68,.3); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--accent-dark); box-shadow: 0 4px 12px rgba(35,33,29,.08); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--ivory-2); color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1.05rem; }
.btn--sm { padding: .55rem 1rem; font-size: .88rem; }
.btn svg { width: 1.1em; height: 1.1em; }

/* Topbar + Header -------------------------------------------------------- */
.topbar {
    background: var(--dark); color: #cfd8cf; font-size: .85rem;
}
.topbar .container { display: flex; gap: .3rem 1.2rem; align-items: center; justify-content: space-between; padding-block: .5rem; flex-wrap: wrap; }
@media (max-width: 640px) { .topbar .container { justify-content: center; } }
.topbar svg { width: 15px; height: 15px; flex: none; }
.topbar a { display: inline-flex; align-items: center; gap: .45rem; color: #eef3ee; text-decoration: none; white-space: nowrap; }
.topbar a:hover { color: #fff; }
.topbar .badge24 { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; color: #fff; white-space: nowrap; letter-spacing: .02em; }
.topbar .badge24::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6fbf8c; box-shadow: 0 0 0 0 rgba(111,191,140,.7); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(111,191,140,.6);} 70%{box-shadow:0 0 0 7px rgba(111,191,140,0);} 100%{box-shadow:0 0 0 0 rgba(111,191,140,0);} }
@media (max-width: 540px) { .topbar .badge24 svg { display: none; } }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(250,247,240,.93); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand--logo { flex-direction: column; align-items: flex-start; gap: .25rem; }
.brand--logo img { display: block; height: 56px; width: auto; }
/* Logo nero su sfondo chiaro; versione chiara generata via CSS per sfondi scuri */
.site-footer .brand--logo img, .admin-sidebar .brand--logo img { height: 50px; filter: brightness(0) invert(1); }
.login-card .brand--logo img { height: 64px; }
.brand__tag { font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-weight: 600; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a { font-family: var(--sans); font-size: .98rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; padding: .55rem .85rem; border-radius: var(--radius); }
.nav a:hover { color: var(--ink); background: var(--ivory-2); }
.nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 600; }
.header-cta { margin-left: .4rem; }
/* il bottone CTA vive dentro .nav: serve specificita' maggiore di ".nav a" */
.nav a.header-cta { color: #fff; background: var(--accent-dark); }
.nav a.header-cta:hover { color: #fff; background: #0f4626; }

.nav-toggle { display: none; }

/* Mobile nav */
@media (max-width: 900px) {
    .header-cta { display: none; }
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 46px; height: 46px; border: 1px solid var(--line); background: var(--surface);
        border-radius: var(--radius); cursor: pointer; color: var(--ink);
    }
    .nav-toggle svg { width: 24px; height: 24px; }
    .nav {
        position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw);
        flex-direction: column; align-items: stretch; gap: .2rem;
        background: var(--surface); padding: 5rem 1.2rem 2rem; box-shadow: var(--shadow-lg);
        transform: translateX(100%); visibility: hidden;
        transition: transform .3s var(--ease), visibility .3s; z-index: 200;
    }
    .nav.open { transform: translateX(0); visibility: visible; }
    .nav a { padding: .85rem 1rem; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
    .nav .header-cta { display: block; margin: 1rem 0 0; }
    .nav-backdrop { position: fixed; inset: 0; background: rgba(35,33,29,.45); opacity: 0; visibility: hidden; transition: opacity .3s; z-index: 150; }
    .nav-backdrop.open { opacity: 1; visibility: visible; }
}

/* Hero — stile "biglietto da visita": crema, doppia cornice verde, fregio  */
.hero-card { 
    position: relative; isolation: isolate; padding-block: clamp(4.5rem, 12vw, 8rem);
}
.hero-card__bg { position: absolute; inset: 0; z-index: -2; }
.hero-card__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-card::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(135deg, rgba(20,32,25,.48) 0%, rgba(20,32,25,.65) 100%);
}
.hero-card__frame {
    position: relative; max-width: 980px; margin-inline: auto; text-align: center;
    background: linear-gradient(180deg, #fdfcf9 0%, #faf7f0 100%);
    border-top: 3px solid var(--accent);
    border-bottom: 3px solid var(--accent);
    border-left: 1.5px solid var(--accent);
    border-right: 1.5px solid var(--accent);
    border-radius: 12px;
    padding: clamp(3.8rem, 9vw, 6rem) clamp(1.8rem, 7vw, 5.2rem);
    box-shadow: 
        0 0 0 1px rgba(30,122,68,.1),
        0 1px 0 rgba(255,255,255,.6) inset,
        0 30px 80px rgba(20,32,25,.18),
        0 8px 20px rgba(20,32,25,.1);
    transform: translateY(0);
    transition: transform .3s var(--ease);
}
.hero-card__frame:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 1px rgba(30,122,68,.15),
        0 1px 0 rgba(255,255,255,.6) inset,
        0 40px 100px rgba(20,32,25,.22),
        0 12px 28px rgba(20,32,25,.14);
}
.hero-card__frame::before {
    content: ""; position: absolute; inset: 10px; pointer-events: none;
    border: 1px solid var(--accent); opacity: .25; border-radius: 6px;
}
.hero-card__frame::after {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 100px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .4;
}
.hero-card .eyebrow { 
    margin-bottom: 1.6rem; font-size: .76rem; letter-spacing: .24em;
    color: var(--accent); text-transform: uppercase; font-weight: 700;
}
.hero-card h1 { 
    max-width: 24ch; margin-inline: auto; margin-bottom: 1.4rem;
    font-size: clamp(2.4rem, 6.5vw, 3.8rem); font-weight: 600;
    letter-spacing: .4px; line-height: 1.08;
    color: var(--ink);
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-card__lead { 
    font-size: clamp(1.08rem, 2.3vw, 1.3rem); color: var(--ink-soft); 
    max-width: 64ch; margin: 0 auto 2.4rem; line-height: 1.8;
    font-weight: 400; letter-spacing: .3px;
}
.hero-card__actions { display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: center; }
.hero-card .divider-icon { 
    margin-block: 1.6rem 2rem;
    opacity: .7; transition: opacity .3s var(--ease);
    transform: scale(1.2);
}
@media (max-width: 560px) {
    .hero-card__actions { flex-direction: column; }
    .hero-card__actions .btn { width: 100%; white-space: normal; }
}

/* Card / griglie --------------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.8rem; box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card__icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 1rem; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); margin-bottom: 0; }

/* Servizi feature */
.feature { display: flex; gap: 1rem; align-items: flex-start; }
.feature__icon { flex: none; width: 44px; height: 44px; color: var(--accent); }

/* Split media + testo */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split--reverse .split__media { order: 2; }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; object-fit: cover; aspect-ratio: 4/3; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .split--reverse .split__media { order: 0; } }

/* Necrologi — card in stile "manifesto": foglio con doppia cornice -------- */
.obit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.8rem; }
.obit-card__sheet {
    display: flex; flex-direction: column; height: 100%; position: relative;
    text-align: center; text-decoration: none; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--accent); border-radius: 6px;
    padding: 1.7rem 1.5rem 1.3rem;
    box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.obit-card__sheet::before {
    content: ""; position: absolute; inset: 6px; pointer-events: none;
    border: 1px solid var(--accent); opacity: .4; border-radius: 3px;
}
.obit-card__sheet:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.obit-card__head { display: flow-root; margin-bottom: 1.1rem; }
.obit-card__photo {
    float: right; width: 76px; height: 94px; object-fit: cover;
    margin: 0 0 .6rem .8rem; padding: 3px; background: var(--surface);
    border: 1px solid var(--accent); border-radius: 2px;
}
.obit-card__sacred {
    float: left; width: 60px; height: 80px; object-fit: contain;
    margin: 0 .8rem .6rem 0; padding: 0; background: none;
    border: 0; border-radius: 0;
}
.obit-card__epigraph {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
    color: var(--muted); margin: 0 0 .4rem;
}
.obit-card__name { font-family: var(--serif); font-size: 1.65rem; line-height: 1.12; color: var(--ink); margin: 0 0 .2rem; }
.obit-card__nick { font-size: .92rem; color: var(--muted); font-style: italic; margin: 0 0 .2rem; }
.obit-card__age { font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 .3rem; }
.obit-card__dates { font-size: .92rem; color: var(--ink-soft); margin: 0; display: inline-flex; align-items: center; gap: .45rem; }
.obit-card__dates-cross { color: var(--accent); }
.obit-card__funeral { font-size: .89rem; color: var(--ink-soft); line-height: 1.55; margin: .85rem 0 0; }
.obit-card__sign {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line-soft);
    font-size: .78rem; color: var(--muted);
}
.obit-card__agency { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.02rem; color: var(--accent-dark); }
.obit-card__cta {
    margin-top: .8rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark);
}
.obit-card__sheet:hover .obit-card__cta { text-decoration: underline; text-underline-offset: 3px; }

/* Necrologio singolo */
.obit-hero { background: var(--ivory-2); border-bottom: 1px solid var(--line); padding-block: clamp(2.4rem,6vw,4rem); text-align: center; }
.obit-hero__photo {
    width: 148px; height: 182px; border-radius: 3px; object-fit: cover; margin: 0 auto 1.2rem;
    padding: 4px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow);
}
.obit-hero__photo--ph { display: flex; align-items: center; justify-content: center; color: var(--accent); background: var(--surface); }
.obit-hero__photo--ph svg { width: 76px; height: 76px; }
.obit-hero__images { display: flex; align-items: flex-end; justify-content: center; gap: 1.4rem; margin-bottom: 1.2rem; }
.obit-hero__images .obit-hero__photo { margin: 0; }
.obit-hero__sacred {
    width: 96px; height: 128px; object-fit: contain;
    padding: 0; background: none; border: 0;
    border-radius: 0; box-shadow: none;
}
.obit-hero h1 { margin-bottom: .2rem; }
.obit-hero__dates { font-size: 1.25rem; color: var(--accent-dark); font-family: var(--serif); }
.obit-hero__meta { color: var(--muted); margin-top: .4rem; }

.info-panel { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1.5rem; }
.info-panel h3 { font-size: 1.15rem; margin-bottom: .8rem; }
.info-row { display: flex; gap: .8rem; padding: .4rem 0; align-items: flex-start; }
.info-row svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: .2rem; }
.info-row span { color: var(--ink-soft); }

/* Condoglianze */
.condolence { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem 1.6rem; margin-bottom: 1rem; }
.condolence__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.condolence__name { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); font-weight: 600; }
.condolence__date { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.condolence__msg { margin: 0; color: var(--ink-soft); }
.condolence__msg::before { content: "“"; font-family: var(--serif); font-size: 1.6rem; color: var(--accent); margin-right: .15rem; line-height: 0; }

/* Form ------------------------------------------------------------------- */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; color: var(--ink); margin-bottom: .4rem; }
.field .req { color: var(--danger); }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.input, .textarea, select.input {
    width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .8rem .9rem; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus, .textarea:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,106,79,.15); outline: none; }
.textarea { min-height: 130px; resize: vertical; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .86rem; margin-top: .35rem; }

.radio-group { display: grid; gap: .6rem; }
.radio-card { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; cursor: pointer; transition: border-color .2s, background .2s; }
.radio-card:hover { border-color: var(--accent); }
.radio-card input { margin-top: .25rem; accent-color: var(--accent); }
.radio-card strong { display: block; color: var(--ink); }
.radio-card small { color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }

.checkbox { display: flex; gap: .6rem; align-items: flex-start; }
.checkbox input { margin-top: .3rem; accent-color: var(--accent); }
.checkbox label { font-weight: 400; color: var(--ink-soft); }

/* honeypot */
.hp { position: absolute; left: -9999px; }

/* Alert / flash ---------------------------------------------------------- */
.alert { border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.4rem; border: 1px solid; display: flex; gap: .7rem; align-items: flex-start; }
.alert svg { width: 22px; height: 22px; flex: none; margin-top: .1rem; }
.alert--success { background: #eef5ef; border-color: #cfe3d4; color: #2c5239; }
.alert--error { background: #f8edec; border-color: #eccfcc; color: #7e2f2a; }
.alert--info { background: #eef2f6; border-color: #d3dde6; color: #355169; }

/* Stato / chip */
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.chip--pending { background: #fbf3e2; color: #8a6d2a; }
.chip--confirmed { background: #e9eff6; color: #355487; }
.chip--approved { background: #e8f3ec; color: #2f6b46; }
.chip--rejected { background: #f6e9e8; color: #8a3a34; }
.chip--private { background: var(--ivory-2); color: var(--muted); }

/* Contatti / dove siamo */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,3.5rem); align-items: start; }
@media (max-width: 850px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line-soft); }
.contact-list svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.contact-list a { text-decoration: none; }
.map-frame { border: 0; width: 100%; min-height: 340px; height: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.map-wrap { aspect-ratio: 16/10; }

/* CTA reperibilità */
.cta24 { background: var(--dark); color: #dde6dd; border-radius: var(--radius-lg); padding: clamp(2rem,5vw,3.2rem); text-align: center; }
.cta24 h2 { color: #fff; }
.cta24 .phone-big { font-family: var(--serif); font-size: clamp(1.8rem,4vw,2.6rem); color: #fff; text-decoration: none; display: inline-block; margin-top: .5rem; }
.cta24 .phone-big:hover { color: #a8d4b6; }

/* Pagination ------------------------------------------------------------- */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 .6rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink-soft); background: var(--surface); }
.pagination a:hover { border-color: var(--accent); color: var(--ink); }
.pagination [aria-current="page"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Breadcrumb */
.breadcrumb { font-size: .88rem; color: var(--muted); padding: 1rem 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.breadcrumb li::after { content: "/"; margin-left: .4rem; color: var(--line); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-dark); }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--dark); color: #a9b3a9; padding-block: clamp(2.8rem,6vw,4rem) 1.5rem; font-size: .95rem; }
.site-footer a { color: #d5ded5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; } }
.site-footer .brand__tag, .admin-sidebar .brand__tag { color: #7fae8c; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55rem; }
.footer-bottom { border-top: 1px solid #27382c; padding-top: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: #8c968c; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 1rem; }
.divider-icon { display: flex; align-items: center; gap: 1rem; color: var(--accent); justify-content: center; margin: 0 auto 1.4rem; max-width: 200px; }
.divider-icon::before, .divider-icon::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.divider-icon svg { width: 26px; height: 26px; }

.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; color: var(--line); margin-bottom: 1rem; }

/* =========================================================================
   AREA RISERVATA (admin)
   ========================================================================= */
body.admin { background: #f1eee8; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--dark); color: #c2ccc2; padding: 1.4rem 1rem; display: flex; flex-direction: column; }
.admin-sidebar .brand--logo { margin-bottom: 2rem; }
.admin-nav { list-style: none; padding: 0; margin: 0; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border-radius: var(--radius); color: #cdd6cd; text-decoration: none; font-size: .96rem; margin-bottom: .2rem; }
.admin-nav a:hover { background: #1f3026; color: #fff; }
.admin-nav a.active { background: var(--accent); color: #fff; }
.admin-nav svg { width: 20px; height: 20px; }
.admin-nav .badge { margin-left: auto; background: #c0392b; color: #fff; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.admin-sidebar form { margin-top: auto; }
.admin-logout { display: flex; align-items: center; gap: .7rem; width: 100%; background: transparent; border: 1px solid #2c4334; color: #cdd6cd; padding: .7rem .9rem; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .95rem; }
.admin-logout:hover { background: #1f3026; color: #fff; }
.admin-main { padding: clamp(1.4rem, 3vw, 2.4rem); min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 1.8rem; margin: 0; }
.admin-view-site { font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.3rem 1.5rem; }
.stat__num { font-family: var(--serif); font-size: 2.4rem; color: var(--ink); line-height: 1; }
.stat__label { color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.stat--alert { border-left: 4px solid #c0392b; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.6rem; }
.panel__head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.panel__head h2 { margin: 0; font-size: 1.25rem; }
.panel__body { padding: 1.4rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .actions { display: flex; gap: .4rem; justify-content: flex-end; }
.admin-table img.thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.table-scroll { overflow-x: auto; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--ink-soft); text-decoration: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--ink); }
.icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }
.inline-form { display: inline; }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.tabs a { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink-soft); font-size: .92rem; }
.tabs a.active { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.tabs a .count { opacity: .7; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(160deg, #142019, #28452f); }
.login-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.8rem, 4vw, 2.6rem); width: 100%; max-width: 420px; }
.login-card .brand { justify-content: center; margin-bottom: 1.5rem; }
.password-wrap { position: relative; }
.password-wrap .toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--muted); padding: .4rem; }
.password-wrap .toggle svg { width: 20px; height: 20px; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4rem; }
.grid-form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid-form { grid-template-columns: 1fr; } .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; } .admin-nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; order: 3; } .admin-sidebar form { margin: 0; } }
.photo-preview { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); margin-bottom: .6rem; }

/* Immagini sacre: picker nel form necrologio */
.sacred-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .8rem; }
.sacred-picker__item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem;
    border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .5rem .6rem;
    cursor: pointer; text-align: center; transition: border-color .2s, background .2s;
}
.sacred-picker__item:hover { border-color: var(--accent); }
.sacred-picker__item input { position: absolute; opacity: 0; pointer-events: none; }
.sacred-picker__item:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.sacred-picker__item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sacred-picker__thumb {
    width: 64px; height: 84px; display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: 2px;
    overflow: hidden; color: var(--muted);
}
.sacred-picker__thumb img { width: 100%; height: 100%; object-fit: contain; }
.sacred-picker__thumb svg { width: 22px; height: 22px; }
.sacred-picker__label { font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }

/* Immagini sacre: pagina libreria */
.sacred-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.sacred-lib__item { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.sacred-lib__item img { width: 90px; height: 120px; object-fit: contain; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 2px; margin-bottom: .6rem; }
.sacred-lib__label { font-weight: 600; font-size: .92rem; margin: 0; color: var(--ink); }
.sacred-lib__usage { font-size: .8rem; color: var(--muted); margin: .15rem 0 .7rem; }
.sacred-lib__badge { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-dark); background: var(--accent-tint); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; }
