/**
 * Veda Portal Styling
 * Modern, professional design for the Veda portal
 */

/* Krishna Sanskrit: Devanagari with Vedic accents + Gentium Latin for transliteration.
   SIL Open Font License 1.1. https://taittiriya.com/#font */
@font-face {
    font-family: 'Krishna Sanskrit';
    src: url('/css/fonts/KrishnaSanskrit-Regular.woff2?v=e557a75ff6') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
    unicode-range: U+0000-036F, U+0900-097F, U+1AB0-1AFF, U+1CD0-1CFF, U+1D00-1EFF, U+2000-206F,
                   U+20A0-20C0, U+2122, U+2212, U+25CC, U+2C60-2C7F, U+A720-A7FF, U+A8E0-A8FF, U+AB30-AB6F;
}

/* Second @font-face removed — single swap declaration is sufficient */

/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
  /* Sacred Color Palette — darkened for contrast */
  --veda-parchment: #fdfbf7;
  --veda-ink-dark: #1a1a1a;
  --veda-ink-medium: #4a3d2b;
  --veda-ink-light: #7a6b55;
  --veda-accent-gold: #b8952f;
  --veda-accent-gold-dark: #96791f;
  --veda-accent-copper: #9a5f2a;
  --veda-accent-copper-dark: #7a4b1f;
  --veda-accent-sage: #5d3a1a;
  --veda-accent-sage-dark: #3d2610;
  --veda-divider: #a36428;
  
  /* Section-specific accent (overridden via data-section) */
  --section-accent: var(--veda-accent-gold-dark);
  --section-accent-light: var(--veda-accent-gold);
  
  /* Portal-specific colors */
  --veda-portal-bg: #fdfbf7;
  --veda-portal-card: #fdfbf7;
  --veda-portal-border: #e0dbd5;
  --veda-portal-shadow: rgba(26, 26, 26, 0.08);
  --veda-portal-hover: #f5f3f0;
  --veda-portal-active: var(--veda-accent-gold-dark);
  
  /* Neumorphic — retained only for search bar */
  --neu-light: #ffffff;
  --neu-dark: #e6e2de;
  --neu-shadow-light: rgba(255, 255, 255, 0.8);
  --neu-shadow-dark: rgba(46, 42, 38, 0.12);
  --neu-inset-light: rgba(255, 255, 255, 0.6);
  --neu-inset-dark: rgba(46, 42, 38, 0.08);
  
  /* Typography */
  --veda-font-primary: 'Krishna Sanskrit', 'Noto Serif Devanagari', 'Arial Unicode MS', serif;
  --veda-font-secondary: 'Georgia', 'Krishna Sanskrit', 'Times New Roman', serif;
  
  /* Spacing */
  --veda-space-xs: 0.5rem;
  --veda-space-sm: 1rem;
  --veda-space-md: 1.5rem;
  --veda-space-lg: 2.5rem;
  --veda-space-xl: 4rem;
  
  /* Layout */
  --veda-max-width: 1200px;
  --veda-card-width: 280px;
}

/* ========================================
   FONT LOADING STATES
   ======================================== */

.fonts-loading .portal-title,
.fonts-loading .veda-card-number,
.fonts-loading .veda-card-title,
.fonts-loading .kanda-number,
.fonts-loading .kanda-topic,
.fonts-loading .prashna-number,
.fonts-loading .prashna-title {
  font-family: 'Noto Serif Devanagari', 'Arial Unicode MS', 'Krishna Sanskrit', serif;
  opacity: 0.8;
}

.fonts-loaded .portal-title,
.fonts-loaded .veda-card-number,
.fonts-loaded .veda-card-title,
.fonts-loaded .kanda-number,
.fonts-loaded .kanda-topic,
.fonts-loaded .prashna-number,
.fonts-loaded .prashna-title {
  font-family: var(--veda-font-primary);
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ========================================
   BASIC RESET & LAYOUT
   ======================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--veda-font-secondary);
  background: var(--veda-portal-bg);
  color: var(--veda-ink-dark);
  line-height: 1.6;
}

.portal-container {
  max-width: var(--veda-max-width);
  margin: 0 auto;
  padding: var(--veda-space-lg);
}

/* ========================================
   HEADER
   ======================================== */

.portal-header {
  text-align: center;
  margin-bottom: var(--veda-space-sm);
  padding: var(--veda-space-md) 0 0;
}

.portal-title {
  font-family: var(--veda-font-primary);
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--veda-ink-dark);
  margin: 0;
  line-height: 1.1;
  text-shadow: 
    2px 2px 4px rgba(46, 42, 38, 0.1),
    0 0 20px rgba(184, 149, 47, 0.05);
  letter-spacing: -0.02em;
  position: relative;
}

/* Ornamental danda beneath title */
.portal-header::after {
  content: '॥ ✧ ॥';
  display: block;
  text-align: center;
  font-family: var(--veda-font-primary);
  font-size: 1.1rem;
  color: var(--veda-accent-gold-dark);
  letter-spacing: 0.5em;
  margin-top: 0.5rem;
  opacity: 0.5;
}

/* ========================================
   SECTION NAVIGATION
   ======================================== */

.section-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--veda-font-primary);
  font-size: 1.8rem;
  color: var(--veda-ink-medium);
  gap: 0.25rem;
}

.section-nav span {
  margin: 0 0.75rem;
  color: var(--veda-accent-gold);
  font-weight: normal;
  font-size: 1.2rem;
  opacity: 0.4;
}

.section-button {
  background: none;
  border: none;
  font-family: var(--veda-font-primary);
  font-size: 1.8rem;
  color: var(--veda-ink-medium);
  cursor: pointer;
  padding: var(--veda-space-xs) var(--veda-space-sm);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.section-button:hover {
  color: var(--veda-ink-dark);
  transform: translateY(-1px);
}

.section-button.active {
  color: var(--veda-accent-gold-dark);
  font-weight: bold;
}

/* Active indicator — small gold underline dash */
.section-button.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--veda-accent-gold-dark);
  border-radius: 1px;
}

/* ========================================
   SEARCH
   ======================================== */

.search-container {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 9999;
  display: flex;
  align-items: center;
  max-width: 600px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: var(--veda-space-md) var(--veda-space-lg);
  padding-right: 4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  background: linear-gradient(135deg, 
    rgba(253, 251, 247, 0.8) 0%, 
    rgba(255, 255, 255, 0.6) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 
    10px 10px 20px var(--neu-shadow-dark),
    -10px -10px 20px var(--neu-shadow-light),
    inset 3px 3px 6px var(--neu-inset-light),
    inset -3px -3px 6px var(--neu-inset-dark);
  transition: all 0.3s ease;
}

.search-container:focus-within {
  border-color: var(--veda-accent-gold);
  background: linear-gradient(135deg, 
    rgba(253, 251, 247, 0.95) 0%, 
    rgba(255, 255, 255, 0.8) 100%);
  box-shadow: 
    4px 4px 8px var(--neu-shadow-dark),
    -4px -4px 8px var(--neu-shadow-light),
    inset 1px 1px 2px var(--neu-inset-light),
    inset -1px -1px 2px var(--neu-inset-dark),
    0 0 0 2px rgba(212, 175, 55, 0.2);
  transform: scale(1.02);
}

.search-filter {
  border: none;
  background: transparent;
  padding: 0.25rem 0.5rem;
  padding-right: 0.75rem;
  font-size: 0.95rem;
  color: var(--veda-ink-light);
  cursor: pointer;
  border-right: 1px solid rgba(139, 115, 85, 0.2);
  margin-right: 0.75rem;
  font-weight: 500;
  font-family: var(--veda-font-secondary);
}

.search-filter:focus {
  outline: none;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 1.1rem;
  background: transparent;
  color: var(--veda-ink-dark);
  font-family: var(--veda-font-secondary);
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: var(--veda-ink-light);
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid var(--veda-accent-gold);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--veda-accent-gold);
  cursor: pointer;
  z-index: 10;
  box-shadow:
    2px 2px 4px var(--neu-shadow-dark),
    -2px -2px 4px var(--neu-shadow-light);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon:hover {
  transform: translateY(-50%) scale(1.1);
  background: var(--veda-accent-gold);
  color: white;
  box-shadow: 
    6px 6px 12px var(--neu-shadow-dark),
    -6px -6px 12px var(--neu-shadow-light);
}

.search-icon:active {
  transform: translateY(-50%) scale(0.95);
}

/* Search Dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: linear-gradient(135deg, 
    rgba(253, 251, 247, 0.98) 0%, 
    rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  box-shadow: 
    10px 10px 20px var(--neu-shadow-dark),
    -10px -10px 20px var(--neu-shadow-light);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
}

.search-dropdown.visible {
  display: block;
}

/* Search Results */
.search-result {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.search-result:first-child {
  border-radius: 16px 16px 0 0;
}

.search-result:last-child {
  border-bottom: none;
  border-radius: 0 0 16px 16px;
}

.search-result:only-child {
  border-radius: 16px;
}

.search-result:hover,
.search-result.focused,
.search-result.highlighted {
  background: rgba(212, 175, 55, 0.08);
}

.search-result.no-results {
  color: var(--veda-ink-light);
  text-align: center;
  cursor: default;
  font-style: italic;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.result-title {
  font-weight: 600;
  color: var(--veda-accent-gold);
  font-size: 0.95rem;
}

.result-ref {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Krishna Sanskrit', monospace;
  font-size: 0.85rem;
  color: var(--veda-ink-light);
  font-weight: 500;
}

.result-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.result-badge.corpus-samhita {
  background: #e8f4e8;
  color: #2d6a2d;
}

.result-badge.corpus-brahmana {
  background: #e8e8f4;
  color: #4a4a8a;
}

.result-badge.corpus-aranyaka {
  background: #fff3e0;
  color: #8b5a2b;
}

.result-badge.kathakam,
.result-badge.corpus-kathakam {
  background: #e0f4f1;
  color: #2d6a5a;
}

.result-badge.ekagnikandam,
.result-badge.corpus-ekagnikandam {
  background: #f4e0e4;
  color: #6a2d4a;
}

.result-badge-samhita,
.result-badge.samhita {
  background: #2d6a2d;
  color: white;
}

.result-badge-brahmana,
.result-badge.brahmana {
  background: #4a4a8a;
  color: white;
}

.result-badge-aranyaka,
.result-badge.aranyaka {
  background: #8b5a2b;
  color: white;
}

.result-badge-kathakam,
.result-badge.kathakam {
  background: #2d6a5a;
  color: white;
}

.result-badge-ekagnikandam,
.result-badge.ekagnikandam {
  background: #6a2d4a;
  color: white;
}

.reference-result {
  background: rgba(212, 175, 55, 0.05);
  border-left: 3px solid var(--veda-accent-gold);
}

.reference-result .result-badge {
  background: var(--veda-accent-gold);
  color: white;
}

/* Patha links inside reference results (Samhita → Pada/Krama navigation) */
.ref-patha-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(139, 90, 43, 0.2);
}

.ref-patha-link {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6b4226;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  font-family: var(--veda-font-primary, 'Noto Serif Devanagari', serif);
}

.ref-patha-link:hover {
  background: rgba(139, 90, 43, 0.85);
  color: white;
  border-color: rgba(139, 90, 43, 0.85);
}

.ref-patha-sep {
  color: rgba(139, 90, 43, 0.25);
  font-size: 0.75rem;
  user-select: none;
}

.result-location {
  font-size: 0.85rem;
  color: var(--veda-ink-light);
}

.result-preview {
  font-size: 0.9rem;
  color: var(--veda-ink-dark);
  line-height: 1.4;
  font-family: var(--veda-font-primary, 'Noto Serif Devanagari', serif);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   UNIFIED CARD SYSTEM
   All portal cards share a single base style.
   Section-specific accents via CSS custom properties.
   ======================================== */

/* --- Grids -------------------------------------------------- */

.kanda-grid,
.brahmana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--veda-space-md);
  max-width: 1240px;
  margin: 0 auto var(--veda-space-lg);
  padding: var(--veda-space-md) 0;
}

.brahmana-grid {
  max-width: 960px;
}

.prashna-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--veda-space-md);
  margin-top: var(--veda-space-md);
}

.aranyaka-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--veda-space-md);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--veda-space-md);
}

/* Keep scroll classes for backwards compatibility but hide them */
.kanda-scroll-container-wrapper,
.kanda-scroll-container {
  display: none;
}

.scroll-nav-button {
  display: none;
}

/* --- Base Card ---------------------------------------------- */

.veda-card {
  background: linear-gradient(135deg,
    rgba(253, 251, 247, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(253, 251, 247, 0.9) 100%);
  border: 1px solid rgba(181, 136, 80, 0.20);
  border-radius: 14px;
  padding: var(--veda-space-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow:
    0 2px 8px rgba(46, 42, 38, 0.08),
    0 1px 3px rgba(46, 42, 38, 0.06),
    inset 0 0 0 3px rgba(181, 136, 80, 0.06);
  animation: cardEnter 0.4s ease both;
  animation-delay: calc(var(--card-index, 0) * 80ms);
}

/* Top accent bar — always visible, color set per section */
.veda-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    var(--card-accent-start, var(--veda-accent-gold)),
    var(--card-accent-mid, var(--veda-accent-copper)),
    var(--card-accent-end, var(--veda-accent-gold)));
  opacity: 0.6;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.veda-card:hover {
  transform: translateY(-4px);
  border-color: rgba(181, 136, 80, 0.35);
  box-shadow:
    0 6px 20px rgba(46, 42, 38, 0.12),
    0 2px 6px rgba(46, 42, 38, 0.08),
    inset 0 0 0 3px rgba(181, 136, 80, 0.10);
}

.veda-card:hover::before {
  opacity: 1;
}

/* Keyboard focus indicator */
.veda-card:focus-visible {
  outline: 2px solid var(--veda-accent-gold);
  outline-offset: 2px;
  box-shadow:
    0 6px 20px rgba(46, 42, 38, 0.12),
    0 2px 6px rgba(46, 42, 38, 0.08),
    inset 0 0 0 3px rgba(181, 136, 80, 0.10);
}

/* Disable cardEnter inside drill-down to avoid double animation */
.prashna-list .veda-card {
  animation: none;
}

.veda-card.active {
  border-color: var(--section-accent, var(--veda-accent-gold));
  background: linear-gradient(135deg, var(--veda-portal-card) 0%, #fefefe 100%);
  box-shadow:
    0 4px 12px rgba(46, 42, 38, 0.10),
    0 1px 4px rgba(46, 42, 38, 0.06),
    inset 0 0 0 4px rgba(var(--section-accent-rgb, 184, 149, 47), 0.12);
}

/* Section modifier classes — accent color overrides */
.veda-card--samhita {
  /* Default gold palette — no overrides needed */
}

.veda-card--brahmana {
  /* Same palette as Samhita for now; ready for future differentiation */
}

.veda-card--aranyaka {
  --card-accent-start: var(--veda-accent-sage);
  --card-accent-mid: var(--veda-accent-copper);
  --card-accent-end: var(--veda-accent-gold);
}

.veda-card--aranyaka:hover {
  border-color: rgba(93, 58, 26, 0.35);
  box-shadow:
    0 6px 20px rgba(46, 42, 38, 0.12),
    0 2px 6px rgba(46, 42, 38, 0.08),
    inset 0 0 0 3px rgba(93, 58, 26, 0.10);
}

/* --- Card Header (number + actions) ------------------------- */

.veda-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--veda-space-sm);
}

.veda-card-number {
  font-family: var(--veda-font-primary);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--veda-ink-dark);
  display: flex;
  align-items: center;
  gap: var(--veda-space-xs);
}

/* Decorative ॥ markers for prashna/prapathaka numbers */
.veda-card-number--decorated::before,
.veda-card-number--decorated::after {
  content: '॥';
  color: var(--veda-accent-copper);
  font-size: 1.1rem;
}

/* Centered title variant (Samhita prashna cards) */
.veda-card-number--centered {
  justify-content: center;
  text-align: center;
  margin-bottom: var(--veda-space-sm);
}

/* --- Card Content ------------------------------------------- */

.veda-card-content {
  position: relative;
  z-index: 2;
}

.veda-card-count {
  font-family: var(--veda-font-primary);
  font-size: 1.1rem;
  color: var(--veda-ink-light);
  margin-bottom: var(--veda-space-sm);
  padding-bottom: var(--veda-space-sm);
  border-bottom: 1px solid rgba(181, 136, 80, 0.15);
}

.veda-card-title {
  font-family: var(--veda-font-primary);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--veda-ink-dark);
  margin-bottom: var(--veda-space-xs);
  line-height: 1.3;
}

/* Opening-sentence snippet (first line of first anuvaka) */
.veda-card-snippet {
  font-family: var(--veda-font-primary);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--veda-ink-medium);
  margin-bottom: var(--veda-space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-spacing: 0.05em;
}

/* Topic label (e.g. दर्शपूर्णमासौ) */
.veda-card-topic {
  font-family: var(--veda-font-primary);
  font-size: 1rem;
  font-weight: 600;
  color: var(--veda-accent-copper);
  margin-bottom: var(--veda-space-xs);
}

.veda-card-description {
  font-family: var(--veda-font-primary);
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--veda-ink-medium);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-spacing: 0.1em;
}

.veda-card-meta {
  font-family: var(--veda-font-primary);
  font-size: 1rem;
  color: var(--veda-ink-light);
  margin-top: var(--veda-space-xs);
}

/* --- Card Actions (buttons row) ------------------------------ */

.veda-card-actions {
  display: flex;
  gap: var(--veda-space-sm);
  opacity: 0.85;
  transition: all 0.3s ease;
}

.veda-card:hover .veda-card-actions {
  opacity: 1;
}

.action-button {
  background: linear-gradient(135deg,
    rgba(253, 251, 247, 0.8) 0%,
    rgba(255, 255, 255, 0.6) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--veda-ink-medium);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--veda-font-primary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--veda-space-xs);
  min-width: 70px;
  position: relative;
  overflow: hidden;
}

.action-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(212, 175, 55, 0.1),
    transparent);
  transition: left 0.5s ease;
}

.action-button:hover {
  background: linear-gradient(135deg, var(--veda-accent-gold) 0%, var(--veda-accent-copper) 100%);
  color: white;
  border-color: var(--veda-accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.action-button:hover::before {
  left: 100%;
}

/* --- Pāṭha variant chips (Pada/Krama alternatives) ---------- */

.veda-card-patha-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--veda-space-sm);
  padding-top: var(--veda-space-sm);
  border-top: 1px solid rgba(181, 136, 80, 0.12);
}

.patha-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(181, 136, 80, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
  background: rgba(253, 251, 247, 0.5);
}

.patha-chip:hover {
  border-color: rgba(181, 136, 80, 0.5);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
  transform: translateY(-1px);
}

/* Left accent stripe for patha type differentiation */
.patha-chip.patha-samhita {
  border-left: 3px solid var(--veda-accent-gold);
}

.patha-chip.patha-single {
  border-left: 3px solid var(--veda-accent-gold);
}

.patha-chip.patha-pada {
  border-left: 3px solid #b5884f;
}

.patha-chip.patha-krama {
  border-left: 3px solid #8b4513;
}

/* Read button — main label area of the chip */
.patha-chip-read {
  background: transparent;
  border: none;
  color: var(--veda-ink-medium);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-family: var(--veda-font-primary);
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.patha-chip-read:hover {
  background: linear-gradient(135deg, var(--veda-accent-gold) 0%, var(--veda-accent-copper) 100%);
  color: white;
}

/* Print button — small icon on the right side of the chip */
.patha-chip-print {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(181, 136, 80, 0.15);
  color: var(--veda-ink-light);
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.25s ease;
  line-height: 1;
}

.patha-chip-print:hover {
  background: rgba(181, 136, 80, 0.12);
  color: var(--veda-accent-copper);
}

/* --- Prashna List (drill-down container) --------------------- */

.prashna-list {
  background: linear-gradient(135deg,
    rgba(253, 251, 247, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 100%);
  border: 1px solid rgba(181, 136, 80, 0.15);
  border-radius: 14px;
  padding: var(--veda-space-lg);
  margin-top: var(--veda-space-md);
  animation: slideDown 0.4s ease-out;
  box-shadow:
    0 2px 8px rgba(46, 42, 38, 0.08),
    0 1px 3px rgba(46, 42, 38, 0.05);
}

.prashna-list.hidden {
  display: none;
}

.prashna-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--veda-space-lg);
  padding-bottom: var(--veda-space-md);
  border-bottom: 2px solid var(--veda-accent-gold);
  position: relative;
}

.prashna-list-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--veda-accent-gold), var(--veda-accent-copper), var(--veda-accent-gold));
  border-radius: 1px;
}

.prashna-list-title {
  font-family: var(--veda-font-primary);
  font-size: 2rem;
  font-weight: bold;
  color: var(--veda-ink-dark);
  text-shadow: 0 2px 4px rgba(46, 42, 38, 0.1);
  margin: 0;
}

.back-button {
  background: var(--veda-portal-bg);
  border: 2px solid var(--veda-accent-gold);
  color: var(--veda-accent-gold);
  padding: var(--veda-space-sm) var(--veda-space-md);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--veda-font-primary);
  font-weight: bold;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: var(--veda-accent-gold);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

/* --- Aranyaka Section Header --------------------------------- */

.aranyaka-header {
  text-align: center;
  margin-bottom: var(--veda-space-lg);
  padding: var(--veda-space-md) 0;
}

.aranyaka-title {
  font-family: var(--veda-font-primary);
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--veda-ink-dark);
  margin-bottom: var(--veda-space-xs);
  text-shadow: 0 2px 4px rgba(46, 42, 38, 0.1);
}

.aranyaka-subtitle {
  font-family: var(--veda-font-secondary);
  font-size: 1.2rem;
  color: var(--veda-ink-medium);
  font-style: italic;
}

/* Legacy scroll/print classes still referenced by old markup */
.kanda-print-icon    { display: none; }

/* ========================================
   COMING SOON
   ======================================== */

.coming-soon {
  text-align: center;
  padding: var(--veda-space-xl);
  background: linear-gradient(135deg, 
    rgba(253, 251, 247, 0.9) 0%, 
    rgba(255, 255, 255, 0.7) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 
    8px 8px 16px var(--neu-shadow-dark),
    -8px -8px 16px var(--neu-shadow-light),
    inset 2px 2px 4px var(--neu-inset-light),
    inset -2px -2px 4px var(--neu-inset-dark);
  animation: slideDown 0.6s ease-out;
  max-width: 600px;
  margin: 0 auto;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: var(--veda-space-md);
  animation: fadeIn 1s ease-in;
}

.coming-soon-title {
  font-family: var(--veda-font-primary);
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--veda-ink-dark);
  margin-bottom: var(--veda-space-sm);
  text-shadow: 0 2px 4px rgba(46, 42, 38, 0.1);
}

.coming-soon-subtitle {
  font-family: var(--veda-font-primary);
  font-size: 2rem;
  font-weight: 600;
  color: var(--veda-accent-gold);
  margin-bottom: var(--veda-space-md);
  text-shadow: 0 2px 4px rgba(184, 149, 106, 0.2);
}

.coming-soon-description {
  font-family: var(--veda-font-secondary);
  font-size: 1.2rem;
  color: var(--veda-ink-medium);
  line-height: 1.6;
  margin-bottom: var(--veda-space-md);
}

.coming-soon-sanskrit {
  font-family: var(--veda-font-primary);
  font-size: 1.3rem;
  color: var(--veda-ink-dark);
  line-height: 1.5;
  margin-bottom: var(--veda-space-lg);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(46, 42, 38, 0.1);
}

.coming-soon-status {
  display: inline-block;
  background: var(--veda-accent-gold);
  color: white;
  padding: var(--veda-space-sm) var(--veda-space-md);
  border-radius: 25px;
  font-family: var(--veda-font-secondary);
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 
    4px 4px 8px var(--neu-shadow-dark),
    -4px -4px 8px var(--neu-shadow-light);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section transition */
#portal-content {
  transition: opacity 0.2s ease;
}

#portal-content.transitioning {
  opacity: 0;
}

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

@media (max-width: 1200px) {
  .portal-container {
    padding: var(--veda-space-md);
  }
  
  .kanda-grid,
  .brahmana-grid {
    max-width: 1000px;
  }
}

@media (max-width: 768px) {
  /* Mobile: Krishna Sanskrit renders correctly on iOS (CoreText) and Android (HarfBuzz) */
  .veda-text,
  .devanagari-text,
  [lang="sa"] {
    font-family: 'Krishna Sanskrit', 'Siddhanta', 'Noto Serif Devanagari', serif;
  }
  
  .portal-container {
    padding: var(--veda-space-sm);
  }
  
  .portal-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: var(--veda-space-sm);
  }
  
  .section-nav {
    font-size: 1.2rem;
    flex-wrap: wrap;
    gap: var(--veda-space-xs);
    margin-bottom: var(--veda-space-sm);
  }
  
  .section-button {
    margin: 0 var(--veda-space-xs);
    padding: var(--veda-space-xs) var(--veda-space-sm);
    font-size: 1rem;
    min-width: 80px;
  }
  
  .search-container {
    margin-bottom: var(--veda-space-md);
  }
  
  .search-input {
    max-width: 100%;
    font-size: 1rem;
    padding: var(--veda-space-sm) var(--veda-space-md);
    padding-right: 3.5rem;
  }
  
  .search-icon {
    width: 36px;
    height: 36px;
    right: 0.5rem;
    font-size: 1rem;
  }
  
  /* Unified card: tablet */
  .kanda-grid,
  .brahmana-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--veda-space-sm);
  }
  
  .prashna-grid,
  .aranyaka-grid {
    grid-template-columns: 1fr;
    gap: var(--veda-space-sm);
  }
  
  .veda-card {
    padding: var(--veda-space-sm);
  }

  /* Keep comfortable padding on cards with action buttons */
  .veda-card:has(.veda-card-actions) {
    padding: var(--veda-space-md);
  }
  
  .veda-card-number {
    font-size: 1.5rem;
  }
  
  .veda-card-title {
    font-size: 1.2rem;
  }
  
  .veda-card-description {
    font-size: 0.95rem;
    -webkit-line-clamp: 3;
  }

  .veda-card-snippet {
    font-size: 0.85rem;
  }

  .veda-card-topic {
    font-size: 0.9rem;
  }
  
  .veda-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--veda-space-xs);
  }
  
  .veda-card-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .action-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    min-width: 60px;
  }
  
  .prashna-list {
    padding: var(--veda-space-md);
    margin-top: var(--veda-space-sm);
  }
  
  .prashna-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--veda-space-sm);
    margin-bottom: var(--veda-space-md);
  }
  
  .prashna-list-title {
    font-size: 1.6rem;
  }

  .aranyaka-title {
    font-size: 2rem;
  }
  
  .coming-soon {
    padding: var(--veda-space-md);
    margin: var(--veda-space-sm);
  }
  
  .coming-soon-title {
    font-size: 2rem;
  }

  /* Patha chips: ensure comfortable touch targets on tablet */
  .patha-chip-read {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }

  .patha-chip-print {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .portal-container {
    padding: var(--veda-space-xs);
  }
  
  .portal-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  .section-nav {
    font-size: 1rem;
    gap: var(--veda-space-xs);
  }
  
  .section-button {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    min-width: 70px;
  }
  
  .search-input {
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
    padding-right: 3rem;
  }
  
  .search-icon {
    width: 32px;
    height: 32px;
    right: 0.4rem;
    font-size: 0.9rem;
  }
  
  /* Unified card: mobile */
  .kanda-grid,
  .brahmana-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--veda-space-xs);
  }
  
  .veda-card {
    padding: var(--veda-space-xs);
  }
  
  .veda-card-number {
    font-size: 1.3rem;
  }
  
  .veda-card-number--decorated::before,
  .veda-card-number--decorated::after {
    font-size: 0.9rem;
  }
  
  .veda-card-title {
    font-size: 1.1rem;
  }
  
  .veda-card-description {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }

  .veda-card-snippet {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
  }

  .veda-card-topic {
    font-size: 0.85rem;
  }
  
  .veda-card-count {
    font-size: 0.95rem;
  }

  .veda-card-meta {
    font-size: 0.85rem;
  }
  
  .prashna-list {
    padding: var(--veda-space-sm);
  }
  
  .prashna-list-title {
    font-size: 1.4rem;
  }
  
  .action-button {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    min-width: 50px;
  }

  .aranyaka-title {
    font-size: 1.6rem;
  }
  
  .coming-soon {
    padding: var(--veda-space-sm);
  }
  
  .coming-soon-title {
    font-size: 1.6rem;
  }

  /* Patha chips: compact on small mobile */
  .veda-card-patha-links {
    gap: 0.4rem;
  }

  .patha-chip-read {
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
  }

  .patha-chip-print {
    padding: 0.25rem 0.4rem;
    font-size: 0.68rem;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --veda-portal-border: #000000;
    --veda-ink-light: #000000;
  }
  
  .veda-card {
    border-width: 3px;
  }
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

.search-results-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--veda-portal-card);
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--veda-portal-border);
  border-top: none;
  box-shadow: 0 8px 32px var(--veda-portal-shadow);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--veda-portal-border);
  background: var(--veda-portal-hover);
}

.search-results-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--veda-ink-dark);
  font-weight: 600;
}

.close-search-results {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--veda-ink-light);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-search-results:hover {
  color: var(--veda-ink-dark);
  background: var(--veda-portal-border);
}

.search-results-list {
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--veda-portal-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.search-result-item:hover {
  background: var(--veda-portal-hover);
  transform: translateX(4px);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.result-title {
  font-weight: 600;
  color: var(--veda-ink-dark);
  font-size: 1rem;
  line-height: 1.3;
}

.result-location {
  font-size: 0.85rem;
  color: var(--veda-accent-copper);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--veda-ink-medium);
  margin-bottom: 0.5rem;
}

.devanagari-line {
  font-family: var(--veda-font-primary);
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 0.4rem;
  color: var(--veda-ink-dark);
}

.iast-line {
  /* Krishna Sanskrit's Latin (Gentium) has every ISO-15919 Vedic accent (ā̠ ā̍ r̥ m̐) */
  font-family: 'Krishna Sanskrit', var(--veda-font-secondary);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--veda-ink-medium);
}

.result-text mark {
  background: rgba(212, 175, 55, 0.3);
  color: var(--veda-ink-dark);
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
  font-weight: 600;
}

.result-context {
  font-size: 0.85rem;
  color: var(--veda-ink-light);
  font-style: italic;
  line-height: 1.4;
}

/* Mobile responsive for search results */
@media (max-width: 768px) {
  .search-results-container {
    max-height: 300px;
  }
  
  .search-result-item {
    padding: 0.8rem 1rem;
  }
  
  .result-header {
    flex-direction: column;
    gap: 0.3rem;
  }
  
  .result-location {
    white-space: normal;
  }
  
  .result-text {
    font-size: 0.9rem;
  }
  
  .devanagari-line {
    font-size: 1.2rem;
  }
  
  .iast-line {
    font-size: 1rem;
  }
  
  .result-context {
    font-size: 0.8rem;
  }
}

/* ========================================
   FULL SEARCH RESULTS PAGE
   ======================================== */

.full-search-results-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--veda-portal-bg);
  z-index: 2000;
  overflow-y: auto;
  padding: var(--veda-space-lg);
}

.full-search-header {
  display: flex;
  align-items: center;
  gap: var(--veda-space-md);
  margin-bottom: var(--veda-space-md);
  padding-bottom: var(--veda-space-sm);
  border-bottom: 1px solid var(--veda-portal-border);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.back-to-portal {
  background: var(--veda-accent-copper);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.back-to-portal:hover {
  background: var(--veda-accent-sage);
  transform: translateY(-1px);
}

.full-search-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--veda-ink-dark);
  font-family: var(--veda-font-primary);
  font-weight: 400;
  flex: 1;
}

.results-count {
  font-size: 0.85rem;
  color: var(--veda-ink-light);
  font-weight: 400;
}

.full-search-results-list {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--veda-space-md);
}

/* ===========================================
   GOOGLE-STYLE SEARCH RESULT ITEMS
   =========================================== */

.full-search-results-list .search-result-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 0;
}

.full-search-results-list .search-result-item:last-child {
  border-bottom: none;
}

.full-search-results-list .search-result-item:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(139, 115, 85, 0.1);
  background: rgba(212, 175, 55, 0.04);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 8px;
}

/* URL Breadcrumb - like Google's green/gray URL line */
.result-breadcrumb {
  font-family: 'Krishna Sanskrit', 'Siddhanta', 'Noto Serif Devanagari', serif;
  font-size: 0.8rem;
  color: var(--veda-ink-light);
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

/* Title - like Google's blue clickable title */
.result-title-link {
  font-family: 'Krishna Sanskrit', 'Siddhanta', 'Noto Serif Devanagari', var(--veda-font-primary), serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--veda-accent-copper);
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: block;
  transition: color 0.15s ease;
}

.search-result-item:hover .result-title-link {
  color: #8B5A2B;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Snippet - like Google's description text */
.result-snippet {
  font-family: 'Krishna Sanskrit', 'Siddhanta', 'Noto Serif Devanagari', serif;
  font-size: 0.95rem;
  color: var(--veda-ink-dark);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-snippet mark {
  background: linear-gradient(120deg, rgba(212, 175, 55, 0.35) 0%, rgba(212, 175, 55, 0.2) 100%);
  padding: 0.05em 0.15em;
  border-radius: 2px;
  color: inherit;
  font-weight: 600;
}

.no-results {
  text-align: center;
  padding: var(--veda-space-xl);
  color: var(--veda-ink-light);
  font-size: 1.2rem;
  font-style: italic;
}

/* Mobile responsive for full search results */
@media (max-width: 768px) {
  .full-search-results-page {
    padding: var(--veda-space-sm);
  }
  
  .full-search-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--veda-space-sm);
  }
  
  .back-to-portal {
    align-self: flex-start;
  }
  
  .full-search-header h2 {
    font-size: 1.5rem;
  }
  
  .results-count {
    margin-left: 0;
  }
  
  .full-search-results-list .search-result-item {
    padding: 1rem 0;
  }
  
  .result-breadcrumb {
    font-size: 0.75rem;
  }
  
  .result-title-link {
    font-size: 1.05rem;
  }
  
  .result-snippet {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }
}

/* Keep these for backwards compatibility but they're not used in Google-style */
.result-topic {
  font-size: 0.9rem;
  color: var(--veda-accent-copper);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.result-preview {
  font-size: 0.95rem;
  color: var(--veda-ink-dark);
  line-height: 1.6;
}

.result-preview mark {
  background: linear-gradient(120deg, rgba(212, 175, 55, 0.4) 0%, rgba(212, 175, 55, 0.25) 100%);
  padding: 0.1em 0.2em;
  border-radius: 3px;
  color: inherit;
}


/* ════════════════════════════════════════════════════════════════
   REDESIGN 2026 LAYER — scholarly modern manuscript
   Appended override layer. Original rules above are untouched;
   delete this block to revert. Palette: madder #7a2a17 · gold
   #b8952f · warm paper #f9f5ec · ink #2b2016.
   ════════════════════════════════════════════════════════════════ */

:root {
  --veda-parchment: #f9f5ec;
  --veda-ink-dark: #2b2016;
  --veda-ink-medium: #4d3c2a;
  --veda-ink-light: #6b5d4a;
  --veda-accent-gold: #b8952f;
  --veda-accent-gold-dark: #8a5a00;
  --veda-accent-copper: #7a2a17;
  --veda-divider: #d8c9a8;
}

/* Woven top border — the portal's signature */
body { background: var(--veda-parchment); }
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, #7a2a17 0 22px, #b8952f 22px 26px);
  z-index: 1002;
  pointer-events: none;
}

.portal-title { color: #3d2317; }
.portal-header::after { color: var(--veda-accent-gold); }

/* Section nav → pill band */
.section-nav span { display: none; }
.section-nav { gap: 8px; flex-wrap: wrap; }
.section-button {
  padding: 8px 20px;
  border-radius: 999px;
  color: #5c4a33;
  transition: background 150ms ease, color 150ms ease;
}
.section-button:hover { background: #f2e8cf; color: #3d2317; transform: none; }
.section-button.active {
  background: #7a2a17;
  color: #f7f0e2;
  font-weight: 600;
}
.section-button.active::after { display: none; }

/* Search — cream pill with madder action */
.search-container {
  border: 1.5px solid #c9b98e;
  border-radius: 999px;
  background: #fffdf7;
  box-shadow: 0 2px 10px rgba(46, 42, 38, 0.06);
}
.search-container:focus-within {
  border-color: #b8952f;
  background: #fffdf7;
  box-shadow: 0 2px 14px rgba(184, 149, 47, 0.18);
}
.search-icon {
  background: #7a2a17;
  color: #f7f0e2;
  border-radius: 50%;
}
.search-icon:hover { background: #5c1a0e; transform: translateY(-50%); }
.search-dropdown {
  border: 1px solid #d8c9a8;
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 0 14px 44px rgba(46, 42, 38, 0.18);
}
.search-result:hover, .search-result.focused, .search-result.highlighted {
  background: rgba(184, 149, 47, 0.10);
}
.reference-result {
  background: rgba(122, 42, 23, 0.04);
  border-left: 3px solid #7a2a17;
}
.reference-result .result-badge { background: #7a2a17; }
.result-title { color: #7a2a17; }
.ref-patha-link { color: #7a2a17; border-color: #d3b193; }
.ref-patha-link:hover { background: #7a2a17; color: #f7f0e2; }

/* Cards — quiet cream manuscript cards */
.veda-card {
  background: #fffdf7;
  border: 1px solid #e2d6b8;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(139, 69, 19, 0.05);
}
.veda-card::before {
  background: linear-gradient(90deg, #b8952f, #7a2a17);
  height: 3px;
}
.veda-card:hover {
  transform: translateY(-3px);
  border-color: #d3b193;
  box-shadow: 0 10px 28px rgba(139, 69, 19, 0.12);
}
.veda-card.active { border-color: #7a2a17; background: #fffdf7; }
.veda-card:focus-visible { outline: 2px solid #7a2a17; outline-offset: 2px; }
.veda-card-number { color: #3d2317; }
.veda-card-number--decorated::before,
.veda-card-number--decorated::after { color: #b8952f; }

/* Pāṭha chips on cards */
.patha-chip { border: 1px solid #e2d6b8; border-radius: 8px; background: #fffdf7; overflow: hidden; }
.patha-chip-read { color: #7a2a17; font-weight: 600; }
.patha-chip-read:hover { background: #f4eedd; }
.patha-chip.patha-samhita { border-color: #d3b193; }
.back-button {
  background: #fffdf7;
  border: 1px solid #d8c9a8;
  border-radius: 999px;
  color: #8a6a2f;
}
.back-button:hover { background: #7a2a17; border-color: #7a2a17; color: #f7f0e2; }

/* ════════════════════════════════════════════════════════════════
   PHASE 2 — portal home: rail + index, banner/sheet, continue strip
   (append-only; within REDESIGN 2026 LAYER)
   ════════════════════════════════════════════════════════════════ */

/* §A continue-reading strip */
#veda-continue { max-width: 1180px; margin: 0 auto 8px; padding: 0 16px; }
.veda-continue-pill {
  display: flex; align-items: center; gap: 14px;
  background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px;
  padding: 10px 14px; box-shadow: 0 2px 10px rgba(46,42,38,0.05);
}
.vc-label { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #8a6a2f; font-weight: 700; }
.vc-pos { flex: 1; min-width: 0; font-family: var(--veda-font-primary); color: #2b2016; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-resume { flex-shrink: 0; background: #7a2a17; color: #f7f0e2; text-decoration: none; border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 0.9rem; }
.vc-resume:hover { background: #5c1a0e; }

/* §B rail + index layout */
.veda-railindex { display: grid; grid-template-columns: 290px minmax(0, 1fr); border-top: 1px solid #e2d6b8; max-width: 1180px; margin: 0 auto; }
.veda-rail { background: linear-gradient(180deg, #f4eedd, #efe6cf); border-right: 1px solid #e2d6b8; padding: 18px 0 10px; }
.veda-rail-head {
  text-align: center; font-family: var(--veda-font-primary); font-size: 1.15rem; color: #5c4a33;
  display: flex; align-items: center; gap: 12px; justify-content: center; padding: 0 16px 12px;
}
.veda-rail-head::before, .veda-rail-head::after { content: ''; height: 1px; flex: 1; }
.veda-rail-head::before { background: linear-gradient(90deg, transparent, #c9a961); }
.veda-rail-head::after { background: linear-gradient(90deg, #c9a961, transparent); }
.veda-rail-rows { display: flex; flex-direction: column; gap: 2px; }
.veda-rail-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 16px; background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--veda-font-primary); color: #2b2016; transition: background 150ms ease;
}
.veda-rail-medallion {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: 1px solid #d8c9a8;
  background: #fffdf7; color: #8a6a2f; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; transition: border-color 150ms ease, color 150ms ease;
}
.veda-rail-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.veda-rail-title { font-size: 1.02rem; color: #2b2016; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veda-rail-counts { font-family: 'Krishna Sanskrit', 'Noto Serif Devanagari', serif; font-size: 0.86rem; line-height: 1.3; color: #6b5d4a; }
.veda-rail-row:hover:not(.active) { background: rgba(255,253,247,0.65); }
.veda-rail-row:hover:not(.active) .veda-rail-medallion { border-color: #b8952f; color: #7a2a17; }
.veda-rail-row:hover:not(.active) .veda-rail-title { font-weight: 600; }
.veda-rail-row:focus-visible { outline: 2px solid #7a2a17; outline-offset: -2px; border-radius: 12px; }
/* active row = manuscript panel */
.veda-rail-row.active {
  background: linear-gradient(135deg, #7a2a17, #5c1a0e); border-radius: 14px; margin: 0 14px;
  box-shadow: 0 8px 22px rgba(92,26,14,0.3); overflow: hidden; padding: 12px 16px;
}
.veda-rail-row.active .veda-rail-medallion { width: 46px; height: 46px; border: 1.5px solid #c9a961; background: rgba(201,169,97,0.12); color: #f0c869; }
.veda-rail-row.active .veda-rail-title { color: #f7f0e2; font-weight: 600; }
.veda-rail-row.active .veda-rail-counts { color: #d3b193; }
.veda-rail-ghost { position: absolute; top: -14px; right: 4px; font-size: 74px; line-height: 1; color: rgba(247,240,226,0.07); pointer-events: none; }
.veda-rail-share { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(247,240,226,0.15); overflow: hidden; }
.veda-rail-share-fill { display: block; height: 100%; background: #f0c869; }
.veda-rail-foot { text-align: center; padding: 14px 16px 4px; }
.veda-rail-star { display: block; color: #c9a961; margin-bottom: 8px; }
.veda-rail-reviewers { font-family: var(--veda-font-primary); font-size: 0.9rem; color: #7a2a17; text-decoration: none; }
.veda-rail-reviewers:hover { color: #5c1a0e; text-decoration: underline; }

/* index (right column) */
.veda-index { padding: 22px 26px 40px; min-width: 0; }
.veda-index-heading { font-family: var(--veda-font-primary); font-size: 1.7rem; color: #2b2016; margin: 0 0 8px; }
.veda-index-desc { max-width: 70ch; color: #6b5d4a; line-height: 1.7; margin: 0 0 18px; }
.veda-index-table { border-top: 1px solid #eee4cd; }
.veda-index-row {
  display: flex; align-items: center; gap: 16px; padding: 12px 6px; border-bottom: 1px solid #eee4cd;
  cursor: pointer; transition: background 120ms ease;
}
.veda-index-row:hover { background: rgba(244,238,221,0.5); }
.veda-index-row:focus-visible { outline: 2px solid #7a2a17; outline-offset: -2px; border-radius: 8px; }
.vi-num { flex-shrink: 0; font-family: var(--veda-font-primary); color: #7a2a17; font-size: 1.05rem; min-width: 3.2em; }
.vi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vi-topic { font-family: var(--veda-font-primary); font-weight: 700; font-size: 18.5px; color: #2b2016; }
.vi-snippet { font-family: var(--veda-font-primary); font-style: italic; color: #6b5d4a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-chips { flex-shrink: 0; display: flex; gap: 6px; }
.vi-chip { display: inline-flex; align-items: stretch; border: 1px solid #d8c9a8; border-radius: 8px; overflow: hidden; background: #f4eedd; }
.vi-chip button { background: none; border: none; cursor: pointer; font-family: var(--veda-font-primary); font-size: 0.85rem; padding: 5px 10px; color: #5c4a33; }
.vi-chip-pdf { border-left: 1px solid #d8c9a8; padding: 5px 8px; display: inline-flex; align-items: center; }
.vi-chip--primary { background: #7a2a17; border-color: #7a2a17; }
.vi-chip--primary .vi-chip-read { color: #f7f0e2; }
.vi-chip--primary .vi-chip-pdf { border-left-color: rgba(247,240,226,0.25); }
.vi-chip button:hover { background: rgba(184,149,47,0.15); }
.vi-chip--primary .vi-chip-read:hover, .vi-chip--primary .vi-chip-pdf:hover { background: rgba(247,240,226,0.15); }

/* mobile banner + bottom sheet (hidden on desktop) */
.veda-kanda-banner { display: none; }
.veda-sheet-overlay { position: fixed; inset: 0; background: rgba(30,22,14,0.55); z-index: 100000; display: flex; align-items: flex-end; opacity: 0; transition: opacity 180ms ease; }
.veda-sheet-overlay.open { opacity: 1; }
.veda-sheet { width: 100%; background: #f9f5ec; border-radius: 18px 18px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; transform: translateY(100%); transition: transform 200ms ease; }
.veda-sheet-overlay.open .veda-sheet { transform: none; }
.veda-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: #d8c9a8; margin: 4px auto 12px; }
.veda-sheet-title { text-align: center; font-family: var(--veda-font-primary); font-size: 1.2rem; color: #5c4a33; margin-bottom: 12px; }
.veda-sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border: none; background: none; border-radius: 12px; cursor: pointer; font-family: var(--veda-font-primary); text-align: left; color: #2b2016; }
.veda-sheet-row .vsr-medallion { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: 1px solid #d8c9a8; background: #fffdf7; color: #8a6a2f; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.veda-sheet-row .vsr-title { flex: 1; min-width: 0; font-size: 1.25rem; line-height: 1.35; }
.veda-sheet-row.active { background: linear-gradient(135deg, #7a2a17, #5c1a0e); color: #f7f0e2; }
.veda-sheet-row.active .vsr-medallion { border-color: #c9a961; background: rgba(201,169,97,0.12); color: #f0c869; }
.vsr-check { color: #f0c869; }

@media (max-width: 768px) {
  /* §E two-row wrapped section pills, no horizontal scroll */
  .section-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; overflow: visible; }
  .veda-railindex { grid-template-columns: 1fr; }
  .veda-rail { display: none; }
  .veda-kanda-banner {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
    background: linear-gradient(135deg, #7a2a17, #5c1a0e); color: #f7f0e2; border: none;
    padding: 14px 16px; font-family: var(--veda-font-primary);
  }
  .veda-kanda-banner .vkb-medallion { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid #c9a961; background: rgba(201,169,97,0.12); color: #f0c869; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
  .veda-kanda-banner .vkb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .veda-kanda-banner .vkb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .veda-kanda-banner .vkb-counts { font-family: 'Krishna Sanskrit', 'Noto Serif Devanagari', serif; font-size: 13px; color: #d3b193; }
  .veda-kanda-banner .vkb-caret { flex-shrink: 0; color: #f0c869; }
  .veda-index { padding: 16px 14px 32px; }
  /* index rows → stacked cards with 44px tap targets */
  .veda-index-table { border-top: none; }
  .veda-index-row { flex-direction: column; align-items: stretch; gap: 8px; background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
  .vi-chips { flex-wrap: wrap; }
  .vi-chip { flex: 1; }
  .vi-chip button { min-height: 44px; }
  .vi-chip-read { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .veda-sheet, .veda-sheet-overlay, .veda-index-row, .veda-rail-row { transition: none; }
}

/* §C flat index sections (Āraṇyaka / Kāṭhakam / Ekāgnikāṇḍam) */
.veda-flat { max-width: 1180px; margin: 0 auto; padding: 22px 26px 40px; }
.veda-flat-head { text-align: center; margin-bottom: 18px; }
.veda-flat-title { font-family: var(--veda-font-primary); font-size: 2rem; color: #2b2016; margin: 0; }
.veda-flat-sub { font-family: var(--veda-font-primary); font-style: italic; color: #6b5d4a; margin: 4px 0 0; }
.vi-desc { color: #6b5d4a; line-height: 1.6; font-size: 1.02rem; }
.vi-counts { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 11px; color: #6b5d4a; letter-spacing: 0.04em; }
/* keep the read/PDF chip within reach of the title on wide screens */
.veda-flat-table { max-width: 760px; margin: 0 auto; }

/* §D Sūktāni dense catalog + filter */
.veda-suktani { max-width: 1180px; margin: 0 auto; padding: 22px 26px 40px; }
.veda-suktani-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.veda-suktani-titles .veda-flat-title { text-align: left; }
.veda-suktani-filter { position: relative; display: flex; align-items: center; gap: 8px; }
#suktani-filter { border: 1px solid #d8c9a8; border-radius: 999px; background: #fffdf7; padding: 8px 16px; font-size: 0.95rem; min-width: 220px; color: #2b2016; font-family: var(--veda-font-primary); }
#suktani-filter:focus { outline: none; border-color: #b8952f; box-shadow: 0 0 0 3px rgba(184,149,47,0.15); }
.vsf-count { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 11px; color: #6b5d4a; }
.vsf-clear { border: none; background: none; cursor: pointer; color: #8a6a2f; font-size: 1rem; line-height: 1; }
.veda-suktani-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.veda-suktani-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid #eee4cd; cursor: pointer; }
.veda-suktani-row.is-soon { cursor: default; opacity: 0.72; }
.veda-suktani-row:hover:not(.is-soon) { background: rgba(244,238,221,0.5); }
.veda-suktani-row:focus-visible { outline: 2px solid #7a2a17; outline-offset: -2px; border-radius: 8px; }
.vsuk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vsuk-title { font-family: var(--veda-font-primary); font-weight: 700; font-size: 1.15rem; color: #2b2016; }
.vsuk-title mark { background: rgba(184,149,47,0.3); color: inherit; padding: 0 1px; border-radius: 2px; }
.vsuk-counts { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 11px; color: #6b5d4a; }
.vsuk-desc { color: #6b5d4a; font-size: 0.9rem; line-height: 1.5; }
.vsuk-soon { font-size: 0.7rem; background: #faf0dc; color: #c07d2a; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.veda-suktani-empty { text-align: center; color: #6b5d4a; padding: 30px; font-style: italic; }
@media (max-width: 900px) { .veda-suktani-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .veda-flat { padding: 16px 14px 32px; }
  .veda-suktani { padding: 16px 14px 32px; }
  .veda-suktani-head { flex-direction: column; align-items: stretch; }
  #suktani-filter { width: 100%; }
  .veda-flat-row { flex-direction: column; align-items: stretch; gap: 8px; background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
  .veda-flat-row .vi-chip { flex: 1; } .veda-flat-row .vi-chip button { min-height: 44px; }
  .veda-suktani-row { flex-direction: column; align-items: stretch; gap: 8px; background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; padding: 14px; }
  .veda-suktani-row .vi-chip { flex: 1; } .veda-suktani-row .vi-chip button { min-height: 44px; }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE POLISH (§4 portal home) — within REDESIGN 2026 LAYER
   (append-only; mobile ≤768px, desktop unchanged)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* §4 section pills: 3×2 equal-width grid, centered labels */
  .section-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    justify-content: stretch;
    align-items: stretch;
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
    overflow: visible;
  }
  .section-nav .section-button {
    margin: 0;
    min-width: 0;
    width: 100%;
    padding: 9px 0;
    font-size: 16px;
    text-align: center;
    white-space: nowrap;
  }

  /* §4 kāṇḍa banner sizes */
  .veda-kanda-banner .vkb-title { font-size: 18px; }
  .veda-kanda-banner .vkb-counts { font-size: 14px; }

  /* §4 continue-reading: readable position text, keep Resume intact */
  .vc-pos { font-size: 16px; }

  /* §4 search pill: slim + contained, compact filter segment */
  .search-container {
    padding-top: 8px;
    padding-bottom: 8px;
    max-width: calc(100vw - 32px);
  }
  .search-filter {
    max-width: 72px;
  }
}

/* ════════════════════════════════════════════════════════════════
   FONT TAB (#font) — Krishna Sanskrit showcase + download
   (append-only; within REDESIGN 2026 LAYER; rendered by
   VedaPortal.renderFontSection in js/veda-portal.js)
   ════════════════════════════════════════════════════════════════ */

/* Sanskrit2020, only for the "before" half of the comparisons; the browser
   downloads it only when the Font tab is open. */
@font-face {
  font-family: 'Sanskrit2020 Before';
  src: url('/css/fonts/Sanskrit2020U.otf') format('opentype');
  font-display: swap;
}

/* The Font pill: a companion to the corpus sections, so gold-outlined */
.section-button--font { border: 1px solid #c9a961; color: #8a6a2f; margin-left: 6px; }
.section-button--font:hover { background: #f4eedd; color: #7a2a17; }
.section-button--font.active { border-color: #7a2a17; }

.veda-font { max-width: 1060px; margin: 0 auto; padding: 26px 26px 56px; color: #2b2016; }
.veda-font [lang="sa"], .veda-font [lang="sa-Latn"] { font-family: 'Krishna Sanskrit', var(--veda-font-primary); }

/* hero */
.vf-hero { text-align: center; padding: 30px 20px 26px; background: linear-gradient(180deg, #fffdf7, #f4eedd); border: 1px solid #e2d6b8; border-radius: 18px; box-shadow: 0 2px 10px rgba(46,42,38,0.05); }
.vf-eyebrow { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a6a2f; font-weight: 700; }
.vf-title { font-size: clamp(3rem, 8vw, 5rem); line-height: 1.2; color: #7a2a17; margin: 10px 0 0; font-weight: 400; }
.vf-title-latin { font-family: 'Krishna Sanskrit', Georgia, serif; font-size: 1.5rem; color: #5c4a33; letter-spacing: 0.02em; }
.vf-lede { max-width: 62ch; margin: 16px auto 22px; line-height: 1.75; color: #4d3c2a; font-size: 1.05rem; }
.vf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vf-btn { display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 999px; border: 1px solid #d8c9a8; background: #fffdf7; color: #7a2a17; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: background 150ms ease, color 150ms ease, border-color 150ms ease; }
.vf-btn:hover { background: #f4eedd; border-color: #b8952f; }
.vf-btn--primary { background: #7a2a17; border-color: #7a2a17; color: #f7f0e2; }
.vf-btn--primary:hover { background: #5c1a0e; border-color: #5c1a0e; color: #f7f0e2; }
.vf-btn:focus-visible { outline: 2px solid #7a2a17; outline-offset: 2px; }
.vf-meta { margin-top: 14px; font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 10.5px; letter-spacing: 0.04em; color: #6b5d4a; }

/* specimen */
.vf-specimen { margin: 26px 0 8px; padding: 22px 26px 16px; background: #fffdf7; border: 1px solid #e2d6b8; border-left: 3px solid #b8952f; border-radius: 14px; }
.vf-specimen-dev { font-size: 1.75rem; line-height: 2.1; margin: 0; }
.vf-specimen-iso { font-size: 1.12rem; line-height: 1.8; color: #4d3c2a; margin: 8px 0 0; }
.vf-specimen figcaption { margin-top: 12px; font-size: 0.8rem; color: #8a6a2f; font-family: 'Krishna Sanskrit', var(--veda-font-secondary); }

/* section headings — echo the rail heading rule */
.vf-h { display: flex; align-items: center; gap: 14px; font-family: var(--veda-font-secondary); font-weight: 600; font-size: 1.3rem; color: #3d2317; margin: 38px 0 12px; }
.vf-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #c9a961, transparent); }
.vf-intro { color: #6b5d4a; line-height: 1.7; margin: 0 0 16px; max-width: 72ch; }

/* before / after cards */
.vf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vf-card { background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 14px; padding: 16px 18px 14px; }
.vf-card-title { margin: 0 0 12px; font-size: 1rem; color: #2b2016; font-family: var(--veda-font-secondary); }
.vf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vf-before, .vf-after { display: flex; flex-direction: column; gap: 4px; border-radius: 10px; padding: 8px 10px 4px; }
.vf-before { background: #f4eedd; }
.vf-after { background: rgba(122,42,23,0.05); box-shadow: inset 0 0 0 1px rgba(122,42,23,0.18); }
.vf-tag { font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #8a6a2f; }
.vf-after .vf-tag { color: #7a2a17; font-weight: 700; }
.vf-sample { font-size: 2rem; line-height: 1.9; white-space: nowrap; overflow-x: auto; }
.vf-before .vf-sample { font-family: 'Sanskrit2020 Before', 'Noto Serif Devanagari', serif; color: #6b5d4a; }
.vf-card-note { margin: 10px 0 0; font-size: 0.88rem; line-height: 1.6; color: #6b5d4a; }

/* why + how */
.vf-points { display: grid; gap: 10px; }
.vf-point { display: flex; gap: 16px; align-items: flex-start; background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; padding: 14px 16px; line-height: 1.65; color: #4d3c2a; }
.vf-point strong { color: #2b2016; }
.vf-point-mark { flex-shrink: 0; min-width: 4.2em; text-align: center; font-size: 1.15rem; color: #7a2a17; border-right: 1px solid #eee4cd; padding-right: 14px; }
.vf-prose p { line-height: 1.8; color: #4d3c2a; max-width: 74ch; margin: 0 0 12px; }

/* usage */
.vf-uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vf-code { background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.vf-code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f4eedd; border-bottom: 1px solid #e2d6b8; font-size: 0.82rem; font-weight: 600; color: #5c4a33; }
.vf-copy { border: 1px solid #d8c9a8; background: #fffdf7; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; color: #7a2a17; cursor: pointer; }
.vf-copy:hover { background: #7a2a17; color: #f7f0e2; border-color: #7a2a17; }
.vf-code pre { margin: 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; line-height: 1.6; color: #2b2016; font-family: ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace; }
.vf-code--note p { margin: 0; padding: 12px; font-size: 0.88rem; line-height: 1.6; color: #4d3c2a; }
.vf-code--note code { font-size: 0.82rem; }
.veda-font code { overflow-wrap: anywhere; }

/* licence */
.vf-license { background: #fffdf7; border: 1px solid #e2d6b8; border-radius: 12px; padding: 16px 20px; }
.vf-license ul { margin: 0; padding-left: 1.2rem; line-height: 1.8; color: #4d3c2a; }
.vf-license strong { color: #2b2016; }
.vf-credits { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #eee4cd; font-size: 0.88rem; line-height: 1.6; color: #6b5d4a; }
.vf-credits a { color: #7a2a17; }

@media (max-width: 900px) {
  .vf-grid, .vf-uses { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* 3×2 pill grid (§4 mobile polish) + the Font pill as a full-width third row */
  .section-nav .section-button--font { grid-column: 1 / -1; margin-left: 0; }
  .veda-font { padding: 16px 12px 40px; }
  .vf-hero { padding: 22px 14px 20px; }
  .vf-specimen { padding: 16px 14px 12px; }
  .vf-specimen-dev { font-size: 1.4rem; }
  .vf-sample { font-size: 1.6rem; }
  .vf-point { flex-direction: column; gap: 6px; }
  .vf-point-mark { border-right: none; padding-right: 0; text-align: left; }
  .vf-btn { min-height: 44px; }
}

/* Home-page colophon: what this is, who maintains it, how to contribute */
.portal-colophon {
  max-width: 1180px; margin: 64px auto 0; padding: 30px 24px 44px;
  border-top: 1px solid #e2d6b8; text-align: center; color: #6b5d4a;
}
.portal-colophon p { font: 14px/1.7 Georgia, 'Times New Roman', 'Krishna Sanskrit', serif; margin: 0; }
.portal-colophon a { color: #7a2a17; text-decoration: none; border-bottom: 1px solid #d9bf72; }
.portal-colophon a:hover { border-bottom-color: #7a2a17; }
@media (max-width: 768px) {
  .portal-colophon { margin-top: 44px; padding: 26px 18px 34px; }
}

/* Complete contents: plain-HTML list of every reading page (injected at build by
   scripts/assemble-dist.cjs) so crawlers and no-JS readers can reach them all. */
.portal-index { margin: 22px auto 0; text-align: left; }
.portal-index > summary {
  cursor: pointer; text-align: center; list-style: none;
  font: 12px/1.6 Georgia, 'Times New Roman', 'Krishna Sanskrit', serif; color: #6b5d4a;
}
.portal-index > summary:hover, .portal-index[open] > summary { color: #7a2a17; }
.portal-index > summary::-webkit-details-marker { display: none; }
.portal-index > summary::before { content: '▸ '; color: #b8952f; }
.portal-index[open] > summary::before { content: '▾ '; }
.portal-index__cols { columns: 3 300px; column-gap: 40px; margin-top: 22px; }
.portal-index section { break-inside: avoid-column; margin-bottom: 18px; }
.portal-index h3 {
  font: 600 15px/1.4 Georgia, 'Times New Roman', 'Krishna Sanskrit', serif; color: #2b2016;
  border-bottom: 1px solid #e2d6b8; padding-bottom: 4px; margin: 0 0 8px;
}
.portal-index h3 span { font-weight: normal; color: #6b5d4a; font-size: 13px; }
.portal-index h4 { font: 600 14px/1.5 'Krishna Sanskrit', Georgia, serif; color: #4d3c2a; margin: 10px 0 2px; break-after: avoid; }
.portal-index ol, .portal-index ul { list-style: none; margin: 0; padding: 0; }
.portal-index li { font: 15px/1.7 'Krishna Sanskrit', Georgia, serif; break-inside: avoid; }
.portal-index li [lang="en"] { font: italic 13px Georgia, 'Krishna Sanskrit', serif; color: #6b5d4a; }
.portal-colophon .portal-index a { border-bottom: none; }
.portal-colophon .portal-index a:hover { border-bottom: 1px solid #7a2a17; }
.portal-colophon .portal-index a.portal-index__patha { font-size: 12px; color: #9a5f2a; margin-left: 4px; }

/* ════════════════════════════════════════════════════════════════
   Hayagrīva identity (2026-10) — homepage masthead.
   Figure beside the title from 768 px up (title may wrap on its own);
   stacked above it on narrower screens. Replaces the ॥ ✧ ॥ ornament.
   ════════════════════════════════════════════════════════════════ */
.portal-header::after { content: none; }

.portal-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
  padding: 8px 16px 6px;
}
.portal-brand__figure {
  display: block;
  width: 160px;
  height: 160px;
  flex: 0 0 auto;
  object-fit: contain;
}
.portal-brand .portal-title {
  min-width: 0;
  text-align: left;
  text-wrap: balance;
}

@media (max-width: 767px) {
  .portal-brand {
    flex-direction: column;
    gap: 12px;
    padding: 4px 12px 2px;
  }
  .portal-brand__figure { width: 112px; height: 112px; }
  .portal-brand .portal-title { text-align: center; }
}

/* ════════════════════════════════════════════════════════════════
   Full search results page — brought into the portal's identity:
   cream page with the woven madder/gold top band, Krishna Sanskrit
   heading, quiet text "back" link instead of a heavy brown button.
   No Hayagrīva here: it's a working list right under the masthead.
   ════════════════════════════════════════════════════════════════ */
.full-search-results-page {
  background: var(--veda-parchment);
  padding: 34px var(--veda-space-lg) var(--veda-space-xl);
}
.full-search-results-page::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, #7a2a17 0 22px, #b8952f 22px 26px);
}
.full-search-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "back back" "title count";
  align-items: baseline;
  gap: 10px 16px;
  max-width: 760px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2d6b8;
}
.back-to-portal {
  grid-area: back;
  justify-self: start;
  background: none;
  border: none;
  padding: 6px 0;
  color: #8a6a2f;
  font: 600 0.92rem/1.4 var(--veda-font-primary);
  letter-spacing: 0;
  border-radius: 6px;
}
.back-to-portal:hover { background: none; color: #7a2a17; transform: none; text-decoration: underline; text-underline-offset: 3px; }
.back-to-portal:focus-visible { outline: 2px solid #b8952f; outline-offset: 2px; }
.full-search-header h2 {
  grid-area: title;
  font-family: var(--veda-font-primary);
  font-size: 1.7rem;
  line-height: 1.25;
  color: #3d2317;
  font-weight: normal;
}
.results-count {
  grid-area: count;
  font: 0.72rem/1 ui-monospace, 'SF Mono', Menlo, 'Krishna Sanskrit', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a7a62;
  white-space: nowrap;
}
.full-search-results-list { max-width: 760px; padding: 0; }
.full-search-results-list .search-result-item { border-bottom-color: #eee4cd; }
.full-search-results-list .search-result-item:hover { background: #f4eedd; }
.result-breadcrumb { color: #8a7a62; }
.result-title-link { color: #7a2a17; }
.search-result-item:hover .result-title-link { color: #5c1f10; text-decoration-color: #b8952f; }
.result-snippet { color: #2b2016; }

@media (max-width: 768px) {
  .full-search-results-page { padding: 26px var(--veda-space-sm) var(--veda-space-lg); }
  .full-search-header { grid-template-areas: "back back" "title title" "count count"; gap: 6px 0; }
  .full-search-header h2 { font-size: 1.35rem; }
}
