/* ==========================================================================
   UttarakhandShaadi Blog — visual identity
   Inspired by Aipan: the geru (red-ochre) and rice-paste folk art drawn at
   thresholds and altars before Kumaoni weddings and festivals. The hero strip
   and dividers carry that motif; the reading surface stays calm and paper-like
   so long-form posts stay easy on the eye.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Yeseva+One&family=Karla:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --geru: #a23c28;       /* red-ochre — primary accent, the Aipan pigment */
  --geru-dark: #7c2c1d;
  --paper: #faf6ee;      /* warm paper background for reading */
  --ink: #2c2620;        /* near-black warm ink for body text */
  --deodar: #2f4438;     /* deep pine green — secondary accent */
  --brass: #b9852c;      /* brass/marigold — highlights, accents */
  --stone: #7a7163;      /* muted secondary text */
  --line: #e6dcc9;       /* hairline borders on paper */

  --font-display: 'Yeseva One', Georgia, serif;
  --font-body: 'Karla', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* --------------------------------------------------------------------------
   Aipan motif — a repeating dot-and-line pattern used as a signature device
   -------------------------------------------------------------------------- */
.aipan-band {
  height: 14px;
  width: 100%;
  background-image:
    radial-gradient(circle at 7px 7px, var(--paper) 2.4px, transparent 2.6px),
    repeating-linear-gradient(90deg, var(--paper) 0 14px, transparent 14px 28px);
  background-color: var(--geru);
  background-size: 28px 14px, 28px 14px;
}

/* ==========================================================================
   Global page shell
   ========================================================================== */
.blog-page,
.blog-detail-page {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

.blog-page a,
.blog-detail-page a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Hero (blogs.php)
   ========================================================================== */
.blog-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 6vw 56px;
  background: var(--deodar);
  color: var(--paper);
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 14px;
  background-image:
    radial-gradient(circle at 7px 7px, var(--deodar) 2.4px, transparent 2.6px),
    repeating-linear-gradient(90deg, var(--brass) 0 14px, transparent 14px 28px);
  background-color: var(--brass);
  background-size: 28px 14px, 28px 14px;
}

.blog-hero__copy .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  border: 1px solid rgba(201, 168, 102, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}

.blog-hero__copy h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.15;
  margin: 0 0 16px;
  max-width: 18ch;
}

.blog-hero__copy p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(250, 246, 238, 0.82);
  max-width: 46ch;
  margin: 0 0 28px;
}

.blog-search {
  display: flex;
  max-width: 420px;
  background: var(--paper);
  border-radius: 999px;
  padding: 5px 5px 5px 20px;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.5);
}

.blog-search input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.blog-search button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  background: var(--geru);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.15s ease;
}

.blog-search button:hover { background: var(--geru-dark); }

.featured-blog {
  display: block;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(250, 246, 238, 0.06);
  border: 1px solid rgba(201, 168, 102, 0.3);
  min-height: 260px;
}

.featured-blog img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.featured-blog span {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--brass);
  color: var(--deodar);
  padding: 5px 12px;
  border-radius: 999px;
}

.featured-blog h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  margin: 16px 18px 6px;
  color: var(--paper);
}

.featured-blog p {
  margin: 0 18px 18px;
  font-size: 14px;
  color: rgba(250, 246, 238, 0.78);
  line-height: 1.5;
}

/* If the featured card has no image, give it a base colour to sit on */
.featured-blog:not(:has(img)) {
  background: linear-gradient(160deg, var(--geru), var(--geru-dark));
}

/* ==========================================================================
   Layout: sidebar + results (blogs.php)
   ========================================================================== */
.blog-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 44px;
  padding: 48px 6vw 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.blog-sidebar h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 12px;
}

.blog-sidebar a {
  position: relative;
  font-size: 15px;
  color: var(--ink);
  padding: 9px 4px 9px 18px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.blog-sidebar a::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transform: translateY(-50%);
  transition: background 0.15s ease;
}

.blog-sidebar a:hover { color: var(--geru); }

.blog-sidebar a.active {
  color: var(--geru);
  font-weight: 600;
  background: rgba(162, 60, 40, 0.07);
}

.blog-sidebar a.active::before { background: var(--geru); }

.blog-results__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 28px;
}

.blog-results__top h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 0;
}

.blog-results__top a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--geru);
  text-decoration: underline;
}

/* ==========================================================================
   Blog cards (grid shared by blogs.php and blog-details.php)
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.blog-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -22px rgba(44, 38, 32, 0.35);
  border-color: rgba(162, 60, 40, 0.3);
}

.blog-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--deodar);
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: rgba(250, 246, 238, 0.55);
  background: repeating-linear-gradient(135deg, var(--deodar) 0 18px, #283b30 18px 36px);
}

.blog-card__body { padding: 18px 20px 22px; }

.blog-card__body > span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
}

.blog-card__body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.32;
  margin: 0 0 8px;
  color: var(--ink);
}

.blog-card__body p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--stone);
  margin: 0 0 12px;
}

.blog-card__body time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--stone);
}

/* ==========================================================================
   Empty state + pagination
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 8px;
}

.empty-state p { color: var(--stone); margin: 0; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 13px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  transition: all 0.15s ease;
}

.pagination a:hover { border-color: var(--geru); color: var(--geru); }

.pagination a.active {
  background: var(--geru);
  border-color: var(--geru);
  color: var(--paper);
}

/* ==========================================================================
   Article page (blog-details.php)
   ========================================================================== */
.blog-article {
  /* max-width: 720px; */
  margin: 0 auto;
  padding: 56px 6vw 20px;
}

.blog-article__header { margin-bottom: 28px; }

.crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brass);
  margin-right: 10px;
}

.crumb::after { content: "/"; margin-left: 10px; color: var(--line); }

.blog-article__header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  margin: 16px 0 14px;
  color: var(--ink);
}

.blog-article__header > p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--stone);
  margin: 0 0 18px;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--stone);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.article-cover {
  display: block;
  width: 100%;
  /* max-width: 720px; */
  margin: 0 auto 36px;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-content {
  /* max-width: 720px; */
  margin: 0 auto;
  padding: 0 6vw;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.article-content h2,
.article-content h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  margin: 36px 0 14px;
}

.article-content p { margin: 0 0 20px; }

.article-content a { color: var(--geru); text-decoration: underline; }

.article-content img {
  width: 100%;
  border-radius: 10px;
  margin: 24px 0;
}

.article-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--geru);
  font-style: italic;
  color: var(--stone);
}

/* Tags — now clickable pills (.tag-pill, added in blog-details.php) */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  /* max-width: 720px; */
  margin: 36px auto 0;
  padding: 24px 6vw 0;
  border-top: 1px solid var(--line);
}

.tag-pill,
.tag-list span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--deodar);
  background: rgba(47, 68, 56, 0.07);
  border: 1px solid rgba(47, 68, 56, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-pill:hover {
  background: var(--geru);
  border-color: var(--geru);
  color: var(--paper);
}

/* Related posts */
.related-posts {
  max-width: 1080px;
  margin: 64px auto 80px;
  padding: 48px 6vw 0;
  border-top: 1px solid var(--line);
}

.related-posts h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 24px;
}

.detail-empty {
  text-align: center;
  padding: 100px 20px;
}

.detail-empty h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 10px;
}

.detail-empty p { color: var(--stone); margin: 0 0 20px; }

.detail-empty .read-more {
  display: inline-block;
  font-weight: 600;
  background: var(--geru);
  color: var(--paper);
  padding: 11px 24px;
  border-radius: 999px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .blog-hero { grid-template-columns: 1fr; padding: 56px 6vw; }
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
  }
  .blog-sidebar h2 { width: 100%; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article,
  .article-content,
  .tag-list { padding-left: 5vw; padding-right: 5vw; }
}

/* ==========================================================================
   Enhanced article layout (screenshot-style detail page)
   ========================================================================== */
.blog-detail-page {
  background:
    radial-gradient(circle at top left, rgba(185, 133, 44, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(162, 60, 40, 0.08), transparent 24%),
    var(--paper);
  padding: 34px 0 76px;
}

.detail-hero-shell,
.detail-content-shell,
.related-posts {
  width: min(1240px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

.detail-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--stone);
  margin-bottom: 22px;
}

.detail-breadcrumbs a {
  color: var(--stone);
  transition: color 0.18s ease;
}

.detail-breadcrumbs a:hover { color: var(--geru); }

.detail-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 34px;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(230, 220, 201, 0.9);
  border-radius: 34px;
  padding: 34px;
  box-shadow: 0 22px 60px rgba(44, 38, 32, 0.08);
}

.detail-hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: #1a1730;
}

.detail-kicker {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff355d;
  font-weight: 600;
}

.detail-summary {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
  color: #5f6678;
}

.detail-author-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.detail-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff5576, #ff2d55);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(255, 45, 85, 0.22);
}

.detail-author-copy {
  display: grid;
  gap: 4px;
  color: #5f6678;
  font-size: 15px;
}

.detail-author-copy strong { color: #ff355d; }

.detail-hero-media img,
.detail-hero-fallback {
  width: 100%;
  min-height: 540px;
  border-radius: 28px;
}

.detail-hero-media img {
  display: block;
  object-fit: cover;
  box-shadow: 0 26px 60px rgba(44, 38, 32, 0.12);
}

.detail-hero-fallback {
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(162, 60, 40, 0.95), rgba(47, 68, 56, 0.92)),
    var(--deodar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.2;
}

.detail-content-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 30px;
}

.detail-toc {
  position: sticky;
  top: 110px;
}

.detail-toc-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 220, 201, 0.95);
  border-radius: 24px;
  padding: 26px 26px 20px;
  box-shadow: 0 18px 40px rgba(44, 38, 32, 0.06);
}

.detail-toc-card h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1730;
}

.detail-toc-card ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  position: relative;
}

.detail-toc-card ul::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 53, 93, 0.9), rgba(255, 53, 93, 0.18));
}

.detail-toc-card li {
  position: relative;
  padding-left: 20px;
}

.detail-toc-card li + li { margin-top: 14px; }

.detail-toc-card li::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff355d;
  box-shadow: 0 0 0 4px rgba(255, 53, 93, 0.12);
}

.detail-toc-card a {
  color: #42495b;
  line-height: 1.55;
  transition: color 0.18s ease, transform 0.18s ease;
}

.detail-toc-card a:hover {
  color: #ff355d;
  transform: translateX(2px);
}

.detail-story {
  min-width: 0;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(230, 220, 201, 0.92);
  border-radius: 30px;
  padding: 18px 34px 12px;
  box-shadow: 0 22px 50px rgba(44, 38, 32, 0.06);
}

.detail-section {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(230, 220, 201, 0.9);
}

.detail-section:last-of-type { border-bottom: none; }

.detail-section-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff5576, #ff2d55);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(255, 45, 85, 0.16);
}

.detail-section-body h2 {
  margin: 2px 0 14px;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.18;
  color: #1a1730;
}

.detail-section-copy {
  font-size: 17px;
  line-height: 1.85;
  color: #404858;
}

.detail-section-copy h3,
.detail-section-copy h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: #1a1730;
  margin: 26px 0 12px;
}

.detail-section-copy p { margin: 0 0 18px; }

.detail-section-copy a {
  color: #ff355d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-section-copy img {
  width: 100%;
  border-radius: 20px;
  margin: 22px 0;
  object-fit: cover;
}

.detail-section-copy blockquote {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid #ff355d;
  border-radius: 0 18px 18px 0;
  background: rgba(255, 53, 93, 0.06);
  color: #51596a;
}

.detail-section-copy ul,
.detail-section-copy ol {
  margin: 0 0 20px 22px;
  padding: 0;
}

.detail-section-copy li + li { margin-top: 10px; }

.detail-tag-list {
  margin: 8px 0 0;
  padding: 24px 0 0 !important;
  border-top: 1px solid rgba(230, 220, 201, 0.9);
}

.detail-tag-list.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-tag-list .tag-pill {
  color: #5a6476;
  background: rgba(255, 53, 93, 0.06);
  border: 1px solid rgba(255, 53, 93, 0.16);
  border-radius: 999px;
  padding: 8px 14px;
}

.detail-tag-list .tag-pill:hover {
  background: #ff355d;
  border-color: #ff355d;
  color: #fff;
}

.related-posts {
  margin-top: 44px;
  padding-top: 38px;
  border-top: 1px solid rgba(230, 220, 201, 0.92);
}

.related-posts h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  color: #1a1730;
  margin: 0 0 24px;
}

@media (max-width: 980px) {
  .detail-hero-card,
  .detail-content-shell {
    grid-template-columns: 1fr;
  }

  .detail-hero-media img,
  .detail-hero-fallback {
    min-height: 380px;
  }

  .detail-toc {
    position: static;
  }
}

@media (max-width: 620px) {
  .detail-hero-shell,
  .detail-content-shell,
  .related-posts {
    width: min(100% - 22px, 1240px);
  }

  .detail-hero-card {
    padding: 18px;
    border-radius: 24px;
    gap: 22px;
  }

  .detail-hero-copy h1 {
    font-size: clamp(30px, 12vw, 48px);
  }

  .detail-summary {
    max-width: none;
    font-size: 16px;
  }

  .detail-hero-media img,
  .detail-hero-fallback {
    min-height: 260px;
    border-radius: 20px;
  }

  .detail-story {
    padding: 12px 18px;
    border-radius: 22px;
  }

  .detail-section {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 0;
  }

  .detail-section-badge {
    width: 44px;
    height: 44px;
  }

  .detail-section-body h2 {
    font-size: clamp(24px, 7vw, 34px);
  }

  .detail-section-copy {
    font-size: 16px;
    line-height: 1.75;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .blog-card, .blog-search button, .pagination a, .tag-pill {
    transition: none;
  }
}
