/*
Theme Name: Wondervàl
Theme URI: https://wunderval.it
Description: Tema custom one-page per Wondervàl — mappa di storie, persone e percorsi della Val di Susa.
Version: 2.0.0
Author: Housedada
Text Domain: wunderval
*/

:root {
  --bg: #f8efe6; --paper: #fdf8f1; --ink: #14304f; --muted: #52667d;
  --blue: #3a78ad; --orange: #dd6a1d; --orange-text: #b04a0c; --line: rgba(20,48,79,.18);
  --band: #3a78ad; --band-ink: #f8efe6; --night: #101f30; --star: #e4a91f;
  --c-visita: #8a5a9a; --c-mangia: #dd6a1d; --c-cammina: #4f8a52; --c-dormi: #2f5f93; --c-scopri: #1f8a92; --c-annusa: #8a8a1f;
  --mtn-a: #7aa3cc; --mtn-b: #a9c3dd; --mtn-c: #d8c7b0; --river: #dd6a1d;
  --shadow: 0 1px 2px rgba(20,48,79,.08), 0 8px 24px rgba(20,48,79,.10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1b2a; --paper: #152739; --ink: #f3e9db; --muted: #a2b4c8; --blue: #79aedd; --orange: #f08a47; --orange-text: #f6a066;
    --line: rgba(243,233,219,.18); --band: #1b4264; --band-ink: #f3e9db; --night: #07111b; --star: #f5cd63;
    --c-visita: #c493d6; --c-mangia: #f08a47; --c-cammina: #86c489; --c-dormi: #7fb0ea; --c-scopri: #58cdd4; --c-annusa: #cfcf5a;
    --mtn-a: #2c5a85; --mtn-b: #23476b; --mtn-c: #1a2e44; --river: #f08a47;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1b2a; --paper: #152739; --ink: #f3e9db; --muted: #a2b4c8; --blue: #79aedd; --orange: #f08a47; --orange-text: #f6a066;
  --line: rgba(243,233,219,.18); --band: #1b4264; --band-ink: #f3e9db; --night: #07111b; --star: #f5cd63;
  --c-visita: #c493d6; --c-mangia: #f08a47; --c-cammina: #86c489; --c-dormi: #7fb0ea; --c-scopri: #58cdd4; --c-annusa: #cfcf5a;
  --mtn-a: #2c5a85; --mtn-b: #23476b; --mtn-c: #1a2e44; --river: #f08a47;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: "EB Garamond", Georgia, serif; font-size: 18px; line-height: 1.5; margin: 0; overflow-x: hidden; }
img, svg { max-width: 100%; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1600px; margin-inline: auto; }
.ui { font-family: "DM Sans", system-ui, sans-serif; }
.eyebrow { font-family: "DM Sans", system-ui, sans-serif; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-family: "DM Sans", sans-serif; font-size: 14px; background: var(--paper); transition: background .2s, color .2s, transform .2s, border-color .2s; white-space: nowrap; }
.chip:hover { transform: translateY(-1px); border-color: var(--orange); }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #1b0f06; font-weight: 600; }
.chip-sm { padding: 4px 11px; font-size: 13px; border-color: var(--line); }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 9px 20px; font-family: "DM Sans", sans-serif; font-weight: 600; font-size: 14px; border: 0; transition: transform .2s, filter .2s; text-decoration: none; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-or { background: var(--orange); color: #1b0f06; }
.btn-bl { background: var(--blue); color: #08131f; }

.card { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-align: left; border: 0; padding: 0; cursor: pointer; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; animation: rise .55s both cubic-bezier(.2,.8,.2,1); position: relative; }
.card:hover { transform: translateY(-4px); }
.card-plate { aspect-ratio: 4/3; width: 100%; display: grid; place-items: center; font-family: "EB Garamond", serif; font-weight: 600; font-size: 40px; color: #fff; position: relative; overflow: hidden; }
.card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .5s ease; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-eyebrow { font-family: "DM Sans", sans-serif; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--orange-text); }
.card-title { font-size: 22px; line-height: 1.15; font-weight: 600; margin: 0; }
.card-meta { font-family: "DM Sans", sans-serif; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; font-family: "DM Sans", sans-serif; font-size: 11.5px; color: var(--muted); }
.cat-dot { width: 9px; height: 9px; border-radius: 9px; display: inline-block; flex-shrink: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideout { from { transform: none; } to { transform: translateX(100%); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.twinkle { animation: twinkle 3.4s ease-in-out infinite; }
.drawer-in { animation: slidein .38s cubic-bezier(.2,.8,.2,1) both; }
.drawer-out { animation: slideout .24s ease-in both; }
.scrim-in { animation: fadein .3s both; }
.scrim-out { animation: fadeout .24s both; }

.wordmark { font-weight: 600; letter-spacing: -.02em; line-height: .9; font-size: clamp(64px, 17vw, 210px); color: var(--blue); margin: 0; }

/* hero backdrop: silhouette acquerello di montagne + fiume, generata staticamente (stesso seed del prototipo) */
.hero-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero-backdrop-wc { filter: url(#wv-wc); }
@media (max-width: 640px), (prefers-reduced-motion: reduce) {
    /* niente feTurbulence/feDisplacementMap su mobile: costoso da rasterizzare, poco visibile a quella dimensione */
    .hero-backdrop-wc { filter: none; }
}
#top .wrap { z-index: 1; }

/* hero: mobile = flusso normale centrato; da 640px in su = composizione a strati come il mockup */
.hero-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: min(480px, 70vh); padding: 48px 0; text-align: center; }
.hero-wordmark { font-size: clamp(52px, 16vw, 210px); }
.hero-tagline { font-style: italic; font-size: clamp(20px, 6vw, 46px); line-height: 1.1; color: var(--ink); }
.hero-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-foot p { margin: 0; max-width: 26rem; font-size: 15px; color: var(--ink); }
@media (min-width: 640px) {
    .hero-wrap { position: relative; min-height: min(560px, 80vh); padding: 40px 0; display: block; text-align: left; }
    .hero-wordmark { position: absolute; left: 0; right: 0; top: 28%; text-align: center; }
    .hero-tagline { position: absolute; left: 0; right: 0; top: 63%; text-align: center; }
    .hero-foot { position: absolute; left: 0; bottom: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
}
.noscroll { overflow: hidden; }
.scroll-thin::-webkit-scrollbar { width: 6px; } .scroll-thin::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }

/* header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.site-logo { text-align: left; border: 0; background: transparent; padding: 0; cursor: pointer; }
.site-logo-wordmark { font-size: 26px; font-weight: 600; line-height: 1; color: var(--blue); }
.site-logo-tag { font-style: italic; font-size: 11px; line-height: 1.2; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a { display: none; font-size: 19px; font-weight: 600; color: var(--blue); text-decoration: none; background: transparent; border: 0; padding: 0 10px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 36px; border: 1px solid var(--line); background: var(--paper); }
@media (min-width: 640px) { .site-nav a { display: inline-block; } .mobile-menu-btn { display: none; } }
.mobile-menu { display: flex; flex-direction: column; padding-bottom: 12px; }
.mobile-menu a { display: block; padding: 10px 0; font-size: 22px; font-weight: 600; color: var(--blue); text-decoration: none; border-top: 1px solid var(--line); }
.mobile-menu[hidden] { display: none; }

/* sections */
section { scroll-margin-top: 70px; }
.band-manifesto { background: var(--band); color: var(--band-ink); padding-top: 56px; padding-bottom: 56px; }
.band-manifesto .grid2 { display: grid; gap: 40px; }
@media (min-width: 768px) { .band-manifesto .grid2 { grid-template-columns: minmax(0,5fr) minmax(0,7fr); } }
.band-manifesto h2 { font-size: clamp(38px,5.5vw,60px); line-height: 1.02; font-weight: 600; margin: 0; }
.band-manifesto p { margin: 0 0 16px; font-size: 19px; line-height: 1.55; }
.manifesto-more { background: transparent; border: 0; padding: 0; color: inherit; font-family: "DM Sans", sans-serif; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

#storie { padding-top: 56px; padding-bottom: 56px; }
#storie .wrap { display: flex; flex-direction: column; gap: 28px; }
#storie h2 { text-align: center; font-size: clamp(28px,4vw,40px); line-height: 1.1; font-weight: 600; margin: 0 auto; max-width: 42rem; color: var(--blue); }
.search-box { max-width: 42rem; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.search-row { display: flex; align-items: center; gap: 12px; border-radius: 999px; padding-left: 20px; padding-right: 8px; height: 56px; background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line); }
.search-row input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 17px; font-family: "DM Sans", sans-serif; }
.search-suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.search-suggest button { background: transparent; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.filters-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.filters-row.season { gap: 8px; align-items: center; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; gap: 12px; font-family: "DM Sans", sans-serif; }
.results-bar > .ui { justify-content: center; }
.results-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.clear-all { background: transparent; border: 0; text-decoration: underline; text-underline-offset: 2px; font-size: 13px; color: var(--blue); padding: 0; cursor: pointer; }
.cards-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: 1fr 1fr 1fr; } }
.empty-state { text-align: center; padding: 64px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.load-more { text-align: center; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 8px; }

#persone { position: relative; overflow: hidden; background: var(--night); color: #f3e9db; padding-top: 64px; padding-bottom: 64px; }
#persone .night-bg { position: absolute; inset: 0; z-index: 0; }
#persone .wrap { position: relative; z-index: 1; display: grid; gap: 40px; align-items: start; }
@media (min-width: 768px) { #persone .wrap { grid-template-columns: minmax(0,5fr) minmax(0,7fr); } }
#persone h2 { font-size: clamp(38px,5.5vw,60px); line-height: 1.02; font-weight: 600; margin: 0; }
#persone p { margin: 0 0 14px; font-size: 18px; line-height: 1.5; color: rgba(243,233,219,.85); }
.cat-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: 1fr 1fr; } }
.cat-card { text-align: left; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; border: 1px solid rgba(243,233,219,.18); background: rgba(7,17,27,.55); color: #f3e9db; transition: transform .2s; cursor: pointer; }
.cat-card:hover { transform: translateY(-4px); }
.cat-card-label { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 600; line-height: 1.1; }
.cat-card-blurb { font-size: 16.5px; line-height: 1.35; color: rgba(243,233,219,.8); }
.cat-card-count { font-family: "DM Sans", sans-serif; font-size: 13px; font-weight: 600; color: #f6a066; margin-top: 4px; }

#segnala { padding-top: 56px; padding-bottom: 56px; }
#segnala .wrap { display: grid; gap: 40px; }
@media (min-width: 768px) { #segnala .wrap { grid-template-columns: minmax(0,5fr) minmax(0,7fr); } }
#segnala h2 { font-size: clamp(32px,4.5vw,48px); line-height: 1.05; font-weight: 600; margin: 0 0 12px; color: var(--blue); }
#segnala > .wrap > div:first-child p { margin: 0; font-size: 19px; color: var(--muted); }
.form-grid { display: flex; flex-direction: column; gap: 16px; font-family: "DM Sans", sans-serif; }
.form-grid .row2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid .row2 { grid-template-columns: 1fr 1fr; } }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.form-grid input, .form-grid textarea { border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 400; background: var(--paper); border: 1px solid var(--line); font-family: "EB Garamond", serif; }
.form-sent { border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 12px; background: var(--paper); border: 1px solid var(--line); }

.partner-band { background: #14304f; color: #f3e9db; padding-top: 56px; padding-bottom: 56px; }
.partner-head { text-align: center; max-width: 42rem; margin: 0 auto 32px; }
.partner-eyebrow { font-family: "DM Sans", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--orange-text); }
.partner-title { margin: 8px 0 0; font-size: clamp(22px, 3.2vw, 32px); line-height: 1.15; font-weight: 600; text-wrap: balance; }
.partner-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin: 0; padding: 0; list-style: none; }
.partner-cell { display: flex; align-items: center; justify-content: center; height: 90px; width: calc((100% - 20px) / 2); padding: 10px 8px; box-sizing: border-box; }
.partner-cell img { max-height: 100%; max-width: 100%; object-fit: contain; }
@media (min-width: 640px) { .partner-cell { width: calc((100% - 40px) / 3); height: 110px; } }
@media (min-width: 1024px) { .partner-cell { width: calc((100% - 80px) / 5); height: 130px; } }

.partner-cell img[src*="turismo-torino"],
.partner-cell img[src*="citta-metropolitana-torino"],
.partner-cell img[src*="graffio"],
.partner-cell img[src*="valle-susa-tesori"] { max-height: 68%; max-width: 68%; }
.partner-cell img[src*="fai-valle-susa"] { max-height: 85%; max-width: 85%; }

.site-footer { padding-top: 40px; padding-bottom: 40px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-family: "DM Sans", sans-serif; font-size: 12.5px; color: var(--muted); }
.site-footer .foot-logo { font-size: 22px; font-weight: 600; color: var(--blue); font-family: "EB Garamond", serif; }

/* drawer */
#modal-drawer { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
#modal-drawer.open { pointer-events: auto; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(7,17,27,.55); opacity: 0; }
#modal-drawer.open .drawer-scrim { opacity: 1; }
.drawer-panel { position: fixed; right: 0; top: 0; height: 100%; width: min(560px, 100%); background: var(--bg); box-shadow: -20px 0 60px rgba(0,0,0,.25); overflow-y: auto; transform: translateX(100%); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer-head { position: relative; aspect-ratio: 16/9; display: grid; place-items: center; color: #fff; font-size: 48px; font-weight: 600; overflow: hidden; }
.drawer-gallery-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .4s ease; }
.drawer-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.88); border: 1px solid var(--line); color: #14283d; font-size: 22px; line-height: 1; cursor: pointer; }
.drawer-gallery-prev { left: 12px; }
.drawer-gallery-next { right: 12px; }
.drawer-gallery-dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; }
.drawer-gallery-dot { width: 8px; height: 8px; border-radius: 8px; padding: 0; border: 0; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(0,0,0,.25); transition: width .2s; cursor: pointer; }
.drawer-gallery-dot.is-active { width: 18px; background: #fff; }
.drawer-head-actions { position: absolute; right: max(16px, env(safe-area-inset-right,0px)); top: calc(14px + env(safe-area-inset-top,0px)); display: flex; gap: 8px; }
.drawer-body { padding: 28px max(16px, env(safe-area-inset-left,0px)); display: flex; flex-direction: column; gap: 28px; }
.drawer-body h2 { font-size: 40px; line-height: 1.02; font-weight: 600; margin: 0; }
.drawer-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.drawer-story { font-size: 21px; line-height: 1.45; margin: 0; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.info-item { display: flex; gap: 12px; align-items: flex-start; }
.info-item.full { grid-column: 1 / -1; }
.info-label { font-family: "DM Sans", sans-serif; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.info-value { font-size: 17px; }
.contact-link { display: inline-flex; align-items: center; gap: 8px; font-family: "DM Sans", sans-serif; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; color: var(--blue); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }
