/* ── Individual post page ─────────────────────────────────────────── */

/* Topbar fitting parity with index, but less clipping on post pages */
.topbar {
  gap: 8px;
}

.topbar .brandWrap {
  flex: 1 1 auto;
  overflow: visible;
}

.topbar .brandWrap > div:not(.logo) {
  overflow: visible;
}

.topbar .topActions {
  gap: 6px;
  margin-left: -4px;
}

@media (max-width: 760px) {
  .topbar .topActions .btn {
    padding: 7px 9px;
    font-size: 12.5px;
  }
}

/* Two-column layout: article + sidebar */
.postLayout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: stretch;
  margin-bottom: 0;
}

/* Constrain the post to a readable width */
.postPage {
  max-width: 720px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .postLayout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .postSidebar { position: static; }
  .postPage { max-width: 100%; }
}

/* ── Sidebar ── */
.postSidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebarWidget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadowSoft);
  padding: 18px;
  overflow: hidden;
}

.sidebarTitle {
  font-family: Fraunces, serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.sidebarPosts {
  display: flex;
  flex-direction: column;
}

.sidebarPost {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 140ms ease;
}
.sidebarPost:last-child { border-bottom: none; padding-bottom: 0; }
.sidebarPost:hover { opacity: 0.72; }

.sidebarPostMeta {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted2);
}

.sidebarPostTitle {
  font-family: Fraunces, serif;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.sidebarCopy {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.sidebarNewsletterForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sidebar subscribe button — compact */
.sidebarNewsletterForm .btn[type="submit"] {
  padding: 8px 14px;
  font-size: 13px;
}

/* Mobile: all on one row — name, email, subscribe */
@media (max-width: 900px) {
  .sidebarNewsletterForm {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr) minmax(92px, 0.9fr);
    gap: 6px;
    align-items: center;
    width: 100%;
  }
  .sidebarNewsletterForm .sidebarInput {
    min-width: 0;
    width: 100% !important;
    max-width: 100%;
    font-size: 13px;
    padding: 8px 11px;
  }
  .sidebarNewsletterForm .btn[type="submit"] {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 12.5px;
  }
}

/* ── Browse Collections widget ───────────────────────────────────── */
.browseCategoryBtns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.browseCategoryBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: 600 13px/1 inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 140ms ease, box-shadow 140ms ease;
}

.browseCategoryBtn:hover {
  opacity: 0.80;
  box-shadow: 0 0 0 3px rgba(22, 22, 22, .14);
}

html[data-theme="dark"] .browseCategoryBtn:hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

/* Mobile: use a single horizontal row */
@media (max-width: 900px) {
  .browseCategoryBtns {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .browseCategoryBtn {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 12.5px;
  }
}



.sidebarInput {
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  border-radius: 10px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 140ms ease;
}
.sidebarInput:focus { border-color: var(--text); }
.sidebarInput::placeholder { color: var(--muted2); }

.newsletterConsent {
  font-size: 11px;
  color: var(--muted2);
  margin: 6px 0 0;
  line-height: 1.4;
}

.sidebarAppBtn {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* ── All Posts breadcrumb ── */
.allPostsBreadcrumb {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #161616;
  text-decoration: none;
}

.allPostsBreadcrumb:hover,
.allPostsBreadcrumb:focus-visible {
  text-decoration: none;
}

html[data-theme="dark"] .allPostsBreadcrumb {
  color: rgba(255,255,255,.92);
}

/* ── Post header ── */
.postHeader { margin-bottom: 22px; }

/* Tag row — category + mood pill + date */
.postTagRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
  margin-bottom: 14px;
}

/* Post search button (opens modal) */
.postSearchBtn{
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease;
}
.postSearchBtn:hover{ color: var(--text); border-color: var(--focus); }
.postSearchBtn:active{ transform: translateY(1px); }
.postSearchBtn svg{ width: 14px; height: 14px; }

/* Shared search modal styles (used on post pages too) */
.blogSearchModal{ position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 18px; }
.blogSearchModal.isOpen{ display: flex; }
.blogSearchBackdrop{ position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.blogSearchPanel{ position: relative; width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; }
.blogSearchRow{ display: flex; align-items: center; gap: 10px; }
.blogSearchField{ flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface2); color: var(--text); font-size: 14px; outline: none; }
.blogSearchField::placeholder{ color: var(--muted2); }
.blogSearchField:focus{ border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
html[data-theme="dark"] .blogSearchField:focus{ box-shadow: 0 0 0 3px rgba(255,255,255,.10); }
.blogSearchClose{ width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.blogSearchClose:hover{ color: var(--text); background: var(--btnHover); }
.blogSearchHint{ margin: 10px 2px 0; font-size: 12px; color: var(--muted2); }

/* Category badge */
.postCategoryBadge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: opacity 140ms ease, box-shadow 140ms ease;
}
a.postCategoryBadge:hover {
  opacity: 0.80;
  box-shadow: 0 0 0 3px rgba(22,22,22,.14);
}
html[data-theme="dark"] a.postCategoryBadge:hover {
  box-shadow: 0 0 0 3px rgba(255,255,255,.16);
}

/* Mood pill */
.postMoodPill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 13px;
  font-weight: 600;
}

/* Mood tints */
.postMoodPill[data-mood="Light"]        { background: rgba(255,227,168,.50); border-color: rgba(255,200,60,.30); }
.postMoodPill[data-mood="Sad"]          { background: rgba(90,65,170,.18);   border-color: rgba(90,65,170,.22); }
.postMoodPill[data-mood="Romantic"]     { background: rgba(245,197,211,.50); border-color: rgba(240,76,136,.25); }
.postMoodPill[data-mood="Dark"]         { background: rgba(201,214,247,.38); border-color: rgba(124,56,216,.22); }
.postMoodPill[data-mood="Adventurous"]  { background: rgba(189,238,219,.50); border-color: rgba(40,204,140,.28); }
.postMoodPill[data-mood="Inspirational"]{ background: rgba(255,217,138,.45); border-color: rgba(255,152,32,.30); }
.postMoodPill[data-mood="Fun"]          { background: rgba(155,227,255,.42); border-color: rgba(40,190,255,.28); }
.postMoodPill[data-mood="Tense"]        { background: rgba(255,180,166,.45); border-color: rgba(238,40,56,.25); }
.postMoodPill[data-mood="Historical"]   { background: rgba(204,154,100,.30); border-color: rgba(170,60,8,.22); }
.postMoodPill[data-mood="Political"]    { background: rgba(24,85,204,.16);   border-color: rgba(24,85,204,.22); }
.postMoodPill[data-mood="Fantasy"]      { background: rgba(136,40,232,.16);  border-color: rgba(136,40,232,.22); }
.postMoodPill[data-mood="Mystery"]      { background: rgba(26,56,120,.20);   border-color: rgba(26,56,120,.22); }

html[data-theme="dark"] .postMoodPill[data-mood="Light"]        { background: rgba(255,227,168,.14); }
html[data-theme="dark"] .postMoodPill[data-mood="Sad"]          { background: rgba(110,85,200,.20); }
html[data-theme="dark"] .postMoodPill[data-mood="Romantic"]     { background: rgba(245,197,211,.14); }
html[data-theme="dark"] .postMoodPill[data-mood="Dark"]         { background: rgba(201,214,247,.14); }
html[data-theme="dark"] .postMoodPill[data-mood="Adventurous"]  { background: rgba(189,238,219,.14); }
html[data-theme="dark"] .postMoodPill[data-mood="Inspirational"]{ background: rgba(255,217,138,.14); }
html[data-theme="dark"] .postMoodPill[data-mood="Fun"]          { background: rgba(155,227,255,.12); }
html[data-theme="dark"] .postMoodPill[data-mood="Tense"]        { background: rgba(255,180,166,.14); }

/* Date */
.postPageDate {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted2);
  margin-left: auto;
}

/* ── Title ── */
.postPageTitle {
  margin: 0 0 16px;
  font-family: Fraunces, serif;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.3px;
}

/* ── Byline — single flat line ── */
.postBylineLine {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* Author name — linked to their site */
.bylineName {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 140ms ease, color 140ms ease;
  line-height: 1;
}
.bylineName:hover { color: var(--text); border-bottom-color: var(--text); }

/* Separator dot */
.bylineSep {
  font-size: 13.5px;
  color: var(--muted2);
  line-height: 1;
  user-select: none;
}

/* Role label — same size and colour as name */
.bylineRole {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
}

/* Social icon links */
.bylineSocials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}

.bylineSocial {
  display: inline-flex;
  align-items: center;
  color: var(--muted2);
  text-decoration: none;
  transition: color 140ms ease;
}
.bylineSocial:hover { color: var(--text); }
.bylineSocial svg { display: block; }

/* For community/guest posts — "Originally on [their blog]" */
.bylineSource {
  width: 100%;
  font-size: 12.5px;
  color: var(--muted2);
  margin-top: 5px;
  line-height: 1.4;
}
.bylineSource a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 140ms ease, color 140ms ease;
}
.bylineSource a:hover { color: var(--text); border-bottom-color: var(--text); }

/* ── Book info block ──────────────────────────────────────────────── */
.bookInfoBlock {
  padding: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 28px;
  overflow: hidden;
}

/* Top row: cover + core meta side by side */
.bookInfoTop {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 16px 18px;
}

.bookInfoCover {
  width: clamp(120px, 22vw, 160px);
  min-width: 120px;
  max-width: 160px;
  height: 100%;
  min-height: 130px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  align-self: stretch;
}

/* Placeholder when cover not loaded yet */
.bookInfoCoverPlaceholder {
  width: 80px;
  min-height: 130px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: Fraunces, serif;
  font-size: 22px;
  color: var(--muted2);
  user-select: none;
  align-self: stretch;
}

.bookInfoMeta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bookInfoLabel {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted2);
  margin: 0 0 5px;
}

.bookInfoTitle {
  font-family: Fraunces, serif;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.2;
}

.bookInfoAuthor {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.4;
}

.bookInfoFlag { margin-right: 3px; }

.bookInfoAge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted2);
  margin: 0;
}

/* Description — now lives inside .bookInfoMeta */
.bookInfoDesc {
  margin: 10px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* Tag row — age badge + genre tags side by side */
.bookInfoTagRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
}

/* Tags — now inline inside .bookInfoTagRow */
.bookInfoTags {
  display: contents; /* let tag spans participate directly in the tagRow flex */
}

/* ── Book info action buttons ─────────────────────────────────────── */
.bookInfoActions {
  display: flex;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.bookInfoActions .btn {
  font-size: 13px;
  padding: 8px 16px;
}

/* Done state — book already on shelf */
.bookInfoBtnDone {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

/* ── Sidebar book widget ─────────────────────────────────────── */
.sidebarBookCard {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 4px;
}

.sidebarBookCover {
  width: 44px;
  height: 66px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: block;
}

.sidebarBookInfo {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebarBookTitle {
  font-family: Fraunces, serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}

.sidebarBookMeta {
  font-size: 12px;
  color: var(--muted2);
  margin: 0;
  line-height: 1.4;
}

/* ── Review content card ──────────────────────────────────────────── */
/* Wraps the actual review text in a surface card so the decorative
   background doesn't distract while reading.                         */
.postContentCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadowSoft);
  padding: 28px 32px;
  margin-bottom: 28px;
  flex: 1;
}

@media (max-width: 560px) {
  .postContentCard { padding: 20px 18px; }
}

.postContentCard p {
  margin: 0 0 18px;
  color: rgba(22,22,22,.82);
  line-height: 1.75;
  font-size: 17px;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  letter-spacing: 0.1px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
}

html[data-theme="dark"] .postContentCard p{
  color: rgba(255,255,255,.78);
}

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

/* Post body headings: tighten spacing (remove big gap after h2/h3) */
.postContentCard h2,
.postContentCard h3{
  font-family: Fraunces, serif;
  color: var(--text);
  line-height: 1.25;
  margin: 18px 0 6px;
}

.postContentCard h2{ font-size: 24px; }
.postContentCard h3{ font-size: 19px; }

/* Post body links: match surrounding text until hover */
.postContentCard a,
.postContentCard a:visited{
  color: inherit;
  text-decoration: none;
}
.postContentCard a:hover{
  color: var(--shape-b, #fb0ac7);
  text-decoration: none;
}

/* Keep content media consistent: no stretch, no overflow */
.postContentCard img,
.postContentCard figure img,
.postContentCard video,
.postContentCard iframe {
  display: block;
  max-width: 100%;
  height: auto !important;
  margin: 14px auto 20px;
  border-radius: 10px;
}

.postContentCard figure {
  margin: 14px 0 20px;
}

/* Pull quote */
.postPullQuote {
  border-left: 3px solid var(--text);
  margin: 6px 0 22px;
  padding: 2px 0 2px 20px;
}

.postPullQuote p {
  font-family: Fraunces, serif;
  font-size: 20px !important;
  line-height: 1.45 !important;
  color: var(--text) !important;
  font-style: italic;
  text-align: left !important;
  margin: 0 !important;
}

/* ── CTA block ── */
.postCTA {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0;
}

.postCTAText { min-width: 0; }

.postCTATitle {
  font-family: Fraunces, serif;
  font-size: 18px;
  margin: 0 0 4px;
  line-height: 1.2;
}

.postCTASub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .postCTA { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ── Community reviewer attribution ── */
.postAttribution {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface2);
  margin-bottom: 32px;
}

.attributionLabel {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted2);
  margin: 0 0 8px;
}

.attributionName {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 5px;
}

.attributionBio {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 10px;
}

.attributionLink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 140ms ease;
}
.attributionLink:hover { border-bottom-color: var(--text); }

/* ── Divider ── */
.postDivider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 28px;
}

/* ── Rating flow — "How was it?" ───────────────────────────────── */
.ratingFlow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ratingQuestion {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.ratingBtns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ratingBtn {
  font-size: 13px !important;
  padding: 7px 14px !important;
}

.ratingCancel {
  font-size: 12px;
  color: var(--muted2);
  padding: 0 !important;
  height: auto !important;
  background: none !important;
  border: none !important;
  text-align: left;
  cursor: pointer;
  align-self: flex-start;
  transition: color 140ms ease;
}
.ratingCancel:hover { color: var(--text) !important; }



/* Post mobile fit fixes */
.postLayout,
.postPage,
.postContentCard,
.postCTA,
.bookInfoBlock,
.bookInfoTop,
.bookInfoMeta {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .postLayout {
    width: 100%;
    overflow-x: visible;
  }

  .postPage {
    width: 100%;
  }

  .bookInfoCover {
    width: clamp(120px, 30vw, 150px);
    min-width: 120px;
    max-width: 150px;
    height: 100%;
  }
}

@media (max-width: 560px) {
  .postContentCard,
  .bookInfoMeta,
  .postCTA {
    overflow-wrap: anywhere;
  }
}
