/* de Mornay Davies — Family History Archive
   Shared stylesheet for the static heritage pages.
   Matches the redesigned homepage. */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --background: hsl(41, 38%, 94%);
  --foreground: hsl(25, 30%, 14%);
  --card: hsl(40, 45%, 97%);
  --primary: hsl(350, 55%, 28%);
  --primary-foreground: hsl(41, 50%, 96%);
  --secondary: hsl(35, 30%, 86%);
  --muted: hsl(38, 25%, 88%);
  --muted-foreground: hsl(25, 15%, 38%);
  --accent: hsl(38, 60%, 48%);
  --border: hsl(35, 25%, 78%);
  --shadow-vintage: 0 10px 40px -10px hsl(25 30% 14% / 0.25), 0 2px 6px hsl(25 30% 14% / 0.08);
  --shadow-frame: 0 0 0 1px hsl(35 25% 65%), 0 8px 24px -8px hsl(25 30% 14% / 0.3);
  --max: 760px;
  --max-wide: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--foreground);
  background: var(--background);
  background-image:
    radial-gradient(at 20% 10%, hsl(38 35% 88% / 0.6) 0, transparent 50%),
    radial-gradient(at 80% 90%, hsl(35 30% 86% / 0.5) 0, transparent 50%);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary); color: var(--primary-foreground); }

h1, h2, h3, h4, .serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-top: 2.5rem; }
h3 { font-size: 1.35rem; margin-top: 2rem; color: var(--primary); }

p { margin: 0 0 1.1em; }

a { color: var(--primary); text-decoration: none; border-bottom: 1px solid hsl(350 55% 28% / 0.25); transition: color .2s, border-color .2s; }
a:hover { color: var(--accent); border-color: var(--accent); }

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

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: hsl(41 38% 94% / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(35 25% 78% / 0.6);
}
.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header__brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  border: 0;
}
.site-header__brand i { font-style: italic; }
.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.9rem;
}
.site-header__nav a {
  color: hsl(25 30% 14% / 0.8);
  border: 0;
}
.site-header__nav a:hover { color: var(--primary); }
.site-header__cta {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 0;
}
.site-header__cta:hover { background: hsl(350 55% 24%); color: var(--primary-foreground); }
@media (max-width: 700px) {
  .site-header__nav { display: none; }
}

/* ---------- Page hero ---------- */
.page-hero {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}
.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.page-hero__eyebrow::before,
.page-hero__eyebrow::after {
  content: '';
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, hsl(38 60% 48% / 0.6), transparent);
}
.page-hero__title {
  margin: 0 auto .75rem;
  max-width: 24ch;
}
.page-hero__title em { color: var(--primary); font-style: italic; }
.page-hero__lede {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--muted-foreground);
  font-size: 1.1rem;
}

/* ---------- Article body ---------- */
.page-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.page-body--wide { max-width: var(--max-wide); }

.page-body p { color: hsl(25 25% 22%); }
.page-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: hsl(40 45% 97% / 0.6);
  font-style: italic;
  color: hsl(25 25% 28%);
  border-radius: 0 6px 6px 0;
}

/* Diary entries */
.diary-entry {
  margin: 0 0 1.75rem;
  padding: 0;
}
.diary-entry__date {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .35rem;
  display: block;
}
.diary-entry__text {
  margin: 0;
  color: hsl(25 25% 22%);
}
.diary-entry__text q,
.diary-entry__text .quote {
  font-style: italic;
  color: hsl(25 25% 18%);
}

/* Notes entries (Doolie) */
.note {
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid hsl(35 25% 78% / 0.7);
}
.note__name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .25rem;
}
.note__body { margin: 0; color: hsl(25 25% 22%); }
.note__editor {
  display: block;
  margin-top: .5rem;
  font-size: 0.9rem;
  color: hsl(140 40% 28%);
  font-style: italic;
}
.note__editor--gold { color: hsl(38 60% 38%); }
.note__sub { padding-left: 1.5rem; border-left-color: hsl(38 60% 48% / 0.4); }

.figure-right {
  float: right;
  width: 220px;
  margin: .5rem 0 1rem 1.5rem;
  padding: .5rem;
  background: var(--card);
  border-radius: 4px;
  box-shadow: var(--shadow-vintage);
}
.figure-right img { width: 100%; height: auto; border-radius: 2px; }
.figure-right figcaption {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: .5rem;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .figure-right { float: none; width: auto; margin: 1rem 0; }
}

/* ---------- Image gallery ---------- */
.gallery-grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
.gallery-grid a {
  display: block;
  border: 0;
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-vintage);
  transition: transform .3s ease, box-shadow .3s ease;
  aspect-ratio: 1 / 1;
}
.gallery-grid a:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-frame);
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-meta {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: var(--primary-foreground);
  margin-top: 4rem;
}
.site-footer__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.site-footer h2 {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--primary-foreground);
  margin: 0 0 .25rem;
}
.site-footer p, .site-footer li { color: hsl(41 50% 96% / 0.8); font-size: 0.9rem; }
.site-footer h3 {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .75rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin: 0 0 .5rem; }
.site-footer a { color: hsl(41 50% 96% / 0.85); border: 0; }
.site-footer a:hover { color: var(--accent); }
.site-footer__bottom {
  border-top: 1px solid hsl(41 50% 96% / 0.1);
  padding: 1.25rem 1.5rem;
  font-size: 0.75rem;
  color: hsl(41 50% 96% / 0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  max-width: var(--max-wide);
  margin: 0 auto;
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer { display: none; }
  body { background: white; }
  a { color: black; border: 0; }
}
