/* Samuel's Diary — modern site stylesheet */

:root {
  --cream: #fbf3ec;
  --cream-2: #f5e9df;
  --paper: #fffdfb;
  --ink: #3b322c;
  --ink-soft: #6b5d54;
  --ink-faint: #9a8c81;
  --rose: #c4685a;
  --rose-dark: #a04c3f;
  --rose-light: #f3d9cf;
  --lavender: #8c7aa6;
  --lavender-light: #ece5f4;
  --border: #ead9cc;
  --shadow: 0 2px 10px rgba(59, 50, 44, 0.08);
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #241f1c;
    --cream-2: #2b2521;
    --paper: #2f2925;
    --ink: #f1e9e2;
    --ink-soft: #cabdb2;
    --ink-faint: #8d8078;
    --rose: #e2917f;
    --rose-dark: #f0ab9c;
    --rose-light: #4a352f;
    --lavender: #b3a2d1;
    --lavender-light: #362f47;
    --border: #453a33;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rose-dark); text-decoration-color: var(--rose-light); }
a:hover { color: var(--rose); }

h1, h2, h3 { font-family: var(--serif); font-weight: normal; color: var(--ink); line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- classic-site banner ---------- */
.classic-banner {
  background: var(--lavender-light);
  color: var(--ink);
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.classic-banner a {
  font-weight: 600;
  color: var(--lavender);
  margin-left: 4px;
}
.classic-banner a:hover { color: var(--rose); }

/* ---------- header / nav ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--rose-dark); }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

nav.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
nav.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  white-space: nowrap;
}
nav.main-nav a:hover { background: var(--cream-2); color: var(--ink); }
nav.main-nav a.active { background: var(--rose-light); color: var(--rose-dark); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 1.1rem;
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    box-shadow: var(--shadow);
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { padding: 12px 8px; border-radius: 8px; }
  .site-header-inner { position: relative; }
}

/* ---------- hero / page header ---------- */
.page-hero {
  padding: 40px 0 24px;
  text-align: center;
}
.page-hero p.lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 620px; margin: 10px auto 0; }

/* ---------- content blocks ---------- */
main { padding-bottom: 60px; }

.prose { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.prose p { margin: 0 0 1.1em; white-space: pre-line; }
.prose p.lead-bold { font-weight: 600; font-size: 1.05rem; }
.prose figure { margin: 2em 0; }
.prose figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.prose figcaption {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 10px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* ---------- date-anchor list (diary jump nav) ---------- */
.jumpnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}
.jumpnav a {
  display: inline-block;
  background: var(--cream-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
}
.jumpnav a:hover { background: var(--rose-light); color: var(--rose-dark); }

.diary-entry { margin-bottom: 2.6em; }
.diary-date {
  font-family: var(--serif);
  color: var(--rose-dark);
  border-bottom: 2px solid var(--rose-light);
  padding-bottom: 6px;
  margin-bottom: 0.7em;
  scroll-margin-top: 90px;
}
.diary-caption {
  font-weight: 600;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- week pager ---------- */
.week-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--border);
}
.week-pager a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.week-pager a:hover { color: var(--rose-dark); }
.week-pager .next { text-align: right; }

/* ---------- week grid (diary landing) ---------- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 32px;
  padding: 0 20px;
}
.week-grid a {
  display: block;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  box-shadow: var(--shadow);
}
.week-grid a:hover { border-color: var(--rose); color: var(--rose-dark); }

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.gallery-grid button {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--paper);
  aspect-ratio: 4 / 3;
}
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
.gallery-grid button:hover { outline: 2px solid var(--rose); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 14, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  flex-direction: column;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(90vw, 900px);
  max-height: 72vh;
  border-radius: 8px;
  margin: 0 auto;
}
.lightbox figcaption {
  color: #fff;
  text-align: center;
  margin-top: 14px;
  font-style: italic;
}
.lightbox-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 10px;
}
.lightbox-controls button {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-controls button:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* ---------- messages ---------- */
.message-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lavender);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.message-card:nth-child(3n+2) { border-left-color: var(--rose); }
.message-card:nth-child(3n) { border-left-color: var(--ink-faint); }
.message-card p { margin: 0; white-space: pre-line; }
.message-photo { text-align: center; margin: 32px 0; }
.message-photo img { border-radius: var(--radius); box-shadow: var(--shadow); display: inline-block; }

/* ---------- tribute ---------- */
.tribute-cover {
  text-align: center;
  margin: 0 auto 32px;
}
.tribute-cover img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 14px;
}
.hymn {
  background: var(--cream-2);
  border-radius: var(--radius);
  padding: 20px 26px;
  margin: 1.4em 0;
}
.hymn p { white-space: pre-line; margin: 0 0 1em; }
.hymn p:last-child { margin-bottom: 0; }
.order-of-service ol {
  padding-left: 1.2em;
}
.order-of-service li { margin-bottom: 0.5em; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 20px 44px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer a { color: var(--ink-soft); }
.site-footer .ribbon { width: 60px; margin: 0 auto 12px; }
