/*
 * AG Modern Pages - stile condiviso (nessun framework).
 * Token presi dal tema Rokka: testo #23201f, sfondo alt #f2f2f2, titoli Cormorant Garamond italic, corpo Montserrat.
 */
:root {
  --ag-text: #23201f;
  --ag-muted: #5b5754;
  --ag-tint: #f2f2f2;
  --ag-gold: #8a6a1c;       /* oro scurito: contrasto 4.9:1 su bianco (il vecchio #f3e0aa era 1.3:1) */
  --ag-gold-soft: #f3e0aa;  /* oro originale del tema, usato su fondi scuri */
  --ag-teal: #0083a8;
  --ag-radius: 4px;
  --ag-font-body: 'AG Montserrat', Montserrat, Arial, Helvetica, sans-serif;
  --ag-font-head: 'AG Cormorant Garamond', 'Cormorant Garamond', Georgia, serif;
}

/* Il tema avvolge il contenuto in .page-wrapper > #primary.container: su queste pagine lo rendiamo full-bleed. */
.ag-modern-page .page-wrapper #primary.container { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
.ag-modern-page .page-wrapper { padding-top: 0 !important; padding-bottom: 0 !important; }
.ag-modern-page .entry-content { margin: 0; }

.ag-modern { font-family: var(--ag-font-body); color: var(--ag-text); font-size: 1rem; line-height: 1.75; overflow-x: clip; }
.ag-modern *, .ag-modern *::before, .ag-modern *::after { box-sizing: border-box; }
.ag-modern img { max-width: 100%; height: auto; display: block; }
.ag-modern p { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.75; }

.ag-wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 1.25rem; }
.ag-narrow { max-width: 760px; text-align: center; }
.ag-section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.ag-section--tint { background: var(--ag-tint); }

/* Titoli */
.ag-modern h1, .ag-modern h2 { font-family: var(--ag-font-head); font-style: italic; font-weight: 600; line-height: 1.15; margin: 0 0 1.25rem; letter-spacing: 0; }
.ag-modern h2 { font-size: clamp(2rem, 4.2vw, 3.5rem); text-wrap: balance; }
.ag-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 1rem; color: var(--ag-muted); }
.ag-center { text-align: center; }

/* Hero */
.ag-hero { position: relative; display: grid; place-items: center; min-height: clamp(380px, 56vh, 580px); color: #fff; isolation: isolate; text-align: center; overflow: hidden; }
.ag-modern .ag-hero .ag-hero__img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; z-index: -2; }
.ag-hero::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .42); z-index: -1; }
.ag-hero__inner { padding: 7rem 1.25rem 4rem; }
.ag-modern .ag-hero h1 { color: #fff; font-size: clamp(2.75rem, 7vw, 4.5rem); margin: 0; position: relative; display: inline-block; padding: 0 .15em; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
/* Cornice doppia del vecchio decoratore "heading-decorator-4" */
.ag-title--framed::before, .ag-title--framed::after { content: ''; position: absolute; left: 50%; width: 50%; height: 4.5rem; border: 4px double rgba(255, 255, 255, .9); transform: translateX(-50%); pointer-events: none; }
.ag-title--framed::before { bottom: calc(100% + 1rem); border-bottom: 0; }
.ag-title--framed::after { top: calc(100% + 1rem); border-top: 0; }

/* Galleria: grande a sinistra, larga in alto a destra, due quadrati sotto (come l'originale) */
.ag-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(120px, 15vw, 210px); gap: 1.25rem; }
.ag-gallery li { margin: 0; overflow: hidden; border-radius: var(--ag-radius); background: var(--ag-tint); }
.ag-gallery li:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.ag-gallery li:nth-child(2) { grid-column: span 2; }
.ag-gallery a { display: block; width: 100%; height: 100%; }
.ag-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ag-gallery a:hover img, .ag-gallery a:focus-visible img { transform: scale(1.04); }
.ag-gallery a:focus-visible, .ag-btn:focus-visible { outline: 3px solid var(--ag-teal); outline-offset: 3px; }

/* Bottone */
.ag-btn { display: inline-block; margin-top: 2.5rem; padding: .8rem 1.6rem; font: 600 .8125rem/1 var(--ag-font-body); letter-spacing: .15em; text-transform: uppercase; text-decoration: none; color: var(--ag-gold); border: 2px solid var(--ag-gold); border-radius: 0; transition: background-color .2s, color .2s; }
.ag-btn:hover { background: var(--ag-gold); color: #fff; }

/* Liste servizi */
.ag-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 3rem; margin-top: 2.25rem; }
.ag-list { margin: 0; padding: 0; list-style: none; }
.ag-list li { position: relative; padding: .4rem 0 .4rem 1.6rem; border-bottom: 1px solid rgba(35, 32, 31, .1); line-height: 1.55; }
.ag-list li::before { content: ''; position: absolute; left: .1rem; top: .95rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ag-gold); }
.ag-lead { max-width: 62ch; }
.ag-section--tint .ag-wrap { text-align: center; }
.ag-section--tint .ag-lead { margin-inline: auto; }
.ag-section--tint .ag-cols { text-align: left; }

/* Rivelazione allo scroll (solo se il JS la attiva; senza JS tutto resta visibile) */
.ag-reveal.ag-pending { opacity: 0; transform: translateY(18px); }
.ag-reveal.ag-pending.ag-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
@media (prefers-reduced-motion: reduce) { .ag-reveal.ag-pending { opacity: 1; transform: none; } .ag-gallery img { transition: none; } }

@media (max-width: 900px) {
  .ag-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ag-gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 38vw; gap: .75rem; }
  .ag-gallery li:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .ag-gallery li:nth-child(2) { grid-column: span 2; }
  .ag-cols { grid-template-columns: 1fr; gap: 0; }
  .ag-title--framed::before, .ag-title--framed::after { height: 3rem; }
}
