/* ==========================================================
   Singing Desert — site stylesheet
   Palette: Desert Varnish. Colors and fonts are set once, in :root.
   ========================================================== */

:root {
  --bg:        #16191a;   /* page background */
  --surface:   #202527;   /* cards and panels */
  --line:      #3b4346;   /* hairlines and borders */
  --text:      #e3e1da;   /* main text */
  --muted:     #a8aba6;   /* places, credits, secondary text */
  --accent:    #b8a57e;   /* links */
  --accent-hover: #d3c3a0;
  --accent-dim:#8d7e5f;   /* card hover border */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --page-width: 1180px;
  --text-width: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

i, em { font-style: italic; }
sup { font-size: .7em; line-height: 0; }

/* ---------- Site header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);   /* scrolls away with the page instead of staying pinned on top */
}

.site-header .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo img { width: 200px; height: auto; }

.site-nav a {
  color: var(--muted);
  font-size: .95rem;
  letter-spacing: .02em;
}
.site-nav a + a { margin-left: 18px; }
.site-nav a:hover { color: var(--text); }

/* ---------- Main ---------- */

main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 20px 64px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: normal;
  line-height: 1.2;
  margin: 0;
}

/* ---------- Home page ---------- */

.hero {
  margin: 40px auto 56px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 8px;
}

.hero .tagline {
  color: var(--muted);
  margin: 0 auto 32px;
  max-width: var(--text-width);
}

.hero figure { margin: 0 auto; max-width: 900px; }
.hero img { width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.hero figcaption { color: var(--muted); margin-top: 12px; font-size: .95rem; }

/* Short thin divider under the top photo */
.rule {
  width: 160px;
  max-width: 40%;
  margin: 40px auto 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.rule-long { width: 280px; margin-top: 36px; }

.culture { margin-top: 56px; }

.culture-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 24px;
}

.culture-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--accent); }
.culture-head .count { color: var(--muted); font-size: .9rem; white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  color: var(--text);
  transition: border-color .2s, transform .2s;
}
.card:hover { color: var(--text); text-decoration: none; border-color: var(--accent-dim); transform: translateY(-2px); }

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg);
}

.card .card-text { padding: 12px 14px 14px; }
.card h3 { font-size: 1.15rem; }
.card .meta { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* ---------- Gallery pages ---------- */

.crumbs {
  font-size: .9rem;
  color: var(--muted);
  margin: 28px 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

.page-head { margin: 10px 0 40px; }
.page-head h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.page-head .place { color: var(--muted); margin: 8px 0 0; }

.intro {
  max-width: var(--text-width);
  font-size: 1.15rem;
  margin: 0 0 40px;
}

.photo {
  margin: 0 auto 64px;
  max-width: 980px;
  width: fit-content;   /* box shrinks to the photo's width */
}

.photo a { display: block; }

.photo img {
  margin: 0 auto;
  max-height: 85vh;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.photo figcaption {
  margin: 16px auto 0;
  text-align: center;
  contain: inline-size; /* caption follows the photo's width instead of widening the box */
}

/* One-line captions sit centered; longer ones wrap with a straight left edge */
.photo figcaption p {
  width: fit-content;
  margin: 0 auto 8px;
  text-align: left;
}
.photo .place { color: var(--muted); font-size: .92rem; }
.photo .hint  { color: var(--muted); font-size: .85rem; }

.notes {
  max-width: var(--text-width);
  margin: 0 auto 56px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: .92rem;
  color: var(--muted);
}
.notes h2 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.notes ol { padding-left: 1.4em; margin: 0; }

/* ---------- About and other text pages ---------- */

.prose {
  max-width: var(--text-width);
  margin: 40px auto 0;
  text-align: left;
}
.prose h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin-bottom: 20px; }
.prose h2 { font-size: 1.4rem; margin: 36px 0 10px; color: var(--accent); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.muted { color: var(--muted); }

/* ---------- Previous / Next ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.pager a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}
.pager a:hover { color: var(--text); text-decoration: none; border-color: var(--accent-dim); }

.pager img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 3px;
  flex: none;
}

.pager .label { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pager .title { font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }

.pager .next { flex-direction: row-reverse; text-align: right; grid-column: 2; }

.back-home { text-align: center; margin-top: 28px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  padding: 24px 20px 40px;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .logo img { width: 160px; }
  .photo { margin-bottom: 48px; }
  .photo img { max-height: none; width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .pager img { width: 72px; height: 54px; }
}
