/* buenaventura.it — stile minimalista provvisorio
   Da personalizzare quando la struttura è validata. */

:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --accent: #b8451f;
  --muted: #666;
  --border: #ddd;
  --max-width: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.5rem;
  margin: 0;
}

.site-title a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}

.site-logo {
  height: 50px;
  width: auto;
  display: block;
}

.home-photo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.gallery-nav {
  background: #f5f3ed;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.8;
}

.gallery-nav a {
  display: inline-block;
  margin: 0.1rem 0.4rem 0.1rem 0;
  padding: 0.2rem 0.5rem;
  background: white;
  border-radius: 3px;
  text-decoration: none;
  color: var(--accent);
}

.gallery-nav a:hover { background: var(--accent); color: white; }

.gallery-section {
  margin: 2.5rem 0;
}

.gallery-section h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.gallery-section .count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: normal;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.gallery-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 3px;
  background: #eee;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.gallery-grid a:hover img {
  transform: scale(1.05);
}

/* Per la rassegna stampa: thumbnails più grandi e con aspect-ratio naturale,
   così l'intero articolo è leggibile senza crop */
.rassegna-stampa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
  margin: 0.5rem 0;
}
.rassegna-stampa-grid a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: #f4f4f4;
  border: 1px solid #ddd;
}
.rassegna-stampa-grid img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s;
}
.rassegna-stampa-grid a:hover img {
  transform: scale(1.02);
}

/* Pagina foto singola */
.photo-page { max-width: 1200px; margin: 0 auto; }
.photo-breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; }
.photo-breadcrumb a { color: var(--muted); }
.photo-breadcrumb small { color: #999; margin-left: 0.5rem; }

.photo-nav-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.photo-nav { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; min-height: 80px; border-radius: 6px; background: #f4f4f4; color: #333; text-decoration: none; transition: background 0.15s, color 0.15s; user-select: none; }
.photo-nav:hover { background: var(--accent, #06c); color: white; }
.photo-nav-disabled { background: transparent; color: #ddd; cursor: default; }
.photo-nav-arrow { font-size: 2.5rem; line-height: 1; font-weight: 300; }

.photo-figure { margin: 0; flex-grow: 1; min-width: 0; }
.photo-figure a { display: block; }
.photo-figure img { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 4px; background: #f4f4f4; }
.photo-figure figcaption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--muted); }
.photo-figure figcaption code { background: #f4f4f4; padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.85rem; }
.photo-description { margin: 0.5rem 0; font-size: 1rem; color: var(--color, #333); }
.photo-anecdote { margin: 0.5rem 0; padding: 0.6rem 1rem; border-left: 3px solid var(--accent, #06c); background: #fafafa; font-style: italic; color: #444; border-radius: 0 4px 4px 0; }
.photo-meta-line { margin: 0.2rem 0; }

@media (max-width: 600px) {
  .photo-nav { width: 36px; min-height: 60px; }
  .photo-nav-arrow { font-size: 2rem; }
}

/* Share buttons (foto-eventi e altre pagine) */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; padding: 0.8rem 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; margin: 1rem 0; }
.share-label { font-weight: 600; color: var(--muted); margin-right: 0.3rem; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f4f4f4; color: #444; text-decoration: none; transition: background 0.15s, color 0.15s; }
.share-btn:hover { background: var(--accent, #06c); color: white; }
.share-icon { width: 18px; height: 18px; }

nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover { color: var(--accent); }

main {
  min-height: 60vh;
  padding-bottom: 4rem;
}

article, section {
  margin-bottom: 3rem;
}

h1 { font-size: 2rem; margin-top: 0; line-height: 1.2; }
h2 { font-size: 1.4rem; margin-top: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

p { margin: 1rem 0; }

a { color: var(--accent); }

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  font-style: italic;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

ul.page-list {
  list-style: none;
  padding: 0;
}

ul.page-list li {
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

ul.page-list a {
  color: var(--fg);
  text-decoration: none;
}

ul.page-list a:hover { color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}

th { background: #f0eee8; }

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.disclaimer {
  background: #fff8e1;
  border-left: 4px solid #f59e0b;
  padding: 0.7rem 1rem;
  margin: 1rem 0 2rem 0;
  border-radius: 4px;
  font-size: 0.93rem;
}

.disclaimer p { margin: 0; }

/* Language switcher combo (header partial + opzionale via {{< lang >}}) */
.lang-switcher { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; padding: 0; background: transparent; font-size: 0.95rem; vertical-align: middle; }
.lang-switcher label { font-size: 1rem; line-height: 1; }
.lang-switcher select { background: white; border: 1px solid var(--border); border-radius: 3px; padding: 0.2rem 0.4rem; font: inherit; font-size: 0.9rem; color: var(--fg); cursor: pointer; max-width: 14em; }
.lang-switcher select:hover { border-color: var(--accent); }
.lang-switcher select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Adattamenti header: stacca dal menu, non andare a capo */
header nav .lang-switcher { margin-left: 1rem; }
@media (max-width: 600px) {
  header nav .lang-switcher { margin: 0.5rem 0 0 0; display: flex; }
  .lang-switcher select { max-width: 100%; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  header .container { flex-direction: column; align-items: flex-start; }
  nav { margin-top: 0.5rem; }
  nav a { margin-left: 0; margin-right: 1rem; }
}
