/* ─────────────────────────────────────────────
   CSS Custom Properties
───────────────────────────────────────────── */
:root {
  --blush:       #F9EEF1;
  --rose-light:  #EFC8D2;
  --rose:        #D4899A;
  --rose-deep:   #B5637A;
  --cream:       #FDF8F5;
  --white:       #FFFFFF;
  --text:        #2A2020;
  --text-mid:    #6B5560;
  --text-light:  #9E8490;
  --border:      #ECDDE2;
  --shadow:      rgba(180, 100, 120, 0.08);
  --shadow-hover:rgba(180, 100, 120, 0.18);

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Playfair Display', Georgia, serif;

  --max-w: 1100px;
  --radius: 12px;
}

/* ─────────────────────────────────────────────
   Reset & Base
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rose-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────
   Layout
───────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

/* ─────────────────────────────────────────────
   Two-column layout (feed + TOC)
───────────────────────────────────────────── */
.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
  min-height: 100vh;
}

@media (max-width: 960px) {
  .site-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none !important; }
  .container   { padding: 0 24px; }
}

/* ─────────────────────────────────────────────
   TOC Sidebar
───────────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: 40px;
}

.toc-heading {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
}

.toc-post-title {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  margin: 18px 0 4px;
}
.toc-post-title:first-child { margin-top: 0; }
.toc-post-title:hover { color: var(--text); text-decoration: none; }

.toc-link {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-light);
  text-decoration: none;
  line-height: 1.5;
  padding: 3px 0 3px 10px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.toc-link:hover       { color: var(--text-mid); text-decoration: none; }
.toc-link--active     { color: var(--rose-deep); border-left-color: var(--rose); }


/* Decorative petals — fixed page-level background */
.petal {
  position: fixed;
  border-radius: 50% 0 50% 0;
  opacity: 0.1;
  background: var(--rose);
  pointer-events: none;
  z-index: 0;
}
.petal-1 { width: 300px; height: 300px; top: -80px;  left: -80px;  transform: rotate(30deg); }
.petal-2 { width: 200px; height: 200px; bottom: -50px; right: 40px; transform: rotate(-20deg); }
.petal-3 { width: 130px; height: 130px; top: 20px;   right: -30px; transform: rotate(55deg); }

.header-inner { position: relative; z-index: 1; }

.site-eyebrow {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 8px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.site-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--rose-deep);
  margin-bottom: 28px;
}

.site-tagline {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.93rem;
  color: var(--text-mid);
  line-height: 1.9;
  max-width: 560px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Main
───────────────────────────────────────────── */
.site-main {
  padding: 56px 0 80px;
  min-height: 50vh;
}

/* ─────────────────────────────────────────────
   States: Loading / Error / Empty
───────────────────────────────────────────── */
.hidden { display: none !important; }

.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-mid);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--rose-light);
  border-top-color: var(--rose-deep);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-icon,
.empty-icon {
  font-size: 2.4rem;
  color: var(--rose-light);
  margin-bottom: 16px;
}

.error-state h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 8px;
}

.error-state code {
  background: var(--blush);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.error-hint {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ─────────────────────────────────────────────
   Featured Video
───────────────────────────────────────────── */
.video-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 56px;
}

.video-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.video-divider-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 0 12px;
  color: var(--text-light);
  transition: color 0.2s;
}

.video-divider-icon:hover {
  color: var(--rose-deep);
  text-decoration: none;
}

.featured-video {
  margin-top: 28px;
}

.featured-video-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.featured-video video {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 4px 24px var(--shadow);
  background: #000;
}

/* ─────────────────────────────────────────────
   Blog Feed
───────────────────────────────────────────── */
.blog-feed {
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────────
   Post (flat document style)
───────────────────────────────────────────── */
.post {
  padding: 56px 0 0;
  border-bottom: 1px solid var(--border);
}

.post:first-child { padding-top: 0; }
.post:last-child  { border-bottom: none; }

.post-header {
  margin-bottom: 20px;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.post-subtitle {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.35;
  margin-top: 12px;
  margin-bottom: 32px;
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  max-width: 40%;
}

.post-author {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
}

.post-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-light);
}

.post-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin: 20px 0 32px;
  padding: 16px 20px;
  border-left: 3px solid var(--rose);
  background: var(--blush);
  border-radius: 0 6px 6px 0;
}

.post-body {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text);
}

.post-body p            { margin-bottom: 1.4em; }
.post-body p.doc-spacer,
.post-page-body p.doc-spacer { margin-bottom: 0; height: 0.8em; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h2           { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; color: var(--text); margin: 2em 0 0.5em; padding-top: 1.6em; border-top: 1px solid var(--border); }
.post-body h3           { font-family: var(--font-serif); font-style: italic; font-size: 1rem; color: var(--text-light); margin: 1.4em 0 0.4em; }
.post-body h4           { font-family: var(--font-serif); font-style: italic; font-size: 0.97rem; color: var(--text-mid); margin: 1.2em 0 3em; }
.post-body ul,
.post-body ol           { margin: 0 0 1.4em 1.6em; }
.post-body li           { margin-bottom: 0.4em; line-height: 1.75; }
.post-body a            { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 2px; }
.post-body strong       { font-weight: 700; }
.post-body em           { font-style: italic; }
.post-body img          { float: left; max-width: 45%; height: auto; border-radius: 4px; margin: 0.2em 1.8em 1.2em 0; display: block; }
.post-body::after       { content: ''; display: table; clear: both; }

.post-body .doc-subtitle,
.post-page-body .doc-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 1.6em;
}

.post-footer {
  margin-top: 28px;
}

.post-comments {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rose-deep);
  text-decoration: none;
}

.post-comments:hover      { text-decoration: underline; }
.post-comments--empty     { color: var(--text-light); font-weight: 400; }


/* ─────────────────────────────────────────────
   Site Footer
───────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(to right, #F2D0DA, #F9EEF1);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-dedication {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-sub {
  font-size: 0.88rem;
  color: var(--text-mid);
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 32px 20px 28px; }
  .post { padding: 40px 0; }
}

/* ─────────────────────────────────────────────
   Focus / A11y
───────────────────────────────────────────── */

/* ─────────────────────────────────────────────
   Rich content inside post body
───────────────────────────────────────────── */
.post-full-body h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2em 0 0.5em;
}

.post-full-body h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-mid);
  margin: 1.5em 0 0.4em;
}

.post-full-body ul,
.post-full-body ol {
  margin: 0 0 1.4em 1.6em;
}

.post-full-body li {
  margin-bottom: 0.4em;
  line-height: 1.75;
}

.post-full-body a {
  color: var(--rose-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-full-body strong { font-weight: 700; }
.post-full-body em     { font-style: italic; }

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95rem;
}

.doc-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  vertical-align: top;
}

.doc-table tr:nth-child(even) td {
  background: var(--blush);
}

/* ─────────────────────────────────────────────
   Minimal header (post page)
───────────────────────────────────────────── */
.site-header--minimal {
  padding: 32px 24px 28px;
}

.site-header--minimal .site-title a {
  color: inherit;
  text-decoration: none;
}

.site-back {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 16px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-back:hover { opacity: 0.7; text-decoration: none; }

/* ─────────────────────────────────────────────
   Post page
───────────────────────────────────────────── */
.post-page {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 52px 56px 48px;
  box-shadow: 0 2px 16px var(--shadow);
}

.post-page-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.post-page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.post-page-subtitle {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.35;
  margin-top: 10px;
  margin-bottom: 32px;
}

.post-page-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  max-width: 40%;
}

.post-page-author {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
}

.post-page-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-light);
}

.post-page-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.post-page-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}

.post-page-body p      { margin-bottom: 1.4em; }
.post-page-body p:last-child { margin-bottom: 0; }
.post-page-body h2     { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 2em 0 0.5em; padding-top: 1.6em; border-top: 1px solid var(--border); }
.post-page-body h3     { font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; color: var(--text-mid); margin: 1.5em 0 0.4em; }
.post-page-body h4     { font-family: var(--font-serif); font-style: italic; font-size: 0.97rem; color: var(--text-mid); margin: 1.2em 0 0.4em; }
.post-page-body ul,
.post-page-body ol     { margin: 0 0 1.4em 1.6em; }
.post-page-body li     { margin-bottom: 0.4em; line-height: 1.75; }
.post-page-body a      { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 2px; }
.post-page-body strong { font-weight: 700; }
.post-page-body em     { font-style: italic; }

.post-page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
}

.post-footer-heart { color: var(--rose-light); font-size: 1.3rem; letter-spacing: 0.3em; }

.post-back-link {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rose-deep);
  text-decoration: none;
  transition: opacity 0.2s;
}
.post-back-link:hover { opacity: 0.7; text-decoration: none; }

@media (max-width: 600px) {
  .post-page { padding: 32px 24px; }
}

/* ─────────────────────────────────────────────
   Comments
───────────────────────────────────────────── */
.comments {
  margin-top: 40px;
}

.comments-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
}

.comments-empty {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 28px;
}

.comment {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.comment:first-child { border-top: 1px solid var(--border); }

.comment-meta {
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rose-deep);
}

.comment-date {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-left: 10px;
}

.comment-message {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--text);
}

.comment-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--blush);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.97rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--rose);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--text-light);
}

.comment-submit {
  align-self: flex-start;
  background: var(--rose-deep);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 28px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.comment-submit:hover    { background: var(--rose); }
.comment-submit:disabled { opacity: 0.6; cursor: not-allowed; }
