/* ===================================
   LIFEBLOG — Editorial Magazine Theme
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400;1,600&family=Jost:wght@300;400;500&family=EB+Garamond:ital@0;1&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #002266;
  --ink: #F0EDE8;
  --ink-soft: #B8B2AA;
  --ink-muted: #6A7A9A;
  --rule: #0A3080;
  --accent: #E8A87C;
  --accent-hover: #D4845A;

  --tag-jam: #252be9;
  --tag-studio: #99139d;
  --tag-gather: #008f5d;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-ui: 'Jost', sans-serif;

  --max-w: 1280px;
  --col-gap: 2rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ---- Utilities ---- */
.u-hidden { display: none !important; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

/* ===================================
   HEADER & NAV
   =================================== */

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
}

/* Logo / Site name */
.site-header__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.site-header__logo img {
  height: 36px;
  width: auto;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav__item {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
  position: relative;
}

.site-nav__item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav__item:hover { color: var(--ink); }
.site-nav__item:hover::after { transform: scaleX(1); }

/* Hamburger (mobile) */
.site-header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.site-header__burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

/* Mobile nav drawer */
.site-nav--mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--cream);
  border-top: 1px solid var(--rule);
  padding: 1.5rem 2rem;
}
.site-nav--mobile.is-open { display: flex; }
.site-nav--mobile .site-nav__item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
}
.site-nav--mobile .site-nav__item:last-child { border-bottom: none; }

/* ===================================
   HERO — 3-PANEL TAG GATEWAY
   =================================== */

.hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 80vh;
}

.hero__panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__panel-link {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hero__panel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.hero__panel:hover .hero__panel-bg { transform: scale(1.04); }

.hero__panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 12, 10, 0.80) 0%,
    rgba(15, 12, 10, 0.30) 50%,
    rgba(15, 12, 10, 0.05) 100%
  );
  z-index: 1;
  transition: opacity 0.4s;
}
.hero__panel:hover .hero__panel-overlay {
  background: linear-gradient(
    to top,
    rgba(15, 12, 10, 0.88) 0%,
    rgba(15, 12, 10, 0.40) 55%,
    rgba(15, 12, 10, 0.10) 100%
  );
}

.hero__panel-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem 2rem;
  width: 100%;
}

.hero__panel-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.5rem;
  display: block;
}

.hero__panel-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.1;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.hero__panel-desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  max-width: 20ch;
  margin-bottom: 1.25rem;
}

.hero__panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s, gap 0.2s;
}
.hero__panel:hover .hero__panel-cta {
  border-color: rgba(255,255,255,0.8);
  gap: 0.75rem;
}

/* Panel accent colors */
.hero__panel--jam .hero__panel-label { color: rgba(150, 155, 255, 0.85); }
.hero__panel--studio .hero__panel-label { color: rgba(220, 150, 225, 0.85); }
.hero__panel--gather .hero__panel-label { color: rgba(100, 220, 165, 0.85); }

/* Fallback background colors when no image is set */
.hero__panel--jam .hero__panel-bg { background-color: #0f11a0; }
.hero__panel--studio .hero__panel-bg { background-color: #5c0a5f; }
.hero__panel--gather .hero__panel-bg { background-color: #005238; }

/* Dividers between panels */
.hero__panel + .hero__panel {
  border-left: 1px solid rgba(255,255,255,0.08);
}

/* ===================================
   MASTHEAD (optional tagline strip)
   =================================== */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.masthead__rule {
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: var(--rule);
}

.masthead__tagline {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ===================================
   RECENT POSTS GRID
   =================================== */

.posts-section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.section-header__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.section-header__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-header__link {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s;
}
.section-header__link:hover { color: var(--accent); }

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem var(--col-gap);
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card__image-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--rule);
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.post-card:hover .post-card__image { transform: scale(1.04); }

.post-card__tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.post-card__tag--jam   { color: var(--tag-jam); }
.post-card__tag--studio { color: var(--tag-studio); }
.post-card__tag--gather { color: var(--tag-gather); }
.post-card__tag--default { color: var(--ink-muted); }

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.post-card:hover .post-card__title { color: var(--accent); }

.post-card__excerpt {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.post-card__meta-dot { opacity: 0.4; }

/* ===================================
   TAG PAGE HEADER
   =================================== */

.tag-header {
  padding: 4rem 2rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  max-width: var(--max-w);
  margin: 0 auto;
}

.tag-header__label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.tag-header__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.tag-header__desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 50ch;
  margin: 0 auto;
}

/* ===================================
   PAGINATION
   =================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
}

.pagination__btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--rule);
  transition: border-color 0.2s, color 0.2s;
}
.pagination__btn:hover { border-color: var(--ink); color: var(--accent); }
.pagination__count { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-muted); }

/* ===================================
   FOOTER
   =================================== */

.site-footer {
  background: #001144;
  color: rgba(255,255,255,0.5);
  padding: 3.5rem 0 2rem;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.site-footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 2rem;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  font-style: italic;
}

.site-footer__nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-footer__nav a {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  transition: color 0.2s;
}
.site-footer__nav a:hover { color: #fff; }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer__copy {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
}

.site-footer__ghost {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  transition: color 0.2s;
}
.site-footer__ghost:hover { color: rgba(255,255,255,0.6); }

/* ===================================
   SINGLE POST
   =================================== */

.post-header {
  padding: 4rem 2rem 2rem;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.post-header__tags {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-tag {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border: 1px solid currentColor;
}
.post-tag--jam    { color: var(--tag-jam); }
.post-tag--studio { color: var(--tag-studio); }
.post-tag--gather { color: var(--tag-gather); }
.post-tag--default { color: var(--ink-muted); }

.post-header__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.post-header__meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.post-header__author { color: var(--ink-soft); }
.post-header__dot { opacity: 0.4; }

.post-feature-image {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 2rem;
}

.post-feature-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Post body */
.post-content {
  max-width: 680px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.post-content p {
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.75rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.5;
}

.post-content img {
  width: 100%;
  margin: 2rem 0;
}

.post-content a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  transition: opacity 0.2s;
}
.post-content a:hover { opacity: 0.7; }

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
}
.post-content li { margin-bottom: 0.4rem; }

/* ---- Koenig card widths ---- */
.kg-width-wide {
  position: relative;
  width: 85vw;
  max-width: 1100px;
  margin: 2rem auto;
  left: 50%;
  transform: translateX(-50%);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  margin: 2rem auto;
  left: 50%;
  transform: translateX(-50%);
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  height: auto;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero__panel {
    min-height: 55vw;
  }
  .hero__panel + .hero__panel {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-nav { display: none; }
  .site-header__burger { display: flex; }
}

@media (max-width: 600px) {
  :root { --col-gap: 1.25rem; }

  .post-grid { grid-template-columns: 1fr; }

  .site-footer__top {
    flex-direction: column;
  }
  .site-footer__nav { justify-content: flex-start; }

  .hero__panel { min-height: 70vw; }

  .post-header { padding: 2.5rem 1.5rem 1.5rem; }
  .post-content { padding: 0 1.5rem; }
}
