/* ---------- Shared: page chrome ---------- */
.writing-page,
.post-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: #100d0b;
}

.writing-page nav,
.post-page nav {
  position: relative;
  z-index: 10;
}

/* ---------- Writing index ---------- */
.writing-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 18vh 2.5rem 6rem;
  width: 100%;
}

.writing-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5rem;
}

.writing-label {
  font-family: 'Syncopate', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--earth-label);
}

.rss-link {
  font-family: 'Syncopate', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--earth-label);
  text-decoration: none;
  border-bottom: 1px solid var(--earth-line);
  padding-bottom: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, border-color 0.2s;
}

.rss-link:hover {
  color: var(--earth-strong);
  border-color: var(--earth-soft);
}

/* Post entry row in index */
.post-entry {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid rgba(240, 237, 232, 0.08);
}

.post-number {
  font-family: 'Syncopate', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--earth-label);
  padding-top: 0.5rem;
  min-width: 2rem;
}

.post-body {
  flex: 1;
}

.post-date {
  font-family: 'Syncopate', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--earth-label);
  margin-bottom: 0.75rem;
}

.post-title {
  display: block;
  font-family: 'Cardo', serif;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 400;
  color: #f0ede8;
  text-decoration: none;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.post-title:hover {
  color: rgba(240, 237, 232, 0.55);
}

.post-dek {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(240, 237, 232, 0.4);
}

.writing-empty {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(240, 237, 232, 0.35);
  padding: 3rem 0;
  border-top: 1px solid rgba(240, 237, 232, 0.08);
}

/* ---------- Individual post page ---------- */
.post-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 14vh 2.5rem 6rem;
  width: 100%;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Syncopate', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--earth-label);
  text-decoration: none;
  margin-bottom: 4rem;
  transition: color 0.2s;
}

.post-back:hover {
  color: var(--earth-strong);
}

.post-header {
  margin-bottom: 3.5rem;
}

.post-header .post-date {
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: 'Cardo', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: #f0ede8;
  letter-spacing: -0.01em;
}

article.post-prose {
  font-family: 'Cardo', serif;
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(240, 237, 232, 0.85);
}

article.post-prose > * + * {
  margin-top: 1.4rem;
}

article.post-prose h2 {
  font-family: 'Cardo', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f0ede8;
  margin-top: 2.8rem;
  line-height: 1.25;
}

article.post-prose h3 {
  font-family: 'Cardo', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f0ede8;
  margin-top: 2.2rem;
}

article.post-prose a {
  color: #f0ede8;
  text-decoration: underline;
  text-decoration-color: var(--earth-soft);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

article.post-prose a:hover {
  text-decoration-color: var(--earth-strong);
}

article.post-prose em {
  font-style: italic;
}

article.post-prose strong {
  font-weight: 700;
  color: #f0ede8;
}

article.post-prose blockquote {
  border-left: 2px solid var(--earth-soft);
  padding-left: 1.25rem;
  color: rgba(240, 237, 232, 0.65);
  font-style: italic;
}

article.post-prose ul,
article.post-prose ol {
  padding-left: 1.5rem;
}

article.post-prose li + li {
  margin-top: 0.5rem;
}

article.post-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(240, 237, 232, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

article.post-prose pre {
  background: rgba(240, 237, 232, 0.05);
  border: 1px solid rgba(240, 237, 232, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}

article.post-prose pre code {
  background: none;
  padding: 0;
}

article.post-prose hr {
  border: none;
  border-top: 1px solid var(--earth-line);
  margin: 2.5rem 0;
}

article.post-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-hero {
  margin: 0 0 2.5rem;
}

.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

article.post-prose figure {
  margin: 2rem 0;
}

article.post-prose figure.figure-small {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

article.post-prose figure.figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-start;
}

article.post-prose figure.figure-row img,
article.post-prose figure.figure-row video {
  flex: 1;
  min-width: 0;
}

article.post-prose figure.figure-row figcaption {
  flex-basis: 100%;
}

article.post-prose figure video,
article.post-prose figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

article.post-prose figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: rgba(240, 237, 232, 0.55);
  text-align: center;
}

article.post-prose .post-note {
  margin: 1.75rem 0;
  padding: 0.9rem 1.15rem;
  border-left: 2px solid var(--earth-soft);
  background: rgba(240, 237, 232, 0.03);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  color: rgba(240, 237, 232, 0.72);
}

article.post-prose .post-note strong {
  font-style: normal;
}

article.post-prose .post-embed {
  position: relative;
  background: #f8f5f0;
  border: 1px solid rgba(240, 237, 232, 0.12);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

article.post-prose .post-embed::before {
  content: '';
  display: block;
  height: 36px;
  background: #2a2520;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

article.post-prose .post-embed::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
}

article.post-prose .post-embed iframe {
  display: block;
  width: 100%;
  height: 600px;
  border: none;
  background: #f8f5f0;
}

/* ---------- Media lightbox ---------- */
.media-zoomable {
  cursor: zoom-in;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.media-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.media-lightbox-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 92vw;
  max-height: 92vh;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
}

.media-lightbox-stage figcaption {
  font-family: 'Cardo', serif;
  font-size: 0.95rem;
  color: rgba(240, 237, 232, 0.7);
  text-align: center;
  max-width: 40rem;
}

.media-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(240, 237, 232, 0.1);
  color: #f0ede8;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.media-lightbox-close:hover {
  background: rgba(240, 237, 232, 0.22);
}
