/*
Theme Name: Pro Loco Orta Nova
Theme URI: https://www.prolocoortanova.it/
Author: Pro Loco Orta Nova
Description: Tema mobile-first per il portale della Pro Loco di Orta Nova.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: proloco
*/

:root {
  --ink: #102636;
  --muted: #587080;
  --navy: #052f4b;
  --blue: #0679bb;
  --sky: #13a8df;
  --orange: #f39a24;
  --gold: #d8b66e;
  --paper: #fffdf8;
  --mist: #eef6f9;
  --white: #fff;
  --border: #d8e4e9;
  --shadow: 0 18px 45px rgba(5, 47, 75, .12);
  --radius: 1.25rem;
  --wrap: 74rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: var(--blue); text-decoration-thickness: .09em; text-underline-offset: .18em; }
a:hover { color: var(--navy); }
button, input, textarea { font: inherit; }
:focus-visible { outline: .2rem solid var(--orange); outline-offset: .18rem; }
.wrap { width: min(calc(100% - 2rem), var(--wrap)); margin-inline: auto; }
.narrow { width: min(calc(100% - 2rem), 48rem); margin-inline: auto; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus { top: .75rem; left: .75rem; z-index: 10000; width: auto; height: auto; padding: .75rem 1rem; clip: auto; background: var(--white); }

.site-header { position: sticky; top: 0; z-index: 100; color: var(--white); background: rgba(5, 47, 75, .97); box-shadow: 0 1px 0 rgba(255,255,255,.12); }
.utility-bar { display: none; background: #03263d; font-size: .85rem; }
.utility-bar .wrap { display: flex; justify-content: flex-end; gap: 1.4rem; padding-block: .35rem; }
.utility-bar a { color: #d9edf5; text-decoration: none; }
.header-main { min-height: 4.8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--white); text-decoration: none; }
.brand-logo { width: 3rem; height: 3.6rem; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-family: Georgia, serif; font-size: 1.05rem; letter-spacing: .01em; }
.brand-text small { margin-top: .28rem; color: #bfe9f8; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.menu-toggle { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; color: var(--white); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: .8rem; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; display: block; width: 1.25rem; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle span { margin-block: .27rem; }
.menu-toggle[aria-expanded="true"] span { opacity: 0; }
.menu-toggle[aria-expanded="true"]::before { transform: translateY(.34rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"]::after { transform: translateY(-.34rem) rotate(-45deg); }
.primary-nav { position: fixed; inset: 4.8rem 0 0; padding: 1rem; visibility: hidden; opacity: 0; background: var(--navy); transform: translateY(-.5rem); transition: .2s ease; overflow-y: auto; }
.primary-nav.is-open { visibility: visible; opacity: 1; transform: none; }
.primary-nav ul { margin: 0; padding: 0; list-style: none; }
.primary-nav a { display: block; padding: .8rem .65rem; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.12); font-weight: 750; text-decoration: none; }
.primary-nav .sub-menu { padding-left: 1rem; }
.primary-nav .sub-menu a { color: #cceefa; font-size: .92rem; font-weight: 600; }

.hero { position: relative; overflow: hidden; color: var(--white); background: linear-gradient(125deg, var(--navy), #056b9e 64%, var(--sky)); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .16; background: url('/wp-content/uploads/legacy/sfondo.jpg') center/cover; mix-blend-mode: screen; }
.hero .wrap { position: relative; display: grid; gap: 2rem; padding-block: clamp(3.5rem, 9vw, 7rem); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .8rem; color: var(--orange); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 2rem; height: .16rem; background: currentColor; }
.hero h1 { max-width: 12ch; margin: 0; font-family: Georgia, serif; font-size: clamp(2.45rem, 9vw, 5.8rem); line-height: .98; letter-spacing: -.04em; }
.hero-copy > p:not(.eyebrow) { max-width: 38rem; margin: 1.25rem 0 1.7rem; color: #e6f6fc; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .7rem 1.1rem; color: var(--navy); background: var(--orange); border: 2px solid var(--orange); border-radius: 999px; font-weight: 850; text-decoration: none; }
.button:hover { color: var(--navy); background: #ffb24a; border-color: #ffb24a; }
.button-secondary { color: var(--white); background: transparent; border-color: rgba(255,255,255,.55); }
.button-secondary:hover { color: var(--navy); background: var(--white); border-color: var(--white); }
.hero-collage { position: relative; min-height: 22rem; }
.hero-collage img { position: absolute; width: 68%; aspect-ratio: 4/3; object-fit: cover; border: .35rem solid rgba(255,255,255,.92); border-radius: 1rem; box-shadow: 0 25px 55px rgba(0,0,0,.3); }
.hero-collage img:nth-child(1) { top: 0; right: 0; transform: rotate(2deg); }
.hero-collage img:nth-child(2) { bottom: 0; left: 0; transform: rotate(-3deg); }
.hero-collage img:nth-child(3) { right: 2%; bottom: -3%; width: 43%; filter: sepia(.25); transform: rotate(4deg); }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-tint { background: var(--mist); }
.section-dark { color: var(--white); background: var(--navy); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.section-heading h2, .page-title { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -.025em; }
.section-heading a { font-weight: 800; white-space: nowrap; }
.card-grid { display: grid; gap: 1.2rem; }
.card { overflow: hidden; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(5,47,75,.07); }
.card-media { display: block; overflow: hidden; aspect-ratio: 16/10; background: linear-gradient(135deg, var(--blue), var(--sky)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { padding: 1.25rem; }
.card-kicker { margin: 0 0 .35rem; color: var(--blue); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.card-title { margin: 0 0 .6rem; font-family: Georgia, serif; font-size: 1.45rem; line-height: 1.18; }
.card-title a { color: var(--navy); text-decoration: none; }
.card-body > p:last-child { margin-bottom: 0; color: var(--muted); }
.explore-grid { display: grid; gap: 1rem; }
.explore-card { min-height: 12rem; display: flex; flex-direction: column; justify-content: end; padding: 1.4rem; color: var(--white); background: linear-gradient(145deg, var(--navy), var(--blue)); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); }
.explore-card:nth-child(2) { background: linear-gradient(145deg, #9f3d18, var(--orange)); }
.explore-card:nth-child(3) { color: var(--navy); background: linear-gradient(145deg, #d4b069, #f2ddb0); }
.explore-card span { margin-bottom: auto; font-size: 2rem; }
.explore-card strong { font-family: Georgia, serif; font-size: 1.55rem; }
.explore-card small { opacity: .85; }
.contact-band { display: grid; gap: 1.5rem; align-items: center; padding: clamp(1.5rem, 5vw, 3rem); color: var(--white); background: linear-gradient(120deg, var(--navy), #075b85); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-band h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 5vw, 3rem); }
.contact-band p { margin: .5rem 0 0; color: #d8f1fa; }

.page-header { padding-block: clamp(2.7rem, 7vw, 5rem); color: var(--white); background: linear-gradient(120deg, var(--navy), var(--blue)); }
.breadcrumbs { margin-bottom: .6rem; color: #cdebf6; font-size: .9rem; }
.breadcrumbs a { color: inherit; }
.content-layout { display: grid; gap: 2.5rem; padding-block: clamp(2.5rem, 6vw, 5rem); }
.entry-content { min-width: 0; font-size: 1.05rem; }
.entry-content > * { max-width: 48rem; margin-right: auto; margin-left: auto; }
.entry-content > .alignwide { max-width: var(--wrap); }
.entry-content h2, .entry-content h3 { margin-top: 1.8em; color: var(--navy); font-family: Georgia, serif; line-height: 1.2; }
.entry-content img { border-radius: .7rem; }
.entry-content table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.entry-content td, .entry-content th { padding: .65rem; border: 1px solid var(--border); }
.entry-content .gallery { max-width: var(--wrap); display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.entry-content .gallery-item { width: auto !important; margin: 0 !important; }
.entry-content .gallery-icon { height: 100%; }
.entry-content .gallery img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border: 0 !important; border-radius: .55rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin: .8rem 0 0; color: #cdebf6; font-size: .92rem; }
.pagination { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-numbers { min-width: 2.6rem; padding: .45rem .75rem; text-align: center; background: var(--white); border: 1px solid var(--border); border-radius: .6rem; text-decoration: none; }
.page-numbers.current { color: var(--white); background: var(--blue); border-color: var(--blue); }
.empty-state { padding: 2rem; text-align: center; background: var(--mist); border-radius: var(--radius); }
.search-form { display: flex; max-width: 34rem; }
.search-field { min-width: 0; flex: 1; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .75rem 0 0 .75rem; }
.search-submit { padding: .75rem 1rem; color: var(--white); background: var(--blue); border: 0; border-radius: 0 .75rem .75rem 0; font-weight: 800; }

.site-footer { color: #d4e9f1; background: #03263d; }
.footer-grid { display: grid; gap: 2rem; padding-block: 3rem; }
.footer-brand { display: flex; gap: 1rem; align-items: start; }
.footer-brand img { width: 4.5rem; max-height: 6rem; object-fit: contain; }
.site-footer h2 { margin: 0 0 .6rem; color: var(--white); font-family: Georgia, serif; font-size: 1.25rem; }
.site-footer p { margin: .25rem 0; }
.site-footer a { color: #bcecff; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li + li { margin-top: .35rem; }
.footer-bottom { padding-block: 1rem; color: #9bc0ce; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }

@media (min-width: 42rem) {
  .utility-bar { display: block; }
  .site-header { top: 0; }
  .primary-nav { inset-block-start: 7rem; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-band { grid-template-columns: 1fr auto; }
  .entry-content .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

@media (min-width: 64rem) {
  .header-main { min-height: 5.5rem; }
  .brand-logo { width: 3.65rem; height: 4.5rem; }
  .brand-text strong { font-size: 1.25rem; }
  .menu-toggle { display: none; }
  .primary-nav { position: static; visibility: visible; opacity: 1; padding: 0; background: transparent; transform: none; overflow: visible; }
  .primary-nav > ul { display: flex; align-items: center; gap: .1rem; }
  .primary-nav li { position: relative; }
  .primary-nav a { padding: .8rem .72rem; border: 0; font-size: .91rem; }
  .primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { color: var(--orange); }
  .primary-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 15rem; padding: .45rem; visibility: hidden; opacity: 0; background: var(--navy); border-radius: .75rem; box-shadow: var(--shadow); transform: translateY(.4rem); transition: .18s ease; }
  .primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
  .primary-nav .sub-menu a { padding: .65rem .75rem; border-radius: .45rem; }
  .hero .wrap { grid-template-columns: 1.05fr .95fr; align-items: center; }
  .hero-collage { min-height: 32rem; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-content .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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