/* ================================================================
   blog.css — Blog index + Single post styles
   Shared by: blog.html, blog-post.html
   ================================================================ */

/* ── Navbar: transparent over hero → frosted on scroll ──────── */
#navbar {
  padding: 6px 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

/* Transparent state — white text over the colored hero */
#navbar .nav-logo { color: #fff; }

#navbar .nav-links a {
  font-size: .875rem;
  font-weight: 400;
  color: rgba(255,255,255,.85);
  transition: color var(--transition);
}
#navbar .nav-links a:hover { color: #fff; }

#navbar .nav-links a.active {
  color: #fff;
  font-weight: 600;
  border-bottom: 2px solid rgba(255,255,255,.6);
  padding-bottom: 2px;
}

#navbar .nav-links .nav-cta {
  padding: 10px 22px;
  font-size: .85rem;
  background: rgba(255,255,255,.15);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 100px;
  transition: var(--transition) !important;
}
#navbar .nav-links .nav-cta:hover {
  background: rgba(255,255,255,.28) !important;
}

#navbar .nav-burger span { background: #fff; }

/* Scrolled state — frosted glass, dark text */
#navbar.scrolled {
  background: rgba(247,245,240,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 4px 0;
}
#navbar.scrolled .nav-logo-img         { height: 52px; }

#navbar.scrolled .nav-logo             { color: var(--clr-text); }
#navbar.scrolled .nav-links a          { color: var(--clr-muted); }
#navbar.scrolled .nav-links a:hover    { color: var(--clr-primary); }

#navbar.scrolled .nav-links a.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
}

#navbar.scrolled .nav-links .nav-cta {
  background: var(--clr-accent) !important;
  border-color: var(--clr-accent) !important;
  color: #fff !important;
}
#navbar.scrolled .nav-links .nav-cta:hover { background: #9A6B4A !important; }

#navbar.scrolled .nav-burger span { background: var(--clr-text); }

/* ── Page Hero (mirrors bio.css) ────────────────────────────── */
#page-hero {
  padding: 9rem 0 4rem;
  background: linear-gradient(135deg, var(--clr-primary-d) 0%, var(--clr-primary) 55%, var(--clr-sage) 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-breadcrumb {
  font-family: var(--ff-sans);
  font-size: .85rem;
  margin-bottom: 1.2rem;
  opacity: .8;
  letter-spacing: .02em;
}
.hero-breadcrumb a { color: rgba(255,255,255,.75); text-decoration: none; }
.hero-breadcrumb a:hover { color: #fff; }

.page-title {
  font-family: var(--ff-serif);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: .8rem;
}

.page-subtitle {
  font-family: var(--ff-sans);
  font-size: 1.05rem;
  font-weight: 300;
  opacity: .85;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Categories Bar ─────────────────────────────────────────── */
#categories-bar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(44, 58, 44, .06);
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .9rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }

.cat-btn {
  font-family: var(--ff-sans);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .03em;
  padding: .38rem .9rem;
  border-radius: 50px;
  border: 1.5px solid var(--clr-border);
  background: transparent;
  color: var(--clr-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.cat-btn:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}
.cat-btn.active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}

/* ── Post category badge ────────────────────────────────────── */
.post-cat {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clr-primary);
  background: rgba(61, 107, 107, .1);
  padding: .25rem .7rem;
  border-radius: 50px;
}

/* ── Post meta ──────────────────────────────────────────────── */
.post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--ff-sans);
  font-size: .82rem;
  color: var(--clr-muted);
}

/* ── Featured Post ──────────────────────────────────────────── */
#featured { padding-block: 3.5rem; }

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  background: var(--clr-surface);
  transition: var(--transition);
}
.featured-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.featured-img {
  position: relative;
  overflow: hidden;
  min-height: 360px;
}
.featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.featured-card:hover .featured-img img { transform: scale(1.04); }

.featured-body {
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.featured-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--clr-text);
}

.featured-excerpt {
  font-family: var(--ff-sans);
  font-size: .95rem;
  line-height: 1.65;
  color: var(--clr-muted);
}

/* ── Posts Grid ─────────────────────────────────────────────── */
#posts { padding-block: 1rem 5rem; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ── Post Card ──────────────────────────────────────────────── */
.post-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(61, 107, 107, .25);
}

.post-card-img-wrap {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.post-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-img-wrap img { transform: scale(1.05); }

.post-card-img-wrap .post-cat {
  position: absolute;
  bottom: .75rem;
  left: .75rem;
  background: rgba(247, 245, 240, .95);
  backdrop-filter: blur(6px);
}

.post-card-body {
  padding: 1.3rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .6rem;
}

.post-card-title {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.3;
}
.post-card-title a {
  color: var(--clr-text);
  text-decoration: none;
  transition: color var(--transition);
}
.post-card-title a:hover { color: var(--clr-primary); }

.post-card-excerpt {
  font-family: var(--ff-sans);
  font-size: .87rem;
  line-height: 1.6;
  color: var(--clr-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-body .post-meta {
  justify-content: space-between;
  margin-top: auto;
  padding-top: .6rem;
  border-top: 1px solid var(--clr-border);
}

.post-read-more {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--ff-sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
  transition: gap var(--transition);
}
.post-read-more:hover { gap: .55rem; }

/* No results message */
.no-results {
  font-family: var(--ff-sans);
  color: var(--clr-muted);
  text-align: center;
  padding: 3rem;
}

/* ── Blog CTA ────────────────────────────────────────────────── */
#blog-cta {
  background: linear-gradient(135deg, var(--clr-primary-d) 0%, var(--clr-primary) 100%);
  padding: 5rem 0;
}

.blog-cta-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.blog-cta-label {
  font-family: var(--ff-sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
}

.blog-cta-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
}

.blog-cta-sub {
  font-family: var(--ff-sans);
  font-size: .97rem;
  line-height: 1.65;
  opacity: .85;
  max-width: 480px;
}

#blog-cta .btn--primary {
  background: #fff;
  color: var(--clr-primary-d);
  margin-top: .5rem;
}
#blog-cta .btn--primary:hover {
  background: var(--clr-bg);
  color: var(--clr-primary-d);
}

/* ================================================================
   Single Post Page (blog-post.html)
   ================================================================ */

/* ── Reading Progress Bar ────────────────────────────────────── */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(to right, var(--clr-primary), var(--clr-accent));
  z-index: 1000;
  transition: width .1s linear;
}

/* ── Post Page Hero ──────────────────────────────────────────── */
#post-hero {
  padding: 8.5rem 0 3.5rem;
  background: linear-gradient(135deg, var(--clr-primary-d) 0%, var(--clr-primary) 55%, var(--clr-sage) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

#post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.post-hero-inner {
  max-width: 820px;
}

.post-hero-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--ff-sans);
  font-size: .85rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color .2s;
}
.post-hero-back:hover { color: #fff; }
.post-hero-back svg { flex-shrink: 0; }

.post-hero-cat {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255,255,255,.2);
  padding: .3rem .8rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.post-hero-title {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 1.2rem;
}

.post-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  font-family: var(--ff-sans);
  font-size: .87rem;
  opacity: .82;
}

.post-hero-meta-dot { opacity: .5; }

.post-hero-meta-author {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.post-hero-meta-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.4);
}

/* ── Article Layout ──────────────────────────────────────────── */
#post-body {
  padding: 4rem 0 5rem;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4rem;
  align-items: start;
}

/* ── Article Typography ─────────────────────────────────────── */
.post-article {
  min-width: 0;
}

.post-article .post-lead {
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--clr-text);
  font-style: italic;
  margin-bottom: 2rem;
  padding: 1.5rem 1.8rem;
  border-left: 4px solid var(--clr-primary);
  background: rgba(61, 107, 107, .04);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-article h2 {
  font-family: var(--ff-serif);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--clr-primary-d);
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.post-article h3 {
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--clr-text);
  margin: 2rem 0 .75rem;
  line-height: 1.3;
}

.post-article p {
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--clr-text);
  margin-bottom: 1.2rem;
}

.post-article ul, .post-article ol {
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text);
  margin: 0 0 1.2rem 1.5rem;
}

.post-article li { margin-bottom: .35rem; }

.post-article blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--clr-accent);
  background: rgba(176, 125, 90, .06);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-article blockquote p {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--clr-text);
  margin: 0;
}
.post-article blockquote cite {
  display: block;
  margin-top: .75rem;
  font-family: var(--ff-sans);
  font-size: .85rem;
  color: var(--clr-muted);
  font-style: normal;
}

.opening-phrases {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--clr-bg);
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
}

.opening-phrase {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--clr-muted);
  padding-left: 1.2rem;
  border-left: 2px solid var(--clr-border);
  margin: 0 !important;
  line-height: 1.5;
}

/* Post closing callout */
.post-closing {
  margin-top: 2.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(61, 107, 107, .07), rgba(122, 158, 126, .07));
  border-radius: var(--radius);
  border: 1px solid rgba(61, 107, 107, .15);
  text-align: center;
}
.post-closing p {
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--clr-primary-d);
  line-height: 1.6;
  margin-bottom: .6rem !important;
}
.post-closing .post-signature {
  font-family: var(--ff-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--clr-muted);
}

/* Post tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
  align-items: center;
}
.post-tags-label {
  font-family: var(--ff-sans);
  font-size: .82rem;
  color: var(--clr-muted);
  font-weight: 500;
  margin-right: .25rem;
}
.post-tag {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: .78rem;
  font-weight: 500;
  padding: .28rem .75rem;
  border-radius: 50px;
  border: 1.5px solid var(--clr-border);
  color: var(--clr-muted);
  text-decoration: none;
  transition: var(--transition);
}
.post-tag:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar: Author card */
.sidebar-author {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.sidebar-author-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  margin: 0 auto .9rem;
  display: block;
  border: 3px solid var(--clr-primary);
}

.sidebar-author-name {
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--clr-text);
  margin-bottom: .2rem;
}

.sidebar-author-title {
  font-family: var(--ff-sans);
  font-size: .8rem;
  color: var(--clr-primary);
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: .8rem;
}

.sidebar-author-bio {
  font-family: var(--ff-sans);
  font-size: .85rem;
  line-height: 1.6;
  color: var(--clr-muted);
  margin-bottom: 1rem;
}

/* Sidebar: Related posts */
.sidebar-related {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-section-title {
  font-family: var(--ff-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--clr-text);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--clr-border);
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.related-item a {
  display: block;
  font-family: var(--ff-sans);
  font-size: .87rem;
  line-height: 1.4;
  color: var(--clr-text);
  text-decoration: none;
  transition: color .2s;
  padding-left: .9rem;
  border-left: 2px solid var(--clr-border);
  transition: var(--transition);
}
.related-item a:hover {
  color: var(--clr-primary);
  border-left-color: var(--clr-primary);
}
.related-item .related-cat {
  font-size: .73rem;
  color: var(--clr-primary);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  display: block;
  margin-bottom: .15rem;
}

/* Sidebar: CTA */
.sidebar-cta {
  background: var(--clr-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar-cta-title {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: .5rem;
}

.sidebar-cta-text {
  font-family: var(--ff-sans);
  font-size: .83rem;
  line-height: 1.55;
  opacity: .88;
  margin-bottom: 1rem;
}

.sidebar-cta .btn--primary {
  background: #fff;
  color: var(--clr-primary-d);
  font-size: .85rem;
  padding: .6rem 1.3rem;
}
.sidebar-cta .btn--primary:hover {
  background: var(--clr-bg);
}

/* ── Post Nav (prev/next) ────────────────────────────────────── */
#post-nav {
  border-top: 1px solid var(--clr-border);
  padding: 2rem 0;
  background: var(--clr-surface);
}

.post-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.post-nav-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--ff-sans);
  font-size: .88rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
  transition: gap var(--transition);
}
.post-nav-back:hover { gap: .7rem; }

/* ── Post Skeleton (loading state) ─────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.post-skeleton > div {
  background: linear-gradient(
    90deg,
    var(--clr-border) 25%,
    var(--clr-bg) 50%,
    var(--clr-border) 75%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 8px;
  margin-bottom: 1.1rem;
}

.skeleton-lead  { height: 80px; }
.skeleton-h2    { height: 28px; width: 55%; }
.skeleton-p     { height: 64px; }
.skeleton-p.short { width: 65%; height: 40px; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr 280px;
    gap: 2.5rem;
  }
}

@media (max-width: 900px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-img { min-height: 240px; aspect-ratio: 16/7; }

  .posts-grid { grid-template-columns: repeat(2, 1fr); }

  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-cta { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  #page-hero { padding: 7rem 0 3rem; }
  .featured-body { padding: 1.5rem; }
  .featured-title { font-size: 1.5rem; }

  .posts-grid { grid-template-columns: 1fr; }
  .post-card-title { font-size: 1rem; }

  .post-hero-meta { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .post-hero-meta-dot { display: none; }

  .post-sidebar { grid-template-columns: 1fr; }
  .sidebar-cta { grid-column: auto; }

  .post-nav-inner { flex-direction: column; align-items: flex-start; }

  .cats { gap: 6px; }
  .cat-btn { padding: 8px 14px; font-size: .78rem; }
}

@media (max-width: 380px) {
  #page-hero { padding: 6.5rem 0 2.5rem; }
  .post-article h2 { font-size: 1.3rem; }
  .post-article h3 { font-size: 1.1rem; }
}
