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

:root {
  --text: #2c2416;
  --text-light: #5a4a38;
  --bg: #faf8f4;
  --accent: #8b7355;
  --rule: #d4c9b8;
  --diary-bg: #f5f1ea;
  --card-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'EB Garamond', 'Georgia', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}

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

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Site header / branding ── */
.site-header {
  text-align: center;
  margin-bottom: 3rem;
}

.site-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.site-title a {
  color: inherit;
  border-bottom: none;
}

.site-tagline {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

/* ── Post header (on individual posts) ── */
.post-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.post-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.post-subtitle {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

/* ── Navigation ── */
.nav-back {
  display: inline-block;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.nav-back::before {
  content: '\2190\00a0';
}

/* ── Post cards (home page) ── */
.post-list {
  margin-top: 2rem;
}

.post-card {
  display: block;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
  border-bottom: 1px solid var(--rule);
}

.post-card:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.post-card-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}

.post-card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.post-card-teaser {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ── Year headings ── */
h2 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--accent);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.04em;
}

/* ── Narrative paragraphs ── */
.narrative {
  margin-bottom: 1.25rem;
  text-align: justify;
  text-indent: 1.5em;
}

.narrative.first {
  text-indent: 0;
}

.narrative.first::first-letter {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 3.2em;
  float: left;
  line-height: 0.8;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--accent);
}

/* ── Diary entries ── */
.diary {
  font-style: italic;
  background: var(--diary-bg);
  border-left: 3px solid var(--rule);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

.diary .date {
  font-weight: 500;
  display: block;
  margin-bottom: 0.4rem;
  font-style: italic;
  color: var(--accent);
}

.diary p {
  margin-bottom: 0.75rem;
  text-align: justify;
}

.diary p:last-child { margin-bottom: 0; }

.diary .underline { text-decoration: underline; }

/* ── Photographs ── */
figure {
  margin: 2rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

figure.portrait img {
  max-width: 65%;
}

figure.letter img {
  max-width: 75%;
}

figcaption {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.6rem;
  letter-spacing: 0.02em;
}

/* ── Sonnets / poems ── */
.sonnet-section {
  margin: 2.5rem 0;
  text-align: center;
}

.sonnet-section h3 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.poem {
  display: inline-block;
  text-align: left;
  line-height: 1.9;
  font-size: 1rem;
}

.poem .line {
  display: block;
}

.poem .stanza-break {
  display: block;
  height: 0.75em;
}

/* ── Short verse ── */
.verse {
  text-align: center;
  margin: 1.5rem 0;
  font-style: italic;
}

.verse .line { display: block; }

/* ── Closing ── */
.closing {
  margin-top: 2rem;
  text-align: justify;
}

/* ── Decorative separator ── */
.separator {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--rule);
  font-size: 1.4rem;
  letter-spacing: 0.5em;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  letter-spacing: 0.03em;
}

/* ── Password gate ── */
.gate-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-box {
  text-align: center;
  max-width: 380px;
  padding: 2.5rem 2rem;
}

.gate-box .site-title {
  margin-bottom: 0.4rem;
}

.gate-box .site-tagline {
  margin-bottom: 2rem;
}

.gate-box label {
  display: block;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.gate-input {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  font-family: 'EB Garamond', 'Georgia', serif;
  font-size: 1rem;
  color: var(--text);
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.gate-input:focus {
  border-color: var(--accent);
}

.gate-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 2rem;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.gate-btn:hover {
  background: var(--text);
}

.gate-error {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #b35a5a;
  min-height: 1.4em;
}

/* ── Audio play buttons ── */
.audio-wrap {
  position: relative;
}

.audio-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--rule);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  padding: 0;
  opacity: 0.7;
}

.audio-btn:hover {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.1);
}

.audio-btn::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent white;
  margin-left: 2px;
}

.audio-btn.playing::before {
  border-width: 0;
  width: 8px;
  height: 10px;
  border-left: 2.5px solid white;
  border-right: 2.5px solid white;
  margin-left: 0;
}

.sonnet-section.audio-wrap {
  position: relative;
}

.sonnet-section.audio-wrap .audio-btn {
  top: 0.2rem;
  right: 0.2rem;
}

.verse.audio-wrap {
  position: relative;
  display: inline-block;
}

/* ── Print ── */
@media print {
  body { background: white; }
  .page { max-width: 100%; padding: 1cm; }
  figure img { box-shadow: none; border: 1px solid #ddd; }
  .diary { background: #f9f7f3; }
  .nav-back { display: none; }
  .audio-btn, audio { display: none; }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .page { padding: 2rem 1rem 3rem; }
  .site-title, .post-title { font-size: 2.2rem; }
  figure.portrait img { max-width: 85%; }
  figure.letter img { max-width: 95%; }
  .post-card { padding: 1.2rem; }
}
