:root {
  color-scheme: dark;
  --bg: #030615;
  --panel: rgba(9, 14, 32, 0.92);
  --card: rgba(10, 16, 30, 0.9);
  --card-hover: rgba(20, 28, 48, 0.95);
  --accent: #4df3ff;
  --accent-strong: #13c7ff;
  --text: #f4f6ff;
  --muted: #9aa4c4;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 15px 45px rgba(4, 9, 20, 0.6);
  --radius: 22px;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #071126, #02030b 60%);
  color: var(--text);
  font-family: var(--font, 'Space Grotesk', sans-serif);
}

.post-page {
  background: radial-gradient(circle at top, #050c1f, #010208 65%);
}

.global-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(3, 6, 21, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.global-header__inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.global-header__brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}

.global-header__logo {
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  letter-spacing: 0.08em;
  color: #23ffdb;
  text-shadow: 0 0 15px rgba(35, 255, 219, 0.7);
  display: inline-flex;
  gap: 0;
  align-items: center;
}

.guru-gyan-header span {
  display: inline-block;
  letter-spacing: inherit;
}

.global-header__tagline {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  opacity: 0.7;
}

.post-shell {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 5vw, 48px) 80px;
}

.post-card {
  margin-top: 20px;
  background: rgba(7, 12, 28, 0.92);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 48px);
}

.hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.post-meta {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.post-card h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin: 12px 0 8px;
}

.fixture-note {
  color: var(--accent);
  font-weight: 500;
}

.post-body {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.7;
  margin-top: 24px;
}

.post-body p {
  margin: 0 0 1.3em;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.2em 1.2em;
}

.share {
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.share-buttons a {
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text);
  font-weight: 600;
}

.share-buttons a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px) 60px;
}

.gg-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 3vw, 32px);
  background: linear-gradient(145deg, rgba(24, 34, 70, 0.92), rgba(7, 11, 26, 0.98));
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero-copy {
  text-align: center;
}

.hero-copy .hero-title {
  margin: 10px 0 6px;
}

.hero-copy .hero-subhead {
  margin: 0 0 6px;
}

.hero-copy .hero-tagline {
  margin-top: 0;
}

.header-topline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-top: 4px;
}

.hero-top-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  position: relative;
  padding-top: 4px;
  /* Adjust this value as needed for vertical alignment */
}

.hero-flag {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(5, 12, 28, 0.92);
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #22d3ee;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.4);
  flex-shrink: 0;
  position: absolute;
  top: 0;
  left: 0;
  top: -10px;
  left: 10px;
  top: -10px;
  transform: translateY(-50%);
}

.hero-top-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 0;
  right: 0;
  transform: translateY(-50%);
}

.hero-title[data-font="xl"] {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-subhead[data-font="md"] {
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-tagline[data-font="sm"] {
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-style: italic;
  color: var(--accent);
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--accent);
  text-align: center;
}

.lede {
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

.header-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-row {
  width: min(500px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.search-field {
  flex-grow: 1;
  max-width: 300px;
  /* Reduced search bar size */
}

.search-field {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(2, 6, 18, 0.85);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.search-field input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
}

.search-field input::placeholder {
  color: var(--muted);
}

.date-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.date-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 25px 45px rgba(3, 6, 21, 0.65);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  min-width: 200px;
  z-index: 50;
}

.date-filter[data-open="true"] .date-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.date-popover input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px;
  background: rgba(5, 9, 20, 0.85);
  color: var(--text);
  font-size: 0.95rem;
}

.date-popover input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#tocSearch {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  background: rgba(3, 6, 21, 0.6);
  color: var(--text);
  font-size: 0.95rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 18, 34, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn {
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 18, 34, 0.8);
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sort-btn[data-order="asc"] {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-ghost {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
}

.search-clear {
  background: rgba(12, 18, 34, 0.9);
  border: 1px solid rgba(77, 243, 255, 0.5);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.search-clear:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(120deg, #00d2ff, #3a7bd5);
  color: #001728;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.feed {
  margin-top: 36px;
  background: rgba(3, 6, 21, 0.7);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: clamp(16px, 4vw, 32px);
  box-shadow: var(--shadow);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

@media (min-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.blog-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid #22d3ee;
  overflow: hidden;
  transition: transform 0.25s ease, background 0.25s ease, border 0.25s ease;
  height: 280px;
  display: flex;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.35);
}

.blog-card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  border-color: #4df3ff;
  box-shadow: 0 0 30px rgba(77, 243, 255, 0.55);
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-image {
  flex: 1;
  padding: 12px 16px;
}

.card-image img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1120;
}

.card-title {
  padding: 0 16px 18px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

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

.pagination button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
}

.pagination button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button:not([disabled]):hover {
  border-color: var(--accent);
  background: rgba(77, 243, 255, 0.08);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 0 10px;
}

.toc-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 10px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-width: 120px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text);
}

.toc-toggle .toc-label {
  color: var(--accent);
}

.header-menu {
  min-width: 100px;
}

.toc-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: rgba(5, 10, 26, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.toc-drawer.open {
  right: 0;
}

.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.toc-overlay[hidden] {
  display: none;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toc-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#tocList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#tocList a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  display: block;
  transition: border 0.2s ease, color 0.2s ease;
}

#tocList a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toc-empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

@media (max-width: 520px) {
  .blog-card {
    height: 260px;
  }

  .card-image img {
    height: 120px;
  }
}

.sort-icon[data-order="asc"] {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  .hero-flag {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    padding: 5px 10px;
  }

  .date-popover {
    right: auto;
    left: 0;
  }

  .header-filters {
    max-width: 100%;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .search-clear {
    width: 100%;
    justify-content: center;
  }
}