/* ============================================================
   Blog / Journal — editorial notebook theme
   ------------------------------------------------------------
   Deliberately different from the subjects "sticky-note wall":
   ruled-paper canvas, serif (Fraunces) headlines, numbered
   index cards, and a dark ink featured spread. Shares the
   paper palette + navbar/footer conventions from style.css.
   ============================================================ */

body.blog-page {
  --blog-accent: #1f5f5b;
  --blog-accent-soft: rgba(31, 95, 91, 0.1);
  --blog-highlight: #b5542f;

  display: flex;
  flex-direction: column;
  min-height: 100vh;

  background-color: var(--paper-bg);
  /* faint ruled notebook lines, like a study journal page */
  background-image: linear-gradient(rgba(216, 201, 168, 0.38) 1px, transparent 1px);
  background-size: 100% 32px;
}

/* ---------- navbar — frosted paper ---------- */
body.blog-page .navbar {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--paper-border);
}

body.blog-page .navbar .logo {
  background: none;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: var(--ink);
  background-clip: border-box;
  color: var(--ink);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.blog-nav-link {
  font-family: "Outfit", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-nav-link:hover {
  color: var(--ink);
}

.blog-nav-link.active {
  color: var(--ink);
  border-bottom-color: var(--blog-accent);
}

/* sign-in link (anonymous visitors) */
.papers-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--paper-line);
  background: var(--paper-card);
  color: var(--ink-soft);
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.papers-signin-btn:hover {
  border-color: var(--blog-accent);
  color: var(--ink);
}

/* profile button — solid ink circle */
.profile-wrapper {
  position: relative;
}

.profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-btn:hover {
  transform: translateY(-2px);
  filter: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.profile-btn span {
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--paper-card);
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(58, 47, 26, 0.2);
  z-index: 100;
}

.profile-wrapper.open .profile-dropdown {
  display: block;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.profile-dropdown-item:hover {
  background: rgba(216, 201, 168, 0.3);
}

.profile-dropdown-item i {
  font-size: 1.1rem;
  opacity: 0.7;
  color: var(--ink-soft);
}

/* ---------- shared page wrap ---------- */
.blog-wrap {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ---------- masthead ---------- */
.blog-masthead {
  margin-top: 150px;
  text-align: center;
}

.blog-eyebrow {
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--blog-highlight);
}

.blog-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.06;
  color: var(--ink);
  max-width: 840px;
  margin: 8px auto 18px;
}

.blog-sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.blog-masthead-meta {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.masthead-back {
  color: var(--blog-accent);
  text-decoration: none;
  font-weight: 600;
}

.masthead-back:hover {
  text-decoration: underline;
}

/* small rule + diamond under masthead */
.blog-masthead::after {
  content: "";
  display: block;
  width: 88px;
  height: 1px;
  margin: 34px auto 0;
  background: var(--paper-line);
  box-shadow: 0 0 0 1px transparent;
}

/* ---------- featured spread ---------- */
.blog-featured {
  position: relative;
  margin-top: 46px;
  padding: 52px 56px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper-card);
  overflow: hidden;
  box-shadow: 0 22px 44px rgba(58, 47, 26, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 56px rgba(58, 47, 26, 0.34);
}

/* teal spine down the left edge */
.blog-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: var(--blog-accent);
}

.featured-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.featured-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.featured-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.4px;
  color: var(--paper-card);
  margin: 0 0 16px;
}

/* tags now sit under the title */
.featured-content .post-tags {
  margin-bottom: 18px;
}

.featured-excerpt {
  font-family: "Fraunces", serif;
  font-size: 1.12rem;
  line-height: 1.6;
  color: rgba(251, 249, 240, 0.78);
  max-width: 620px;
}

.featured-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(251, 249, 240, 0.62);
}

.featured-subject {
  color: #cfe6e3;
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--paper-card);
  border-bottom: 1px solid rgba(251, 249, 240, 0.4);
  padding-bottom: 3px;
}

.blog-featured:hover .featured-cta i {
  transform: translateX(4px);
}

.featured-cta i {
  transition: transform 0.2s ease;
}

/* oversized ghost number */
.featured-index {
  position: absolute;
  right: 40px;
  bottom: -34px;
  font-family: "Fraunces", serif;
  font-size: 11rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(251, 249, 240, 0.06);
  pointer-events: none;
}

/* ---------- toolbar (search + tags) ---------- */
.blog-toolbar {
  margin-top: 52px;
  padding-bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--paper-line);
}

.blog-search {
  position: relative;
  width: min(100%, 780px);
  /* this element is a <form>: reset the global form styling */
  display: block;
  flex-grow: 0;
  height: auto;
  gap: 0;
}

.blog-search i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--ink-muted);
}

.blog-search-input {
  width: 100%;
  height: 48px;
  padding: 0 20px 0 54px;
  border-radius: 14px;
  border: 1px solid var(--paper-line);
  background: #ffffff;
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
}

.blog-search-input::placeholder {
  color: #a49a7f;
}

.blog-search-input:focus {
  outline: none;
  border-color: var(--blog-accent);
  box-shadow: 0 6px 18px rgba(31, 95, 91, 0.12);
}

.blog-tag-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tag-filter {
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--paper-line);
  background: var(--paper-card);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tag-filter:hover {
  transform: none;
  border-color: var(--blog-accent);
  color: var(--ink);
}

.tag-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-card);
}

/* ---------- post grid + cards ---------- */
.blog-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 24px;
}

.post-card {
  position: relative;
  padding: 28px 26px 24px;
  background: var(--paper-card);
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--blog-accent);
  box-shadow: 0 16px 32px rgba(58, 47, 26, 0.16);
}

/* index number, inline before the title */
.post-index {
  margin-right: 10px;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blog-accent);
  opacity: 0.55;
  transition: opacity 0.22s ease;
}

.post-card:hover .post-index {
  opacity: 1;
}

.post-card-body {
  min-width: 0;
}

.post-card-title {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
}

.post-card-excerpt {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.58;
  margin-bottom: 0;
}

.post-card-rule {
  border: none;
  border-top: 1px solid var(--paper-line);
  margin: 14px 0;
}

.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---------- tags ---------- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tag {
  display: inline-block;
  font-family: "Outfit", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blog-accent);
  background: var(--blog-accent-soft);
  border: 1px solid rgba(31, 95, 91, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
  text-decoration: none;
}

.post-tag--featured {
  color: #e7f2f0;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

/* ---------- card meta ---------- */
.post-card-meta {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.post-meta-dot {
  opacity: 0.6;
}

/* ---------- empty state ---------- */
.blog-empty {
  display: none;
  text-align: center;
  padding: 60px 0;
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  color: var(--ink-muted);
}

.blog-empty.visible {
  display: block;
}

/* ---------- pagination ---------- */
.blog-pagination {
  margin: 56px 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.page-btn:hover {
  color: var(--blog-accent);
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  gap: 8px;
}

.page-num {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--paper-line);
  background: var(--paper-card);
  color: var(--ink-soft);
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.page-num:hover {
  border-color: var(--blog-accent);
  color: var(--ink);
}

.page-num.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-card);
}

/* ---------- footer ---------- */
.blog-footer {
  margin-top: 64px;
  padding: 40px 48px 32px;
  border-top: 1px solid var(--paper-line);
  background: var(--paper-card);
}

.blog-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.blog-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-footer-logo {
  font-size: 1.15rem;
}

.blog-footer-copy {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.blog-footer-socials {
  display: flex;
  gap: 20px;
}

.blog-footer-socials a {
  display: inline-flex;
  align-items: center;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.blog-footer-socials a:hover {
  color: var(--ink);
}

.blog-footer-socials a i {
  color: inherit;
}

.blog-footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 0.8125rem;
}

.blog-footer-links a {
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.blog-footer-links a:hover {
  color: var(--ink);
}

.blog-back-to-top {
  margin-top: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-back-to-top:hover {
  transform: translateY(-3px);
  filter: none;
  box-shadow: 0 6px 14px rgba(58, 47, 26, 0.28);
}

.blog-back-to-top i {
  color: var(--paper-card);
  font-size: 1.3rem;
  line-height: 1;
}

.blog-footer-disclaimer {
  max-width: 1240px;
  margin: 24px auto 0;
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ============================================================
   Article detail
   ============================================================ */
.blog-article-wrap {
  max-width: 800px;
}

.article-breadcrumb {
  margin-top: 140px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.article-breadcrumb a {
  color: var(--blog-accent);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-breadcrumb i {
  color: var(--ink-muted);
}

.article-header {
  margin-top: 26px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--paper-line);
}

.article-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 1.08;
  color: var(--ink);
  margin: 18px 0;
}

.article-excerpt {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.article-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.article-author {
  font-weight: 600;
  color: var(--ink);
}

.article-body {
  margin-top: 34px;
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.article-body p {
  color: var(--ink-soft);
  font-size: inherit;
  margin-bottom: 22px;
}

.article-body .lead {
  font-family: "Fraunces", serif;
  font-size: 1.28rem;
  line-height: 1.65;
  color: var(--ink);
}

.article-body h2 {
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ink);
  margin: 42px 0 14px;
  line-height: 1.2;
}

.article-body h3 {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 32px 0 12px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 24px 24px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- related articles ---------- */
.article-related {
  margin-top: 56px;
}

.article-related-heading {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  padding-top: 28px;
  margin-bottom: 22px;
  border-top: 1px solid var(--paper-line);
}

.article-related .blog-grid {
  margin-top: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.article-body blockquote {
  margin: 34px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--blog-accent);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 1.22rem;
  color: var(--ink);
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--blog-accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-body pre {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--ink);
  color: #f4ecd9;
  overflow-x: auto;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-body table {
  width: 100%;
  margin-bottom: 24px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border: 1px solid var(--paper-line);
  text-align: left;
}

.article-body th {
  background: rgba(216, 201, 168, 0.28);
  color: var(--ink);
}

/* ---------- subject CTA ---------- */
.article-subject-cta {
  margin-top: 56px;
  padding: 34px 38px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  box-shadow: 0 20px 40px rgba(58, 47, 26, 0.24);
}

.cta-eyebrow {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  color: #d9c9a4;
}

.cta-title {
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--paper-card);
  margin: 4px 0 6px;
}

.cta-text {
  font-size: 0.92rem;
  color: rgba(251, 249, 240, 0.72);
}

.article-subject-cta .cta-button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  background: var(--paper-card);
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-subject-cta .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
}

.article-subject-cta .cta-button i {
  color: var(--ink);
}

/* ---------- article footer nav ---------- */
.article-footer-nav {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--paper-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blog-accent);
  text-decoration: none;
}

.article-back:hover {
  text-decoration: underline;
}

.article-back i {
  color: var(--blog-accent);
}

.article-share-note {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .blog-wrap {
    padding: 0 32px;
  }

  .blog-footer {
    padding: 36px 32px 28px;
  }

  .featured-index {
    font-size: 8rem;
    right: 20px;
  }
}

@media (max-width: 600px) {
  body.blog-page .navbar {
    padding: 20px 24px;
  }

  .navbar .logo {
    font-size: 1.15rem;
  }

  .blog-nav-link {
    display: none;
  }

  .blog-wrap {
    padding: 0 24px;
  }

  .blog-masthead {
    margin-top: 142px;
  }

  .blog-title {
    font-size: 2.15rem;
  }

  .blog-sub {
    font-size: 0.98rem;
  }

  .blog-featured {
    padding: 36px 26px;
  }

  .featured-index {
    font-size: 6rem;
    right: 12px;
    bottom: -20px;
  }

  .blog-toolbar {
    margin-top: 36px;
    align-items: stretch;
  }

  .blog-search {
    width: 100%;
  }

  .blog-search-input {
    height: 46px;
    font-size: 1rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .post-card {
    padding: 24px 20px 22px;
  }

  .blog-pagination {
    gap: 12px;
  }

  .page-btn span,
  .page-btn {
    font-size: 0.82rem;
  }

  .article-breadcrumb {
    margin-top: 134px;
  }

  .article-subject-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }

  .blog-footer-inner {
    flex-direction: column;
    gap: 28px;
  }

  .blog-footer-links {
    align-items: flex-start;
  }
}
