/*
 * Theme Name: Pallav Blog
 * Theme URI: https://pallavsharda.com/blog
 * Description: Minimal custom theme for pallavsharda.com/blog. Matches the site-wide design system.
 * Version: 1.0
 * Author: Pallav Sharda
 * Author URI: https://pallavsharda.com
 * License: Private
 * Text Domain: pallav-blog
 */


/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* ============================================================
   DESIGN TOKENS
   Mirrored from production design-system.css
   ============================================================ */

:root {
  /* Color */
  --ink:        #18181b;
  --ink-2:      #3f3f46;
  --ink-3:      #8d8d96;
  --link:       #c9605a;
  --link-hover: #a84844;
  --base:       #FAFAF8;

  /* Typography */
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'DM Sans', -apple-system, sans-serif;
  --text-base: 15px;

  /* Layout */
  --gutter: 48px;
  --max:    840px;
  --nav-h:  56px;
}


/* ============================================================
   BASE
   ============================================================ */

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  color: var(--ink);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--base);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}


/* ============================================================
   BACKGROUND SYSTEM
   Warm parchment + grain noise + drifting blobs + vignette
   ============================================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--base);
  pointer-events: none;
}

/* Grain noise */
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.065;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Ambient blobs */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.bg-blob-1 {
  width: 600px; height: 500px;
  top: -140px; left: -100px;
  background: radial-gradient(ellipse, rgba(210,160,90,0.14) 0%, transparent 70%);
  animation: drift1 22s ease-in-out infinite alternate;
}

.bg-blob-2 {
  width: 340px; height: 280px;
  bottom: -80px; right: -80px;
  background: radial-gradient(ellipse, rgba(210,160,90,0.07) 0%, transparent 70%);
  animation: drift2 28s ease-in-out infinite alternate;
}

.bg-blob-3 {
  width: 380px; height: 320px;
  top: 42%; right: 6%;
  background: radial-gradient(ellipse, rgba(130,160,150,0.09) 0%, transparent 70%);
  animation: drift3 20s ease-in-out infinite alternate;
}

.bg-blob-4 {
  width: 340px; height: 280px;
  bottom: 15%; left: -60px;
  background: radial-gradient(ellipse, rgba(200,155,80,0.07) 0%, transparent 70%);
  animation: drift1 26s ease-in-out infinite alternate-reverse;
}

/* Warm vignette */
.bg-fold {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 65% 55% at 103% 103%,
    rgba(140,108,52,0.20) 0%,
    rgba(140,108,52,0.09) 42%,
    rgba(140,108,52,0.02) 62%,
    transparent 75%
  );
  pointer-events: none;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(36px, 28px); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-28px, -22px); }
}
@keyframes drift3 {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-18px, 24px); }
}


/* Corner ornaments removed for blog theme */


/* ============================================================
   STACKING ORDER
   ============================================================ */

nav, main, footer { position: relative; z-index: 1; }


/* ============================================================
   NAV
   Fixed frosted-glass bar (matches production design-system.css)
   ============================================================ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(250,250,248,0.85);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06), 0 1px 0 rgba(0,0,0,0.04);
}

.nav-logo {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
}

.nav-monogram {
  width: 30px; height: 30px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.nav-monogram-fallback {
  display: none;
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

/* Animated underline */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1.5px;
  background: var(--link);
  transform: scaleX(0);
  transition: transform 0.2s;
  transform-origin: left;
}

.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link:hover::after,
.nav-link.active::after,
.nav-link--active::after { transform: scaleX(1); }
.nav-link.active,
.nav-link--active { color: var(--ink); }


/* ============================================================
   FOOTER
   Matches production footer from design-system.css
   ============================================================ */

.page-footer {
  background: rgba(248,248,246,0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 -2px 18px rgba(0,0,0,0.05), 0 -1px 0 rgba(0,0,0,0.04);
}

.page-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter) 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

.page-footer-inner a {
  color: var(--ink-2);
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.2s;
}

.page-footer-inner a:hover { color: var(--link); }

.footer-ai-text a {
  color: var(--link);
  text-decoration: none;
  margin-left: 0;
  transition: color 0.2s;
}
.footer-ai-text a:hover { text-decoration: underline; }

.footer-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-icon-link {
  display: flex;
  align-items: center;
  margin-left: 0;
  transition: color 0.2s;
}

.footer-icon-link.fi-li       { color: #8ab0cc; }
.footer-icon-link.fi-li:hover { color: #0a66c2; }
.footer-icon-link.fi-q        { color: #c97472; }
.footer-icon-link.fi-q:hover  { color: #B92B27; }


/* ============================================================
   BLOG LAYOUT
   Centered column, no sidebar
   ============================================================ */

.blog-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 32px 64px;
}


/* ============================================================
   CATEGORY PILLS
   ============================================================ */

.cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cat-pill {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-3);
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 100px;
  padding: 5px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-pill:hover {
  color: var(--link);
  border-color: var(--link);
  background: rgba(255,255,255,0.7);
  text-decoration: none;
}

.cat-pill.active {
  color: var(--link);
  border-color: var(--link);
  background: rgba(255,255,255,0.7);
  font-weight: 500;
  text-decoration: none;
}


/* ============================================================
   POST LIST
   ============================================================ */

.post-item {
  padding: 20px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.post-date {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.post-title-link {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
  display: inline-block;
}

.post-title-link:hover {
  color: var(--link);
  text-decoration: none;
}

.post-excerpt {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 6px;
  line-height: 1.55;
}

.post-cat-tag {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}


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

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
}

.pagination a {
  font-size: 14px;
  color: var(--link);
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}


/* ============================================================
   ARCHIVE LINK (below pagination on index)
   ============================================================ */

.archive-callout {
  margin-top: 40px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
}

.archive-callout strong {
  font-weight: 500;
  color: var(--ink-2);
}

.archive-callout a strong {
  color: inherit;
}

.archive-callout a {
  color: var(--link);
  text-decoration: none;
}

.archive-callout a:hover {
  text-decoration: underline;
}


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

.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 56px) 32px 64px;
}

/* Breadcrumb meta */
.article-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.article-meta a {
  color: var(--link);
  text-decoration: none;
}

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

/* Post title */
.article-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 8px;
}

/* Post date */
.article-date {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 40px;
}

/* Article body: WP content styling */
.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin: 40px 0 16px;
}

.article-body h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin: 32px 0 12px;
}

.article-body h4 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin: 24px 0 10px;
}

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

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

.article-body blockquote {
  border-left: 3px solid rgba(0,0,0,0.14);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(0,0,0,0.02);
  border-radius: 0 8px 8px 0;
}

.article-body blockquote p {
  color: var(--ink-2);
  font-style: italic;
  margin-bottom: 0;
}

.article-body code {
  font-size: 14px;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-body pre {
  background: rgba(0,0,0,0.04);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.article-body strong {
  font-weight: 500;
}

.article-body a {
  color: var(--link);
  text-decoration: none;
}

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

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

.article-body figure {
  margin: 24px 0;
}

.article-body figcaption {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 8px;
  text-align: center;
}

/* WP block styling */
.article-body .wp-block-image {
  margin: 24px 0;
}

.article-body .wp-block-separator {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 32px 0;
}


/* ============================================================
   POST NAVIGATION (prev/next at bottom of single post)
   ============================================================ */

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.post-nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  max-width: 45%;
}

.post-nav a:hover {
  color: var(--link);
  text-decoration: none;
}

.post-nav .nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
  display: block;
}

.post-nav .nav-title {
  font-weight: 500;
  color: inherit;
}

/* Back to blog link */
.back-to-blog {
  display: inline-block;
  margin-top: 32px;
  font-size: 14px;
  color: var(--link);
  text-decoration: none;
}

.back-to-blog:hover {
  text-decoration: underline;
}


/* ============================================================
   PAGE TEMPLATE (generic WP pages)
   ============================================================ */

.page-container {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 56px) 32px 64px;
}

.page-container h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 32px;
}

.page-container .entry-content p { margin-bottom: 20px; }
.page-container .entry-content h2 { font-size: 20px; font-weight: 500; margin: 40px 0 16px; }
.page-container .entry-content h3 { font-size: 17px; font-weight: 500; margin: 32px 0 12px; }
.page-container .entry-content ul,
.page-container .entry-content ol { margin: 0 0 20px 20px; }
.page-container .entry-content li { margin-bottom: 8px; }
.page-container .entry-content a { color: var(--link); }
.page-container .entry-content a:hover { text-decoration: underline; }


/* ============================================================
   ARCHIVE PAGE TEMPLATE
   ============================================================ */

.archive-page-intro {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 32px;
  line-height: 1.65;
}

.archive-year-heading {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.archive-year-heading:first-of-type {
  margin-top: 0;
}


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

@media (max-width: 720px) {
  :root { --gutter: 20px; }

  nav { padding: 0 20px; }
  .nav-links { gap: 18px; }

  .blog-container {
    padding: calc(var(--nav-h) + 32px) 20px 48px;
  }

  .article-container {
    padding: calc(var(--nav-h) + 40px) 20px 48px;
  }

  .page-container {
    padding: calc(var(--nav-h) + 40px) 20px 48px;
  }

  .cat-row {
    gap: 6px;
  }

  .cat-pill {
    font-size: 15px;
    padding: 4px 12px;
  }

  .post-nav {
    flex-direction: column;
    gap: 20px;
  }

  .post-nav a {
    max-width: 100%;
  }

  .page-footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 20px 20px 48px;
  }

}
