/*
Theme Name: Studio Polo 1116
Theme URI: https://www.polo1116.it
Author: Studio Polo 1116
Description: Tema del sito di Studio Polo 1116. Progetti, categorie, tipologie, testi e immagini si gestiscono dal pannello di WordPress (Progetti, Aspetto → Personalizza, Aspetto → Menu).
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: studiopolo
*/

@font-face { font-family: "EB Garamond"; src: url("assets/fonts/eb-garamond-normal.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("assets/fonts/eb-garamond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

/* ------------------------------------------------------------
   Variabili
------------------------------------------------------------ */
:root {
	--ow: #e7e4de;                       /* off-white: testi e icone */
	--ow-60: rgba(231, 228, 222, .6);
	--ow-50: rgba(231, 228, 222, .5);
	--ow-35: rgba(231, 228, 222, .35);
	--ow-25: rgba(231, 228, 222, .25);
	--ink: #1b1c1e;                      /* testo scuro su fondo chiaro */
	--bg: #1f1d1d;                       /* grigio scuro di fondo */
	--wrap: 1238px;                      /* larghezza griglia */
	--gap: 10px;                         /* spazio tra immagini */
	--radius: 8px;
	--serif: "EB Garamond", Garamond, "Times New Roman", serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ow);
	font-family: var(--serif);
	font-size: 20px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	font-variant-numeric: oldstyle-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-weight: 400; margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* numeri in maiuscoletto */
.num { font-variant-caps: all-small-caps; font-variant-numeric: lining-nums; letter-spacing: .06em; }

.wrap { width: min(var(--wrap), calc(100% - 64px)); margin: 0 auto; }

/* ------------------------------------------------------------
   Sfondo foto sfocata
------------------------------------------------------------ */
.sp-bg {
	position: fixed; inset: -40px; z-index: -2;
	background-size: cover; background-position: center;
	filter: blur(26px);
	transform: scale(1.05);
}
.sp-bg::after {
	content: ""; position: absolute; inset: 0;
	background: rgba(31, 29, 29, .55);
}
body:not(.has-bg) .sp-bg { display: none; }

/* ------------------------------------------------------------
   Header fisso
------------------------------------------------------------ */
.sp-header {
	position: sticky; top: 0; z-index: 50;
	padding-top: 40px;
}
.sp-header::before {
	content: ""; position: absolute; inset: 0 0 -60px 0; z-index: -1;
	background: linear-gradient(rgba(0, 0, 0, .27), rgba(0, 0, 0, 0));
	-webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
	-webkit-mask-image: linear-gradient(#000 60%, transparent);
	mask-image: linear-gradient(#000 60%, transparent);
}
.sp-header__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }

/* logotipo testuale */
.sp-logo { display: inline-block; line-height: 1; color: var(--ow); }
.sp-logo__name { display: block; font-size: 64px; letter-spacing: -.01em; font-variant-numeric: oldstyle-nums; }
.sp-logo__names { display: flex; justify-content: space-between; font-size: 15px; margin-top: -6px; padding-right: 30%; }
.sp-logo img { width: 300px; height: auto; }
.sp-footer .sp-logo img { width: 210px; }

.sp-nav { display: flex; align-items: center; gap: 24px; padding-top: 12px; }
.sp-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }

/* ------------------------------------------------------------
   Pillole (menu, filtri)
------------------------------------------------------------ */
.sp-pill {
	position: relative; display: inline-block;
	padding: 6px 18px 8px;
	font-size: 20px; line-height: 26px;
	color: var(--ow-50);
	transition: color .28s var(--ease);
}
.sp-pill::before {
	content: ""; position: absolute; inset: 0;
	border: 1px solid transparent; border-radius: 999px;
	transform: scale(.98);
	transition: border-color .28s var(--ease), transform .28s var(--ease);
}
.sp-pill span { display: inline-block; transition: transform .28s var(--ease); }
.sp-pill:hover, .sp-pill:focus-visible, .sp-pill.is-active { color: var(--ow); }
.sp-pill:hover::before, .sp-pill:focus-visible::before, .sp-pill.is-active::before { border-color: var(--ow-60); transform: scale(1.02); }
.sp-pill:hover span, .sp-pill.is-active span { transform: scale(1.05); }
.sp-pill--small { font-size: 19px; }

.sp-lang { display: flex; align-items: center; gap: 8px; font-size: 20px; color: var(--ow-50); list-style: none; margin: 0; padding: 0; }
.sp-lang li { display: flex; align-items: center; gap: 8px; }
.sp-lang li + li::before { content: "/"; color: var(--ow-25); }
.sp-lang .current-lang a, .sp-lang a:hover { color: var(--ow); }
.sp-lang img { width: 16px; height: auto; }

.sp-filters { display: flex; justify-content: space-between; align-items: center; margin-top: 34px; padding-bottom: 41px; }
.sp-project > .sp-filters { margin-top: 64px; padding-bottom: 28px; }
.sp-filters__group { display: flex; gap: 12px; }

/* ------------------------------------------------------------
   Pulsanti tondi
------------------------------------------------------------ */
.sp-round {
	width: 56px; height: 56px; flex: none;
	display: inline-grid; place-items: center;
	border-radius: 50%; border: 1px solid rgba(231, 228, 222, .7);
	color: var(--ow);
	transition: background-color .28s var(--ease), color .28s var(--ease), transform .28s var(--ease), border-color .28s var(--ease);
}
.sp-round svg { width: 24px; height: 24px; transition: transform .28s var(--ease); }
.sp-round:hover, .sp-round:focus-visible { background: var(--ow); border-color: var(--ow); color: var(--ink); transform: scale(1.1); }

/* Torna su */
.sp-top {
	position: fixed; right: max(32px, calc((100vw - var(--wrap)) / 2)); bottom: 40px; z-index: 60;
	background: rgba(0, 0, 0, .65);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
	opacity: 0; pointer-events: none;
	transition: opacity .3s var(--ease), background-color .28s var(--ease), color .28s var(--ease), transform .28s var(--ease);
}
.sp-top.is-visible { opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------
   Home
------------------------------------------------------------ */
.sp-home { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; background-size: cover; background-position: center; }
.sp-home::before {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(90deg, rgba(0,0,0,.3), rgba(0,0,0,.12) 27%, rgba(0,0,0,0) 50%),
		linear-gradient(rgba(0,0,0,.27), rgba(0,0,0,0) 31%);
}
.sp-home__menu { position: absolute; top: 93px; right: max(32px, 8.26%); display: flex; gap: 12px; }
.sp-home__menu .sp-pill { font-size: 24px; line-height: 31px; color: rgba(231, 228, 222, .7); }
.sp-home__menu .sp-pill:hover { color: var(--ow); }
.sp-home__line { position: absolute; left: 11%; right: 7%; top: 63.7%; height: 2px; background: var(--ow); }
.sp-home__logo {
	position: absolute; left: 9.72%; top: 61.9%;
	transform: rotate(-90deg); transform-origin: left top;
	white-space: nowrap; color: var(--ow);
}
.sp-home__logo .sp-logo__name { font-size: 118px; }
.sp-home__logo .sp-logo__names { font-size: 22px; }
.sp-home__logo img { width: min(464px, 51.5vh); }
.sp-home__address { position: absolute; left: 11%; bottom: 40px; margin: 0; font-size: 14px; letter-spacing: .02em; }

/* ------------------------------------------------------------
   Galleria (miniature)
------------------------------------------------------------ */
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.sp-card { position: relative; display: block; aspect-ratio: 302 / 227; border-radius: var(--radius); overflow: hidden; background: rgba(231, 228, 222, .08); }
.sp-card img, .sp-card__ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.sp-card__ph { display: grid; place-items: center; text-align: center; padding: 16px; font-size: 16px; color: var(--ow-60); }
.sp-card__veil { position: absolute; inset: 0; background: linear-gradient(rgba(20,21,24,.1), rgba(20,21,24,.3) 30%, rgba(20,21,24,.72) 55%, rgba(20,21,24,.92)); opacity: 0; transition: opacity .3s var(--ease); }
.sp-card__cap { position: absolute; left: 18px; right: 18px; bottom: 8px; opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.sp-card__year { display: block; font-size: 16px; color: rgba(231, 228, 222, .8); }
.sp-card__title { display: block; font-size: 21px; line-height: 1.2; }
.sp-card:hover img, .sp-card:focus-visible img { transform: scale(1.06); }
.sp-card:hover .sp-card__veil, .sp-card:hover .sp-card__cap,
.sp-card:focus-visible .sp-card__veil, .sp-card:focus-visible .sp-card__cap { opacity: 1; transform: none; }

/* Registro */
.sp-index { list-style: none; margin: 0; padding: 0; }
.sp-index li { position: relative; }
.sp-index__row { display: grid; grid-template-columns: 90px minmax(0, 700px) minmax(0, 1fr); gap: 16px; padding: 16px 0 15px; border-top: 1px solid var(--ow-25); transition: background-color .2s; }
.sp-index__row:hover, .sp-index__row:focus-visible { background: rgba(255, 255, 255, .14); }
.sp-index__preview { position: absolute; left: 846px; top: 1px; width: 280px; height: 210px; z-index: 5; border-radius: var(--radius); overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.sp-index__preview img { width: 100%; height: 100%; object-fit: cover; }
.sp-index__row:hover .sp-index__preview { opacity: 1; }
.sp-index__row:hover .sp-index__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.sp-index__year { font-size: 17px; line-height: 24px; color: var(--ow-60); padding-top: 4px; }
.sp-index__title { display: block; font-size: 23px; line-height: 30px; }
.sp-index__client { display: block; font-size: 16px; line-height: 22px; color: var(--ow-60); margin-top: 6px; }
.sp-index__types { font-size: 16px; line-height: 22px; color: rgba(231, 228, 222, .7); letter-spacing: .05em; align-self: center; }

/* ------------------------------------------------------------
   Scheda progetto
------------------------------------------------------------ */
.sp-project__head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 440px; column-gap: 40px; margin-top: 13px; }
.sp-project__title { grid-column: 1 / -1; font-size: 54px; line-height: 1.08; max-width: 1000px; padding-right: 240px; }
.sp-project__buttons { position: absolute; right: 0; top: 7px; display: flex; gap: 16px; }
.sp-project__desc { grid-column: 1; max-width: 720px; margin-top: 24px; font-size: 20px; line-height: 1.45; }
.sp-project__desc p:last-child { margin-bottom: 0; }
.sp-project__client { grid-column: 2; align-self: end; margin: 0 0 2px; text-align: right; font-size: 18px; line-height: 1.35; white-space: pre-line; }
.sp-project__meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 37px 0 46px; }
.sp-project__credits { text-align: right; font-size: 18px; line-height: 1.35; color: var(--ow-60); white-space: pre-line; }

.sp-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.sp-tag { display: inline-block; padding: 7px 18px 9px; border: 1px solid var(--ow-35); border-radius: 999px; font-size: 17px; line-height: 1.2; }
a.sp-tag:hover { border-color: var(--ow-60); }

/* immagini: griglia a 2 colonne */
.sp-plates { display: flex; flex-direction: column; gap: var(--gap); }
.sp-plates__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.sp-plates__row--full { grid-template-columns: 1fr; }
.sp-plates__stack { display: flex; flex-direction: column; gap: var(--gap); }
.sp-plates__stack .sp-plate { flex: 1 1 0; aspect-ratio: auto; min-height: 0; }
.sp-plate { position: relative; overflow: hidden; border-radius: var(--radius); background: rgba(231, 228, 222, .08); margin: 0; }
.sp-plate img { width: 100%; height: 100%; object-fit: cover; }
.sp-plate--empty { display: grid; place-items: center; color: var(--ow-60); font-size: 16px; padding: 20px; text-align: center; min-height: 240px; }

/* progetto simile */
.sp-similar { display: block; margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--ow-25); }
.sp-similar__label { font-size: 19px; color: var(--ow-60); margin-bottom: 20px; }
.sp-similar__row { display: flex; gap: 26px; align-items: stretch; }
.sp-similar__thumb { flex: none; width: 198px; aspect-ratio: 302 / 227; border-radius: var(--radius); overflow: hidden; background: rgba(231, 228, 222, .08); }
.sp-similar__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-similar__text { max-width: 640px; }
.sp-similar__title { display: block; font-size: 32px; line-height: 1.2; margin: -6px 0 18px; text-decoration: underline transparent; text-decoration-thickness: 1px; text-underline-offset: 5px; transition: text-decoration-color .2s var(--ease); }
.sp-similar:hover .sp-similar__title { text-decoration-color: currentColor; }
.sp-similar__desc { font-size: 18px; line-height: 1.45; color: var(--ow-60); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------
   Contatti e pagine
------------------------------------------------------------ */
.sp-page { padding-top: 114px; }
.single-progetto .sp-footer { margin-top: 96px; }
.sp-intro { max-width: 923px; font-size: 32px; line-height: 1.25; }
.sp-intro p { margin: 0 0 .6em; }
.sp-intro p:last-child { margin-bottom: 0; }
.sp-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 98px; }
.sp-label { display: block; font-size: 17px; color: rgba(231, 228, 222, .65); font-variant-caps: all-small-caps; letter-spacing: .06em; margin-bottom: 10px; }
.sp-cols__item { font-size: 19px; line-height: 1.48; }
.sp-cols__bio { font-size: 18px; line-height: 1.35; color: rgba(231, 228, 222, .85); margin-top: 10px; }
.sp-clients { margin-top: 63px; }
.sp-clients .sp-label { margin-bottom: 14px; }
.sp-clients ul { list-style: none; margin: 0; padding: 0; columns: 4; column-gap: 22px; }
.sp-clients li { font-size: 18px; line-height: 1.35; color: rgba(231, 228, 222, .85); margin-bottom: 7px; break-inside: avoid; }
.sp-content { max-width: 720px; font-size: 20px; }
.sp-content h1 { font-size: 54px; line-height: 1.08; margin-bottom: 30px; }
.sp-content a { text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------
   Footer
------------------------------------------------------------ */
.sp-footer { margin-top: 120px; padding: 28px 0 110px; border-top: 1px solid var(--ow-25); display: grid; grid-template-columns: auto auto auto auto 1fr; gap: 40px; font-size: 18px; line-height: 1.45; }
.sp-footer .sp-logo__name { font-size: 40px; }
.sp-footer .sp-logo__names { font-size: 10px; margin-top: -3px; }
.sp-footer > div { color: rgba(231, 228, 222, .85); }
.sp-footer > .sp-footer__legal { text-align: right; color: var(--ow-60); }
.sp-footer__legal a + a { margin-left: 18px; }
.sp-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------
   Schermi piccoli
------------------------------------------------------------ */
@media (max-width: 1100px) {
	.sp-grid { grid-template-columns: repeat(3, 1fr); }
	.sp-project__head { grid-template-columns: 1fr; }
	.sp-project__title { padding-right: 0; padding-top: 72px; font-size: 44px; }
	.sp-project__client { grid-column: 1; text-align: left; margin-top: 24px; }
	.sp-cols { grid-template-columns: repeat(2, 1fr); }
	.sp-clients ul { columns: 2; }
	.sp-footer { grid-template-columns: 1fr 1fr; }
	.sp-footer__legal { text-align: left; }
}
@media (max-width: 700px) {
	body { font-size: 18px; }
	.wrap { width: calc(100% - 32px); }
	.sp-header { padding-top: 20px; }
	.sp-header__row { flex-direction: column; }
	.sp-logo img { width: 240px; }
	.sp-nav { flex-wrap: wrap; gap: 8px; padding-top: 0; }
	.sp-filters { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 24px; }
	.sp-pill { font-size: 18px; padding: 5px 14px 7px; }
	.sp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.sp-card__cap { opacity: 1; transform: none; }
	.sp-card__veil { opacity: 1; }
	.sp-card__title { font-size: 17px; }
	.sp-index__row { grid-template-columns: 1fr; gap: 4px; }
	.sp-index__preview { display: none; }
	.sp-project__title { font-size: 34px; }
	.sp-project__meta { flex-direction: column; align-items: flex-start; }
	.sp-project__credits { text-align: left; }
	.sp-plates__row { grid-template-columns: 1fr; }
	.sp-plates__stack .sp-plate { flex: none; aspect-ratio: var(--ar); }
	.sp-similar__row { flex-direction: column; }
	.sp-similar__thumb { width: 100%; }
	.sp-intro { font-size: 24px; }
	.sp-cols { grid-template-columns: 1fr; }
	.sp-clients ul { columns: 1; }
	.sp-footer { grid-template-columns: 1fr; gap: 20px; }
	.sp-home__logo .sp-logo__name { font-size: 64px; }
	.sp-home__menu { top: 24px; right: 16px; }
	.sp-home__line { left: 16px; right: 16px; }
	.sp-home__logo { left: 16px; }
	.sp-home__address { left: 16px; }
	.sp-top { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Barra di amministrazione di WordPress (solo da loggati) */
.admin-bar .sp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .sp-header { top: 0; } }
