/*
Theme Name: Turista del Weekend
Description: Tema per il blog di gite fuori porta: foto grandi, ricerca e filtri per regione, nessun servizio esterno.
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: turista
*/

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/fonts/fraunces-latin-opsz-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(assets/fonts/fraunces-latin-opsz-italic.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/fonts/inter-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(assets/fonts/inter-latin-wght-italic.woff2) format('woff2'); }

/* Colori e font del sito: si cambiano tutti da qui. */
:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #6b716c;
  --line: #e6e1d7;
  --accent: #2f6b57;
  --accent-dark: #245746;
  --accent-soft: #e3eee8;
  --sun: #e9a23b;
  --dark: #1f2421;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 36, 33, .04), 0 8px 24px rgba(31, 36, 33, .06);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(720px, 100% - 40px); margin-inline: auto; }
.section { padding-block: 64px; }
.center { text-align: center; }

.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.eyebrow a { text-decoration: none; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.meta { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 600; text-decoration: none;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 99px;
}
.chip-light { background: rgba(255, 255, 255, .9); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: 12px 22px; border-radius: 99px; transition: transform .2s, background .2s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ---------- intestazione ---------- */
.site-header {
  position: sticky; top: var(--wp-admin--admin-bar--height, 0); z-index: 50;
  background: rgba(247, 244, 238, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; font-weight: 650; }
.logo em { font-style: italic; font-weight: 500; color: var(--accent); }
.logo-mark { width: 34px; height: 34px; flex: none; }
.site-nav { display: flex; gap: 32px; }
.site-nav a { text-decoration: none; font-weight: 500; color: var(--muted); transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .25s; }

/* ---------- apertura home ---------- */
.hero { padding: 56px 0 24px; }
.hero-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin-bottom: 20px; }
.hl { color: var(--accent); font-style: italic; font-weight: 500; }
.hero-stats { display: flex; gap: 36px; margin-top: 32px; }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1; }
.hero-stats span { font-size: .85rem; color: var(--muted); }

.featured {
  position: relative; display: block; aspect-ratio: 4 / 3.4;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--accent-soft);
}
.featured img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.featured:hover img { transform: scale(1.04); }
.featured-overlay {
  position: absolute; inset: auto 0 0; padding: 28px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}
.featured-overlay h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); margin: 12px 0 6px; }
.featured-overlay .meta { color: rgba(255, 255, 255, .85); }

/* ---------- elenco articoli ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2, .related h2 { font-size: 2rem; }
.related h2 { margin-bottom: 28px; }
.search {
  display: flex; align-items: center; gap: 8px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  padding: 0 16px; width: min(320px, 100%);
}
.search:focus-within { border-color: var(--accent); }
.search svg { flex: none; }
.search input { border: 0; outline: 0; background: none; font: inherit; padding: 11px 0; width: 100%; color: var(--text); }
.search-page { margin-top: 24px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.filter {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 99px; transition: all .2s;
}
.filter small { color: var(--muted); margin-left: 2px; }
.filter:hover { border-color: var(--text); }
.filter.active { background: var(--text); color: #fff; border-color: var(--text); }
.filter.active small { color: rgba(255, 255, 255, .6); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
}
.card a:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 16px 40px rgba(31,36,33,.12); }
.card-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--accent-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card a:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body .chip { align-self: flex-start; }
.card h3 { font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; }
.card.hidden { display: none; }
/* L'ultimo articolo e' gia' in apertura: nella griglia torna solo se si filtra o si cerca. */
.grid:not(.filtering) .card.is-featured { display: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.img-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), #f3e6cf); }
.img-placeholder svg { width: 64px; height: 64px; opacity: .6; }

/* ---------- anteprima "chi sono" ---------- */
.about-teaser { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 72px 0; }
.about-inner { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: center; max-width: 960px; }
.about-inner img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; }
.about-inner h2 { font-size: 2.2rem; margin-bottom: 16px; }
.about-inner p { color: var(--muted); margin: 0 0 24px; }

/* ---------- pagine ---------- */
.page-head { padding: 64px 0 0; }
.page-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); margin-bottom: 12px; }
.page-head.center .lead { margin-inline: auto; }
.page-head.center .btn { margin-top: 16px; }

.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.region { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; background: var(--accent-soft); }
.region img, .region .img-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.region:hover img { transform: scale(1.05); }
.region .region-text { position: absolute; inset: auto 0 0; padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.region h2 { font-size: 1.6rem; }
.region span { font-size: .9rem; opacity: .85; }

/* ---------- articolo ---------- */
.post-header { padding: 56px 0 32px; text-align: center; }
.post-header h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 18px 0 14px; }
.post-header .chip { font-size: .8rem; }
.post-cover { margin: 0 auto 48px; }
.post-cover img { width: 100%; height: auto; max-height: 640px; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; }
.post-cover figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: 10px; }

.prose { font-size: 1.1rem; line-height: 1.8; }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-size: 1.9rem; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.45rem; margin: 1.8em 0 .6em; color: var(--accent); }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }
.prose figure { margin: 2em 0; }
.prose figure img { width: auto; max-width: 100%; max-height: 78vh; height: auto; margin-inline: auto; border-radius: 12px; cursor: zoom-in; background: var(--line); }
.prose figcaption, .prose .wp-element-caption { font-size: .88rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.prose > .wp-block-image { width: calc(100% + 80px); margin-inline: -40px; }

/* Gallerie dell'editor di WordPress */
.prose .wp-block-gallery.has-nested-images {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 2em -40px;
}
.prose .wp-block-gallery.has-nested-images figure.wp-block-image { width: 100% !important; margin: 0; display: block; }
.prose .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100%; height: auto; max-height: none; aspect-ratio: 1; object-fit: cover;
}
.prose .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  position: static; background: none; color: var(--muted); max-height: none; padding: 0; text-shadow: none; overflow: visible;
}

.prose .wp-block-embed { margin: 2em 0; }
.prose .wp-block-embed iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }

.prose .wp-block-quote {
  margin: 2.4em 0; padding: 8px 0 8px 28px; border-left: 3px solid var(--sun);
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.5; font-style: italic;
}
.prose .wp-block-quote p { margin: 0 0 .4em; }
.prose .wp-block-quote cite { font-family: var(--sans); font-size: .9rem; font-style: normal; color: var(--muted); }

/* Il timbro "Let's go", la firma del blog */
.prose .is-style-lets-go {
  display: table; margin: 2.2em auto; padding: .55rem .85rem .5rem;
  border: 1.5px solid var(--accent); border-radius: 6px; color: var(--accent);
  font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .14em; line-height: 1;
  text-transform: uppercase; transform: rotate(-2deg);
}

.post-footer { padding: 32px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.tags a { font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 3px 10px; border-radius: 99px; text-decoration: none; }
.tags a:hover { border-color: var(--text); color: var(--text); }
.share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 24px 0; border-bottom: 1px solid var(--line); }
.share span { font-weight: 600; margin-right: 6px; }
.share a, .share button {
  font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 99px; transition: border-color .2s;
}
.share a:hover, .share button:hover { border-color: var(--text); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 28px 0; }
.post-nav a { text-decoration: none; font-family: var(--serif); font-size: 1.1rem; line-height: 1.3; }
.post-nav a:hover { color: var(--accent); }
.post-nav small { display: block; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.post-nav .next { text-align: right; }
.related { border-top: 1px solid var(--line); margin-top: 32px; }

/* ---------- commenti ---------- */
.comments { padding-top: 12px; }
.comments h2 { font-size: 1.5rem; margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0 0 36px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-author .says { display: none; }
.comment-metadata a { text-decoration: none; }
.comment-content p { margin: 0 0 .6em; }
.reply a { font-size: .85rem; color: var(--accent); }
.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 4px; }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: baseline; }
.comment-form .comment-form-cookies-consent label { font-weight: 400; }
.comment-notes, .logged-in-as { font-size: .85rem; color: var(--muted); }
.comment-form input:not([type="checkbox"]):not([type="submit"]), .comment-form textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.comment-form input:focus, .comment-form textarea:focus { outline: 0; border-color: var(--accent); }
.comment-form .submit {
  font: inherit; font-weight: 600; cursor: pointer; color: #fff; background: var(--accent);
  border: 0; padding: 12px 22px; border-radius: 99px; transition: background .2s;
}
.comment-form .submit:hover { background: var(--accent-dark); }

/* ---------- ingrandimento foto ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100000; display: none; place-items: center;
  background: rgba(15, 17, 16, .94); padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 92vh; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; padding: 16px; opacity: .7; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- pie' di pagina ---------- */
.site-footer { background: var(--dark); color: #c9cec9; margin-top: 64px; padding: 64px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.site-footer .logo { color: #fff; margin-bottom: 12px; }
.site-footer .logo em { color: #8fc4ae; }
.site-footer p { max-width: 42ch; font-size: .93rem; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .93rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid #353b37; font-size: .85rem; color: #9ba19c; }

/* ---------- schermi piccoli ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .about-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .about-inner img { max-width: 260px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
  .prose > .wp-block-image { width: 100%; margin-inline: 0; }
  .prose .wp-block-gallery.has-nested-images { margin-inline: 0; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 1.1rem; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .section { padding-block: 44px; }
  .hero { padding-top: 32px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 1.05rem; }
  .prose .wp-block-gallery.has-nested-images { grid-template-columns: 1fr 1fr; gap: 8px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
