/* ============================================================
   A Case for Wisdom — Journal
   Listing (/) and single post (/post.html). Content-first:
   a single centred column, hairline rules, no cards, no images
   by default. Cormorant carries the headings; gold is absent.
   ============================================================ */

/* ============================================================
   1. JOURNAL LISTING — /
   ============================================================ */

.journal-page {
  max-width: var(--container-prose);
  margin-inline: auto;
  padding: var(--space-section-y) var(--space-section-x);
}

/* ---- Page header ---- */
.journal-header { margin-bottom: var(--space-6); }

.journal-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  color: var(--color-green);
  margin-bottom: var(--space-2);
}

.journal-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  max-width: var(--measure-prose);
}

/* ---- Filter tabs ---- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.filter-tab {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  cursor: pointer;
  transition: var(--transition-colors);
}
.filter-tab:hover { color: var(--color-green); }
.filter-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.filter-tab.is-active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}

/* ---- Search ---- */
.journal-search { margin-bottom: var(--space-8); position: relative; }

.journal-search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.journal-search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-6);
  transition: var(--transition-colors);
}
.journal-search-input::placeholder { color: var(--color-text-soft); }
.journal-search-input:focus { outline: none; border-bottom-color: var(--color-green); }

.journal-search-count {
  margin: var(--space-3) 0 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---- Article list ---- */
.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-rule);
}

.article-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.article-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  line-height: 1.25;
  color: var(--color-green);
  margin-bottom: var(--space-2);
  text-decoration: none;
}
a.article-title:hover,
a.article-title:focus-visible {
  color: var(--color-green);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.article-excerpt {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.article-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Lead article — first item only */
.article-item--lead .article-title { font-size: var(--text-3xl); }
.article-item--lead .article-thumb {
  flex-basis: 200px;
  width: 200px;
  height: auto;
  aspect-ratio: 4 / 5;
}

/* Compact variant — related posts under a single essay */
.article-item--compact { padding: var(--space-4) 0; }
.article-item--compact .article-title { font-size: var(--text-lg); margin-bottom: var(--space-1); }
.article-item--compact .article-excerpt { display: none; }

@media (max-width: 40rem) {
  .article-thumb { flex-basis: 56px; width: 56px; height: 56px; }
  .article-item--lead .article-thumb { flex-basis: 110px; width: 110px; }
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-10) 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.pagination__link { color: var(--color-text-muted); }
.pagination__link:hover { color: var(--color-green); text-decoration: underline; text-underline-offset: 0.2em; }
.pagination__link[aria-disabled="true"],
.pagination__link.is-disabled { opacity: 0.35; pointer-events: none; }
.pagination__current { color: var(--color-green); }

/* ---- Empty / error states ---- */
.posts-empty {
  text-align: center;
  padding: var(--space-11) var(--space-4);
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}
.posts-empty__headline {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  color: var(--color-green);
  margin: 0;
}
.posts-empty__sub {
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   2. NEWSLETTER — shared by listing + single post
   ============================================================ */
.newsletter-section {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding: var(--space-10) var(--space-section-x);
  border-top: 1px solid var(--color-rule);
  text-align: center;
}
.newsletter-section__heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-regular);
  color: var(--color-green);
  margin: 0 0 var(--space-2);
}
.newsletter-section__sub {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-6);
}
.newsletter-section__form {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}
.newsletter-section__input {
  flex: 1 1 18rem;
  max-width: 22rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
  padding: var(--space-2) 0;
}
.newsletter-section__input::placeholder { color: var(--color-text-soft); }
.newsletter-section__input:focus { outline: none; border-bottom-color: var(--color-green); }
.newsletter-section__msg {
  margin: var(--space-5) 0 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-green);
  min-height: 1.2em;
}
.newsletter-section__msg.is-error { color: var(--color-error); }

/* ============================================================
   3. SINGLE POST — /post.html
   ============================================================ */
.post-page {
  max-width: var(--container-prose);
  margin-inline: auto;
  padding: var(--space-section-y) var(--space-section-x);
}

.post-loading {
  max-width: var(--container-prose);
  margin: 0 auto;
  padding: var(--space-section-y) var(--space-section-x);
}

.post-header {
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-rule);
  margin-bottom: var(--space-8);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.post-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-regular);
  line-height: 1.15;
  color: var(--color-green);
  margin: 0;
}

.post-excerpt {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  max-width: var(--measure-prose);
}

.post-cover {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-8);
}

.post-body { margin-top: var(--space-2); }

.post-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-rule);
}

.post-back {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.post-back:hover { color: var(--color-green); text-decoration: underline; text-underline-offset: 0.2em; }

/* Share buttons — ghost style */
.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.share-btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition-colors);
}
.share-btn:hover { border-color: var(--color-green); color: var(--color-green); }
.share-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.post-share__status {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-text-muted);
}

/* Related posts — "More essays" */
.related {
  max-width: var(--container-prose);
  margin: var(--space-10) auto 0;
  padding: 0 var(--space-section-x) var(--space-12);
}
.related__heading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

/* ============================================================
   4. ABOUT — plain editorial layout
   ============================================================ */
.about-header {
  padding: var(--space-section-y) var(--space-section-x) var(--space-8);
}
.about-header__inner {
  max-width: var(--container-mid);
  margin-inline: auto;
}
.about-headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  color: var(--color-green);
  margin: 0;
  max-width: 22ch;
}
.about-body {
  margin-top: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--color-text);
  max-width: var(--measure-prose);
}
.about-body p { margin: 0 0 var(--space-5); }

.about-quote {
  padding: var(--space-9) var(--space-section-x);
  border-top: 1px solid var(--color-rule);
}
.about-quote__inner {
  max-width: var(--container-prose);
  margin-inline: auto;
  text-align: center;
}
.about-quote__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  color: var(--color-green);
  margin: 0;
}
.about-quote__attr {
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
