/* === Custom styles per Sardegna 2026 v2 (cache-bust) === */
/* IMPORTANT: bump version comment to invalidate browser CSS cache */

/* Mappa My Maps responsive */
.map-responsive {
  position: relative;
  padding-bottom: 75%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.5em 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.map-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
@media (min-width: 768px) {
  .map-responsive { padding-bottom: 56.25%; }
}

/* Badge giornate */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  margin-right: 0.3em;
}
.badge-easy   { background: #d4edda; color: #155724; }
.badge-medium { background: #fff3cd; color: #856404; }
.badge-hard   { background: #f8d7da; color: #721c24; }
.badge-star   { background: #fef3c7; color: #92400e; }

[data-md-color-scheme="slate"] .badge-easy   { background: #1e4d2b; color: #a5d6a7; }
[data-md-color-scheme="slate"] .badge-medium { background: #5c4a1e; color: #ffd54f; }
[data-md-color-scheme="slate"] .badge-hard   { background: #5c1e25; color: #ef9a9a; }
[data-md-color-scheme="slate"] .badge-star   { background: #5c4119; color: #ffd54f; }

/* Tabelle riepilogative più leggibili */
.md-typeset table:not([class]) {
  font-size: 0.85em;
}
.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: white;
}

/* Hero della home */
.hero {
  background: linear-gradient(135deg, #00897b 0%, #ff7043 100%);
  color: white;
  padding: 2em 1.5em;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 2em;
}
.hero h1 { color: white; margin: 0 0 0.3em; font-size: 2.2em; }
.hero p { margin: 0.3em 0; font-size: 1.1em; opacity: 0.95; }

/* Quick links grid in home */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1em;
  margin: 1.5em 0;
}
.grid-cards .card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  padding: 1.2em;
  text-decoration: none;
  color: inherit !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.grid-cards .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  border-color: var(--md-primary-fg-color);
}
.grid-cards .card h3 { margin: 0 0 0.5em; color: var(--md-primary-fg-color); }
.grid-cards .card p  { margin: 0; font-size: 0.9em; opacity: 0.85; }

/* Box "carico giornata" sopra al titolo giorno */
.day-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0.5em 0 1.5em;
  font-size: 0.9em;
}
.day-meta span {
  background: var(--md-code-bg-color);
  padding: 0.3em 0.8em;
  border-radius: 8px;
}

/* Migliorare admonition per mobile */
@media (max-width: 600px) {
  .md-typeset .admonition,
  .md-typeset details {
    font-size: 0.85em;
  }
}

/* Tabelle scroll su mobile */
.md-typeset__scrollwrap {
  margin: 1em 0;
}

/* === Print styles per generazione PDF dei giorni === */
@media print {
  /* Nascondi navigazione, sidebar, footer */
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-source,
  .md-search,
  .md-skip,
  .md-nav,
  .md-top,
  nav,
  .md-content__button,
  details summary::after,
  .grid-cards { display: none !important; }

  /* Larghezza piena */
  .md-grid { max-width: 100% !important; }
  .md-main__inner { margin: 0 !important; }
  .md-content { margin: 0 !important; max-width: 100% !important; }
  .md-content__inner { padding: 1cm !important; }

  /* Apri tutti i details (collapsibles) */
  details { display: block !important; }
  details > summary { pointer-events: none; }

  /* Page-break friendly */
  h1, h2, h3 { page-break-after: avoid; }
  table, blockquote, .admonition { page-break-inside: avoid; }

  /* Colori più sobri per stampa */
  body { background: white !important; color: black !important; }
  a { color: #1a73e8 !important; text-decoration: underline; }
  a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  /* Non aggiungere URL accanto a link interni o ancore */
  a[href^="#"]::after,
  a[href^="/"]::after,
  a[href^="./"]::after,
  a[href^="../"]::after { content: ""; }
}
