/* ----------------------------------------------------
   Literary Minimalist Design System
   Writer: Alomoy Chakma (আলোময় চাকমা)
   ---------------------------------------------------- */

:root {
  /* Colors */
  --surface: #ffffff;
  --surface-dim: #f3ebda;
  --surface-bright: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #ffffff;
  --surface-container: #faf6ee;
  --surface-container-high: #f3ebda;
  --surface-container-highest: #ede1cd;
  --on-surface: #222222;
  --on-surface-variant: #555555;
  --inverse-surface: #2d2d2d;
  --inverse-on-surface: #ffffff;
  --outline: #dcd2bf;
  --outline-variant: #ebdcc5;
  --surface-tint: #cc6611;
  
  --primary: #cc6611;
  --on-primary: #ffffff;
  --primary-container: #fbeccb;
  --on-primary-container: #8b4e00;
  --inverse-primary: #ffb570;
  
  --secondary: #7c6a59;
  --on-secondary: #ffffff;
  --secondary-container: #fef4db;
  --on-secondary-container: #cc6611;
  
  --tertiary: #5c4033;
  --on-tertiary: #ffffff;
  --tertiary-container: #f4eae1;
  --on-tertiary-container: #3d271d;
  
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  
  /* Fixed states mapping (for reference/backups) */
  --primary-fixed: #ebdcc5;
  --primary-fixed-dim: #cfc2ad;
  --on-primary-fixed: #2b1f0d;
  --on-primary-fixed-variant: #57442a;
  --secondary-fixed: #fef4db;
  --secondary-fixed-dim: #ebdcb9;
  --on-secondary-fixed: #2c2005;
  --on-secondary-fixed-variant: #59441a;
  --tertiary-fixed: #f4eae1;
  --tertiary-fixed-dim: #ebd4c6;
  --on-tertiary-fixed: #2c1a11;
  --on-tertiary-fixed-variant: #59392c;
  
  --background: #fdf6e7;
  --on-background: #222222;
  --surface-variant: #ebdcc5;

  /* Typography */
  --font-headline: 'Hind Siliguri', 'Playfair Display', serif;
  --font-body: 'Hind Siliguri', 'EB Garamond', serif;
  --font-label: 'Hind Siliguri', 'Inter', sans-serif;

  /* Spacing */
  --base: 8px;
  --container-max: 1140px;
  --content-max: 720px;
  --gutter: 24px;
  --margin-mobile: 20px;
  
  --stack-lg: 80px;
  --stack-md: 48px;
  --stack-sm: 24px;

  /* Transition timings */
  --transition-speed: 0.3s;
  --transition-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-speed) var(--transition-easing),
              color var(--transition-speed) var(--transition-easing),
              border-color var(--transition-speed) var(--transition-easing);
  overflow-x: hidden;
}

/* Typography Utility Classes */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

.headline-lg {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.headline-md {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
}

.headline-sm {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.body-lg {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.6;
}

.body-md {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
}

.label-md {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.label-sm {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

/* Layout Utilities */
.container-max {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.reading-well {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.w-full {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* Spacing Margins */
.mb-stack-lg { margin-bottom: var(--stack-lg); }
.mb-stack-md { margin-bottom: var(--stack-md); }
.mb-stack-sm { margin-bottom: var(--stack-sm); }
.mt-stack-lg { margin-top: var(--stack-lg); }
.mt-stack-md { margin-top: var(--stack-md); }
.mt-stack-sm { margin-top: var(--stack-sm); }

/* Custom Layout Modules */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: var(--primary); /* Deep orange background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  transition: background-color var(--transition-speed) var(--transition-easing),
              border-color var(--transition-speed) var(--transition-easing);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 600;
  color: #ffffff; /* White logo text */
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img-wrapper {
  height: 38px;
  width: 38px;
  border-radius: 50%;
  background-color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: scale(1.85);
  transition: all 0.3s ease;
}

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

.nav-link {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85); /* Muted white nav links */
  text-decoration: none;
  transition: color 0.2s ease;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff; /* White active nav links */
}

.nav-link.active {
  border-bottom-color: #ffffff;
}

/* Icons styling */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Sharp Buttons */
button, .btn {
  border-radius: 0 !important;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-easing);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background-color: #b55a0f; /* Darker orange hover */
  color: #ffffff;
}

/* Specific styling for contact button in the orange header */
header .btn-primary {
  background-color: #ffffff;
  color: var(--primary);
}

header .btn-primary:hover {
  background-color: var(--surface-container);
  color: var(--primary);
}

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

.btn-secondary:hover {
  background-color: var(--surface-container-low);
}

.btn-icon {
  background: none;
  border: none;
  padding: 8px;
  color: var(--secondary);
}

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

/* Filter Sub-header */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 16px;
  margin-bottom: var(--stack-md);
}

.filter-tabs {
  display: flex;
  gap: 32px;
}

.filter-tab {
  background: none;
  border: none;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  padding: 0 0 16px 0;
  margin-bottom: -17px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-speed) var(--transition-easing);
  text-transform: uppercase;
}

.filter-tab:hover, .filter-tab.active {
  color: var(--primary);
}

.filter-tab.active {
  border-bottom-color: var(--primary);
}

.filter-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  font-family: var(--font-label);
  font-size: 12px;
}

/* Grid System */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1-indexed);
  gap: 24px;
}

.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }

/* Cards & Mood Elements */
.writing-card {
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 380px;
  transition: all var(--transition-speed) var(--transition-easing);
  text-decoration: none;
  color: inherit;
}

.writing-card:hover {
  background-color: var(--surface-container);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(27, 28, 26, 0.04);
}

.mood-card {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 380px;
  border: 1px solid var(--outline-variant);
  background-color: var(--primary);
}

.mood-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.75;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.mood-card:hover .mood-image {
  transform: scale(1.02);
  opacity: 0.85;
}

.mood-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 25, 25, 0.8) 0%, rgba(24, 25, 25, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  color: #ffffff;
}

.mood-quote {
  font-family: var(--font-headline);
  font-size: 24px;
  font-style: italic;
  line-height: 1.4;
}

.card-category {
  font-family: var(--font-label);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
  margin-bottom: 16px;
  display: block;
}

.card-title {
  margin-bottom: 24px;
  font-size: 32px;
}

.card-excerpt {
  color: var(--on-surface-variant);
  font-style: italic;
  margin-bottom: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--outline-variant);
  padding-top: 16px;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--secondary);
}

.card-link {
  text-decoration: none;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.card-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Category Dividers */
.section-divider {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.section-divider h3 {
  font-size: 24px;
  white-space: nowrap;
}

.section-line {
  height: 1px;
  flex-grow: 1;
  background-color: var(--outline-variant);
}

/* Poetry List Layout */
.poetry-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.poetry-item {
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 32px;
}

.poetry-item:last-child {
  border-bottom: none;
}

.poetry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.poetry-title {
  font-size: 22px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.poetry-title:hover {
  color: var(--secondary);
}

.poetry-date {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--secondary);
}

.poetry-excerpt {
  color: var(--on-surface-variant);
  font-style: italic;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Short Stories Grid */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1-indexed);
  gap: 32px;
}

.story-badge {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  font-family: var(--font-label);
  font-size: 11px;
  padding: 4px 8px;
  display: inline-block;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* PDF Book Collection */
.pdf-collection-section {
  border-top: 1px solid var(--outline-variant);
  padding-top: var(--stack-md);
}

.pdf-collection-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.pdf-collection-intro .headline-md {
  margin-top: 8px;
}

.pdf-book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.pdf-book-card {
  min-width: 0;
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed) var(--transition-easing);
}

.pdf-book-card:hover {
  background-color: var(--surface-container);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(27, 28, 26, 0.06);
}

.pdf-book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--outline-variant);
  background-color: var(--surface-container);
}

.pdf-book-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
}

.pdf-book-copy .headline-sm {
  font-size: 21px;
}

.pdf-book-copy .body-md {
  font-size: 15px;
  line-height: 1.5;
}

.pdf-download-btn {
  width: 100%;
  margin-top: auto;
  padding: 10px 12px;
  font-size: 12px;
}

.pdf-download-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Video Feature */
.video-feature-section {
  border-top: 1px solid var(--outline-variant);
  padding-top: var(--stack-md);
}

.video-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: stretch;
}

.video-frame {
  background-color: var(--primary);
  border: 1px solid var(--outline-variant);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-feature-copy {
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.video-feature-copy .headline-md {
  font-size: 28px;
}

.video-book-link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  padding: 14px 0;
}

.video-book-link img {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--outline-variant);
  background-color: var(--surface-container);
}

.video-book-link p {
  margin: 4px 0 0;
  font-weight: 500;
}

.video-watch-btn {
  margin-top: auto;
  width: 100%;
}

.video-watch-btn .material-symbols-outlined {
  font-size: 20px;
}

/* Editorial Links */
.link-editorial {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  text-decoration: none;
  position: relative;
  display: inline-block;
}

.link-editorial::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: var(--secondary);
  transition: height 0.2s ease;
}

.link-editorial:hover::after {
  height: 2px;
}

/* Custom Square List Bullet Points */
.square-list {
  list-style: none;
}

.square-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
}

.square-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  background-color: var(--primary);
}

/* Input Fields & Forms */
.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-minimalist {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  padding: 12px 0;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s ease;
  border-radius: 0;
  width: 100%;
}

.input-minimalist:focus {
  border-bottom-color: var(--secondary);
}

.input-minimalist::placeholder {
  color: var(--outline);
  opacity: 0.7;
}

textarea.input-minimalist {
  min-height: 120px;
  resize: vertical;
}

/* Newsletter Section */
.newsletter-section {
  padding-top: var(--stack-md);
  padding-bottom: var(--stack-md);
  border-top: 1px solid var(--outline-variant);
  text-align: center;
}

.newsletter-form {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  margin-top: 24px;
}

.newsletter-form .input-minimalist {
  width: 320px;
  text-align: center;
}

/* Reading Well & Reader View */
.reader-view {
  padding-top: var(--stack-md);
  padding-bottom: var(--stack-lg);
  display: none;
}

.reader-header {
  border-bottom: 1px solid var(--outline-variant);
  padding-bottom: 24px;
  margin-bottom: 40px;
}

.reader-back {
  background: none;
  border: none;
  font-family: var(--font-label);
  font-size: 14px;
  color: var(--secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 32px;
  text-transform: uppercase;
}

.reader-back:hover {
  color: var(--primary);
}

.reader-meta {
  font-family: var(--font-label);
  font-size: 14px;
  color: var(--secondary);
  margin-top: 16px;
}

.reader-content {
  font-size: 20px;
  line-height: 1.8;
  color: var(--on-surface);
}

.reader-content p {
  margin-bottom: 32px;
  text-align: justify;
}

.reader-content p.poem-line {
  margin-bottom: 8px;
  text-align: center;
  font-style: italic;
}

.reader-content p.poem-stanza-break {
  margin-bottom: 32px;
}

/* Fixed Background Layer for Reader View (Immersive Mobile Compatible Parallax) */
.reader-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f8f6ef;
  display: none;
  opacity: 0;
  filter: saturate(0.92) contrast(0.96);
  transition: opacity var(--transition-speed) var(--transition-easing);
}

body.rhyme-reader-active .reader-bg {
  display: block;
  opacity: 0.34;
  background-image: url('rhyme-bg.jpg');
}

body.poem-reader-active .reader-bg {
  display: block;
  opacity: 0.34;
  background-image: url('poem-bg.jpg');
}

body.story-reader-active .reader-bg {
  display: block;
  opacity: 0.34;
  background-image: url('story-bg.jpg');
}

body.song-reader-active .reader-bg {
  display: block;
  opacity: 0.34;
  background-image: url('story-bg.jpg');
}



/* Write text directly on the image - no section card division */
body.rhyme-reader-active .reader-view .reading-well,
body.poem-reader-active .reader-view .reading-well {
  background-color: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin-top: 32px;
  margin-bottom: 32px;
}

/* Themed text adjustments with drop shadow for premium overlay look */
body.rhyme-reader-active .reader-view .reader-back,
body.poem-reader-active .reader-view .reader-back {
  color: #faf9f5 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
body.rhyme-reader-active .reader-view .reader-back:hover,
body.poem-reader-active .reader-view .reader-back:hover {
  color: #bdcaba !important;
}

body.rhyme-reader-active .reader-header h1.headline-lg,
body.poem-reader-active .reader-header h1.headline-lg {
  color: #faf9f5 !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.4);
}

body.rhyme-reader-active,
body.poem-reader-active,
body.story-reader-active,
body.song-reader-active {
  background-color: var(--background); /* Use the new warm cream background */
}

body.rhyme-reader-active .reader-view .reading-well,
body.poem-reader-active .reader-view .reading-well,
body.story-reader-active .reader-view .reading-well,
body.song-reader-active .reader-view .reading-well {
  background-color: rgba(255, 255, 255, 0.9) !important; /* Clean semi-transparent white card background */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--outline-variant) !important; /* Mapped outline variant */
  box-shadow: 0 24px 64px rgba(204, 102, 17, 0.08) !important; /* Soft warm shadow using primary color */
  padding: 40px !important;
  margin-top: 32px;
  margin-bottom: 32px;
}

/* Back button inside reader view */
body.rhyme-reader-active .reader-view .reader-back,
body.poem-reader-active .reader-view .reader-back,
body.story-reader-active .reader-view .reader-back,
body.song-reader-active .reader-view .reader-back {
  color: var(--secondary) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

body.rhyme-reader-active .reader-view .reader-back:hover,
body.poem-reader-active .reader-view .reader-back:hover,
body.story-reader-active .reader-view .reader-back:hover,
body.song-reader-active .reader-view .reader-back:hover {
  color: var(--primary) !important; /* Orange hover for back button */
}

/* Article title inside reader view */
body.rhyme-reader-active .reader-header h1.headline-lg,
body.poem-reader-active .reader-header h1.headline-lg,
body.story-reader-active .reader-header h1.headline-lg,
body.song-reader-active .reader-header h1.headline-lg {
  color: var(--primary) !important; /* Make title orange! */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

/* Meta details (date, read time) */
body.rhyme-reader-active .reader-meta,
body.poem-reader-active .reader-meta,
body.story-reader-active .reader-meta,
body.song-reader-active .reader-meta {
  color: var(--secondary) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

/* Body text & lines of poems/stories */
body.rhyme-reader-active .reader-content p.poem-line,
body.poem-reader-active .reader-content p.poem-line,
body.story-reader-active .reader-content p,
body.song-reader-active .reader-content p.poem-line {
  color: var(--on-surface) !important; /* Dark readable text #222222 */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

body.rhyme-reader-active .reader-content p.poem-line,
body.poem-reader-active .reader-content p.poem-line,
body.song-reader-active .reader-content p.poem-line {
  font-size: 22px;
  font-weight: 500;
}

/* Mobile Compatibility & Responsiveness Overrides */
@media (max-width: 768px) {
  /* Prevent background zoom-in on mobile by focusing the center top of the fixed layer */
  body.rhyme-reader-active .reader-bg,
  body.poem-reader-active .reader-bg,
  body.story-reader-active .reader-bg,
  body.song-reader-active .reader-bg {
    background-position: center center !important;
    background-size: cover !important;
  }

  body.rhyme-reader-active .reader-content p.poem-line,
  body.poem-reader-active .reader-content p.poem-line,
  body.song-reader-active .reader-content p.poem-line {
    font-size: 17px !important; /* Avoid word wrapping to keep poem line rhythm */
    line-height: 1.5;
    padding-left: 8px;
    padding-right: 8px;
  }

  body.rhyme-reader-active .reader-header h1.headline-lg,
  body.poem-reader-active .reader-header h1.headline-lg {
    font-size: 28px !important;
    line-height: 1.3;
  }

  body.rhyme-reader-active .reader-view .reading-well,
  body.poem-reader-active .reader-view .reading-well,
  body.story-reader-active .reader-view .reading-well,
  body.song-reader-active .reader-view .reading-well {
    padding: 24px 18px !important;
  }
}

/* Blockquotes */
.block-quote {
  font-family: var(--font-body);
  font-size: 22px;
  font-style: italic;
  border-left: 3px solid var(--secondary);
  padding-left: 24px;
  margin: 40px 0;
  color: var(--on-surface-variant);
  white-space: pre-line;
}

/* Bio Section (About Page) */
.bio-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}

.bio-image-wrapper {
  border: 1px solid var(--outline-variant);
  background-color: var(--surface-container-low);
  padding: 12px;
}

.bio-image {
  width: 100%;
  height: auto;
  filter: grayscale(100%);
  display: block;
}

.bio-text {
  font-size: 20px;
  line-height: 1.8;
}

.bio-text p {
  margin-bottom: 24px;
}

.bio-contact-panel {
  border-top: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
  padding: 22px 0;
  margin-top: 32px;
}

.bio-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--outline-variant);
  background-color: var(--surface-container-low);
  color: var(--primary);
  font-family: var(--font-label);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  transition: all var(--transition-speed) var(--transition-easing);
}

.contact-chip:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-1px);
}

.contact-chip .material-symbols-outlined {
  font-size: 19px;
  flex: 0 0 auto;
}

/* Contact Modal Slider */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(27, 28, 26, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-container {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background-color: var(--background);
  border-left: 1px solid var(--outline-variant);
  z-index: 1001;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--secondary);
}

.modal-close:hover {
  color: var(--primary);
}

.modal-overlay.open {
  display: block;
  opacity: 1;
}

.modal-overlay.open .modal-container {
  transform: translateX(0);
}

.direct-contact-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.direct-contact-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--primary);
  font-family: var(--font-label);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.direct-contact-list a:hover {
  color: var(--secondary);
}

.direct-contact-list .material-symbols-outlined {
  font-size: 20px;
  color: var(--secondary);
  flex: 0 0 auto;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toast {
  background-color: var(--primary);
  color: var(--on-primary);
  padding: 16px 24px;
  border: 1px solid var(--outline-variant);
  font-family: var(--font-label);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  opacity: 0;
  animation: slideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Footer Section */
footer {
  margin-top: var(--stack-lg);
  background-color: var(--surface-container-low);
  border-top: 1px solid var(--outline-variant);
  padding-top: var(--stack-md);
  padding-bottom: var(--stack-md);
  font-family: var(--font-label);
  transition: background-color var(--transition-speed) var(--transition-easing),
              border-color var(--transition-speed) var(--transition-easing);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand h4 {
  font-size: 20px;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 32px;
}

.footer-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 13px;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 992px) {
  .grid-12 {
    gap: 16px;
  }
  .col-8 { grid-column: span 12; }
  .col-4 { grid-column: span 12; }
  .mood-card { min-height: 250px; }
  .writing-card { min-height: 320px; }

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

  .video-feature-layout {
    grid-template-columns: 1fr;
  }
  
  .bio-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .bio-image-wrapper {
    max-width: 250px;
    margin: 0 auto;
  }

  .bio-contact-panel {
    text-align: center;
  }

  .bio-contact-links {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --stack-lg: 64px;
    --stack-md: 38px;
    --stack-sm: 20px;
  }
  
  body {
    font-size: 16px;
  }
  
  nav {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }
  
  .nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .headline-lg { font-size: 32px; }
  .headline-md { font-size: 26px; }
  .headline-sm { font-size: 20px; }
  .body-lg { font-size: 18px; }
  .body-md { font-size: 16px; }
  
  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 20px;
  }
  
  .filter-tab {
    white-space: nowrap;
    padding-bottom: 8px;
  }
  
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pdf-collection-intro {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pdf-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .pdf-book-copy {
    padding: 14px;
  }

  .pdf-book-copy .headline-sm {
    font-size: 18px;
  }

  .video-feature-copy {
    padding: 22px;
  }

  .video-feature-copy .headline-md {
    font-size: 24px;
  }
  
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .newsletter-form .input-minimalist {
    width: 100%;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
    gap: 16px 24px;
  }

  .contact-chip {
    width: 100%;
    justify-content: center;
  }
  
  .toast-container {
    bottom: 20px;
    right: 20px;
    left: 20px;
  }
  
  .modal-container {
    padding: 32px;
  }
}

/* ----------------------------------------------------
   Pagination Components (Sharp Editorial Style)
   ---------------------------------------------------- */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--outline-variant);
  width: 100%;
}

.page-btn {
  background: transparent;
  border: 1px solid var(--outline-variant);
  color: var(--secondary);
  font-family: var(--font-label);
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-easing);
  border-radius: 0 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-btn:hover {
  background-color: var(--surface-container-low);
  color: var(--primary);
  border-color: var(--primary);
}

.page-btn.active {
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--outline-variant);
  color: var(--outline);
  background: transparent;
}

.page-btn-num {
  padding: 8px 12px;
  min-width: 35px;
  justify-content: center;
}

.page-ellipsis {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--secondary);
  padding: 8px 12px;
  min-width: 35px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile responsive pagination */
@media (max-width: 480px) {
  .pagination-container {
    gap: 4px;
    margin-top: 32px;
    padding-top: 16px;
  }
  .page-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .page-btn-num {
    padding: 6px 8px;
    min-width: 28px;
  }
  .page-ellipsis {
    padding: 6px 8px;
    min-width: 28px;
    font-size: 11px;
  }

  .pdf-book-grid {
    grid-template-columns: 1fr;
  }

  .pdf-book-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .pdf-book-cover {
    height: 100%;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: 1px solid var(--outline-variant);
  }
}

/* ────────────────────────────────────────────────────────
   Share Buttons — Category Headers & Article Reader
   ──────────────────────────────────────────────────────── */

/* Section divider with share button */
.section-divider-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-divider-wrap .section-divider {
  flex: 1;
  margin-bottom: 0;
}

.section-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--outline-variant);
  color: var(--secondary);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all var(--transition-speed) var(--transition-easing);
  flex-shrink: 0;
}

.section-share-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-1px);
}

.section-share-btn .material-symbols-outlined {
  font-size: 16px;
}

/* Share bar row (used in both article reader and section share popup) */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--outline-variant);
}

.share-bar-label {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-basis: 100%;
  margin-bottom: 2px;
}

/* Individual share buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.22s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.share-btn .material-symbols-outlined,
.share-btn .share-icon-svg {
  font-size: 16px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Facebook */
.share-btn--facebook {
  background-color: #1877f2;
  color: #fff;
  border-color: #1877f2;
}
.share-btn--facebook:hover {
  background-color: #0d65d8;
  border-color: #0d65d8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

/* WhatsApp */
.share-btn--whatsapp {
  background-color: #25d366;
  color: #fff;
  border-color: #25d366;
}
.share-btn--whatsapp:hover {
  background-color: #1ab558;
  border-color: #1ab558;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

/* Twitter / X */
.share-btn--twitter {
  background-color: #000;
  color: #fff;
  border-color: #000;
}
.share-btn--twitter:hover {
  background-color: #222;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Copy Link */
.share-btn--copy {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.share-btn--copy:hover {
  background-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 28, 26, 0.15);
}

/* Native Share (mobile) */
.share-btn--native {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  border-color: var(--secondary-container);
}
.share-btn--native:hover {
  background-color: var(--secondary);
  color: var(--on-secondary);
  transform: translateY(-2px);
}

/* Share popup / dropdown (floating over section header) */
.share-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: transparent;
}

.share-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  box-shadow: 0 12px 32px rgba(27, 28, 26, 0.12);
  padding: 20px;
  z-index: 600;
  min-width: 260px;
  animation: popIn 0.18s ease forwards;
}

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

.share-popup-title {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.share-popup-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-popup-btns .share-btn {
  justify-content: center;
  padding: 9px 10px;
}

/* Reader view share bar is inline and full-width */
.reader-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--outline-variant);
}

.reader-share-label {
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary);
  flex-basis: 100%;
  margin-bottom: 4px;
}

/* Responsive share bar */
@media (max-width: 480px) {
  .share-popup-btns {
    grid-template-columns: 1fr;
  }

  .share-btn {
    font-size: 11px;
    padding: 7px 10px;
  }

  .section-share-btn span:not(.material-symbols-outlined) {
    display: none;
  }

  .section-share-btn {
    padding: 7px 10px;
  }
}

/* Position helper for section-divider share popup */
.section-share-wrap {
  position: relative;
  display: inline-flex;
}

/* Loading Overlay Screen */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.35s ease-in-out, visibility 0.35s ease-in-out;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.spinner-container {
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 0 auto 16px;
}

.loading-text {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

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