@font-face {
  font-family: 'Cormorant Garamond Fallback';
  src: local('Georgia');
  size-adjust: 106%;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Cormorant Garamond Fallback';
  src: local('Georgia');
  size-adjust: 101%;
  ascent-override: 88%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Uthmanic Hafs';
  src: url('/fonts/UthmanicHafs_V22.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --header-h: 64px;
  --color-bg: #FAF8F5;
  --color-bg-warm: #F3EDE4;
  --color-bg-card: #FFFFFF;
  --color-primary: #1a1a1a;
  --color-primary-light: #444444;
  --color-primary-pale: #F0F0F0;
  --color-secondary: #B8860B;
  --color-secondary-light: #D4A843;
  --color-secondary-pale: #F5EDD6;
  --color-accent: #2D6A4F;
  --color-accent-light: #52B788;
  --color-accent-pale: #E6F2EC;
  --color-text: #1a1a1a;
  --color-text-light: #5A5A5A;
  --color-text-muted: #767676;
  --color-border: #DDD5C8;
  --color-border-light: #EBE5DB;
  --color-white: #FFFFFF;
  --color-danger: #9B2226;
  --color-danger-pale: #FCEAEA;
  --color-success: #155724;
  --color-success-pale: #d4edda;
  --color-success-border: #c3e6cb;
  --color-error: #721c24;
  --color-error-pale: #f8d7da;
  --color-error-border: #f5c6cb;

  --gradient-gold: linear-gradient(135deg, #B8860B 0%, #D4A843 50%, #C49628 100%);
  --gradient-primary: linear-gradient(135deg, #000000 0%, #333333 100%);
  --gradient-warm: linear-gradient(135deg, #F3EDE4 0%, #FAF8F5 50%, #EDE5D8 100%);
  --gradient-accent: linear-gradient(135deg, #2D6A4F 0%, #40916C 100%);

  --cat-neuroscience: #4A6741, #5E8C52, #72A863;
  --cat-bioscience: #1A3C28, #2D6A4F, #40916C;
  --cat-astroscience: #0B1D3A, #1B3A5C, #2A5570;
  --cat-geoscience: #0E4258, #1A6B8A, #2891B5;
  --cat-embryology: #5E1518, #9B2226, #C0393B;
  --cat-physics: #4A2808, #63370D, #8B5A2B;

  --font-heading: 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  --font-body: 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  --font-arabic: 'Uthmanic Hafs', 'KFGQPC Nastaleeq', 'Amiri', 'Noto Naskh Arabic', serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(27,58,75,0.06);
  --shadow-md: 0 4px 12px rgba(27,58,75,0.08);
  --shadow-lg: 0 8px 30px rgba(27,58,75,0.10);
  --shadow-glow: 0 0 20px rgba(184,134,11,0.08);
  --shadow-card: 0 2px 8px rgba(27,58,75,0.04), 0 8px 24px rgba(27,58,75,0.06);

  --max-width: 1200px;
  --max-width-narrow: 900px;

  --z-base: 1;
  --z-overlay: 2;
  --z-slider: 5;
  --z-dropdown: 10;
  --z-tooltip: 50;
  --z-header: 100;
  --z-skip: 1000;

  --navbar-bg: #FAF8F5;
  --navbar-bg-hero: rgba(var(--hero-text-rgb),0.15);
  --logo-text: var(--color-primary);
  --logo-text-hero: #FAF8F5;
  --hero-text: #FAF8F5;
  --hero-text-rgb: 250, 248, 245;
  --footer-bg: linear-gradient(180deg, var(--color-primary) 0%, #132B3A 100%);
  --footer-text: #FAF8F5;
  --footer-text-rgb: 250, 248, 245;
  --post-science-bg: #FAF8F5;
  --post-quran-bg: linear-gradient(135deg, var(--color-bg-warm), rgba(243,237,228,0.5));
  --post-card-bg: #FAF8F5;
  --subject-card-bg: #FAF8F5;
  --pattern-map-bg: #FAF8F5;
  --pm2-bg: #FAF8F5;
  --share-btn-bg: #FAF8F5;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-skip);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: url('/uploads/rp-bg.webp') no-repeat center center fixed;
  background-size: cover;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: var(--z-base);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--color-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-primary);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1.25rem; }

/* Parchment glow for text sitting directly against the background image */
.post-header h1,
.post-meta,
.breadcrumb,
.breadcrumb a,
.category-header h1,
.category-header h2,
.category-header p,
.subject-group h2,
.subject-group h2 a,
.pattern-index h2,
.search-page h1,
.search-meta,
.not-found h1,
.related-posts h2,
.about-content h2,
.about-content h3,
.about-content p,
.subjects-intro,
.share-label,
.form-group label,
.contribution-body h3 {
  -webkit-text-stroke: 6px #faf2e2;
  paint-order: stroke fill;
  text-shadow: 0 0 1px #faf2e2, 0 0 2px #faf2e2;
}

h1,
.pattern-index h2 {
  font-family: 'Italianno', 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  font-weight: normal;
  font-size: 56px;
}

.related-posts h2 {
  font-family: 'Italianno', 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  font-weight: normal;
  font-size: 48px;
}

.hero-slide-content h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: inherit;
}

.geometric-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.geometric-divider::before,
.geometric-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border), var(--color-secondary-light), var(--color-border), transparent);
}

.geometric-divider .ornament {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--color-secondary);
  transform: rotate(45deg);
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(135deg, rgba(184,134,11,0.1), transparent);
}

.geometric-divider .ornament::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--color-secondary);
  transform: translate(-50%, -50%) rotate(-45deg);
}

.geometric-divider .ornament::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Original solid navbar background (backup)
.site-header {
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: 0 1px 8px rgba(27,58,75,0.05);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--navbar-bg);
  }
}
*/

.site-header {
  background: rgba(var(--hero-text-rgb), 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: 0 1px 8px rgba(27,58,75,0.05);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--navbar-bg);
  }
}

.site-header.over-hero {
  background: rgba(var(--hero-text-rgb),0.15);
  border-bottom-color: rgba(var(--hero-text-rgb),0.1);
  box-shadow: none;
  position: relative;
}

.site-header.over-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(23,23,23,0.60) 0%, rgba(23,23,23,0.45) 50%, rgba(23,23,23,0.55) 100%);
  z-index: -1;
}

.site-header .logo-text {
  color: var(--logo-text);
}

.site-header.over-hero .logo-text {
  color: var(--logo-text-hero);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.site-header.over-hero .logo-text span {
  color: var(--color-secondary-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
}

.site-header .main-nav a {
  color: var(--color-primary);
}

.site-header.over-hero .main-nav a {
  color: rgba(var(--hero-text-rgb),0.8);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.site-header.over-hero .main-nav a:hover {
  color: var(--hero-text);
}

.site-header.over-hero .main-nav a.active {
  color: var(--hero-text);
}

.site-header.over-hero .mobile-toggle span {
  background: var(--hero-text);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  position: relative;
  filter: drop-shadow(0 0 3px rgba(184,134,11,0.2));
  transition: filter 0.3s ease;
}

.logo:hover .logo-mark {
  filter: drop-shadow(0 0 6px rgba(184,134,11,0.35));
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--logo-text);
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--color-secondary);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.main-nav a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-light);
  position: relative;
  padding: var(--space-xs) 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.main-nav a:hover {
  color: var(--color-primary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  margin: 5px 0;
  transition: 0.3s;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-search-toggle:hover {
  color: var(--color-primary);
}

.nav-search-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 400px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border: 1px solid var(--color-border-light);
  z-index: var(--z-header);
  overflow: hidden;
}

.nav-search-dropdown.hidden {
  display: none;
}

.nav-search-input-wrap {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-search-input-wrap input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-warm);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  outline: none;
  box-sizing: border-box;
}

.nav-search-input-wrap input:focus {
  box-shadow: 0 0 0 2px rgba(184,134,11,0.2);
}

.nav-search-results {
  max-height: 450px;
  overflow-y: auto;
}

.nav-search-empty {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.nav-search-result {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.15s;
  border-bottom: 1px solid var(--color-border-light);
}

.nav-search-result:last-child {
  border-bottom: none;
}

.nav-search-result:hover {
  background: var(--color-bg-warm);
}

.nav-search-thumb-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-border-light);
  overflow: hidden;
  flex-shrink: 0;
}

.nav-search-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-search-info {
  flex: 1;
  min-width: 0;
}

.nav-search-cat {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.nav-search-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-search-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.site-header.over-hero .nav-search-toggle {
  color: rgba(var(--hero-text-rgb),0.8);
}

.site-header.over-hero .nav-search-toggle:hover {
  color: var(--hero-text);
}

.site-header.over-hero .locale-switcher {
  border-left-color: rgba(var(--hero-text-rgb), 0.8);
  border-right-color: rgba(var(--hero-text-rgb), 0.8);
}

.site-header.over-hero .locale-switcher-btn,
.site-header.over-hero .locale-switcher-btn .locale-code {
  color: rgba(var(--hero-text-rgb), 0.8);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.site-header.over-hero .locale-switcher-btn:hover,
.site-header.over-hero .locale-switcher-btn:hover .locale-code {
  color: var(--hero-text);
  background: rgba(255,255,255,0.15);
}

.site-header.over-hero .locale-switcher-dropdown {
  background: var(--color-white);
}

.site-header.over-hero .locale-switcher-item,
.site-header.over-hero .locale-switcher-item .locale-code,
.site-header.over-hero .locale-switcher-item .locale-name {
  color: var(--color-text);
  text-shadow: none;
}

.site-header.over-hero .locale-switcher-item:hover {
  color: var(--color-primary);
  background: var(--color-bg-warm);
}

.site-header.over-hero .locale-arrow {
  color: rgba(var(--hero-text-rgb), 0.8);
}

.site-header.over-hero .locale-switcher-btn:hover .locale-arrow {
  color: var(--hero-text);
}

.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--gradient-warm);
  height: 100vh;
  height: 100dvh;
  margin-top: calc(-1 * var(--header-h, 0px));
}

.hero-slides {
  position: relative;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: var(--z-overlay);
}

.hero-slide-intro {
  justify-content: center;
}

.hero-slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-slide-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* .hero-slide-overlay — commented out to remove overlay; uncomment to restore
.hero-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(38,38,38,0.35) 0%, rgba(38,38,38,0.20) 50%, rgba(38,38,38,0.30) 100%);
  z-index: var(--z-base);
}
*/

.hero-slide-content {
  position: relative;
  z-index: var(--z-overlay);
  padding: var(--space-4xl) 0 var(--space-3xl);
  color: var(--hero-text);
}

.hero-slide-intro .hero-slide-content {
  display: flex;
  justify-content: center;
}

.hero-intro-glass {
  max-width: 1000px;
}

.hero-intro-glass .hero-slide-info {
  text-align: left;
  padding: var(--space-2xl);
}

.hero-intro-glass .hero-subtitle {
  margin: 0;
}

.hero-intro-glass .hero-stats {
  margin-top: var(--space-xl);
  gap: var(--space-xl);
}

.hero-intro-glass .hero-stat {
  background: rgba(64,64,64,0.85);
  border-color: rgba(255,255,255,0.15);
  padding: var(--space-md) var(--space-lg);
}

.hero-intro-glass .hero-stat-label {
  color: rgba(var(--hero-text-rgb),0.85);
}

.hero-slide-glass {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(var(--hero-text-rgb),0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--hero-text-rgb),0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.hero-slide-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(38,38,38,0.60) 0%, rgba(38,38,38,0.45) 50%, rgba(38,38,38,0.55) 100%);
  border-radius: var(--radius-lg);
  z-index: -1;
}

@supports (backdrop-filter: blur(1px)) {
  .hero-slide-glass {
    background: rgba(var(--hero-text-rgb),0.1);
  }
}

.hero-slide-info {
  flex: 1.1;
  min-width: 0;
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-slide-divider {
  width: 1px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, transparent, rgba(var(--hero-text-rgb),0.3), rgba(var(--hero-text-rgb),0.3), transparent);
}

.hero-slide-verse-col {
  flex: 0.9;
  min-width: 0;
  display: flex;
  align-items: center;
}

.hero-slide-intro .hero-slide-content h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--hero-text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hero-slide-intro .hero-slide-content h1 .dot {
  -webkit-text-fill-color: var(--color-secondary-light);
  text-shadow: 0 0 20px rgba(184,134,11,0.3);
}

.hero-slide-intro .hero-subtitle {
  font-size: 1.2rem;
  color: rgba(var(--hero-text-rgb),0.85);
}

.hero-slide-intro .hero-stat {
  background: rgba(64,64,64,0.85);
  border-color: rgba(255,255,255,0.15);
}

.hero-slide-intro .hero-stat-label {
  color: rgba(var(--hero-text-rgb),0.6);
}

.hero-slide-content h2 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--hero-text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-text-light);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.5;
}

.hero-slide-category {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(var(--hero-text-rgb),0.9);
  background: rgba(var(--hero-text-rgb),0.12);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  border: 1px solid rgba(var(--hero-text-rgb),0.15);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-slide-science {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: rgba(var(--hero-text-rgb),0.8);
  font-style: italic;
  margin-bottom: var(--space-lg);
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.hero-slide-text {
  font-size: 0.95rem;
  color: rgba(var(--hero-text-rgb),0.85);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.hero-slide-quran-ref {
  font-size: 0.85rem;
  color: rgba(var(--hero-text-rgb),0.7);
  text-align: right;
  margin-bottom: var(--space-md);
  font-style: italic;
}

.hero-slide-verse {
  padding: var(--space-xl);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  /* The hero slide has its own .hero-slide-divider between the info and
     verse columns. The global blockquote gold border is suppressed at the
     end of this file via a higher-specificity selector (see below). */
}

.hero-slide-verse::before {
  display: none;
}

.hero-slide-verse-arabic {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 2.4;
  color: var(--color-secondary-light);
  direction: rtl;
  text-align: center;
  margin: 0;
  -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.7);
  paint-order: stroke fill;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-slide-verse-translation {
  font-size: 0.98rem;
  font-style: italic;
  color: rgba(var(--hero-text-rgb),0.9);
  line-height: 1.8;
  border-top: 1px solid rgba(var(--hero-text-rgb),0.2);
  padding-top: var(--space-md);
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-slide-verse-ref {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-heading);
  color: rgba(var(--hero-text-rgb),0.7);
  margin: 0;
  font-style: normal;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.hero-slide-cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hero-text);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--color-secondary-light);
  border-radius: var(--radius-sm);
  background: rgba(184,134,11,0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-slide:hover .hero-slide-cta {
  background: var(--color-secondary);
  color: var(--hero-text);
  border-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(184,134,11,0.3);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  margin-top: var(--space-xl);
}

.hero-stat {
  text-align: center;
  padding: var(--space-md) var(--space-xl);
  background: rgba(var(--hero-text-rgb),0.8);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(184,134,11,0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@supports (backdrop-filter: blur(1px)) {
  .hero-stat {
    background: rgba(var(--hero-text-rgb),0.5);
  }
}

.hero-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-secondary);
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.7);
  paint-order: stroke fill;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-slider);
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-secondary-light);
  border-radius: 50%;
  background: rgba(184,134,11,0.3);
  color: var(--hero-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.hero-slider-arrow:hover {
  background: var(--color-secondary);
  color: var(--hero-text);
  border-color: var(--color-secondary);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 16px rgba(184,134,11,0.3);
}

.hero-slider-prev {
  left: var(--space-lg);
}

.hero-slider-next {
  right: var(--space-lg);
}

.hero-slider-dots {
  position: absolute;
  bottom: calc(var(--space-xl) + var(--space-md, 2.5rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-slider);
  display: flex;
  gap: var(--space-sm);
}

.hero-slider-dot {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider-dot::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--hero-text);
  background: rgba(var(--hero-text-rgb), 0.8);
  transition: all 0.3s ease;
}

.hero-slider-dot:hover::before {
  border-color: var(--color-secondary-light);
}

.hero-slider-dot.active::before {
  background: var(--color-secondary-light);
  border-color: var(--color-secondary-light);
  box-shadow: 0 0 8px rgba(184,134,11,0.4);
}

.hero-slider-pause {
  background: rgba(184,134,11,0.3);
  border: 1px solid var(--color-secondary-light);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--hero-text);
  transition: all 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}

.hero-slider-pause:hover {
  background: var(--color-secondary);
  color: var(--hero-text);
  border-color: var(--color-secondary);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(184,134,11,0.3);
}

.hero-slider-pause .play-icon {
  display: none;
}

.hero-slider-pause[aria-pressed="true"] .pause-icon {
  display: none;
}

.hero-slider-pause[aria-pressed="true"] .play-icon {
  display: block;
}

.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;
}

.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
  pointer-events: none;
  z-index: var(--z-base);
}

.pattern-index {
  padding: 8rem 0 var(--space-3xl);
  min-height: 100vh;
  scroll-margin-top: 0;
}

.pattern-index h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

/* Original solid post-card background (backup)
.post-card {
  background: var(--post-card-bg);
}
*/

.post-card {
  background: var(--post-card-bg);
  border: 2px solid rgba(184,134,11,0.75);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-md);
}

.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(184,134,11,0.15);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(184,134,11,1);
}

.post-card:hover::after {
  opacity: 1;
}

.post-card > a:first-of-type {
  display: block;
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.post-card-image-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.post-card-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.15;
}

.post-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--space-md);
}

.post-card-verse {
  margin-top: auto;
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  border-left: 2px solid rgba(255,255,255,0.3);
  background: var(--color-text-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.8;
}

.post-card-category {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-white);
  background: var(--color-text-light);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.post-card-category[data-category="Neuroscience"] { background: linear-gradient(135deg, var(--cat-neuroscience)); }
.post-card-category[data-category="Bioscience"] { background: linear-gradient(135deg, var(--cat-bioscience)); }
.post-card-category[data-category="Astroscience"] { background: linear-gradient(135deg, var(--cat-astroscience)); }
.post-card-category[data-category="Geoscience"] { background: linear-gradient(135deg, var(--cat-geoscience)); }
.post-card-category[data-category="Embryology"] { background: linear-gradient(135deg, var(--cat-embryology)); }
.post-card-category[data-category="Physics"] { background: linear-gradient(135deg, var(--cat-physics)); }

.post-card-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.post-card-title a {
  color: var(--color-primary);
}

.post-card-title a:hover {
  color: var(--color-secondary);
}

.post-card-excerpt {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  font-style: italic;
}

.pattern-item[data-category="Neuroscience"] .post-card-verse,
.post-card[data-category="Neuroscience"] .post-card-verse { background: linear-gradient(135deg, var(--cat-neuroscience)); border-left-color: rgba(255,255,255,0.2); }
.pattern-item[data-category="Bioscience"] .post-card-verse,
.post-card[data-category="Bioscience"] .post-card-verse { background: linear-gradient(135deg, var(--cat-bioscience)); border-left-color: rgba(255,255,255,0.2); }
.pattern-item[data-category="Astroscience"] .post-card-verse,
.post-card[data-category="Astroscience"] .post-card-verse { background: linear-gradient(135deg, var(--cat-astroscience)); border-left-color: rgba(255,255,255,0.2); }
.pattern-item[data-category="Geoscience"] .post-card-verse,
.post-card[data-category="Geoscience"] .post-card-verse { background: linear-gradient(135deg, var(--cat-geoscience)); border-left-color: rgba(255,255,255,0.2); }
.pattern-item[data-category="Embryology"] .post-card-verse,
.post-card[data-category="Embryology"] .post-card-verse { background: linear-gradient(135deg, var(--cat-embryology)); border-left-color: rgba(255,255,255,0.2); }
.pattern-item[data-category="Physics"] .post-card-verse,
.post-card[data-category="Physics"] .post-card-verse { background: linear-gradient(135deg, var(--cat-physics)); border-left-color: rgba(255,255,255,0.2); }

.post-card-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.post-card:hover .post-card-corner {
  opacity: 1;
}

.post-card-corner::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  background: var(--gradient-gold);
  transform: rotate(45deg);
}

.post-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.post-header {
  text-align: center;
  margin-bottom: var(--space-md);
}

.post-header-category {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-white);
  background: var(--color-text-light);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.post-header-category[data-category="Neuroscience"] { background: linear-gradient(135deg, var(--cat-neuroscience)); }
.post-header-category[data-category="Bioscience"] { background: linear-gradient(135deg, var(--cat-bioscience)); }
.post-header-category[data-category="Astroscience"] { background: linear-gradient(135deg, var(--cat-astroscience)); }
.post-header-category[data-category="Geoscience"] { background: linear-gradient(135deg, var(--cat-geoscience)); }
.post-header-category[data-category="Embryology"] { background: linear-gradient(135deg, var(--cat-embryology)); }
.post-header-category[data-category="Physics"] { background: linear-gradient(135deg, var(--cat-physics)); }

.post-header h1 {
  font-family: 'Italianno', 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  font-weight: normal;
  font-size: 56px;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.post-meta {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.dual-panel-science > img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: block;
}

.dual-panel-image {
  max-width: 800px;
  margin: var(--space-xl) auto 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.dual-panel-image img {
  width: 100%;
}

.dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 400px;
  position: relative;
}

.dual-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--color-secondary-light), var(--color-border), transparent);
  z-index: var(--z-base);
}

.dual-panel-section {
  padding: var(--space-2xl);
}

.dual-panel-science {
  background: var(--post-science-bg);
  border-right: 1px solid var(--color-border-light);
  position: relative;
}

.dual-panel-quran {
  background: var(--post-quran-bg);
}

.dual-panel-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.dual-panel-science .dual-panel-label {
  color: var(--color-primary-light);
}

.dual-panel-quran .dual-panel-label {
  color: var(--color-accent);
}

.dual-panel h2 {
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.dual-panel-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text);
}

.dual-panel-content p {
  margin-bottom: var(--space-md);
}

.dual-panel-content p:last-child {
  margin-bottom: 0;
}

.quran-verse-block {
  background-color: var(--color-white);
  background-image: linear-gradient(135deg, rgba(184,134,11,0.25) 0%, rgba(212,168,67,0.15) 50%, rgba(196,150,40,0.25) 100%);
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.copy-verse-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--color-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
}

.copy-verse-btn:hover {
  background: var(--color-secondary);
  color: var(--color-white);
}

.copy-verse-btn.copied {
  color: var(--color-accent);
  border-color: transparent;
  background: transparent;
}

.quran-verse-block::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  border: 1px solid rgba(184,134,11,0.12);
  border-radius: 50%;
}

.quran-verse-block::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(184,134,11,0.12);
  border-radius: 50%;
}

.quran-verse-translation {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text);
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(26,26,26,0.15);
  margin-bottom: var(--space-md);
}

.quran-verse-ref {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Connection row. Uses a 3-column × 2-row grid:
     row 1: [empty] [timeline] [empty]
     row 2: [prev]  [conclusion] [next]
   Row 2's height is determined by the conclusion (the tallest item in
   that row), so the prev/next buttons — vertically centered within
   row 2 via `align-self: center` — end up centered on the conclusion. */
.post-connection-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: var(--space-sm);
  row-gap: var(--space-md);
  margin: var(--space-md) auto 0;
  max-width: 100%;
}

/* The center wrapper uses `display: contents` so the timeline and
   conclusion become direct grid children of the row. Without this, the
   wrapper would be a single grid item and the row 2 height would only
   reflect the button heights, not the conclusion. */
.post-connection-center {
  display: contents;
}

.post-connection-center .post-timeline {
  grid-column: 2;
  grid-row: 1;
}

.post-connection-center .post-conclusion {
  grid-column: 2;
  grid-row: 2;
}

/* Prev/next links sit in row 2 (the conclusion row) and are vertically
   centered within that row, which is the conclusion's box. */
.post-nav-link.prev {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  flex-shrink: 0;
}

.post-nav-link.next {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  flex-shrink: 0;
}

.post-conclusion {
  margin: 0;
  padding: var(--space-xl);
  background-color: var(--color-white);
  background-image: linear-gradient(135deg, rgba(184,134,11,0.25) 0%, rgba(212,168,67,0.15) 50%, rgba(196,150,40,0.25) 100%);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-secondary);
  border-left: 5px solid var(--color-secondary);
  position: relative;
}

.post-conclusion::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at top right, rgba(184,134,11,0.06), transparent 70%);
  border-radius: 0 var(--radius-md) 0 0;
}

.post-conclusion h2 {
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-conclusion p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.post-tag-cloud {
  max-width: 800px;
  margin: 0 auto;
}

.tag-cloud-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
}

.tag-cloud-item {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  color: var(--color-secondary);
  border: 1px solid rgba(184,134,11,0.3);
  border-radius: 12px;
  opacity: 0.7;
  transition: all 0.25s ease;
}

.tag-cloud-item:hover {
  opacity: 1;
  background: rgba(184,134,11,0.08);
  border-color: var(--color-secondary);
  transform: translateY(-1px);
}

.post-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-md);
  background: var(--color-bg-warm);
  transition: all 0.25s ease;
}

.post-nav-link:hover {
  color: var(--color-white);
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  box-shadow: var(--shadow-glow);
}

.post-nav-link.prev {
  flex-shrink: 0;
}

.post-nav-link.next {
  flex-shrink: 0;
}

.related-posts {
  margin-top: var(--space-lg);
}

.related-posts h2 {
  text-align: center;
  margin-bottom: var(--space-md);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.category-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.category-header {
  text-align: center;
  margin-bottom: var(--space-md);
}

.category-header h1,
.category-header h2 {
  margin-bottom: var(--space-sm);
  font-family: 'Italianno', 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Georgia', serif;
  font-weight: normal;
  font-size: 56px;
}

.category-header p {
  color: var(--color-text-light);
  font-style: italic;
}

.subjects-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.subject-group h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
}

.subject-group h2 a {
  color: var(--color-primary);
}

.subject-group h2 a:hover {
  color: var(--color-secondary);
}

.subject-count {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.subjects-intro {
  text-align: center;
  font-style: italic;
  color: var(--color-text-light);
  margin: 0 auto var(--space-xl);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.subjects-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  justify-content: center;
}

.subject-filter {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  border: 2px solid var(--color-secondary);
  border-radius: 20px;
  background: var(--color-bg-warm);
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.subject-filter:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
  background: rgba(184,134,11,0.15);
}

.subject-filter.active {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-white);
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

/* Original solid subject-card background (backup)
.subject-card {
  background: var(--subject-card-bg);
}
*/

.subject-card {
  display: flex;
  align-items: stretch;
  background: var(--subject-card-bg);
  border: 2px solid rgba(184,134,11,0.75);
  border-radius: var(--radius-md);
  padding: 0;
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, opacity 0.3s ease;
  position: relative;
  overflow: hidden;
}

.subject-card.card-visible {
  opacity: 1;
}

.subject-card.card-hidden {
  opacity: 0;
  transform: scale(0.95);
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--gradient-gold);
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--color-secondary-light);
}

.subject-card:hover::before {
  height: 100%;
}

.subject-card-content {
  flex: 1;
  padding: var(--space-lg);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.subject-card-image {
  width: 100px;
  min-width: 100px;
  align-self: stretch;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
}

.subject-card-image::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: linear-gradient(180deg, #4A2808, #63370D);
  z-index: 2;
}

.subject-card[data-category="Neuroscience"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-neuroscience)); }
.subject-card[data-category="Bioscience"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-bioscience)); }
.subject-card[data-category="Astroscience"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-astroscience)); }
.subject-card[data-category="Geoscience"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-geoscience)); }
.subject-card[data-category="Embryology"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-embryology)); }
.subject-card[data-category="Physics"] .subject-card-image::before { background: linear-gradient(180deg, var(--cat-physics)); }

.subject-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}



.subject-card[data-category="Neuroscience"] .subject-card-image { background-color: #4A6741; }
.subject-card[data-category="Bioscience"] .subject-card-image { background-color: #2D6A4F; }
.subject-card[data-category="Astroscience"] .subject-card-image { background-color: #1B3A5C; }
.subject-card[data-category="Geoscience"] .subject-card-image { background-color: #1A6B8A; }
.subject-card[data-category="Embryology"] .subject-card-image { background-color: #9B2226; }
.subject-card[data-category="Physics"] .subject-card-image { background-color: #63370D; }

.subject-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.subject-card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  font-family: var(--font-heading);
  background: var(--color-text-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.subject-card-category[data-category="Neuroscience"] { background: linear-gradient(135deg, var(--cat-neuroscience)); }
.subject-card-category[data-category="Bioscience"] { background: linear-gradient(135deg, var(--cat-bioscience)); }
.subject-card-category[data-category="Astroscience"] { background: linear-gradient(135deg, var(--cat-astroscience)); }
.subject-card-category[data-category="Geoscience"] { background: linear-gradient(135deg, var(--cat-geoscience)); }
.subject-card-category[data-category="Embryology"] { background: linear-gradient(135deg, var(--cat-embryology)); }
.subject-card-category[data-category="Physics"] { background: linear-gradient(135deg, var(--cat-physics)); }

.subject-card-ref {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: block;
  text-align: left;
  margin-bottom: var(--space-sm);
}

.subject-card-ref::before {
  content: '';
  margin-right: 0;
  color: transparent;
}

.subject-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.subject-card:hover .subject-card-title {
  color: var(--color-secondary);
}

.subject-card-science {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.subject-card:hover .subject-card-link {
  opacity: 1;
  transform: translateX(0);
}

.pattern-map-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.pattern-map-legend {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-xl);
  background: transparent;
  padding: var(--space-sm) var(--space-lg);
}

.pattern-map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.pattern-map-controls .pattern-map-legend {
  margin-bottom: 0;
}

.pattern-map-sort {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: var(--space-xs);
}

.sort-btn {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  border: 2px solid var(--color-secondary);
  border-radius: 20px;
  background: var(--color-bg-warm);
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
  background: rgba(184,134,11,0.15);
}

.sort-btn.active {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-white);
}

.sort-btn-right {
  margin-left: auto;
}

.tooltip-reason {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  transition: color 0.2s;
}

.legend-item:hover .legend-label {
  text-decoration: underline;
  color: var(--color-primary);
}

.legend-hex {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid rgba(184, 134, 11, 0.5);
  vertical-align: middle;
}



@supports (clip-path: polygon(0 0)) {
  .legend-hex {
    border-radius: 0;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  }
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-line {
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--color-secondary);
  opacity: 0.5;
}

.legend-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

.legend-item.legend-active .legend-label {
  color: var(--color-primary);
  font-weight: 600;
}

.pattern-map-container {
  position: relative;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--pattern-map-bg);
  box-shadow: var(--shadow-card);
}

.pattern-map-container canvas {
  display: block;
  width: 100%;
}

.pattern-map-fallback {
  display: none;
}

.no-js .pattern-map-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.pattern-map-fallback a {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
}

.pattern-map-fallback a:hover,
.pattern-map-fallback a:focus {
  background: var(--color-secondary);
  color: var(--color-white);
}

.pattern-map-tooltip {
  display: none;
  position: absolute;
  background: #FFFFFF;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  max-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  pointer-events: none;
  z-index: var(--z-dropdown);
  line-height: 1.4;
}

@supports (backdrop-filter: blur(1px)) {
  .pattern-map-tooltip {
    background: rgba(255,255,255,0.7);
  }
}

.pattern-map-tooltip strong {
  color: var(--color-primary);
  font-family: var(--font-heading);
}

.tooltip-category {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.pattern-map-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.pattern-map-stat {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-white);
  text-align: center;
}

.pattern-map-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pattern-map-stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-xs);
}

.about-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.about-content {
  max-width: 700px;
  margin: 0 auto;
}

.about-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.about-content p {
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-content ul {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
  list-style: disc;
}

.about-content ul li {
  margin-bottom: var(--space-xs);
  line-height: 1.7;
}

.about-content ul + h3 {
  margin-top: var(--space-lg);
}

/* Scholar bio cards (Mufasireen page). Glassmorphism following the
   hero-slider recipe (.hero-slide-glass): cream-tinted translucent panel,
   cream border (matching the slider's white-tone border on dark imagery),
   subtle dark gradient overlay via ::before pseudo for visible blur,
   base background drops to 0.1 when backdrop-filter is supported so
   the card actually reads as glass. */
.scholar-entry {
  position: relative;
  margin: var(--space-lg) 0;
  padding: var(--space-lg) calc(var(--space-lg) + 0.25rem);
  background: rgba(var(--hero-text-rgb), 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(184, 134, 11, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.scholar-entry:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 134, 11, 0.7);
  box-shadow: 0 4px 12px rgba(27,58,75,0.06), 0 12px 32px rgba(27,58,75,0.08);
}

@supports (backdrop-filter: blur(1px)) {
  .scholar-entry {
    background: rgba(var(--hero-text-rgb), 0.1);
  }
}

.scholar-entry h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
  font-family: var(--font-heading);
  /* Override the page-wide text-stroke halo (style.css ~line 230) so the
     glassmorphism on .scholar-entry actually reads as translucent. The
     6px cream stroke otherwise fills the card with a fat halo that masks
     the backdrop-filter. Only resets inside cards; .about-content prose
     on /about and /privacy still uses the stroke for legibility. */
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
}

.scholar-entry p {
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
}

.scholar-meta {
  margin: 0 0 var(--space-md) 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
  letter-spacing: 0.01em;
}

.scholar-entry p:last-child {
  margin-bottom: 0;
}

/* Timeline rail: a vertical line in the left gutter of .about-content that
   the 5 scholar cards "hang off" of. Each card has a small dot marker on its
   left edge, centered on the rail. Hidden under 768px where the gutter closes. */
.about-content {
  position: relative;
  z-index: 0;
}

.timeline-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -22px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(184, 134, 11, 0.10) 0%,
    rgba(184, 134, 11, 0.40) 8%,
    rgba(184, 134, 11, 0.40) 92%,
    rgba(184, 134, 11, 0.10) 100%
  );
  pointer-events: none;
}

.timeline-marker {
  position: absolute;
  top: 28px;
  left: -27px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #B8860B;
  border: 2px solid rgba(var(--hero-text-rgb), 0.95);
  box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.45);
  pointer-events: none;
}

@media (max-width: 767px) {
  .timeline-rail,
  .timeline-marker {
    display: none;
  }
  .scholar-entry {
    padding-left: var(--space-lg);
  }
}

.site-footer {
  background: var(--footer-bg);
  color: rgba(var(--footer-text-rgb),0.75);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-secondary) 0px,
    var(--color-secondary) 20px,
    transparent 20px,
    transparent 25px,
    var(--color-secondary) 25px,
    var(--color-secondary) 27px,
    transparent 27px,
    transparent 32px
  );
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.footer-brand h3 {
  color: var(--footer-text);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.footer-brand h3 span {
  color: var(--color-secondary-light);
  font-weight: 400;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 340px;
}

.footer-links h4 {
  color: var(--color-secondary-light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: rgba(var(--footer-text-rgb),0.8);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--footer-text);
}

.footer-subjects ul {
  column-count: 2;
  column-gap: var(--space-lg);
}

.footer-bottom {
  border-top: 1px solid rgba(var(--footer-text-rgb),0.1);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(var(--footer-text-rgb),0.7);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb .separator {
  font-size: 0.7rem;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  justify-content: center;
}

.category-filter {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  padding: 6px 16px;
  border: 2px solid var(--color-secondary);
  border-radius: 20px;
  color: var(--color-primary);
  background: var(--color-bg-warm);
  cursor: pointer;
  transition: all 0.2s;
}

.category-filter:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
  background: rgba(184,134,11,0.15);
}

.category-filter.active {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-white);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.back-link:hover {
  color: var(--color-primary);
}

.not-found {
  text-align: center;
  padding: var(--space-4xl) 0;
}

.not-found h1 {
  font-size: 6rem;
  color: var(--color-border);
  margin-bottom: var(--space-md);
}

.not-found p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.admin-login {
  max-width: 400px;
  margin: var(--space-4xl) auto;
  background: var(--color-bg-card);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}

.admin-login h1 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primary);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--color-bg-warm);
  color: var(--color-text);
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-primary-pale);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 4px 12px;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.admin-sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 101;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1;
}

.admin-sidebar-toggle:hover {
  background: var(--color-primary-dark, #0f1f2e);
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.admin-sidebar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

.admin-sidebar-view-site {
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color 0.15s;
}

.admin-sidebar-view-site:hover {
  color: rgba(255,255,255,0.8);
}

.admin-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.admin-sidebar-section {
  margin-bottom: 0.25rem;
}

.admin-sidebar-section-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  padding: 0.75rem 1rem 0.25rem;
  opacity: 0.85;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  border-radius: 0;
  position: relative;
}

.admin-sidebar-nav a:hover {
  color: var(--color-white);
  background: rgba(255,255,255,0.06);
}

.admin-sidebar-nav a.active {
  color: var(--color-white);
  background: rgba(255,255,255,0.1);
}

.admin-sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
}

.admin-sidebar-nav a svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.admin-sidebar-nav a:hover svg,
.admin-sidebar-nav a.active svg {
  opacity: 0.9;
}

.admin-sidebar-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: auto;
  line-height: 1.4;
}

.admin-sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.admin-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.admin-sidebar-logout:hover {
  color: var(--color-white);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.admin-sidebar-logout svg {
  flex-shrink: 0;
}

body.admin-body {
  margin-left: 220px;
}

body.admin-body .site-header {
  display: none;
}

body.admin-body .admin-dashboard {
  padding-top: var(--space-lg);
}

@media (max-width: 960px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar-overlay.active {
    display: block;
  }

  .admin-sidebar-toggle {
    display: block;
  }

  body.admin-body {
    margin-left: 0;
  }
}

.admin-bar-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 2px;
}

.admin-dashboard {
  padding: var(--space-xl) 0 var(--space-3xl);
}

body.admin-body .admin-dashboard .container {
  max-width: 1100px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.admin-stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.flash-message {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.flash-success {
  background: var(--color-success-pale);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.flash-error {
  background: var(--color-error-pale);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.admin-stat-card .number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.admin-stat-card .label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-table {
  width: 100%;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th {
  background: var(--color-primary-pale);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table th.sort-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.admin-table th.sort-header:hover {
  background: var(--color-border-light);
}

.admin-table th.sort-header .sort-arrow {
  font-size: 0.7rem;
  opacity: 0.4;
}

.admin-table th.sort-asc .sort-arrow,
.admin-table th.sort-desc .sort-arrow {
  opacity: 1;
  color: var(--color-accent);
}

.admin-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.table-filters {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.filter-search {
  flex: 1;
  min-width: 200px;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
}

.filter-search:focus,
.filter-select:focus {
  border-color: var(--color-primary);
}

.filter-select {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  cursor: pointer;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table .actions {
  display: flex;
  gap: var(--space-sm);
}

.drag-handle-col {
  width: 36px;
}

.drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  text-align: center;
  user-select: none;
  padding: var(--space-sm);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-table tr.dragging {
  opacity: 0.5;
  background: var(--color-primary-pale);
}

.sortable-table tr[draggable="true"] {
  background: var(--color-secondary-pale);
}

.reorder-notice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-secondary-pale);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--color-secondary);
}

.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toggle-publish {
  cursor: pointer;
  transition: opacity 0.15s;
}

.toggle-publish:hover {
  opacity: 0.75;
}

.status-published {
  background: var(--color-accent-pale);
  color: var(--color-accent);
}

.status-draft {
  background: var(--color-secondary-pale);
  color: var(--color-secondary);
}

.admin-form {
  max-width: 900px;
  margin: 0 auto;
}

.admin-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.admin-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.admin-form-header h1 {
  margin: 0;
}

.image-preview {
  max-width: 300px;
  margin-top: var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.html-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.html-field-header label {
  margin-bottom: 0;
}

.preview-toggle.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.html-preview {
  min-height: 150px;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  line-height: 1.7;
  overflow-wrap: break-word;
}

.html-preview p {
  margin-bottom: var(--space-sm);
}

.html-preview em {
  font-style: italic;
}

.html-preview strong {
  font-weight: 700;
}

.html-preview ul, .html-preview ol {
  margin: var(--space-sm) 0;
  padding-left: var(--space-xl);
}

.html-preview blockquote {
  border-left: 3px solid var(--color-secondary);
  padding-left: var(--space-md);
  margin: var(--space-sm) 0;
  color: var(--color-text-light);
  font-style: italic;
}

.html-preview h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: var(--space-sm) 0 var(--space-xs);
}

.contribution-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.contribution-card.pending {
  border-left: 3px solid var(--color-secondary);
}

.contribution-card.reviewed {
  border-left: 3px solid var(--color-accent-light);
  opacity: 0.75;
}

.contribution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary-pale);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.contribution-header > div:first-child {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.contribution-category {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.contribution-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.contribution-actions {
  display: flex;
  gap: var(--space-xs);
}

.contribution-actions form {
  display: inline;
}

.contribution-body {
  padding: var(--space-md);
}

.contribution-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 var(--space-sm);
  color: var(--color-primary);
}

.contribution-body p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 var(--space-sm);
}

.contribution-section {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}

.contribution-verse {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  text-align: right;
  line-height: 2;
  direction: rtl;
}

.contribution-translation {
  font-style: italic;
  color: var(--color-text-light);
}

.contribution-footer {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-warm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.contribution-footer a {
  color: var(--color-primary-light);
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
  width: auto;
}

.error-msg {
  background: var(--color-danger-pale);
  color: var(--color-danger);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.success-msg {
  background: var(--color-success-pale);
  color: var(--color-success);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--color-primary-pale);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
  font-weight: 600;
}

.bulk-check-col {
  width: 36px;
  text-align: center;
}

.bulk-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.draft-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.scroll-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-secondary);
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-white);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: var(--z-tooltip);
}

.scroll-top:hover {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(184,134,11,0.3);
}

.scroll-top.visible {
  display: flex;
}

.hero .container {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  transform: translateY(20px);
}

.pattern-grid .pattern-item {
  animation: fadeInCard 0.5s ease-out backwards;
}

.pattern-grid .pattern-item:nth-child(1) { animation-delay: 0.05s; }
.pattern-grid .pattern-item:nth-child(2) { animation-delay: 0.1s; }
.pattern-grid .pattern-item:nth-child(3) { animation-delay: 0.15s; }
.pattern-grid .pattern-item:nth-child(4) { animation-delay: 0.2s; }
.pattern-grid .pattern-item:nth-child(5) { animation-delay: 0.25s; }
.pattern-grid .pattern-item:nth-child(6) { animation-delay: 0.3s; }
.pattern-grid .pattern-item:nth-child(n+7) { animation-delay: 0.35s; }

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(27,58,75,0.05);
}

.quran-verse-arabic {
  font-family: var(--font-arabic);
  font-size: 1.75rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--color-text);
  direction: rtl;
  margin-bottom: var(--space-lg);
}

.post-card-title a {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--color-secondary-light), var(--color-secondary-light));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}

.post-card-title a:hover {
  background-size: 100% 1px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gradient-gold);
  transition: width 0.3s ease;
}

.subject-card-link {
  font-size: 0.8rem;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateX(-4px);
  display: block;
  text-align: right;
  align-items: center;
  gap: 2px;
  margin-top: auto;
}

.subject-card:hover .subject-card-link {
  opacity: 1;
  transform: translateX(0);
}

.dual-panel-label .label-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 2px rgba(184,134,11,0.15));
}

@media (max-width: 960px) {
  .dual-panel {
    grid-template-columns: 1fr;
  }

  .pattern-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dual-panel-science {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }

  .dual-panel::before {
    display: none;
  }

  .dual-panel {
    min-height: auto;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-slide-glass {
    flex-direction: column;
  }

  .hero-slide-info {
    padding: var(--space-xl);
  }

  .hero-slide-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), rgba(255,255,255,0.3), transparent);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-subjects ul {
    column-count: 1;
  }

  .admin-form .form-row {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-md);
  }

  @supports (backdrop-filter: blur(1px)) {
    .main-nav {
      background: rgba(255,255,255,0.6);
    }
  }

  .main-nav.open {
    display: flex;
  }

  .nav-search-dropdown {
    position: fixed;
    left: var(--space-md);
    right: var(--space-md);
    width: auto;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-slider-arrow {
    width: 40px;
    height: 40px;
  }

  .subjects-intro {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .hero-slide-bg img {
    object-fit: cover;
    object-position: center 30%;
  }

  .hero-slide-glass {
    padding: var(--space-lg) var(--space-md);
  }

  .hero-slide-verse-col {
    display: none;
  }

  .hero-slide-divider {
    display: none;
  }

  .hero-slide-info {
    padding: var(--space-md);
  }

  .hero-slide-info h2 {
    font-size: 1.3rem;
  }

  .hero-slide-text {
    display: none;
  }

  .hero-pattern {
    display: none;
  }

  .hero-intro-glass .hero-slide-info {
    padding: var(--space-lg);
  }

  .hero-intro-glass .hero-stats {
    gap: var(--space-md);
  }

  .hero-slide-content h1 {
    font-size: 2rem;
  }

  .hero-slide-content h2 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-stats {
    gap: var(--space-xl);
  }

  .hero-stat-number {
    font-size: 1.8rem;
  }

  .pattern-grid {
    grid-template-columns: 1fr;
  }

  .post-header h1 {
    font-size: 1.8rem;
  }

  .dual-panel-section {
    padding: var(--space-lg);
  }

  .quran-verse-arabic {
    font-size: 1.1rem;
  }

  .post-connection-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    row-gap: var(--space-md);
  }

  /* On mobile: stack everything vertically. The center wrapper is
     restored to a real flex column so the timeline + conclusion stack
     together in row 1; then the prev/next links each get their own
     rows below. */
  .post-connection-center {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .post-connection-center .post-timeline,
  .post-connection-center .post-conclusion {
    grid-column: auto;
    grid-row: auto;
  }

  .post-nav-link.prev,
  .post-nav-link.next {
    grid-column: auto;
    grid-row: 2;
    width: auto;
    justify-content: center;
  }

  .subjects-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 var(--space-md);
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero-slider-arrow {
    width: 36px;
    height: 36px;
  }

  .hero-slider-prev {
    left: var(--space-sm);
  }

  .hero-slider-next {
    right: var(--space-sm);
  }

  .hero-slide-content h1 {
    font-size: 1.6rem;
  }

  .hero-slide-content h2 {
    font-size: 1.5rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-slider-dots {
    bottom: var(--space-md);
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 4px 8px;
  }

  .pattern-map-stats {
    grid-template-columns: 1fr;
  }

  .pattern-map-legend {
    gap: var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-slide {
    transition: none !important;
  }
  .post-card {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
  }
}

.search-page { padding: var(--space-2xl) 0 var(--space-4xl); }
.search-page h1 { margin-bottom: var(--space-lg); }
.search-form { margin-bottom: var(--space-xl); display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: flex-start; }
.search-form .filter-search { flex: 1; min-width: 200px; }
.search-meta { color: var(--color-text-muted); margin-bottom: var(--space-lg); }
.search-results { display: flex; flex-direction: column; gap: var(--space-lg); }
.search-result { display: flex; gap: var(--space-lg); padding: var(--space-lg); background: var(--color-bg-card); border: 1px solid var(--color-border-light); border-radius: var(--radius-md); }
.search-result h3 { font-size: 1.2rem; margin-bottom: var(--space-xs); }
.search-result h3 a { color: var(--color-primary); }
.search-result h3 a:hover { color: var(--color-secondary); }
.search-result p { color: var(--color-text-light); font-size: 0.95rem; margin-bottom: var(--space-xs); }
.search-result-category { font-size: 0.78rem; color: var(--color-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.search-result-image { flex-shrink: 0; width: 100px; height: 75px; border-radius: var(--radius-sm); overflow: hidden; }
.search-result-image img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
  .search-result { flex-direction: column; }
  .search-result-image { width: 100%; height: 150px; }
}
.share-bar { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.share-bar-centered { display: flex; flex-direction: row; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-sm) auto 0 auto; width: 100%; text-align: center; }
.share-label { font-family: var(--font-heading); font-size: 0.85rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: var(--space-xs); }
.share-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--post-science-bg); color: var(--color-text-muted); text-decoration: none; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; padding: 0; margin: 0; flex: 0 0 auto; line-height: 0; }
.share-icon svg { display: block; }
.share-icon:hover { color: var(--color-secondary); border-color: var(--color-secondary); }
.share-icon:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.share-copy.copied { background: var(--color-accent); color: var(--color-white); border-color: var(--color-accent); }

/* Share "more" popover: hidden by default, shown when the more button is
   clicked. Positioned absolutely below the share bar, centered on it. */
.share-bar-centered { position: relative; }

.share-more-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 12rem;
  background: #fff;
  border: 1px solid rgba(27, 58, 75, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 50;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.share-more-popover { display: none; }
.share-more-popover.is-open { display: flex; }

.share-more-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.share-more-item:hover,
.share-more-item:focus-visible {
  background: var(--color-bg-warm, #F3EDE4);
  color: var(--color-secondary);
  outline: none;
}

.share-more-item svg { flex-shrink: 0; }

.share-more-item.share-native {
  border-bottom: 1px solid rgba(27, 58, 75, 0.12);
  margin-bottom: 0.2rem;
  padding-bottom: 0.55rem;
}

.contribute-page-content { max-width: 760px; }
.contribute-success-msg { background: var(--color-accent-pale); color: var(--color-accent); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); margin-bottom: var(--space-xl); border-left: 4px solid var(--color-accent); }
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }
.char-count { display: block; font-size: 0.78rem; color: var(--color-text-muted); text-align: right; margin-top: 2px; }
.char-count-warn { color: var(--color-secondary); }
.char-count-over { color: var(--color-danger); font-weight: 600; }
.form-row-lg { margin-bottom: var(--space-lg); }
.rtl-textarea { min-height: 120px; direction: rtl; font-family: var(--font-arabic); }
.tall-textarea { min-height: 120px; }
.medium-textarea { min-height: 100px; }
.submit-center { text-align: center; margin-top: var(--space-xl); }

.contact-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.contact-popup-overlay.active { display: flex; }
.contact-popup {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.contact-popup-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.contact-popup-close:hover { color: var(--color-primary); }
.contact-popup-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  background: var(--color-secondary-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
}
.contact-popup h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}
.contact-popup-email {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-secondary);
  background: var(--color-secondary-pale);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  word-break: break-all;
}
.contact-popup-email a {
  color: var(--color-secondary);
  text-decoration: none;
}
.contact-popup-email a:hover {
  text-decoration: underline;
}
.contact-popup-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}
.contact-popup-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}
.contact-popup-actions .btn {
  padding: 8px 20px;
  font-size: 0.85rem;
}
.contact-popup-copy.copied {
  background: var(--color-accent) !important;
  color: var(--color-white) !important;
  border-color: var(--color-accent) !important;
}
.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.privacy-consent-group {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.privacy-consent-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
}

.privacy-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-secondary);
  cursor: pointer;
  vertical-align: middle;
}

.privacy-consent-label a {
  color: var(--color-secondary);
  text-decoration: underline;
}

.privacy-consent-label a:hover {
  color: var(--color-primary);
}

/* Privacy page — solid parchment bg, centered text, outline on all text */
.privacy-page,
.privacy-popup-page {
  background: #faf2e2;
  padding: var(--space-xl) 0 var(--space-2xl);
}

.privacy-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

.privacy-content h1,
.privacy-content h2 {
  text-align: center;
}

.privacy-content h1,
.privacy-content h2,
.privacy-content h3,
.privacy-content p,
.privacy-content li,
.privacy-content ul,
.privacy-content code,
.privacy-content strong {
  -webkit-text-stroke: 6px #faf2e2;
  paint-order: stroke fill;
  text-shadow: 0 0 1px #faf2e2, 0 0 2px #faf2e2;
}

.privacy-content ul {
  list-style: disc;
  display: inline-block;
  text-align: left;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-lg);
}

[dir="rtl"] .privacy-content ul {
  text-align: right;
  padding-left: 0;
  padding-right: var(--space-lg);
}
.pattern-map-sort-center { justify-content: center; margin-bottom: var(--space-xl); }
.pattern-map-legend-inline { position: absolute; top: 0; left: 0; right: 0; z-index: 5; margin-bottom: 0; flex-wrap: nowrap; background: rgba(250, 248, 245, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--color-border-light); }
.legend-item-cursor { cursor: pointer; }

/* ----- Voronoi Stained Glass Pattern Map ----- */
.voronoi-container {
  background: var(--pattern-map-bg);
  border: 1px solid var(--color-border-light);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.06),
    0 12px 40px rgba(0,0,0,0.08);
}
.voronoi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-xl);
}
.voronoi-legend .legend-item {
  gap: 6px;
}
.voronoi-legend .legend-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
}
.voronoi-wrap {
  padding: 0;
  line-height: 0;
}
.voronoi-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.voronoi-cell {
  stroke: #111;
  stroke-width: 4px;
  stroke-linejoin: round;
  fill-opacity: 0.85;
  cursor: pointer;
  transition: fill-opacity 0.3s ease;
}
.voronoi-highlight {
  fill: none;
  stroke: rgba(255,255,255,0.45);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  pointer-events: none;
}
.voronoi-shadow {
  fill: none;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  pointer-events: none;
}
.voronoi-link:hover .voronoi-cell {
  fill-opacity: 0.65;
}
.voronoi-link:hover .voronoi-visited-overlay {
  opacity: 0.8 !important;
}
.voronoi-cell.visited {
  fill-opacity: 0.55;
}
.voronoi-visited-overlay.visited {
  opacity: 0.7;
}
.voronoi-link {
  text-decoration: none;
}

/* Labels hidden by default, appear on hover */
.cell-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: #ffffff;
  paint-order: stroke fill;
  stroke: rgba(0,0,0,0.7);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cell-tag {
  font-family: var(--font-body);
  font-size: 7.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  fill: rgba(255,255,255,0.75);
  paint-order: stroke fill;
  stroke: rgba(0,0,0,0.4);
  stroke-width: 2.5px;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Labels appear only when their cell is hovered (synced via JS) */
.cell-label.active {
  opacity: 1;
}
.cell-tag.active {
  opacity: 0.8;
}

.voronoi-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

/* Mobile text-link fallback — hidden on desktop */
.voronoi-mobile {
  display: none;
}
.voronoi-mobile-group {
  margin-bottom: var(--space-lg);
}
.voronoi-mobile-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 4px solid #5A5A5A;
}
.voronoi-mobile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.voronoi-mobile-list li a {
  display: block;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.voronoi-mobile-list li a:hover,
.voronoi-mobile-list li a:focus {
  background: var(--color-bg-warm);
  color: var(--color-secondary);
}

/* Responsive: swap SVG for text list on mobile */
@media (max-width: 768px) {
  .voronoi-wrap {
    display: none;
  }
  .voronoi-mobile {
    display: block;
    padding: var(--space-md);
  }
  .voronoi-legend {
    display: none;
  }
}

/* Pattern Map 2 - Arc Diagram */
#pm2Canvas { display: block; width: 100%; height: auto; }
.pm2-search { position: absolute; top: 12px; right: 16px; z-index: 15; }
.pm2-search input { padding: 0.4rem 0.75rem; border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); font-size: 0.85rem; background: var(--color-white); width: 200px; }
.pm2-search input:focus { outline: none; border-color: var(--color-secondary); }
.pm2-search-results { position: absolute; top: calc(100% + 4px); right: 0; width: 260px; max-height: 240px; overflow-y: auto; background: var(--color-white); border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); z-index: 20; }
.pm2-search-results.hidden { display: none; }
.pm2-search-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.85rem; border-bottom: 1px solid var(--color-border-light); transition: background 0.15s; }
.pm2-search-item:hover { background: var(--color-secondary-light); }
.pm2-search-item small { color: var(--color-text-muted); }
.pm2-info-panel { position: absolute; top: 60px; right: 16px; width: 280px; max-width: calc(100vw - 2rem); background: var(--color-white); border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 1.25rem; pointer-events: auto; z-index: 15; }
.pm2-info-panel.hidden { display: none; }
.pm2-info-close { position: absolute; top: 0.5rem; right: 0.5rem; background: none; border: none; font-size: 1.25rem; color: var(--color-text-muted); cursor: pointer; line-height: 1; }
.pm2-info-close:hover { color: var(--color-primary); }
.pm2-info-panel h3 { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-primary); margin-bottom: 0.5rem; padding-right: 1.5rem; }
.pm2-info-category { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pm2-info-science, .pm2-info-quran { font-size: 0.85rem; color: var(--color-text); margin-bottom: 0.5rem; line-height: 1.5; }
.pm2-info-panel .btn-sm { margin-top: 0.5rem; }

@media (max-width: 768px) {
  .pm2-search { position: relative; top: auto; right: auto; width: 100%; padding: 0 1rem; }
  .pm2-search input { width: 100%; }
  .pm2-search-results { left: 0; right: auto; width: 100%; }
  .pm2-info-panel { right: 0.75rem; left: 0.75rem; width: auto; top: 140px; }
}

.subject-group { scroll-margin-top: 120px; }

@media print {
  .site-header, .site-footer, .admin-sidebar, .admin-sidebar-toggle, .admin-sidebar-overlay, .scroll-top, .share-bar, .hero-slider, .mobile-toggle, .skip-link, .related-posts, .post-card-corner, nav.breadcrumb { display: none !important; }
  main { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .post-page { padding: 0 !important; }
  .dual-panel { grid-template-columns: 1fr !important; }
  .dual-panel-section { break-inside: avoid; border: none !important; box-shadow: none !important; padding: 1rem 0 !important; }
  .post-header h1 { font-size: 18pt !important; }
  h2, h3 { font-size: 14pt !important; }
  a { color: #000 !important; text-decoration: underline !important; }
  a[href]::after { content: none !important; }
  img { max-width: 100% !important; page-break-inside: avoid; }
  .geometric-divider { display: none !important; }
}

.container-narrow { max-width: var(--max-width-narrow); }
.input-lg { font-size: 1.1rem; padding: 0.75rem 1rem; }
.text-center-muted { text-align: center; color: var(--color-text-muted); }
.verse-quote { text-align: center; font-style: italic; color: #8A8A8A; }
.logo-img { max-height: 40px; display: block; }

/* ----- Locale switcher (Phase C) ----- */
/* ----- Locale switcher dropdown (Phase C) ----- */
.locale-switcher {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 var(--space-xs);
  border-left: 1px solid var(--color-text-light);
  border-right: 1px solid var(--color-text-light);
}
.locale-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-light);
  transition: color 0.15s, background 0.15s;
}
.locale-switcher-btn:hover {
  color: var(--color-primary);
  background: var(--color-bg-warm);
}
.locale-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.locale-icon {
  width: 28px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.locale-icon-dark {
  display: none;
}
.site-header.over-hero .locale-icon-light {
  display: none;
}
.site-header.over-hero .locale-icon-dark {
  display: inline-block;
}
.locale-code {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.locale-switcher-item .locale-code {
  margin: 0 6px;
}
.locale-arrow {
  transition: transform 0.2s ease;
  margin-left: 0.15rem;
}
.locale-switcher-btn[aria-expanded="true"] .locale-arrow {
  transform: rotate(180deg);
}
.locale-switcher-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 140px;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 0.35rem;
  z-index: var(--z-dropdown);
  margin-top: 0.25rem;
}
.locale-switcher-dropdown.open {
  display: block;
}
.locale-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-text);
  transition: background 0.15s;
}
.locale-switcher-item:hover {
  background: var(--color-bg-warm);
  color: var(--color-primary);
}
.locale-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
[dir="rtl"] .locale-switcher {
  border-left: none;
  border-right: 1px solid var(--color-border-light);
}
[dir="rtl"] .locale-switcher-dropdown {
  right: auto;
  left: 0;
}

/* ---------------------------------------------------------------------
   Phase C.3 — RTL chrome audit.
   The base rules above use physical CSS properties (margin-left/right,
   padding-left/right, text-align: left/right, border-left, left/right)
   that don't flip in RTL. The overrides below re-mirror the most
   user-visible chrome on [dir="rtl"] pages (e.g. /ar). We use physical
   overrides for consistency with the rest of this stylesheet rather
   than migrating to logical properties, which would require touching
   every rule.
   Scope: header, footer, post page, home (hero + cards), search, 404,
   500, contact popup. Admin is out of scope (admins use en).
   Pattern-map and pattern-map-2 are also out of scope (a new pattern
   map is coming).
   --------------------------------------------------------------------- */
[dir="rtl"] body {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
}
[dir="rtl"] .dual-panel-content,
[dir="rtl"] .post-conclusion p {
  font-size: 1.15rem;
}
[dir="rtl"] h1,
[dir="rtl"] .pattern-index h2,
[dir="rtl"] .related-posts h2,
[dir="rtl"] .post-header h1,
[dir="rtl"] .category-header h1,
[dir="rtl"] .category-header h2 {
  font-family: 'Aref Ruqaa', var(--font-arabic);
}
[dir="rtl"] .post-nav-link svg,
[dir="rtl"] .post-nav-link.next svg,
[dir="rtl"] .post-nav-link.prev svg {
  transform: scaleX(-1);
}
[dir="rtl"] .html-preview blockquote,
[dir="rtl"] blockquote {
  border-left: none;
  border-right: 3px solid var(--color-secondary);
  padding-left: 0;
  padding-right: var(--space-md);
}
[dir="rtl"] .html-preview ul,
[dir="rtl"] .html-preview ol,
[dir="rtl"] .about-content ul,
[dir="rtl"] .about-content ol {
  padding-left: 0;
  padding-right: var(--space-xl);
}
[dir="rtl"] .about-content ul,
[dir="rtl"] .about-content ol {
  padding-right: var(--space-lg);
}
[dir="rtl"] .contact-popup-close {
  right: auto;
  left: var(--space-md);
}
[dir="rtl"] .subject-card-link {
  text-align: left;
  transform: translateX(4px);
}
[dir="rtl"] .subject-card:hover .subject-card-link {
  transform: translateX(0);
}
[dir="rtl"] .char-count {
  text-align: left;
}
/* Subject-card "Quran N:M" reference: in LTR it's left-aligned; in RTL
   it should be right-aligned (start side) for natural reading flow. */
[dir="rtl"] .subject-card-ref {
  text-align: right;
}
[dir="rtl"] .hero-intro-glass .hero-slide-info {
  text-align: right;
}
/* Locale switcher should sit at the visual "start" of the header in
   RTL. The base styles put it on the right; we keep that as the default
   for LTR and override here for RTL.
   NOTE: the existing rule above already handles the border. This just
   makes sure the dropdown position also flips — but the JS positions
   the dropdown based on the wrapper's bounding rect, so no CSS change
   is needed for the dropdown itself. */
@media (max-width: 768px) {
  .main-nav {
    gap: var(--space-md);
  }
  .locale-switcher {
    border: none;
    padding: 0;
    margin: 0;
  }
}
.opacity-70 { opacity: 0.7; }

/* The home hero slider uses <blockquote class="hero-slide-verse"> for the
   verse column. The global blockquote rules below set a 3px gold border
   (`var(--color-secondary)`) on the start side, which renders as an extra
   thick gold stripe adjacent to the slider's own .hero-slide-divider.
   Override with a selector that has higher specificity (0,2,1,0 = class +
   class + type) than the global blockquote rules (0,1,1,0 = `[dir="rtl"]`
   + type, or .html-preview + type) so this wins regardless of source order. */
blockquote.hero-slide-verse,
.hero-slide-verse.hero-slide-verse {
  border: 0;
  background: transparent;
  margin: 0;
}

/* In RTL, the global `[dir="rtl"] blockquote` rule sets
   `padding-left: 0; padding-right: var(--space-md)` which would squish
   the verse content against the slider divider. Restore the original
   32px padding on both sides. */
[dir="rtl"] blockquote.hero-slide-verse,
[dir="rtl"] .hero-slide-verse.hero-slide-verse {
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

/* ============================================================================
   Post footer timeline
   Quiet single-axis timeline rendered between the dual panel and the
   conclusion. Year axis runs 600 → current_year, with ticks every 100 years.
   Markers: verse year/range (always tradition/blue), timeline_points
   color-coded by side. Full content width. Tooltip on hover/focus.
   ============================================================================ */
.post-timeline {
  margin: 0;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(to bottom, rgba(250, 242, 226, 0.5) 0%, rgba(250, 242, 226, 0.8) 100%);
  border-radius: var(--radius-md);
}

.post-timeline-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 0.1rem;
  text-align: center;
}

.post-timeline-track {
  position: relative;
  height: 1.5rem;
  margin: 0;
}

.post-timeline-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.2),
    #000 12%,
    #000 88%,
    rgba(0, 0, 0, 0.2)
  );
}

.post-timeline-line::before,
.post-timeline-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  background: #000;
  transform: translateY(-50%);
}

.post-timeline-line::before { left: 0; }
.post-timeline-line::after { right: 0; }

.post-timeline-tick {
  position: absolute;
  top: calc(50% - 3px);
  width: 1px;
  height: 6px;
  background: #000;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Minor (unlabeled) tick marks: every 100 years, same size and color as
   the labeled major ticks so the only visual difference is the label. */
.post-timeline-tick-minor {
  top: calc(50% - 3px);
  width: 1px;
  height: 6px;
  background: #000;
}

.post-timeline-tick-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: #000;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.post-timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}

.post-timeline-marker-range {
  /* Range markers: the JS sets left + width; transform centers on the
     bar's midpoint, which is the center of the visible bar (left + width/2). */
  transform: translate(0, -50%);
}

.post-timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1B3A4B;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1.5px currentColor, 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
  color: #1B3A4B;
}

.post-timeline-marker:hover .post-timeline-dot,
.post-timeline-marker:focus .post-timeline-dot {
  transform: scale(1.35);
}

.post-timeline-marker-verse .post-timeline-dot {
  background: #0f744e;
  color: #0f744e;
  width: 10px;
  height: 10px;
}

.post-timeline-marker-tradition .post-timeline-dot {
  background: #1B3A4B;
  color: #1B3A4B;
}

.post-timeline-marker-modern .post-timeline-dot {
  background: #B85C00;
  color: #B85C00;
}

/* Verse range markers use the standard dot, but the dot's `data-pos`
   is set to the midpoint of the year range by the template. The tooltip
   shows the full range. No special range-bar styling needed. */

.post-timeline-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 11rem;
  max-width: 17rem;
  background: #fff;
  border: 1px solid rgba(27, 58, 75, 0.25);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 4px 12px rgba(27, 58, 75, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
  text-align: left;
}

.post-timeline-marker:hover .post-timeline-tip,
.post-timeline-marker:focus .post-timeline-tip {
  opacity: 1;
  pointer-events: auto;
}

/* When the tooltip would overflow the viewport, JS flips the marker to
   `data-tip-state="overflow-l"` or `"overflow-r"`. Re-anchor the tip to
   the relevant edge of the marker so it stays inside the screen. */
.post-timeline-marker[data-tip-state="overflow-l"] .post-timeline-tip {
  left: 0;
  transform: translateX(0);
}
.post-timeline-marker[data-tip-state="overflow-r"] .post-timeline-tip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.post-timeline-tip strong {
  display: block;
  font-size: 0.9rem;
  color: #1B3A4B;
  margin-bottom: 0.15rem;
  letter-spacing: 0.02em;
}

.post-timeline-tip-year {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

.post-timeline-tip span {
  display: block;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--color-text, #333);
}

.post-timeline-tip-source {
  margin-top: 0.3rem !important;
  font-size: 0.68rem !important;
  color: rgba(27, 58, 75, 0.6) !important;
  border-top: 1px dotted rgba(27, 58, 75, 0.2);
  padding-top: 0.25rem;
  font-style: italic;
}

@media (max-width: 720px) {
  .post-timeline-tick-label { font-size: 0.56rem; }
  .post-timeline-tip { min-width: 9rem; max-width: 80vw; font-size: 0.78rem; }
  .post-timeline-tip strong { font-size: 0.88rem; }
  .post-timeline-tip span { font-size: 0.8rem; }
  .post-timeline-tip-year { font-size: 0.78rem; }
}

/* Admin form: timeline-points list rows */
.timeline-points-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  max-width: 920px;
}

.timeline-point-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.timeline-point-row .input-sm {
  flex: 0 0 auto;
}

.timeline-point-row .input-grow {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.timeline-point-row .timeline-point-remove {
  flex: 0 0 auto;
}
