/*
Theme Name: Belhasa Blog
Theme URI: https://belhasa.com/
Author: Belhasa
Author URI: https://belhasa.com/
Description: Editorial blog theme for Belhasa — brand identity with shadcn/ui polish.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: belhasa-blog
*/

:root {
  /* Brand */
  --brand-red: #e3120b;
  --brand-red-dark: #b90c06;
  --brand-header-bg: #e3120b;

  /* shadcn/ui design tokens (zinc light) */
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: var(--brand-red);
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #09090b;
  --radius: 0.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);

  /* Legacy aliases (keep templates working) */
  --color-bg: var(--background);
  --color-text: var(--foreground);
  --color-muted: var(--muted-foreground);
  --color-header-red: var(--brand-red);
  --color-header-red-dark: var(--brand-red-dark);
  --color-border: var(--border);
  --shadcn-background: var(--background);
  --shadcn-foreground: var(--foreground);
  --shadcn-muted: var(--muted);
  --shadcn-muted-fg: var(--muted-foreground);
  --shadcn-border: var(--border);
  --shadcn-ring: rgb(9 9 11 / 0.12);
  --shadcn-radius: calc(var(--radius) - 2px);
  --shadcn-shadow-sm: var(--shadow-sm);

  --font-primary: 'Inter', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  --font-heading: 'Noto Sans Tamil', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --heading-size: 25px;
  --container-max: 1280px;
  --container-pad: 1.25rem;
  --site-header-offset: 8.125rem;
  --transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  --hover-bg: rgb(227 18 11 / 0.08);
  --hover-border: rgb(227 18 11 / 0.22);
}

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

html {
  font-family: var(--font-primary);
}

html,
body,
button,
input,
textarea,
select,
optgroup,
kbd,
.site-main,
.site-header,
.site-footer,
.entry-content,
.entry-content *,
.wp-block-post-content,
.wp-block-post-content * {
  font-family: var(--font-primary);
}

h1,
h2,
h3,
h4,
h5,
h6,
.single-title,
.homepage-hero-title,
.homepage-hero-title a,
.homepage-hero-side-title,
.homepage-hero-side-title a,
.story-feed-heading,
.story-card-title,
.story-card-title a,
.archive-list-item-title,
.archive-list-item-title a,
.archive-title,
.archive-year-title,
.archive-card-title,
.archive-card-title a,
.static-page-title,
.not-found-title,
.search-page-title,
.post-card-title,
.mag-card-title,
.mag-card-title a,
.mag-section-title,
.single-sidebar-title,
.single-related-title,
.single-related-title a,
.single-entry-content h2,
.single-entry-content h3,
.single-entry-content h4,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4,
.wp-block-post-content h5,
.wp-block-post-content h6,
.footer-site-name,
.footer-site-name a {
  font-family: var(--font-heading);
}

html,
body {
  background: var(--background);
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-primary);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  line-height: 1.6;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--primary);
}

.belhasa-site-header .register-header-bar a:hover {
  color: #ffffff;
}

.belhasa-site-header .register-header-bar .btn-header-join:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--background);
}

.belhasa-site-header .register-header-bar .btn-header-join:hover .btn-header-join-icon {
  color: #25d366;
}

.homepage-hero-author:hover,
.homepage-hero-side-meta a:hover,
.mag-section-link:hover,
.single-entry-content a:hover,
.static-page-content a:hover,
.logged-in-as a:hover {
  color: var(--brand-red-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.site-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   SITE HEADER — Belhasa brand + shadcn polish
   ========================================================================== */

/* Reading progress (single posts) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 260;
  pointer-events: none;
  background: transparent;
}

.reading-progress-bar {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: #09090b;
  transition: transform 0.18s linear;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar {
    transition: none;
  }
}

.belhasa-site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  font-family: var(--font-primary);
  background: var(--brand-header-bg);
  border-bottom: none;
}

.register-header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
}

.register-header-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  z-index: 2;
  min-width: 0;
}

.header-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.15rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgb(255 255 255 / 0.35);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.header-date-day {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-date-sep {
  opacity: 0.75;
}

.header-date-full {
  font-weight: 500;
}

.register-header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: calc(100% - 320px);
  pointer-events: none;
  z-index: 1;
}

.register-header-center a,
.register-header-center .custom-logo-link {
  pointer-events: auto;
}

.register-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  z-index: 2;
}

.btn-header-join-icon {
  flex-shrink: 0;
  color: #25d366;
}

.register-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #ffffff;
  border-radius: var(--shadcn-radius);
  transition: var(--transition);
  flex-shrink: 0;
}

.register-icon-btn:hover {
  background: rgb(255 255 255 / 0.14);
  color: #ffffff;
}

.register-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-red), 0 0 0 4px rgb(255 255 255 / 0.45);
}

.register-icon-btn svg {
  display: block;
}

/* Sections drawer toggle — mobile/tablet only (desktop uses category nav) */
@media (min-width: 901px) {
  #btn-sections-open {
    display: none;
  }

  .header-date {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
}

.register-site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.register-site-logo:hover {
  opacity: 0.92;
  color: #ffffff;
}

.register-site-logo img,
.custom-logo-link img {
  display: block;
  max-height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.register-sign-in {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.35rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
}

.register-sign-in:hover {
  opacity: 0.88;
  color: #ffffff;
}

.btn-header-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 1rem;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--shadcn-radius);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-header-join:hover {
  background: var(--background);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-header-join:focus-visible {
  outline: none;
  box-shadow:
    var(--shadow-sm),
    0 0 0 2px var(--brand-red),
    0 0 0 4px rgb(255 255 255 / 0.55);
}

.btn-header-join:active {
  transform: translateY(0.5px);
  box-shadow: none;
}

/* Category navigation */
.category-nav-bar {
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.category-nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar {
  display: none;
}

.category-nav-list {
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
  width: max-content;
  flex-shrink: 0;
  gap: 0;
}

.category-nav-item {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.category-nav-item:not(:last-child) .category-nav-link {
  border-right: 1px solid #d4d4d8;
}

.category-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.15rem;
  color: #3f3f46;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  border-bottom: none;
  margin-bottom: 0;
  transition: var(--transition);
}

.category-nav-link:hover {
  color: var(--primary);
  background: var(--background);
}

.category-nav-item.is-active .category-nav-link {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: transparent;
}

/* News ticker */
.news-ticker {
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.news-ticker-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.35rem var(--container-pad);
  min-height: 2.15rem;
}

.news-ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.2rem 0.55rem 0.2rem 0.4rem;
  border-radius: 9999px;
  background: rgb(227 18 11 / 0.08);
  border: 1px solid rgb(227 18 11 / 0.16);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  white-space: nowrap;
  line-height: 1;
}

.news-ticker-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgb(227 18 11 / 0.45);
  animation: news-ticker-pulse 1.8s ease-out infinite;
}

.news-ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
}

.news-ticker-track {
  display: flex;
  width: max-content;
  animation: news-ticker-scroll 55s linear infinite;
}

.news-ticker:hover .news-ticker-track,
.news-ticker:focus-within .news-ticker-track {
  animation-play-state: paused;
}

.news-ticker-group {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 0.85rem;
}

.news-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 28rem;
  color: inherit;
  transition: var(--transition);
}

.news-ticker-cat {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
}

.news-ticker-link {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.news-ticker-item:hover .news-ticker-link {
  color: var(--primary);
}

.news-ticker-sep {
  flex-shrink: 0;
  width: 1px;
  height: 0.75rem;
  background: var(--border);
}

@keyframes news-ticker-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes news-ticker-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(227 18 11 / 0.45);
  }

  70% {
    box-shadow: 0 0 0 0.35rem rgb(227 18 11 / 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgb(227 18 11 / 0);
  }
}

@media (max-width: 680px) {
  .news-ticker-inner {
    gap: 0.55rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

  .news-ticker-item {
    max-width: 16rem;
  }

  .news-ticker-link {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    gap: 0.5rem 0.875rem;
  }

  .news-ticker-dot {
    animation: none;
  }

  .news-ticker-group[aria-hidden='true'] {
    display: none;
  }

  .news-ticker-viewport {
    mask-image: none;
    overflow: visible;
  }
}

/* Search command palette (shadcn Command) */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(9 9 11 / 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.search-command {
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%) scale(0.98);
  width: min(640px, calc(100vw - 2rem));
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 301;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.search-command.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.search-command-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
}

.search-command-icon {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.search-command-input {
  flex: 1;
  min-width: 0;
  height: 3rem;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--foreground);
  outline: none;
}

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

.search-command-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--shadcn-radius);
  background: var(--muted);
  color: var(--muted-foreground);
  font-family: var(--font-primary);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  text-transform: lowercase;
  cursor: pointer;
  flex-shrink: 0;
}

.search-command-kbd:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.search-command-body {
  max-height: min(360px, 50vh);
  overflow: hidden;
}

.search-command-list {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  padding: 0.5rem;
  scroll-padding: 0.5rem;
}

.search-command-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.search-command-group + .search-command-group {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.search-command-group-label {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 1;
}

.search-command-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--shadcn-radius);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.35;
  cursor: pointer;
  transition: var(--transition);
}

.search-command-item--post {
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
}

.search-command-item:hover,
.search-command-item.is-active,
.search-command-item[aria-selected="true"] {
  background: var(--hover-bg);
  color: var(--primary);
}

.search-command-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.search-command-item-thumb {
  display: block;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: calc(var(--shadcn-radius) - 1px);
  background: var(--muted);
  border: 1px solid var(--border);
}

.search-command-item-thumb--empty {
  background:
    linear-gradient(135deg, transparent 46%, var(--border) 46%, var(--border) 54%, transparent 54%),
    linear-gradient(45deg, transparent 46%, var(--border) 46%, var(--border) 54%, transparent 54%),
    var(--muted);
  background-size: 100% 100%;
}

.search-command-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-command-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.search-command-item-text {
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-command-item-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-command-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.search-command-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.65rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.search-command-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--muted-foreground);
  border-radius: 50%;
  animation: searchSpin 0.65s linear infinite;
}

@keyframes searchSpin {
  to { transform: rotate(360deg); }
}

.search-command-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.search-command-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.search-command-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.search-command-kbd-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--shadcn-radius) - 2px);
  background: var(--background);
  color: var(--muted-foreground);
  font-family: var(--font-primary);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1;
}

/* Mobile navigation drawer */
.sections-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgb(9 9 11 / 0.45);
  backdrop-filter: blur(4px);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sections-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.sections-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--background);
  border-right: none;
  box-shadow: none;
  z-index: 251;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary);
}

.sections-drawer.is-active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  background: var(--brand-header-bg);
  border-bottom: none;
  flex-shrink: 0;
}

.drawer-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.drawer-brand .custom-logo-link,
.drawer-brand .custom-logo-link img {
  display: block;
  max-height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
}

.drawer-brand-text {
  color: #ffffff;
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.drawer-brand-text:hover {
  color: #ffffff;
  opacity: 0.92;
}

.drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: -0.25rem;
  border-radius: var(--shadcn-radius);
  color: #ffffff;
  transition: var(--transition);
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  background: rgb(255 255 255 / 0.14);
  color: #ffffff;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.drawer-nav-item + .drawer-nav-item {
  border-top: none;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0;
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--foreground);
  transition: var(--transition);
}

.drawer-nav-link:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.drawer-nav-arrow {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
}

.drawer-nav-link:hover .drawer-nav-arrow {
  color: var(--primary);
}

.drawer-tools {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.drawer-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--shadcn-radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  color: var(--muted-foreground);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-search-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.drawer-search-trigger svg {
  flex-shrink: 0;
  color: currentColor;
}

.drawer-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.75rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.drawer-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid var(--primary);
  border-radius: var(--shadcn-radius);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: var(--transition);
}

.drawer-footer-btn:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
  color: var(--primary-foreground);
}

.drawer-footer-btn-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #ffffff;
}

@media (min-width: 480px) {
  .sections-drawer {
    width: 18rem;
    max-width: 88vw;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
}

/* Main content */
.site-main,
.homepage-magazine,
.homepage-hero,
.story-feed-section,
.site-footer,
.category-nav-bar,
.news-ticker {
  background-color: var(--background);
}

.site-main {
  padding: 2rem 0 4rem;
}

.post-list {
  display: grid;
  gap: 2rem;
}

.post-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-card-title a:hover {
  color: var(--primary);
}

.post-card-meta {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.post-card-excerpt {
  color: var(--muted-foreground);
}

/* Archive / category timeline */
.archive-main {
  background-color: var(--background);
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem var(--container-pad) 4rem;
}

.archive-header {
  margin-bottom: 2.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.archive-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.archive-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.archive-header-tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 0 1 auto;
  width: min(100%, 420px);
  justify-content: flex-end;
  margin-left: auto;
}

.archive-headlines-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  justify-content: flex-start;
}

.archive-headlines-label {
  font-family: var(--font-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground);
  white-space: nowrap;
}

.archive-headlines-switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0;
  border: 1.5px solid var(--foreground);
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.archive-headlines-switch:hover {
  border-color: var(--primary);
}

.archive-headlines-switch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px rgb(227 18 11 / 0.35);
}

.archive-headlines-switch[aria-checked='true'] {
  background: var(--primary);
  border-color: var(--primary);
}

.archive-headlines-switch-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 0.875rem;
  height: 0.875rem;
  border: 1.5px solid var(--foreground);
  border-radius: 50%;
  background: var(--background);
  transform: translateY(-50%);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.archive-headlines-switch[aria-checked='true'] .archive-headlines-switch-thumb {
  transform: translate(1.15rem, -50%);
  border-color: var(--background);
}

.archive-main.is-headlines-only .archive-list-item-media {
  display: none;
}

.archive-main.is-headlines-only .archive-list-item {
  grid-template-columns: minmax(0, 1fr);
}

.archive-header-copy {
  min-width: 0;
}

.archive-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
  margin: 0 0 0.5rem;
}

.archive-summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.archive-search {
  flex: 1 1 auto;
  width: min(100%, 280px);
  max-width: 360px;
}

.archive-search-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--shadcn-radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.archive-search-inner:focus-within {
  border-color: var(--foreground);
  box-shadow: var(--shadow-sm), 0 0 0 2px rgb(9 9 11 / 0.08);
}

.archive-search-icon {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.archive-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--foreground);
  outline: none;
}

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

.archive-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin-top: 1rem;
}

.archive-timeline {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.archive-year-group {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.archive-year-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.archive-year-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
}

.archive-year-count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.archive-month-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.archive-month-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-list-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.9rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.archive-list-item:first-child {
  border-top: none;
  padding-top: 0.25rem;
}

.archive-list-item-media {
  display: block;
  width: 112px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  border: 1px solid var(--border);
}

.archive-list-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.archive-list-item-media:hover .archive-list-item-image {
  transform: scale(1.04);
}

.archive-list-item-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--muted);
}

.archive-list-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.archive-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--muted-foreground);
}

.archive-list-item-category {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.archive-list-item-meta-sep {
  opacity: 0.55;
}

.archive-list-item-date {
  font-weight: 500;
  white-space: nowrap;
}

.archive-list-item-title {
  margin: 0;
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.archive-list-item-title a {
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}

.archive-list-item-title a:hover {
  color: var(--primary);
}

.archive-empty {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

@media (max-width: 680px) {
  .archive-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .archive-header-tools {
    flex: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    gap: 0.75rem;
  }

  .archive-headlines-toggle {
    justify-content: flex-start;
    width: 100%;
  }

  .archive-search {
    flex: none;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .archive-list-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.85rem 0;
    align-items: start;
  }

  .archive-list-item-media {
    width: 88px;
    height: 66px;
  }

  .archive-list-item-title {
    font-size: 0.9rem;
  }
}

@media (min-width: 900px) {
  .archive-list-item {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 1.15rem;
    padding: 1.15rem 0;
  }

  .archive-list-item-media {
    width: 128px;
    height: 90px;
  }

  .archive-list-item-title {
    font-size: 1.0625rem;
  }
}

/* Legacy archive card styles — category grid */
.category-archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}

.archive-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  height: 100%;
}

.archive-card[hidden] {
  display: none !important;
}

.category-archive-grid.is-searching {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.archive-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background: var(--muted);
}

.archive-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.archive-card:hover .archive-card-image {
  transform: scale(1.02);
}

.archive-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.archive-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.archive-card-author {
  color: var(--muted-foreground);
  transition: var(--transition);
}

.archive-card-author:hover {
  color: var(--primary);
}

.archive-card-meta-sep {
  opacity: 0.55;
}

.archive-card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.archive-card-title a {
  color: var(--foreground);
  transition: var(--transition);
}

.archive-card-title a:hover {
  color: var(--primary);
}

.archive-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.archive-card-excerpt p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.archive-empty {
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

@media (max-width: 1200px) {
  .category-archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .category-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .category-archive-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .category-archive-search {
    max-width: none;
  }

  .category-archive-main .archive-title {
    font-size: 1.375rem;
  }
}

/* Category archive header — title first, search below */
.category-archive-header-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.category-archive-search {
  width: 100%;
  max-width: 360px;
}

.category-archive-header-top .archive-header-copy {
  min-width: 0;
  text-align: left;
}

.category-archive-main .archive-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
}

.category-archive-main .archive-eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.category-archive-main .archive-header-meta-sep {
  color: var(--muted-foreground);
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.7;
}

.category-archive-main .archive-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--foreground);
}

.category-archive-main .archive-summary {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted-foreground);
}

.category-archive-main .archive-header {
  margin-bottom: 1.75rem;
}

@media (min-width: 681px) {
  .category-archive-header-top {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .category-archive-search {
    flex: 0 0 auto;
    order: 2;
  }

  .category-archive-header-top .archive-header-copy {
    flex: 1 1 auto;
    order: 1;
  }

  .category-archive-main .archive-title {
    font-size: 1.75rem;
  }
}

.archive-live-search {
  width: 100%;
}

.archive-live-search-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.archive-live-search-inner:focus-within {
  border-color: var(--foreground);
  box-shadow: var(--shadow-sm), 0 0 0 2px rgb(9 9 11 / 0.08);
}

.archive-live-search-icon {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.archive-live-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--foreground);
  outline: none;
}

.archive-live-search-input::placeholder {
  color: var(--muted-foreground);
}

.archive-live-search-clear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: var(--transition);
}

.archive-live-search-clear:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.category-search-empty {
  margin-top: 1.5rem;
  text-align: center;
}

/* ==========================================================================
   HOMEPAGE MAGAZINE LAYOUT
   ========================================================================== */
.homepage-magazine {
  padding-top: 0;
}

.mag-empty {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  padding: 3rem 0;
}

/* Homepage hero — featured + sidebar */
.homepage-hero {
  background: var(--background);
  color: var(--foreground);
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.homepage-hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2.5rem var(--container-pad) 3rem;
}

.homepage-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 2rem;
  align-items: start;
}

.homepage-hero-featured {
  min-width: 0;
}

.homepage-hero-media {
  display: block;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--muted);
  box-shadow: var(--shadow-sm);
}

.homepage-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.homepage-hero-media:hover .homepage-hero-image {
  transform: scale(1.02);
}

.homepage-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 240px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.homepage-hero-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.homepage-hero-title a {
  color: var(--foreground);
}

.homepage-hero-title a:hover {
  color: var(--primary);
}

.homepage-hero-meta-line,
.homepage-hero-side-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.homepage-hero-meta-line time,
.homepage-hero-side-meta time {
  color: var(--muted-foreground);
}

.homepage-hero-author,
.homepage-hero-side-meta a {
  color: var(--primary);
  font-weight: 600;
}

.homepage-hero-author:hover,
.homepage-hero-side-meta a:hover {
  color: var(--brand-red-dark);
}

.homepage-hero-meta-sep {
  opacity: 0.45;
}

.homepage-hero-side {
  min-width: 0;
}

.homepage-hero-side-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.homepage-hero-side-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
  padding: 1rem;
}

.homepage-hero-side-item + .homepage-hero-side-item {
  border-top: 1px solid var(--border);
}

.homepage-hero-side-thumb {
  display: block;
  width: 112px;
  height: 80px;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}

.homepage-hero-side-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.homepage-hero-side-thumb:hover .homepage-hero-side-image {
  transform: scale(1.04);
}

.homepage-hero-side-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.homepage-hero-side-body {
  min-width: 0;
}

.homepage-hero-side-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 0.45rem;
}

.homepage-hero-side-title a {
  color: var(--foreground);
}

.homepage-hero-side-title a:hover {
  color: var(--primary);
}

.homepage-hero-side-meta {
  margin: 0;
  font-size: 0.75rem;
}

@media (max-width: 1024px) {
  .homepage-hero-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 680px) {
  .homepage-hero-inner {
    padding: 2rem var(--container-pad) 2.5rem;
  }

  .homepage-hero-side-item {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.875rem;
  }

  .homepage-hero-side-thumb {
    width: 96px;
    height: 68px;
  }
}

/* Editorial story feed */
.story-feed-section {
  background-color: var(--background);
  padding: 2.5rem 0 3rem;
  font-family: var(--font-primary);
}

.story-feed-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.story-feed-tabs-wrap {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.story-feed-tabs {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.story-feed-tabs::-webkit-scrollbar {
  display: none;
}

.story-feed-tab {
  flex-shrink: 0;
  position: relative;
  padding: 0 0 0.875rem;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.story-feed-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background-color 0.15s ease;
}

.story-feed-tab:hover {
  color: var(--primary);
}

.story-feed-tab.is-active {
  color: var(--primary);
}

.story-feed-tab.is-active::after {
  background: var(--primary);
}

.story-feed-tab:focus-visible {
  outline: none;
  color: var(--primary);
}

.story-feed-tab:focus-visible::after {
  background: var(--primary);
}

.story-feed-panels {
  min-height: 200px;
}

.story-feed-panel[hidden] {
  display: none;
}

.story-feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.story-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.story-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hover-border);
}

.story-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1rem 0;
}

.story-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  margin-bottom: 1rem;
}

.story-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.story-card:hover .story-card-image {
  transform: scale(1.02);
}

.story-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}

.story-card-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0;
}

.story-card-title a {
  color: var(--foreground);
  transition: var(--transition);
}

.story-card-title a:hover {
  color: var(--primary);
}

.story-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.story-card-excerpt p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.story-card-footer {
  padding: 0.875rem 1rem 1rem;
  margin-top: auto;
}

.story-card-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  transition: var(--transition);
}

.story-card-badge:hover {
  background: var(--hover-bg);
  color: var(--primary);
  border-color: var(--hover-border);
}

.story-feed-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--shadcn-muted-fg);
}

.story-feed-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
}

.story-feed-view-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 1.125rem;
  border: 1px solid var(--primary);
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: var(--transition);
  white-space: nowrap;
}

.story-feed-view-more:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
  color: var(--primary-foreground);
}

.story-feed-view-more:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px rgb(227 18 11 / 0.35);
}

@media (max-width: 1024px) {
  .story-feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .story-feed-section {
    padding: 2rem 0 2.5rem;
  }

  .story-feed-tabs-wrap {
    margin-bottom: 1.5rem;
  }

  .story-feed-tabs {
    gap: 1.25rem;
  }

  .story-feed-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.mag-section {
  margin-bottom: 3rem;
}

.mag-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--foreground);
}

.mag-section-title {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
}

.mag-section-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.mag-section-link:hover {
  color: var(--brand-red-dark);
}

.mag-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.mag-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hover-border);
}

.mag-card-media {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--muted);
}

.mag-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.mag-card:hover .mag-card-image {
  transform: scale(1.03);
}

.mag-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.mag-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.1rem 1.15rem;
}

.mag-card-category {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 0.45rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}

.mag-card-category:hover {
  background: var(--hover-bg);
  color: var(--primary);
  border-color: var(--hover-border);
}

.mag-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.55rem;
}

.mag-card-title a:hover {
  color: var(--primary);
}

.mag-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
  flex: 1;
}

.mag-card-excerpt p {
  margin: 0;
}

.mag-card-meta {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: auto;
}

.mag-card--featured .mag-card-media {
  aspect-ratio: 16 / 9;
}

.mag-card--featured .mag-card-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.2;
}

.mag-card--featured .mag-card-body {
  padding: 1.15rem 1.25rem 1.25rem;
}

.mag-card--compact {
  flex-direction: row;
}

.mag-card--compact .mag-card-media {
  flex: 0 0 38%;
  min-height: 100%;
}

.mag-card--compact .mag-card-placeholder {
  min-height: 100%;
}

.mag-card--compact .mag-card-body {
  padding: 0.85rem 1rem;
}

.mag-card--compact .mag-card-title {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

/* Grids */
.mag-grid {
  display: grid;
  gap: 1.5rem;
}

.mag-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mag-grid .mag-card-media {
  aspect-ratio: 16 / 10;
}

/* Banner ad */
.mag-banner-ad {
  margin-bottom: 3rem;
  border: 1px solid var(--shadcn-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2e7a 0%, #121a44 100%);
}

.mag-banner-ad-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  color: var(--background);
}

.mag-banner-ad-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.mag-banner-ad-copy {
  min-width: 0;
}

.mag-banner-ad-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.mag-banner-ad-text {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
  line-height: 1.45;
}

.mag-banner-ad-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 1rem;
  background: #25d366;
  border-radius: var(--shadcn-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.mag-banner-ad-image {
  flex-shrink: 0;
  width: 120px;
  height: 72px;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mag-banner-ad-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grid ad card */
.mag-card--ad {
  border-style: dashed;
  background: var(--muted);
}

.mag-ad-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.mag-ad-media {
  aspect-ratio: 16 / 10;
}

.mag-ad-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: linear-gradient(135deg, #1f2e7a 0%, #121a44 100%);
}

.mag-ad-body {
  gap: 0.35rem;
}

.mag-ad-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.mag-ad-visual .mag-ad-badge {
  background: rgba(255, 255, 255, 0.15);
  color: var(--background);
}

.mag-ad-company {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.mag-ad-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  flex: 1;
}

.mag-ad-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 0.35rem;
  height: 2rem;
  padding: 0 0.85rem;
  background: var(--primary);
  border-radius: var(--shadcn-radius);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition);
}

.mag-card--ad:hover .mag-ad-cta {
  background: var(--brand-red-dark);
}

@media (max-width: 1024px) {
  .mag-hero-grid {
    grid-template-columns: 1fr;
  }

  .mag-hero-side-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .mag-card--compact {
    flex-direction: column;
  }

  .mag-card--compact .mag-card-media {
    flex: none;
    aspect-ratio: 16 / 10;
  }

  .mag-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .mag-hero-side-col {
    grid-template-columns: 1fr;
  }

  .mag-grid-3 {
    grid-template-columns: 1fr;
  }

  .mag-banner-ad-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .mag-banner-ad-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .mag-banner-ad-image {
    width: 100%;
    height: 140px;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--shadcn-border);
  background-color: var(--background);
  padding: 3rem 0 2rem;
  font-family: var(--font-primary);
  color: var(--shadcn-muted-fg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 2.5rem;
  align-items: start;
}

.footer-brand {
  max-width: 22rem;
}

.footer-site-name {
  margin: 0 0 0.65rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--foreground);
}

.footer-site-name a {
  color: inherit;
}

.footer-site-name a:hover {
  color: var(--primary);
}

.footer-tagline {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}

.footer-nav-menu {
  grid-template-columns: 1fr;
}

.footer-nav-column {
  min-width: 0;
}

.footer-nav-title {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.footer-nav-list,
.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-nav-list a,
.footer-menu a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--shadcn-muted-fg);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.footer-nav-list a:hover,
.footer-menu a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--shadcn-border);
  font-size: 0.8125rem;
}

.footer-copyright,
.footer-credit {
  margin: 0;
}

.footer-copyright a,
.footer-credit a {
  color: var(--shadcn-foreground);
  font-weight: 600;
}

.footer-copyright a:hover,
.footer-credit a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-footer {
    padding: 2.25rem 0 1.75rem;
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .header-date-sep,
  .header-date-full {
    display: none;
  }

  .header-date {
    padding-left: 0.5rem;
    margin-left: 0;
  }

  .register-header-center {
    max-width: calc(100% - 260px);
  }
}

@media (max-width: 1024px) {
  .category-nav-inner {
    justify-content: flex-start;
    max-width: none;
    touch-action: pan-x;
    scroll-snap-type: x proximity;
  }

  .category-nav-item {
    scroll-snap-align: start;
  }
}

@media (max-width: 680px) {
  .register-header-bar {
    height: 48px;
  }

  .header-date {
    display: none;
  }

  .register-header-center {
    max-width: calc(100% - 180px);
  }

  .register-site-logo {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
  }

  .register-icon-btn {
    width: 2rem;
    height: 2rem;
  }

  .btn-header-join {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
  }

  .category-nav-link {
    min-height: 38px;
    padding: 0 0.85rem;
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   SINGLE POST — shadcn/ui inspired layout
   ========================================================================== */
.single-post-main {
  padding: 0;
  background-color: var(--background);
}

.single-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem var(--container-pad) 4rem;
  align-items: start;
}

.single-article {
  min-width: 0;
}

.single-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.single-breadcrumb-back,
.single-breadcrumbs a {
  color: var(--muted-foreground);
  background: transparent;
  text-decoration: none;
  transition: var(--transition);
}

.single-breadcrumb-back {
  display: inline;
  padding: 0;
  border: none;
}

.single-breadcrumb-back:hover,
.single-breadcrumbs a:hover {
  color: var(--primary);
}

.single-breadcrumb-current {
  color: var(--foreground);
}

.single-breadcrumb-sep {
  opacity: 0.45;
}

.single-header {
  margin-bottom: 1.75rem;
}

.single-title {
  font-size: var(--heading-size);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--foreground);
  margin: 0 0 1.25rem;
  padding: 0.75rem 0;
}

.single-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.single-byline-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.single-byline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--background);
  box-shadow: 0 0 0 1px var(--border);
}

.single-author-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.single-author-name a {
  color: var(--foreground);
  transition: var(--transition);
}

.single-author-name a:hover {
  color: var(--primary);
}

.single-byline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.single-byline-dot {
  opacity: 0.5;
}

.single-share {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.single-share-label {
  margin-right: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.single-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
  background: var(--background);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.single-share-btn:hover {
  background: var(--hover-bg);
  color: var(--primary);
  border-color: var(--hover-border);
}

.single-share-btn.share-whatsapp:hover {
  color: #25d366;
  border-color: rgb(37 211 102 / 0.35);
}

.single-share-btn.share-facebook:hover {
  color: #1877f2;
  border-color: rgb(24 119 242 / 0.35);
}

.single-share-btn.share-telegram:hover {
  color: #229ed9;
  border-color: rgb(34 158 217 / 0.35);
}

.single-share-btn:focus-visible {
  outline: none;
  box-shadow:
    var(--shadow-sm),
    0 0 0 2px var(--background),
    0 0 0 4px var(--ring);
}

.single-share-btn.is-copied {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--hover-bg);
}

.belhasa-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 400;
  transform: translate(-50%, 0.75rem);
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--foreground);
  color: var(--background);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.belhasa-copy-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .belhasa-copy-toast {
    transition: none;
  }
}

.single-featured-image {
  margin: 0 0 1.5rem;
}

.single-hero-media {
  margin: 0;
}

.single-hero-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 9;
}

.single-hero-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0;
  display: block;
  border: none;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
  box-shadow: none;
}

.single-hero-caption {
  margin-top: 0.65rem;
  padding: 0 0.15rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted-foreground);
  text-align: left;
}

.single-entry-content {
  font-family: var(--font-primary);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--foreground);
  text-align: left;
}

.single-entry-content .has-text-align-justify,
.single-entry-content [style*="text-align: justify"],
.single-entry-content [style*="text-align:justify"] {
  text-align: left !important;
}

.single-entry-content * {
  font-family: inherit;
}

.single-entry-content p {
  margin: 0 0 1.25rem;
  text-align: left;
}

.single-entry-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: var(--transition);
}

.single-entry-content a:hover {
  color: var(--brand-red-dark);
}

.single-entry-content h2,
.single-entry-content h3,
.single-entry-content h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 1rem;
  color: var(--foreground);
}

.single-entry-content ul,
.single-entry-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.single-entry-content li {
  margin-bottom: 0.35rem;
}

.single-entry-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 0 0.75rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted-foreground);
  font-style: italic;
}

.single-entry-content hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.single-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.single-entry-content pre,
.single-entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
}

.single-entry-content pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
}

.single-entry-content :not(pre) > code {
  padding: 0.15rem 0.4rem;
  border-radius: calc(var(--radius) - 4px);
  background: var(--muted);
  border: 1px solid var(--border);
}

.single-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.single-comments-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
}

.single-comment-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.single-comment-list .children {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.single-comment {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.single-comment-avatar img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
}

.single-comment-main {
  flex: 1;
  min-width: 0;
}

.single-comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
}

.single-comment-author {
  font-style: normal;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.single-comment-header time {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.single-comment-moderation {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.single-comment-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--foreground);
}

.single-comment-content p {
  margin: 0 0 0.75rem;
}

.single-comment-content p:last-child {
  margin-bottom: 0;
}

.single-comment-reply {
  margin-top: 0.65rem;
}

.single-comment-reply a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
}

.single-comment-reply a:hover {
  color: var(--brand-red-dark);
}

.single-comments-nav {
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.single-comments-nav .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.single-comment-form-wrap {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.single-comment-form .comment-reply-title {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--foreground);
}

.single-comment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.single-comment-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.single-comment-form-grid .single-comment-field {
  margin-bottom: 0;
}

.single-comment-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.single-comment-field .required {
  color: var(--primary);
}

.single-comment-field input,
.single-comment-field textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.single-comment-field input:focus,
.single-comment-field textarea:focus {
  outline: none;
  border-color: var(--foreground);
  box-shadow: var(--shadow-sm), 0 0 0 2px rgb(9 9 11 / 0.08);
}

.single-comment-field textarea {
  resize: vertical;
  min-height: 140px;
}

.single-comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.125rem;
  border: 1px solid var(--primary);
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.single-comment-submit:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
}

.single-comments-closed {
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

.single-comment-count {
  color: inherit;
  transition: var(--transition);
}

.single-comment-count:hover {
  color: var(--primary);
}

.logged-in-as {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.logged-in-as a {
  color: var(--primary);
}

.single-related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.single-related-posts-header {
  margin-bottom: 1.5rem;
}

.single-related-posts-heading {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
}

.single-related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.single-sidebar {
  position: sticky;
  top: calc(var(--site-header-offset) + 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.single-sidebar-block {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.single-sidebar-title {
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--foreground);
}

.single-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.single-related-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.875rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.single-related-item:first-child {
  padding-top: 0;
}

.single-related-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.single-related-thumb {
  display: block;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  border: 1px solid var(--border);
}

.single-related-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.single-related-thumb:hover .single-related-image {
  transform: scale(1.04);
}

.single-related-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--muted);
}

.single-related-body {
  min-width: 0;
}

.single-related-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.single-related-label {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.single-related-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.single-related-title a {
  color: var(--foreground);
  transition: var(--transition);
}

.single-related-title a:hover {
  color: var(--primary);
}

.single-trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.single-trending-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.single-trending-item:first-child {
  padding-top: 0;
}

.single-trending-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.single-trending-rank {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.35;
}

.single-trending-link {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--foreground);
  transition: var(--transition);
}

.single-trending-link:hover {
  color: var(--primary);
}

.single-topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.single-topic-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--secondary-foreground);
  background: var(--secondary);
  transition: var(--transition);
}

.single-topic-tag:hover {
  background: var(--hover-bg);
  color: var(--primary);
  border-color: var(--hover-border);
}

.single-sidebar-empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (max-width: 1024px) {
  .single-post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .single-sidebar {
    position: static;
  }

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

@media (max-width: 680px) {
  .single-post-layout {
    padding: 1.5rem var(--container-pad) 3rem;
  }

  .single-byline {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .single-share {
    width: 100%;
    justify-content: flex-start;
  }

  .single-related-posts-grid {
    grid-template-columns: 1fr;
  }

  .single-comment-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STATIC PAGES — shadcn/ui
   ========================================================================== */
.contact-page-main,
.search-page-main,
.not-found-main {
  background: var(--background);
}

.static-page-inner,
.search-page-inner,
.not-found-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem var(--container-pad) 4rem;
}

.static-page-header,
.search-page-header {
  margin-bottom: 2rem;
}

.static-page-eyebrow,
.search-page-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.static-page-title,
.search-page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
}

.static-page-subtitle,
.search-page-summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.static-page-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.static-page-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--foreground);
  text-align: left;
}

.static-page-content h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.static-page-content h2:first-child {
  margin-top: 0;
}

.static-page-content p,
.static-page-content ul,
.static-page-content ol {
  margin: 0 0 1rem;
}

.static-page-content ul,
.static-page-content ol {
  padding-left: 1.5rem;
}

.static-page-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.static-page-content a:hover {
  color: var(--brand-red-dark);
}

.static-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.static-info-card {
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
}

.static-info-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.static-info-card p {
  margin: 0;
  font-size: 0.9375rem;
}

.static-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.static-btn-primary {
  color: var(--primary-foreground);
  background: var(--primary);
  border: 1px solid var(--primary);
}

.static-btn-primary:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
}

.static-btn-outline {
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.static-btn-outline:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--hover-bg);
}

.contact-form-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.contact-page-inner {
  padding-top: 2.5rem;
}

.contact-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3rem;
  align-items: start;
}

.contact-page-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
}

.contact-page-lead {
  margin: 0 0 2rem;
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}

.contact-page-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-page-detail {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.9375rem;
  color: var(--foreground);
}

.contact-page-detail a {
  color: inherit;
  transition: var(--transition);
}

.contact-page-detail a:hover {
  color: var(--primary);
}

.contact-page-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.contact-page-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.contact-page-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-page-social-icon:hover {
  color: var(--primary);
  border-color: var(--hover-border);
  background: var(--hover-bg);
}

.contact-page-social-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px rgb(227 18 11 / 0.35);
}

.contact-page-form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--secondary);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.contact-form-header {
  margin-bottom: 1.5rem;
}

.contact-form-heading {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.contact-form-subheading {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.contact-form-required {
  color: var(--primary);
}

.contact-form-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
}

.contact-form-notice--success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.contact-form-notice--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.contact-form-grid .contact-form-field {
  margin-bottom: 0;
}

.contact-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.contact-form-input,
.contact-form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-form-input:focus,
.contact-form-textarea:focus {
  outline: none;
  border-color: var(--foreground);
  box-shadow: var(--shadow-sm), 0 0 0 2px rgb(9 9 11 / 0.08);
}

.contact-form-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid var(--primary);
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.contact-form-submit:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
  color: var(--primary-foreground);
}

.search-page-header .archive-search {
  max-width: 420px;
  margin-top: 1.25rem;
}

.search-results-list {
  border-top: 1px solid var(--border);
}

.search-empty-card,
.not-found-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  text-align: center;
}

.not-found-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.not-found-card {
  width: 100%;
  max-width: 520px;
}

.not-found-code {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--primary);
}

.not-found-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.not-found-text,
.search-empty-text {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.not-found-actions,
.search-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.not-found-search .archive-search {
  max-width: 100%;
  margin: 0 auto;
}

@media (max-width: 680px) {
  .static-page-inner,
  .search-page-inner,
  .not-found-inner {
    padding: 1.5rem var(--container-pad) 3rem;
  }

  .static-page-card {
    padding: 1.125rem;
  }

  .static-info-grid,
  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-page-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-page-form-card {
    padding: 1.125rem;
  }

  .not-found-actions,
  .search-empty-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .static-btn {
    width: 100%;
  }
}
