/* ===== tokens ===== */
:root {
  --bg:           #ffffff;
  --bg-alt:       #eef4fa;
  --surface:      #ffffff;
  --text:         #16263a;
  --text-soft:    #3f5366;
  --muted:        #647689;
  --line:         #dbe4ed;

  --primary:      #1f6aa8;     /* shutter blue */
  --primary-soft: #3e88c5;
  --primary-deep: #0f3e72;
  --primary-ink:  #ffffff;     /* on-primary text */
  --accent:       #ffffff;     /* CTA: white-on-blue */

  --placeholder-a: #9bb2cb;
  --placeholder-b: #5c7c9f;

  --radius:       14px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md:    0 2px 6px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);

  --gap:          1.5rem;
  --container:    1100px;

  --font:         "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ===== base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-soft); text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

/* material symbols sizing */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
}

/* ===== topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--primary); text-decoration: none; }
.brand-icon { color: var(--primary); font-size: 28px; }
.brand-name { font-size: 1.05rem; }

.nav {
  display: none;
  margin-left: auto;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-soft);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav a:hover { background: var(--bg-alt); color: var(--text); text-decoration: none; }

.lang {
  display: inline-flex; gap: 0.15rem;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 0.2rem;
}
.lang button {
  border: 0; background: transparent;
  font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--text-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang button[aria-selected="true"] {
  background: var(--primary);
  color: var(--primary-ink);
}

.menu-toggle {
  display: inline-flex;
  background: transparent; border: 0; padding: 0.25rem;
  color: var(--text); cursor: pointer;
}
.menu-toggle .material-symbols-outlined { font-size: 28px; }

@media (min-width: 820px) {
  .nav { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* mobile nav drawer */
.nav.open {
  display: flex; flex-direction: column;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem 1rem;
  gap: 0;
}
.nav.open a { padding: 0.7rem 0.5rem; border-radius: var(--radius-sm); }

/* ===== layout ===== */
main { display: block; }
.section {
  padding: 4rem 1.25rem;
  max-width: var(--container);
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-alt);
  max-width: none;
  margin: 0;
  padding-left: 0; padding-right: 0;
}
.section-alt > * {
  max-width: var(--container);
  margin-left: auto; margin-right: auto;
  padding-left: 1.25rem; padding-right: 1.25rem;
}
.section-alt > h2 { padding-top: 0; }

.subtitle { color: var(--muted); margin-top: -0.5rem; }
.lead { font-size: 1.1rem; color: var(--text-soft); max-width: 60ch; }

/* ===== hero ===== */
.hero {
  position: relative;
  min-height: clamp(420px, 70vh, 720px);
  display: flex; align-items: flex-end;
  color: var(--primary-ink);
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #4d8cc4 0%, #1f6aa8 55%, #0f3e72 100%);
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15, 62, 114, 0.45), transparent 55%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
.hero-content h1 { margin-bottom: 0.4rem; }
.hero-tagline { font-size: clamp(1rem, 1.6vw, 1.25rem); opacity: 0.92; max-width: 40ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: #ffffff; color: var(--primary-deep); font-weight: 700; }
.btn-primary:hover { background: #eaf2fa; color: var(--primary-deep); }
.btn-ghost { background: rgba(255,255,255,0.10); color: var(--primary-ink); border: 1.5px solid rgba(255,255,255,0.55); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); color: var(--primary-ink); }

/* ===== real images ===== */
.image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-alt);   /* shown while loading */
}
.image.is-hero { border-radius: 0; }

/* ===== placeholder image ===== */
.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--placeholder-a), var(--placeholder-b));
  color: rgba(255,255,255,0.9);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.placeholder::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 10px);
}
.placeholder span.material-symbols-outlined {
  font-size: 32px; opacity: 0.5;
  margin-right: 0.4rem;
}
.placeholder .placeholder-label { z-index: 1; }
.placeholder.is-hero { border-radius: 0; }

.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-4-3  { aspect-ratio: 4 / 3; }
.aspect-3-4  { aspect-ratio: 3 / 4; }
.aspect-1-1  { aspect-ratio: 1 / 1; }

/* ===== gestione ===== */
.managers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 720px) {
  .managers { grid-template-columns: 1fr 1fr; }
}
.manager-card {
  display: flex; gap: 1rem; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.manager-card .placeholder {
  width: 96px; flex: 0 0 96px;
  border-radius: 50%;
  font-size: 0.65rem;
}
.manager-card .placeholder span.material-symbols-outlined {
  font-size: 24px;
}
.manager-name { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.3rem; }
.manager-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.manager-link .material-symbols-outlined { font-size: 18px; }

/* ===== rifugio ===== */
.rifugio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 760px) {
  .rifugio-grid { grid-template-columns: 1.4fr 1fr; }
}
.history { font-size: 1.05rem; color: var(--text-soft); max-width: 60ch; }
.facts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 1rem;
}
.facts dt { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; }

/* ===== servizi ===== */
.facilities {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}
@media (min-width: 540px) { .facilities { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .facilities { grid-template-columns: repeat(4, 1fr); } }
.facility {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex; align-items: center; gap: 0.7rem;
  box-shadow: var(--shadow-sm);
}
.facility .material-symbols-outlined {
  color: var(--primary);
  font-size: 26px;
}
.facility-label { font-size: 0.95rem; font-weight: 500; }

/* ===== season ===== */
.season {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .season { grid-template-columns: 1fr 1fr; }
}
.season-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 0.9rem; align-items: flex-start;
}
.season-card .material-symbols-outlined { color: var(--primary); font-size: 28px; }
.season-label { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.season-value { font-weight: 600; font-size: 1.05rem; margin-top: 0.1rem; }

/* ===== arrivo ===== */
.arrivo-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .arrivo-grid { grid-template-columns: 1fr 1fr; } }
.arrivo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.arrivo-icon { color: var(--primary); font-size: 28px; }
.arrivo-card h3 { margin: 0.4rem 0 0.4rem; }
.arrivo-card p  { color: var(--text-soft); margin: 0; }

.arrivo-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}
.arrivo-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1.5px solid var(--primary);
  transition: background 0.15s ease, transform 0.1s ease;
}
.arrivo-btn:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: var(--primary-ink);
  text-decoration: none;
  transform: translateY(-1px);
}
.arrivo-btn .material-symbols-outlined { font-size: 20px; }

.coords-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--text-soft);
  font: inherit; font-size: 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.coords-chip:hover {
  background: #ffffff;
  border-color: var(--primary-soft);
  color: var(--primary);
}
.coords-chip.is-copied {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.coords-chip .material-symbols-outlined { font-size: 16px; }

/* ===== sentieri ===== */
.trails {
  list-style: none; padding: 0; margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .trails { grid-template-columns: repeat(3, 1fr); } }
.trail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.trail-head { display: flex; align-items: center; gap: 0.5rem; }
.trail-head .material-symbols-outlined { color: var(--primary); font-size: 22px; }
.trail-name { font-weight: 600; }
.trail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.trail-meta dt { color: var(--muted); }
.trail-meta dd { margin: 0; }
.trail-badge {
  margin-left: auto;
  background: var(--bg-alt);
  color: var(--text-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== gallery ===== */
.gallery {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery li .placeholder { width: 100%; }

/* ===== contacts ===== */
.contacts {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .contacts { grid-template-columns: 1fr 1fr; } }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.9rem;
  align-items: center;
}
.contact-card .material-symbols-outlined { color: var(--primary); font-size: 22px; }
.contact-card .label { color: var(--muted); font-size: 0.82rem; font-weight: 500; grid-column: 2; }
.contact-card .value { font-weight: 500; grid-column: 2; word-break: break-word; }
.contact-card .row   { display: contents; }

/* ===== footer ===== */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-owner { margin: 0 0 0.3rem; font-weight: 500; color: var(--text-soft); }
.footer-owner a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.footer-owner a:hover { color: var(--primary); text-decoration-color: var(--primary); }
.footer-made  { margin: 0; font-style: italic; }
