/* ============================================
   OVB - Osservatorio Astronomico Val Bratica
   Foglio di stile principale
   Palette: notte profonda + oro antico
   ============================================ */

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep:      #050510;
  --bg-night:    #0a0a18;
  --bg-panel:    #11111f;
  --bg-card:     #161628;
  --gold:        #e8c050;
  --gold-dim:    #c8902a;
  --gold-soft:   #d4a030;
  --ivory:       #f5f0e8;
  --text:        #d8d4cc;
  --text-mute:   #9a958a;
  --blue-night:  #1a1a3a;
  --line:        rgba(200,144,42,0.25);
  --line-strong: rgba(200,144,42,0.55);
  --shadow:      0 10px 40px rgba(0,0,0,0.6);
  --serif:       "Cormorant Garamond", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:        "JetBrains Mono", "Courier New", Courier, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(1px 1px at 20% 30%,  rgba(255,255,255,0.45), transparent 50%),
    radial-gradient(1px 1px at 75% 80%,  rgba(255,255,255,0.35), transparent 50%),
    radial-gradient(1px 1px at 60% 15%,  rgba(255,255,255,0.40), transparent 50%),
    radial-gradient(2px 2px at 35% 70%,  rgba(255,255,255,0.25), transparent 50%),
    radial-gradient(1px 1px at 90% 40%,  rgba(255,255,255,0.30), transparent 50%),
    radial-gradient(1px 1px at 10% 85%,  rgba(255,255,255,0.30), transparent 50%),
    radial-gradient(1.5px 1.5px at 50% 55%, rgba(232,192,80,0.20), transparent 50%),
    radial-gradient(ellipse at top, var(--bg-night) 0%, var(--bg-deep) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Tipografia --- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: 0.01em;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; color: var(--gold); }
h3 { font-size: 1.4rem; margin-bottom: 0.7rem; color: var(--gold-soft); }
p  { margin-bottom: 1.1rem; }
a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-dim);
  transition: color .2s, border-color .2s;
}
a:hover { color: var(--ivory); border-color: var(--ivory); }
strong { color: var(--ivory); font-weight: 600; }
em     { color: var(--gold-soft); font-style: italic; }

/* --- Layout principale --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- HEADER --- */
.site-header {
  background: linear-gradient(180deg, rgba(10,10,24,0.95) 0%, rgba(10,10,24,0.80) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  border: none;
}
.brand img { height: 56px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.18em;
  font-weight: 600;
}
.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  text-transform: uppercase;
}

/* --- NAVIGAZIONE --- */
.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.main-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  border: none;
  padding: 0.5rem 0;
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: all .3s;
  transform: translateX(-50%);
}
.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }
.main-nav a.active { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: 4px;
}

/* --- HERO --- */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(232,192,80,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  margin-bottom: 1.2rem;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text);
  font-family: var(--serif);
  font-style: italic;
}

/* --- SEZIONI E CARDS --- */
.section { padding: 4rem 0; }
.section-narrow { max-width: 820px; margin: 0 auto; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem auto;
  max-width: 600px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.divider-icon {
  color: var(--gold);
  font-size: 1.2rem;
  transform: rotate(45deg);
  display: inline-block;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* --- IMMAGINI --- */
.fig {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}
.fig img {
  width: 100%;
  height: auto;
  display: block;
}
.fig figcaption {
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-mute);
  font-style: italic;
  text-align: center;
  background: var(--bg-night);
  border-top: 1px solid var(--line);
}
.fig-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}
.fig-row .fig { margin: 0; }

/* --- TABELLE / DATI --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--mono);
  font-size: 0.92rem;
}
.data-table th,
.data-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.data-table td:last-child { color: var(--ivory); }

/* --- BLOCCO STATS --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.stat-value {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--gold);
  display: block;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 0.3rem;
  display: block;
}

/* --- PULL QUOTE --- */
.pull-quote {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--ivory);
  border-left: 3px solid var(--gold);
  padding: 0.5rem 1.5rem;
  margin: 2rem 0;
}

/* --- BOX INFO / CALLOUT --- */
.callout {
  background: linear-gradient(135deg, rgba(232,192,80,0.07), rgba(232,192,80,0.02));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
}
.callout h3 {
  color: var(--gold);
  margin-bottom: 0.6rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

/* --- IFRAME WRAPPER METEO --- */
.iframe-wrap {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.iframe-wrap iframe {
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.iframe-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: var(--bg-night);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-mute);
  font-family: var(--mono);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-soft);
}
.refresh-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* --- LISTA SEMPLICE --- */
.feature-list {
  list-style: none;
  padding: 0;
}
.feature-list li {
  padding: 0.6rem 0 0.6rem 1.8rem;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.feature-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.9rem;
  top: 0.6rem;
}
.feature-list li:last-child { border-bottom: none; }

/* --- FOOTER --- */
.site-footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  background: rgba(5,5,16,0.6);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-block h4 {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
  font-family: var(--sans);
  font-weight: 600;
}
.footer-block p,
.footer-block a {
  font-size: 0.88rem;
  color: var(--text-mute);
  border: none;
}
.footer-block a:hover { color: var(--gold); }
.footer-coords {
  font-family: var(--mono);
  color: var(--gold-soft);
  font-size: 0.85rem;
}
.footer-bottom {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-night);
    border-bottom: 1px solid var(--line);
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .main-nav a:last-child { border-bottom: none; }
  .main-nav a::after { display: none; }
  .brand img { height: 44px; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: 0.62rem; }
  .hero { padding: 3rem 0 2rem; }
  .section { padding: 2.5rem 0; }
}

/* --- UTILITY --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
