/*
 * Lelioswing — Stile statico
 * Replica fedele del tema simplekey originale, con tecniche moderne.
 * Palette: bianco/grigio + accent arancione #f26c4f
 * Tipografia: Oswald (heading) + Arial/system (body)
 */

/* ---------- Font self-hosted (nessuna dipendenza esterna) ---------- */
@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/oswald-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f5f1;
  --text: #444444;
  --text-soft: #666666;
  --text-strong: #232527;
  --accent: #f26c4f;
  --accent-hover: #232527;
  --selection-bg: #83b350;
  --selection-fg: #ffffff;
  --muted: #dddddd;
  --rule: #e6e2db;

  --font-display: "Oswald", "Helvetica Neue", Arial, sans-serif;
  --font-body: Arial, Helvetica, "Liberation Sans", sans-serif;

  --container: 1080px;
  --gap: 2rem;
  --radius: 4px;
}

/* ---------- Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; }
img, picture { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: var(--accent-hover); }
::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* ---------- Base type ---------- */
body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-strong);
  margin: 0 0 .6em;
  line-height: 1.15;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 300; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); font-weight: 400; }
h3 { font-size: 1.4rem; font-weight: 400; }
h4 { font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1.2em; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.8em 0;
  padding: .2em 0 .2em 1.4em;
  color: var(--text-strong);
  font-style: italic;
  font-size: 1.05em;
}
blockquote cite { display: block; margin-top: .6em; font-style: normal; font-size: .85em; color: var(--text-soft); }
blockquote cite::before { content: "— "; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }

/* ---------- Layout containers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.2rem; }
.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--rule); }

/* ---------- Header ---------- */
.site-header {
  background: rgba(29,29,29,.96);
  border-bottom: 1px solid #2f2f2f;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  max-width: var(--container);
  margin: 0 auto;
  gap: 1.5rem;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  text-transform: uppercase;
}
.brand:hover { color: var(--accent); }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .12em;
  color: #a8a39a;
  text-transform: uppercase;
  margin-top: .15em;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: .95rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.nav a {
  display: inline-block;
  padding: .6rem .9rem;
  color: #e9e6e1;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #4a4a4a;
  color: #fff;
  border-radius: var(--radius);
  padding: .45rem .7rem;
  font-family: var(--font-display);
  font-size: .85rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-alt);
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.hero .inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.hero h1 { margin: 0 0 .2em; }
.hero .lead {
  font-size: 1.2rem;
  color: var(--text-soft);
  margin: 0 0 2.2rem;
}
.hero-figure {
  margin: 0 0 2.2rem;
  width: 100%;
  max-width: 880px;
}
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 26px 60px -24px rgba(0,0,0,.35);
}
.hero-text {
  max-width: 62ch;
  margin: 0 auto 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  justify-content: center;
  margin: 0;
}

/* ---------- Cards grid ---------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -15px rgba(0,0,0,.15); }
.card .body { padding: 1.2rem 1.3rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 .4em; font-size: 1.15rem; }
.card p { color: var(--text-soft); font-size: .95rem; margin-bottom: 1em; }
.card .more { margin-top: auto; font-family: var(--font-display); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Content (prose) ---------- */
.prose { max-width: 750px; margin: 0 auto; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose img { margin: 1.2em auto; border-radius: var(--radius); }
.prose figure { margin: 1.6em 0; text-align: center; }
.prose figcaption { font-size: .85em; color: var(--text-soft); margin-top: .5em; font-style: italic; }
.prose a { border-bottom: 1px dotted currentColor; }
.prose a:hover { border-bottom-style: solid; }

.prose figure.align-left { float: left; margin: .3em 1.5em 1em 0; max-width: 260px; }
.prose figure.align-right { float: right; margin: .3em 0 1em 1.5em; max-width: 260px; }
.prose figure.align-center { margin-left: auto; margin-right: auto; }
.prose::after { content: ""; display: table; clear: both; }

/* ---------- Post list (news/rassegna) ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list time {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .07em;
  display: block;
  margin-bottom: .3em;
}
.post-list a { color: var(--text-strong); font-weight: 700; }
.post-list a:hover { color: var(--accent); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gallery a {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.gallery a:hover img { transform: scale(1.05); }

/* ---------- Page title block ---------- */
.page-title {
  background: var(--bg-alt);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.page-title h1 { margin-bottom: 0; }
.page-title .breadcrumbs {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .8em;
}
.page-title .breadcrumbs a { color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: #1d1d1d;
  color: #c9c5be;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  font-size: .95rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }
.site-footer .inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.site-footer h4 {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1em;
  font-size: 1rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin: .35em 0; }
.site-footer .colophon {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: .8rem;
  color: #888;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .7em 1.4em;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 0;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn.outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn.outline:hover { background: var(--accent); color: #fff; }

/* ---------- Quote shortcode replacement ---------- */
.quote {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  padding: 1.5em 1.8em;
  margin: 2em 0;
  font-size: 1.1em;
  font-style: italic;
  color: var(--text-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote .author { display: block; margin-top: .8em; font-size: .85em; font-style: normal; color: var(--text-soft); }
.quote .author::before { content: "— "; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .site-footer .inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #1d1d1d;
    flex-direction: column;
    padding: .5rem 0;
    border-bottom: 1px solid #2f2f2f;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .8rem 1.2rem; width: 100%; }
  .prose figure.align-left,
  .prose figure.align-right { float: none; max-width: 100%; margin: 1.2em auto; }
}

/* ---------- Gallery ---------- */
.gallery-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1.15rem;
  color: var(--text-strong);
  margin: 0 0 1.2rem;
}
.gallery-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery-grid li { margin: 0; }
.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
  filter: saturate(.96);
}
.gallery-grid a:hover img,
.gallery-grid a:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1.05);
}
.gallery-grid a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- PDF incorporato (ex shortcode [gview]) ---------- */
.pdf-embed { margin: 2em 0; }
.pdf-embed object {
  display: block;
  width: 100%;
  height: min(78vh, 720px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.pdf-embed figcaption {
  margin-top: .7em;
  text-align: center;
  font-size: .92rem;
  font-style: normal;
}
.pdf-embed figcaption a {
  display: inline-block;
  padding: .55em 1.1em;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--text-strong);
}
.pdf-embed figcaption a:hover,
.pdf-embed figcaption a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 800px) {
  /* I browser mobili non incorporano i PDF e mostrerebbero un riquadro vuoto:
     lì lasciamo solo il link, che apre il documento nel visore di sistema. */
  .pdf-embed object { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .gallery-grid { display: block; }
  .gallery-grid img { max-width: 48%; display: inline-block; }
}
