/* 
   AajKaVrat - Style Sheet (Indian Illustrated Manuscript Style)
   Domain: aajkavrat.in
   Primary Language: Hindi (Devanagari)
*/

:root {
  --color-bg: #F2E9D3;
  --color-bg-card: #FBF5E6;
  --color-bg-warm: #F0DFB8;
  --color-text-primary: #2B1710;
  --color-text-secondary: #5C4028;
  --color-text-tertiary: #8C6F4E;
  --color-terracotta: #C4432E;
  --color-terracotta-light: #D97056;
  --color-terracotta-dark: #8F2E1C;
  --color-ochre: #C08A1E;
  --color-ochre-dark: #8F6614;
  --color-ochre-light: #DCB768;
  --color-ash-blue: #3B5478;
  --color-ash-blue-bg: rgba(59,84,120,0.09);
  --color-border: rgba(140,111,78,0.22);
  --color-border-medium: rgba(140,111,78,0.34);
  --color-shadow: rgba(43,23,16,0.08);
  --color-shadow-hover: rgba(43,23,16,0.14);
  --color-green: #2D6A4F;
  --color-green-bg: #EAF4EF;
  --color-red: #8B3A2A;
  --color-red-bg: #F8EDEA;
  --color-ekadashi: #3F5C82;
  --color-ekadashi-bg: #E9EDF3;
  --color-parana: #B8722E;
  --color-parana-bg: #F5E8D6;
  
  --card-shadow: 0 1px 16px var(--color-shadow);
  --card-shadow-hover: 0 4px 32px var(--color-shadow-hover);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: 'Noto Sans Devanagari', 'DM Sans', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px; /* Padding for fixed banner at bottom */
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: 600; /* Max 600 weight anywhere as per design specification */
}

a {
  color: inherit;
  text-decoration: none;
}

/* Hero (Header) Section */
.hero-section {
  position: relative;
  height: auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at center, rgba(196,67,46,0.05) 0%, transparent 70%);
  overflow: hidden;
  padding: 36px 16px;
  border-bottom: 0.5px solid var(--color-border);
}

@media (min-width: 768px) {
  .hero-section {
    min-height: 240px;
    padding: 40px 16px;
  }
}

/* 8-fold Geometric SVG Mandala Background & Animation */
.mandala-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 460px;
  height: 460px;
  pointer-events: none;
  z-index: 0;
}

.mandala-svg {
  width: 100%;
  height: 100%;
  color: var(--color-ochre);
  opacity: 0.042;
  animation: manuscript-breathe 5s ease-in-out infinite alternate;
}

@keyframes manuscript-breathe {
  0% {
    opacity: 0.028;
    transform: scale(0.97);
  }
  100% {
    opacity: 0.058;
    transform: scale(1.03);
  }
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
}

.diya-wrapper {
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
}

.diya-svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-family: 'Noto Serif Devanagari', serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .brand-title {
    font-size: 44px;
  }
}

.brand-domain {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.14em;
  margin-top: 1px;
}

.brand-tagline {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.date-pill-wrapper {
  margin-top: 16px;
}

.date-pill {
  display: inline-block;
  background-color: var(--color-bg-warm);
  border: 0.5px solid var(--color-border);
  border-radius: 20px;
  padding: 3px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

header#header:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(3) > span#hero-date-pill:nth-of-type(1) {
  box-shadow: 0 4px 14px rgba(255, 112, 0, 0.4), 0 0 2px rgba(255, 112, 0, 0.5);
  border-color: rgba(255, 112, 0, 0.4);
  font-weight: bold;
  color: #5b091d;
}

/* Main Container Layout */
.main-container {
  max-width: 780px; /* Aligned with standard tablet / mobile-first reading width */
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 2;
  margin-top: -20px; /* Slight peek below fold overlay on hero */
}

@media (min-width: 768px) {
  .main-container {
    max-width: 860px;
    margin-top: -30px;
  }
}

@media (min-width: 1024px) {
  .main-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
    max-width: 1140px;
    margin: 0 auto;
    margin-top: -40px;
    padding: 0 24px;
    align-items: start;
  }
  
  #today.vrat-section {
    grid-column: span 12;
    margin-bottom: 40px;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  
  #upcoming.vrat-section {
    grid-column: span 12;
    margin-bottom: 0;
    width: 100%;
  }

  .toran-divider {
    grid-column: span 12;
    width: 100%;
  }
  
  .books-section {
    grid-column: span 12;
    margin-top: 40px;
  }
}

/* Section Title Styling */
.section-title {
  font-family: 'Noto Serif Devanagari', serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--color-terracotta-light);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1) {
  position: relative;
  justify-content: center;
  border-bottom: none !important;
  padding-bottom: 0;
  margin-bottom: 28px;
  margin-top: 24px;
}

@media (min-width: 768px) {
  main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1) {
    margin-top: 36px;
  }
}

@media (min-width: 1024px) {
  main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1) {
    margin-top: 48px;
  }
}

main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5px;
  background-color: var(--color-terracotta-light);
  z-index: 1;
}

main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1) > span:nth-of-type(1) {
  text-align: center;
  color: #7a1a1a;
  position: relative;
  z-index: 2;
  background-color: var(--color-bg);
  padding: 0 16px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
}

.swastik-icon {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  display: block !important;
}

.upcoming-section-title {
  justify-content: center;
}

main:nth-of-type(1) > section#upcoming:nth-of-type(2) > h2:nth-of-type(1) > span:nth-of-type(1) {
  color: #7A1A1A;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 27px;
  }
}

.toran-divider {
  width: 100%;
  max-width: 1200px;
  margin: 28px auto;
  opacity: 0.95;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}

.vrat-section {
  margin-bottom: 30px;
}

/* Loading Placeholder */
.loading-placeholder {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 14px;
  color: var(--color-text-tertiary);
  text-align: center;
  padding: 40px 16px;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-border);
}

/* Dynamic Multi-Festival Image Layout for Cards */
.card-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
  border-radius: 22px 22px 0 0;
  background-color: var(--color-bg-warm);
  position: relative;
  border-bottom: 0.5px solid var(--color-border);
}

/* 1 Image: 1:1 Aspect Ratio */
.card-image-container.count-1 {
  height: auto;
  aspect-ratio: 1 / 1;
}

.card-image-container.count-1 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* 2 Images: Dynamic columns (side-by-side) wrapping to stacked if tight */
.card-image-container.count-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.card-image-container.count-2 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 0.3s ease;
  background-color: var(--color-bg-warm);
}

/* 3 Images: 3 Columns wrapping as needed */
.card-image-container.count-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.card-image-container.count-3 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 0.3s ease;
  background-color: var(--color-bg-warm);
}

/* 4+ Images: Grid Layout (2x2) */
.card-image-container.grid-layout,
.card-image-container.count-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.card-image-container.grid-layout img,
.card-image-container.count-4 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 0.3s ease;
  background-color: var(--color-bg-warm);
}

/* Specificity safety for responsive viewports */
@media (min-width: 768px) {
  .card-image-container.count-1,
  .card-image-container.count-2,
  .card-image-container.count-3,
  .card-image-container.count-4,
  .card-image-container.grid-layout {
    height: auto !important;
  }
}

/* Overlay Label for Multiple Festivals */
.multi-perv-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(253, 250, 245, 0.94);
  border: 0.5px solid var(--color-border-medium);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-style: italic;
  color: var(--color-text-secondary);
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  z-index: 10;
}

/* Today's Card Design */
.today-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.today-card {
  background-color: var(--color-bg-card);
  background-image: radial-gradient(circle at center, rgba(201, 168, 112, 0.12) 0%, transparent 80%);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-ochre);
  box-shadow: 
    0 15px 40px rgba(139, 58, 42, 0.16), 
    0 4px 18px rgba(201, 168, 112, 0.24),
    inset 0 0 0 6px var(--color-bg-card),
    inset 0 0 0 7.5px var(--color-ochre-light);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hanging Temple Bells (Ghanti) on left and right sides */
.today-card::before,
.today-card::after {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 56px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><line x1='12' y1='0' x2='12' y2='10' stroke='%239A7840' stroke-width='1.5' /><path d='M7 15 C7 11, 17 11, 17 15 L18 17 C18 18, 6 18, 7 17 Z' fill='%23C9A870' stroke='%239A7840' stroke-width='1' /><rect x='6' y='17' width='12' height='1.5' rx='0.5' fill='%239A7840' /><circle cx='12' cy='20' r='1.5' fill='%239A7840' /></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
  pointer-events: none;
  transform-origin: top center;
}

.today-card::before {
  left: 20px;
}

.today-card::after {
  right: 20px;
}

@keyframes swingBell {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
  60% { transform: rotate(4deg); }
  80% { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}

/* Premium Card Tap / Hover elevation */
@media (hover: hover) {
  .today-card:hover {
    transform: translateY(-4px);
    box-shadow: 
      0 22px 50px rgba(139, 58, 42, 0.22), 
      0 6px 24px rgba(201, 168, 112, 0.30),
      inset 0 0 0 6px var(--color-bg-card),
      inset 0 0 0 7.5px var(--color-ochre-light);
  }
  .today-card:hover::before,
  .today-card:hover::after {
    animation: swingBell 1.2s ease-in-out;
  }
}

.today-card.active-focus {
  transform: translateY(-4px);
  box-shadow: 
    0 22px 50px rgba(139, 58, 42, 0.22), 
    0 6px 24px rgba(201, 168, 112, 0.30),
    inset 0 0 0 6px var(--color-bg-card),
    inset 0 0 0 7.5px var(--color-ochre-light);
}

.today-card.active-focus::before,
.today-card.active-focus::after {
  animation: swingBell 1.2s ease-in-out;
}

/* Majestic Temple Arch Image Container */
.today-card .card-image-container {
  margin: 18px 18px 0;
  width: calc(100% - 36px);
  height: auto !important;
  border-radius: 160px 160px 16px 16px;
  border: 2px solid var(--color-ochre);
  box-shadow: inset 0 0 15px rgba(154, 120, 64, 0.3), 0 4px 12px rgba(70,45,18,0.08);
  overflow: hidden;
  background-color: var(--color-bg-warm);
  position: relative;
  z-index: 5;
}

@media (min-width: 768px) {
  .today-card .card-image-container {
    margin: 24px 24px 0;
    width: calc(100% - 48px);
    height: auto !important;
    border-radius: 220px 220px 22px 22px;
  }
}

/* Symmetrical Centered Layout for Sacred Vrat content */
.today-card .vrat-title-hindi {
  color: var(--color-red);
  text-align: center;
  margin-bottom: 2px;
}

.today-card .vrat-title-english {
  text-align: center;
  margin-bottom: 8px;
}

.today-card .vrat-secondary-badge {
  align-self: center;
  margin-bottom: 12px;
}

.today-card .anya-vrat-tyohar-line {
  text-align: center;
  margin-top: -6px;
  margin-bottom: 14px;
}

.today-card .tithi-month-row {
  justify-content: center;
  margin-top: 10px;
}

.today-card .date-text-row {
  text-align: center;
  margin-top: 8px;
  font-weight: 500;
}

.today-card .card-divider {
  border-top: 1px dashed var(--color-border);
  max-width: 140px;
  margin: 18px auto;
}

.today-card-body {
  padding: 20px;
}

@media (min-width: 768px) {
  .today-card-body {
    padding: 28px;
  }
}

/* Inside Card Content Stack */
.vrat-entry-block {
  display: flex;
  flex-direction: column;
}

.entry-separator {
  text-align: center;
  color: var(--color-terracotta);
  opacity: 0.40;
  font-size: 18px;
  letter-spacing: 0.2em;
  margin: 24px 0;
  user-select: none;
}

.vrat-title-hindi {
  font-family: 'Noto Serif Devanagari', serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

@media (min-width: 768px) {
  .vrat-title-hindi {
    font-size: 33px;
  }
}

.vrat-title-english {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

@media (min-width: 768px) {
  .vrat-title-english {
    font-size: 16px;
  }
}

.vrat-secondary-badge {
  display: inline-block;
  background-color: rgba(196,67,46,0.11);
  border: 0.5px solid rgba(196,67,46,0.32);
  color: var(--color-terracotta-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 10px;
  margin-top: 8px;
  align-self: flex-start;
}

.anya-vrat-tyohar-line {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  margin-top: 5px;
}

/* Tithi and Month display */
.tithi-month-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.tithi-tag-pill {
  background: linear-gradient(135deg, #FF6F00 0%, #FF9F00 100%) !important;
  border: none !important;
  border-radius: 20px;
  padding: 4px 16px;
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF !important;
  box-shadow: 0 3px 8px rgba(255, 111, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tithi-tag-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(255, 111, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tithi-text-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.date-text-row {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 6px;
}

.card-divider {
  border: none;
  border-top: 0.5px solid var(--color-border);
  margin: 14px 0;
}

.vrat-summary {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--color-text-primary);
  text-align: justify;
}

/* Special boxes on Today card */
.guidance-box {
  background-color: var(--color-bg-warm);
  border-radius: 0 8px 8px 0;
  border-left: 2.5px solid var(--color-terracotta);
  padding: 13px 15px 13px 17px;
  margin-top: 16px;
}

.guidance-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-terracotta);
  display: block;
  margin-bottom: 4px;
}

.guidance-text {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.ekadashi-timing-box {
  background-color: var(--color-ekadashi-bg);
  border-radius: 0 8px 8px 0;
  border-left: 2.5px solid var(--color-ekadashi);
  padding: 13px 15px;
  margin-top: 16px;
}

.ekadashi-timing-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-ekadashi);
  display: block;
  margin-bottom: 4px;
}

.ekadashi-timing-text {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Two column layout for rules and items */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.rules-column {
  display: flex;
  flex-direction: column;
}

.rules-header {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rules-header.green-header {
  color: var(--color-green);
}

.rules-header.red-header {
  color: var(--color-red);
}

.rules-items {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-warm);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 0.5px solid var(--color-border);
  height: 100%;
}

.parana-box {
  background-color: var(--color-parana-bg);
  border-radius: 0 8px 8px 0;
  border-left: 2.5px solid var(--color-parana);
  padding: 13px 15px;
  margin-top: 16px;
}

.parana-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-parana);
  display: block;
  margin-bottom: 4px;
}

.parana-text {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Share Button Today Card */
.whatsapp-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: 1.5px solid var(--color-green);
  color: var(--color-green);
  background-color: transparent;
  border-radius: 100px;
  padding: 10px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  margin-top: 24px;
  text-decoration: none;
}

@media (hover: hover) {
  .whatsapp-share-btn:hover {
    background-color: var(--color-green);
    color: #FDFAF5;
  }
}

/* Upcoming Section */
.upcoming-cards-wrapper {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding: 4px 4px 16px 4px;
  margin: 0 -4px;
  scrollbar-width: none; /* Hide standard Firefox scrollbar */
}

.upcoming-cards-wrapper::-webkit-scrollbar {
  display: none; /* Hide webkit scrollbar */
}

.upcoming-card {
  width: 268px;
  flex-shrink: 0;
  scroll-snap-align: start;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(139, 58, 42, 0.09), 0 2px 8px rgba(201, 168, 112, 0.12);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@media (hover: hover) {
  .upcoming-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(139, 58, 42, 0.18), 0 3px 14px rgba(201, 168, 112, 0.22);
  }
}

.upcoming-card.active-focus {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(139, 58, 42, 0.18), 0 3px 14px rgba(201, 168, 112, 0.22);
}

/* Responsive grid for Upcoming Section on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .upcoming-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: stretch;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 4px;
    margin: 0;
  }
  
  .upcoming-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    scroll-snap-align: none;
  }

  .upcoming-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

/* Horizontal list layout for Upcoming Section on desktop - now 3 columns below Today's section */
@media (min-width: 1024px) {
  .upcoming-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 4px;
    margin: 0;
  }
  
  .upcoming-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    scroll-snap-align: none;
  }
  
  .upcoming-image-area {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
    border-bottom: 0.5px solid var(--color-border);
  }
  
  .upcoming-image-area img {
    border-radius: 0;
  }
  
  .upcoming-card-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  
  .upcoming-title-hindi {
    font-size: 18px;
  }
  
  .upcoming-actions {
    flex-direction: row;
    gap: 8px;
    margin-top: auto;
  }
  
  .upcoming-share-btn, .upcoming-reminder-btn {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
  }
}

.upcoming-image-area {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-bg-warm);
  position: relative;
  border-bottom: 0.5px solid var(--color-border);
}

/* 1 Image: 1:1 Aspect Ratio */
.upcoming-image-area.count-1 {
  height: auto;
  aspect-ratio: 1 / 1;
}

.upcoming-image-area.count-1 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 2 Images: Dynamic columns (side-by-side) wrapping to stacked if tight */
.upcoming-image-area.count-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.upcoming-image-area.count-2 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: var(--color-bg-warm);
}

/* 3 Images: 3 Columns wrapping as needed */
.upcoming-image-area.count-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.upcoming-image-area.count-3 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: var(--color-bg-warm);
}

/* 4+ Images: Grid Layout (2x2) */
.upcoming-image-area.grid-layout,
.upcoming-image-area.count-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  height: auto;
  width: 100%;
  background-color: var(--color-bg);
}

.upcoming-image-area.grid-layout img,
.upcoming-image-area.count-4 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: var(--color-bg-warm);
}

/* Specificity safety for responsive viewports */
@media (min-width: 768px) {
  .upcoming-image-area.count-1,
  .upcoming-image-area.count-2,
  .upcoming-image-area.count-3,
  .upcoming-image-area.count-4,
  .upcoming-image-area.grid-layout {
    height: auto !important;
  }
}

.upcoming-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.upcoming-title-hindi {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.upcoming-title-english {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.upcoming-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.upcoming-date-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Urgent / Non-urgent days left badge */
.days-left-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 11px;
  display: inline-block;
  border: 0.5px solid transparent;
}

.days-left-urgent { /* 1-3 days */
  background-color: rgba(139,58,42,0.10);
  border-color: rgba(139,58,42,0.30);
  color: var(--color-red);
}

.days-left-warning { /* 4-7 days */
  background-color: rgba(196,67,46,0.12);
  border-color: rgba(196,67,46,0.32);
  color: var(--color-terracotta-dark);
}

.days-left-normal { /* 8+ days */
  background-color: var(--color-bg-warm);
  border-color: var(--color-border);
  color: var(--color-text-tertiary);
}

.upcoming-desc {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Buttons Stack inside Upcoming card */
.upcoming-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.upcoming-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  color: #FFFFFF;
  background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

@media (hover: hover) {
  .upcoming-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4);
    color: #FFFFFF;
  }
}

.upcoming-reminder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  color: #FFFFFF;
  background: linear-gradient(135deg, #E65100 0%, #FF8F00 100%);
  box-shadow: 0 4px 10px rgba(230, 81, 0, 0.25);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
  .upcoming-reminder-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(230, 81, 0, 0.4);
    color: #FFFFFF;
  }
}

/* Books Section */
.books-section {
  margin-top: 20px;
  margin-bottom: 40px;
}

.books-sub {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: -12px;
  margin-bottom: 24px;
}

.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.book-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.book-image-area {
  height: 200px;
  background-color: var(--color-bg-warm);
  position: relative;
  overflow: hidden;
  border-bottom: 0.5px solid var(--color-border);
}

.book-image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-fallback-cover {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--color-bg-warm);
}

.book-emoji {
  font-size: 40px;
}

.book-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.book-desc {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.book-divider {
  border: none;
  border-top: 0.5px solid var(--color-border);
  margin: 12px 0;
}

.book-teaser {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-tertiary);
  text-align: center;
  margin-bottom: 16px;
}

.book-button {
  display: block;
  width: 100%;
  border-radius: 100px;
  background-color: var(--color-terracotta);
  color: #FDFAF5;
  padding: 10px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.2s ease;
  margin-top: auto;
}

.book-button:hover {
  opacity: 0.9;
}

/* Footer Styling */
.main-footer {
  background-color: var(--color-bg-warm);
  border-top: 0.5px solid var(--color-border);
  padding: 32px 16px;
  text-align: center;
  width: 100%;
  margin-top: 40px;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-copyright {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-terracotta-dark);
}

.footer-separator {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--color-text-tertiary);
  user-select: none;
}

.footer-disclaimer {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

/* Add to Homescreen Prompt */
.homescreen-prompt-placeholder {
  position: relative;
  z-index: 999;
}

.homescreen-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg-card);
  border-top: 0.5px solid var(--color-border);
  padding: 11px 16px;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(70,45,18,0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(100%);
}

.homescreen-prompt.homescreen-prompt-active {
  transform: translateY(0);
}

.homescreen-prompt-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.homescreen-prompt-text {
  font-family: 'Noto Sans Devanagari', 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.homescreen-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.homescreen-add-btn {
  background-color: var(--color-terracotta);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.homescreen-add-btn:hover {
  opacity: 0.9;
}

.homescreen-dismiss-btn {
  background-color: transparent;
  color: var(--color-text-tertiary);
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Focused Elements Custom Styling */
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(1) {
  font-size: 11px;
}
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(2) {
  font-size: 10px;
  font-weight: bold;
}
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(1) {
  font-size: 11px;
}
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(2) {
  font-weight: bold;
}
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(3) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(1) {
  font-size: 11px;
}
main:nth-of-type(1) > section#upcoming:nth-of-type(2) > div#upcoming-cards-container:nth-of-type(1) > div:nth-of-type(3) > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(3) > span:nth-of-type(2) {
  font-weight: bold;
}
footer:nth-of-type(1) > div:nth-of-type(1) {
  font-size: 16px;
}
footer:nth-of-type(1) > div:nth-of-type(1) > nav:nth-of-type(1) > a#footer-ekadashi-link:nth-of-type(1) {
  font-size: 14px;
  color: #b34d00;
  font-weight: bold;
}
footer:nth-of-type(1) > div:nth-of-type(1) > nav:nth-of-type(1) > a:nth-of-type(2) {
  font-size: 14px;
  font-weight: bold;
  color: #B34D00;
}
footer:nth-of-type(1) > div:nth-of-type(1) > nav:nth-of-type(1) > a:nth-of-type(3) {
  font-size: 14px;
  font-weight: bold;
  color: #B34D00;
}
footer:nth-of-type(1) > div:nth-of-type(1) > nav:nth-of-type(1) > a:nth-of-type(4) {
  font-size: 14px;
  font-weight: bold;
  color: #B34D00;
}
footer:nth-of-type(1) > div:nth-of-type(1) > nav:nth-of-type(1) > a:nth-of-type(5) {
  font-size: 14px;
  color: #B34D00;
  font-weight: bold;
}
footer:nth-of-type(1) > div:nth-of-type(1) > p:nth-of-type(2) {
  font-size: 10px;
}
footer:nth-of-type(1) {
  /* No overrides needed */
}
footer:nth-of-type(1) > div:nth-of-type(1) > p:nth-of-type(1) {
  font-size: 12px;
}

/* User Specific Layout and Focus overrides */
main:nth-of-type(1) > section#today:nth-of-type(1) > h2#today-title:nth-of-type(1) > span:nth-of-type(1) {
  font-size: 28px;
  line-height: 42.6px;
}

main:nth-of-type(1) > section#upcoming:nth-of-type(2) > h2:nth-of-type(1) > span:nth-of-type(1) {
  font-size: 26px;
}

main:nth-of-type(1) > section#upcoming:nth-of-type(2) > h2:nth-of-type(1) {
  line-height: 41.2px;
}

header#header:nth-of-type(1) > div:nth-of-type(2) > h1:nth-of-type(1) {
  font-size: 44px;
}

header#header:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) {
  font-size: 13px;
}

header#header:nth-of-type(1) > div:nth-of-type(2) > p:nth-of-type(1) {
  font-size: 14px;
  font-weight: bold;
  color: #544039;
}

header#header:nth-of-type(1) {
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (min-width: 1024px) {
  header#header:nth-of-type(1) {
    height: 180px;
    width: 1364px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 40px;
    padding-right: 16px;
    padding-left: 8px;
    padding-top: 20px;
  }
}
