/*
Theme Name: Battaglia
Description: Tema su misura per il sito del pittore Biagio Battaglia: carosello delle opere, griglia per anno, lightbox.
Version: 1.2.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: battaglia
*/

@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url(assets/fonts/cormorant-garamond-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url(assets/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url(assets/fonts/cormorant-garamond-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(assets/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(assets/fonts/inter-latin-500-normal.woff2) format("woff2"); }

:root {
	--bg: #faf8f4;
	--surface: #f1ede6;
	--ink: #1d1b18;
	--muted: #6e685f;
	--line: #e2dcd2;
	--accent: #9c3d26;
	--serif: "Cormorant Garamond", Georgia, serif;
	--sans: "Inter", system-ui, sans-serif;
	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--frame: clamp(4px, .5vw, 8px); /* bordo bianco intorno alle immagini */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font: 500 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { text-decoration: none; font: 500 26px/1 var(--serif); letter-spacing: .01em; }
.brand small { display: block; font: 400 11px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.nav a { text-decoration: none; font-size: 14px; letter-spacing: .04em; }
.nav .current-menu-item > a, .nav .current_page_item > a, .nav .current-page-ancestor > a { color: var(--accent); }
.nav ul ul { display: none; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
	.nav.is-open { display: block; }
	.nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
	.nav a { display: block; padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
}

/* Hero + carosello */
.hero { padding: clamp(32px, 5vw, 64px) 0 clamp(24px, 3vw, 36px); }
.hero h1 { font-size: clamp(44px, 7.5vw, 96px); margin: 0; }
.hero h1 + p { font: italic 400 clamp(20px, 2.4vw, 28px)/1.3 var(--serif); color: var(--muted); margin: 12px 0 0; }
.hero .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 22px; border: 1px solid var(--ink); text-decoration: none; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; transition: background .2s, color .2s; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line); }

.strip { position: relative; overflow: hidden; }
.strip .swiper { background: #fff; padding: var(--frame) 0; }
.strip .swiper-slide { width: auto; }
.strip figure { margin: 0; position: relative; overflow: hidden; }
.strip img { height: clamp(320px, 68vh, 760px); width: auto; max-width: 92vw; object-fit: cover; }
.strip figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 22px 16px; background: linear-gradient(to top, rgba(18,14,10,.7), rgba(18,14,10,0)); color: #fff; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.strip figcaption b { font: 500 22px/1.2 var(--serif); }
.strip .swiper-slide:hover figcaption, .strip .swiper-slide-active figcaption { opacity: 1; }
@media (max-width: 600px) {
	.strip .swiper-slide { width: 86vw; }
	.strip img { width: 100%; height: 62vh; max-width: none; }
}
.strip-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.strip-controls { color: var(--muted); }
.strip-controls .count { font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.strip-controls button { width: 44px; height: 44px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 18px; color: var(--ink); }
.strip-controls button:hover { border-color: var(--ink); }

/* Sezioni */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-flush { padding-bottom: 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(34px, 4.5vw, 54px); margin: 0; }

/* Mosaico giustificato a tutta larghezza (stile Oshine: niente spazi, comparsa allo scorrimento).
   Ogni tessera cresce in proporzione al formato del quadro, cosi' ogni riga riempie la pagina. */
.mosaic { --row: clamp(220px, 30vw, 460px); display: flex; flex-wrap: wrap; gap: var(--frame); padding: var(--frame); background: #fff; }
.mosaic-years { --row: clamp(200px, 24vw, 380px); }
.tile { position: relative; flex: var(--ar) 1 calc(var(--ar) * var(--row) * .8); height: var(--row); overflow: hidden; display: block; color: #fff; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .5s; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,14,10,.78), rgba(18,14,10,.15) 45%, rgba(18,14,10,0) 70%); opacity: 0; transition: opacity .45s; }
.tile-info { position: absolute; left: 22px; right: 22px; bottom: 18px; z-index: 1; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; }
.tile-info b { display: block; font: 500 clamp(22px, 2.2vw, 30px)/1.1 var(--serif); }
.tile-info span { font-size: 12.5px; letter-spacing: .06em; opacity: .85; }
.tile:hover, .tile:focus-visible { color: #fff; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile:hover::after, .tile:hover .tile-info, .tile:focus-visible::after, .tile:focus-visible .tile-info { opacity: 1; transform: none; }
/* Le raccolte (anni) mostrano sempre l'etichetta */
.mosaic-years .tile::after, .mosaic-years .tile-info { opacity: 1; transform: none; }
.mosaic-years .tile-info b { font-size: clamp(34px, 3.6vw, 52px); }
.mosaic-years .tile-info span { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
@media (hover: none) { .tile::after, .tile-info { opacity: 1; transform: none; } }
@media (max-width: 600px) {
	.mosaic { --row: 46vw; }
	.mosaic-years { --row: 52vw; }
	.tile-info { left: 12px; right: 12px; bottom: 10px; }
	.tile-info span { display: none; }
	.mosaic-years .tile-info span { display: block; }
}
[data-glightbox] { cursor: zoom-in; }

/* Comparsa allo scorrimento (solo se il JS e' attivo e il movimento non e' ridotto) */
.has-reveal .reveal { opacity: 0; transform: translateY(70px); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.has-reveal .reveal.is-in { opacity: 1; transform: none; }

.year-nav { position: sticky; top: 72px; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.year-nav ul { list-style: none; margin: 0 auto; padding: 12px var(--gutter); max-width: var(--wrap); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.year-nav a { display: block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.year-nav a:hover { border-color: var(--ink); color: var(--ink); }
.year-block { scroll-margin-top: 140px; padding-top: clamp(40px, 6vw, 72px); }

.year-block h2 a { text-decoration: none; }
.year-block h2 { font-size: clamp(40px, 5vw, 64px); display: flex; align-items: baseline; gap: 16px; }
.year-block h2 small { font: 400 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Intestazione pagine */
.page-head { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(44px, 7vw, 88px); margin: 0; }
.page-head p { color: var(--muted); margin: 10px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }

/* Scheda opera */
.artwork { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr) 56px; gap: clamp(28px, 4vw, 56px); align-items: start; padding: clamp(32px, 5vw, 64px) 0; }
.artwork > .side, .artwork-stage { align-self: stretch; }
/* Palco dell'opera: tasto precedente | immagine | tasto successivo (alti quanto l'opera) */
.artwork-stage { display: flex; align-items: stretch; gap: clamp(16px, 2vw, 28px); touch-action: pan-y; }
.artwork-image { flex: 1; min-width: 0; display: flex; align-items: flex-start; justify-content: center; transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s; }
.artwork-image a { display: block; background: var(--surface); cursor: zoom-in; }
.artwork-image img { max-height: 82vh; width: auto; margin: 0 auto; }
.side { flex: 0 0 56px; display: flex; align-items: center; justify-content: center; background: #ebe6de; color: var(--ink); transition: background .25s; }
.side svg { width: 22px; height: 22px; fill: currentColor; transition: transform .25s; }
.side:hover, .side:focus-visible { background: #d3cbbf; }
.side-prev:hover svg { transform: translateX(-3px); }
.side-next:hover svg { transform: translateX(3px); }
.side.is-disabled { background: #f2efe9; color: #d9d2c7; }
.position { float: right; letter-spacing: .08em; }
.swipe-hint { display: none; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
	.side { display: none; }
	.swipe-hint { display: block; }
}
.artwork-info { position: sticky; top: 104px; }
.artwork-info h1 { font-size: clamp(38px, 4.5vw, 60px); }
.artwork-info .details { color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin: 18px 0 24px; }
.artwork-info .body { font-size: 16.5px; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 24px 0 56px; font-size: 14px; }
.pager a { text-decoration: none; }
.pager span { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pager b { font: 500 22px/1.2 var(--serif); }
.pager .next { text-align: right; margin-left: auto; }
@media (max-width: 860px) {
	.artwork { grid-template-columns: 1fr; }
	.artwork-info { position: static; }
}

/* Testo (La vita, Mostre, Bibliografia, ...) */
.prose { max-width: 720px; font-size: 17px; padding-bottom: clamp(56px, 8vw, 104px); }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-size: 34px; margin-top: 1.4em; }
.prose figure { margin: 2em 0; }
.prose img { margin: 0 auto; }

/* Home: artista */
.artist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: center; }
.artist img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.artist blockquote { margin: 0 0 24px; font: italic 400 clamp(22px, 2.4vw, 30px)/1.35 var(--serif); }
.artist ul { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.artist li a { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font: 500 22px var(--serif); }
@media (max-width: 760px) { .artist { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--ink); color: #cfc8bc; padding: 56px 0 40px; font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer .brand { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .copy { flex-basis: 100%; color: #8f887d; font-size: 12.5px; border-top: 1px solid #3a362f; padding-top: 20px; margin-top: 12px; }

/* Lightbox */
.glightbox-clean .gslide-description { background: var(--bg); }
.glightbox-clean .gslide-title { font: 500 24px/1.2 var(--serif); margin-bottom: 4px; }
.glightbox-clean .gslide-desc { font: 400 14px/1.5 var(--sans); color: var(--muted); }
.glightbox-clean .gslide-desc a { color: var(--accent); }
