/* =========================================================================
   Kalp Katha — homepage
   Two epics, two themes: dark navy/gold/violet by default, warm ivory/gold
   /violet on toggle. Everything on this page (Continue Reading, Featured
   Series counts, Latest Chapters list) is placeholder marketing content —
   the live catalogue only has one seed comic so far. Wire it to /api/*
   once there's enough real data to justify replacing these blocks.
   ========================================================================= */

@import url('/css/base.css');



* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }

.eyebrow-mark { font-family: var(--display); color: var(--gold); }

/* =========================================================================
   HEADER
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand-block { display: flex; flex-direction: column; line-height: 1.1; }
.brand-block .mark { font-family: var(--display); font-size: 26px; color: var(--gold); letter-spacing: .3px; }
.brand-block .tag { font-size: 11px; color: var(--muted); margin-top: 2px; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav .nav-item { position: relative; }
.main-nav a.nav-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.main-nav a.nav-link:hover { color: var(--gold); }
.main-nav a.nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }
.main-nav .chev { width: 9px; height: 9px; opacity: .7; }

.nav-dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 170px; padding: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius);
  opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s;
}
.nav-item:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(2px); }
.nav-dropdown a { display: block; padding: 8px 10px; font-size: 13.5px; color: var(--text-dim); border-radius: var(--radius-sm); }
.nav-dropdown a:hover { background: var(--bg-elevated-2); color: var(--gold); }

.header-right { display: flex; align-items: center; gap: 14px; }
/* Moved to base.css: rendered by a script that runs on every page, so
   rules that live only here leave it unstyled on the other nineteen. */

/* Also used on an <a> (the My Library shortcut), which needs the flex
   centring and text-decoration reset a <button> gets for free. */
/* Moved to base.css: rendered by a script that runs on every page, so
   rules that live only here leave it unstyled on the other nineteen. */
.icon-btn-round svg { width: 17px; height: 17px; }
.icon-btn-round .moon { display: none; }
:root[data-theme="light"] .icon-btn-round .sun { display: none; }
:root[data-theme="light"] .icon-btn-round .moon { display: block; }

.premium-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold), var(--saffron));
  color: #1B1408; font-size: 13px; font-weight: 700;
  border: 1px solid transparent;
}
.premium-pill svg { width: 14px; height: 14px; }

/* The avatar moved to base.css — mobile-nav.js builds it on every page, so
   its styles cannot live in a stylesheet only the homepage loads. Without
   them the menu had no rules and rendered as a visible block over the
   content, which is exactly what happened on the other eighteen pages. */

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  margin: 20px clamp(16px, 3vw, 40px) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  height: min(64vh, 620px);
  box-shadow: var(--shadow);
}
.hero__half {
  position: absolute; top: 0; bottom: 0;
  width: 58%;
  display: flex; align-items: center;
  padding: 0 clamp(24px, 4vw, 64px);
  transition: opacity .5s ease;
  overflow: hidden;
}
/* Real comic cover art, layered under the gradient wash + a legibility scrim */
.hero__cover {
  position: absolute; inset: -4%;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .4s ease;
  filter: saturate(1.05) brightness(.8);
}
.hero__cover.show { opacity: .55; }
.hero__photo-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.75));
  pointer-events: none;
}
.hero__half--left {
  left: 0;
  background:
    radial-gradient(120% 140% at 10% 20%, rgba(212,169,71,0.30), transparent 55%),
    linear-gradient(120deg, #3A2308 0%, #291705 55%, #180E04 100%);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0% 100%);
}
.hero__half--right {
  right: 0;
  width: 46%;
  background:
    radial-gradient(120% 140% at 90% 30%, rgba(139,107,240,0.35), transparent 55%),
    linear-gradient(135deg, #150C2E 0%, #0C0A22 60%, #060512 100%);
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0% 100%);
  align-items: flex-end;
  text-align: right;
  justify-content: flex-end;
  flex-direction: column;
  padding-bottom: 48px;
}
.hero__glow {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(600px 300px at 55% 50%, rgba(212,169,71,0.08), transparent 70%);
}
.hero__content { position: relative; z-index: 2; max-width: 520px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 16px;
}
.hero__title {
  font-family: var(--display); color: #F5EEDD;
  font-size: clamp(32px, 4.2vw, 58px); line-height: 1.02; margin: 0 0 14px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.hero__subtitle { font-size: 15px; color: #E7E1CE; margin: 0 0 4px; font-weight: 500; }
.hero__desc { font-size: 14px; color: #C9C1A8; margin: 0 0 26px; max-width: 40ch; }
.hero__ctas { display: flex; gap: 12px; }
.btn-hero {
  padding: 13px 24px; border-radius: var(--radius); font-size: 13.5px; font-weight: 700;
  letter-spacing: .3px;
}
.btn-hero--fill { background: var(--gold); color: #1B1408; border: 1px solid var(--gold); }
.btn-hero--fill:hover { background: var(--gold-soft); }
.btn-hero--ghost { background: rgba(255,255,255,0.06); color: #F2EFE6; border: 1px solid rgba(255,255,255,0.35); }
.btn-hero--ghost:hover { background: rgba(255,255,255,0.14); }

.hero__saga-label { position: relative; z-index: 2; }
.hero__saga-label .name { font-family: var(--display); font-size: clamp(22px, 2.8vw, 34px); color: #EDE7FF; letter-spacing: 1px; }
.hero__saga-label .sub { font-size: 12.5px; color: #B7ACE8; margin-top: 4px; }
.hero__half--left .hero__saga-label { position: absolute; left: clamp(24px, 4vw, 64px); bottom: 40px; }
.hero__half--left .hero__saga-label .name { color: #F5DFA9; }
.hero__half--left .hero__saga-label .sub { color: #D8C79A; }

.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,13,24,0.55); border: 1px solid var(--gold); color: var(--gold);
  backdrop-filter: blur(4px);
}
.hero__arrow:hover { background: rgba(212,169,71,0.2); }
.hero__arrow--prev { left: 20px; }
.hero__arrow--next { right: 20px; }
.hero__arrow svg { width: 18px; height: 18px; }

.hero__dots { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; }
.hero__dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.35); border: none; padding: 0; }
.hero__dot.active { background: var(--gold); width: 20px; border-radius: var(--radius-sm); }

/* =========================================================================
   CONTENT ROW — Continue Reading (60%) + Featured Series (40%)
   ========================================================================= */
/* padding-top/bottom, never the shorthand: these classes are always paired
   with .wrap in the markup, and .wrap's own left/right padding is what holds
   the content off the edge of the screen. A shorthand declared later wipes
   that to zero. On a desktop it goes unnoticed because max-width leaves slack
   either side anyway; on a phone every heading and card ends up flush against
   the glass. */
.content-row { display: grid; grid-template-columns: 3fr 2fr; gap: clamp(20px, 3vw, 36px); padding-top: 56px; align-items: start; }

.empty-note { padding: 22px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-family: var(--head); font-size: 21px; margin: 0; color: var(--text); }
.section-head .view-all { font-size: 13px; font-weight: 600; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }
.section-head .view-all svg { width: 12px; height: 12px; }

.cr-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cr-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.cr-card--violet { border-color: var(--border-violet); }
.cr-card__top { display: flex; gap: 14px; }
.cr-thumb {
  width: 128px; aspect-ratio: 16/9; border-radius: var(--radius-sm); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 20px; color: rgba(255,255,255,0.85);
  background-color: #1A1108;
  background-image: linear-gradient(160deg, #3A2308, #180E04);
  border: 1px solid var(--border);
}
.cr-card--violet .cr-thumb { background-color: #120C28; background-image: linear-gradient(160deg, #241852, #0A0818); border-color: var(--border-violet); }
.cr-card__info { flex: 1; min-width: 0; }
.cr-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 9px; border-radius: var(--radius-pill); margin-bottom: 6px;
  background: rgba(212,169,71,0.14); color: var(--gold-soft); border: 1px solid var(--border);
}
.cr-card--violet .cr-badge { background: rgba(139,107,240,0.15); color: var(--violet-soft); border-color: var(--border-violet); }
.cr-card__info h3 { margin: 0 0 4px; font-family: var(--head); font-size: 15px; letter-spacing: .5px; }
.cr-card__info p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.cr-card__menu { color: var(--muted); align-self: flex-start; }
.cr-card__menu svg { width: 16px; height: 16px; }

.cr-progress { margin-top: 14px; }
.cr-progress .pct { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.cr-progress .bar { height: 6px; border-radius: var(--radius-pill); background: var(--bg-elevated-2); overflow: hidden; }
.cr-progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), var(--gold)); border-radius: var(--radius-pill); }
.cr-card--violet .cr-progress .bar span { background: linear-gradient(90deg, var(--violet), var(--violet-soft)); }

.cr-card__actions { margin-top: 14px; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700;
  background: var(--gold); color: #1B1408; border: 1px solid var(--gold);
}
.cr-card--violet .btn-sm { background: var(--violet); color: #F5F2FF; border-color: var(--violet); }
.btn-sm:hover { filter: brightness(1.08); }
.btn-sm--outline { background: transparent; color: var(--gold); border: 1px solid var(--border); }
.cr-card--violet .btn-sm--outline { color: var(--violet-soft); }

.cr-next {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.cr-card--violet .cr-next { border-top-color: var(--border-violet); }
.cr-next .lines { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cr-next .lines .done { color: var(--text-dim); }
.cr-next .lines b { color: var(--text); font-weight: 600; }

/* Featured series (right column) */
.fs-cards { display: flex; flex-direction: column; gap: 16px; }
.fs-card {
  position: relative; border-radius: var(--radius); overflow: hidden; padding: 18px 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  background: linear-gradient(120deg, #3A2308 0%, #1C1104 100%);
}
.fs-card--violet { background: linear-gradient(120deg, #251952 0%, #0B0919 100%); border-color: var(--border-violet); }
.fs-card .fs-title { font-family: var(--display); font-size: 22px; color: #F5EEDD; margin: 0 0 2px; }
.fs-card--violet .fs-title { color: #ECE6FF; }
.fs-card .fs-sub { font-size: 12px; color: var(--gold-soft); margin: 0 0 10px; }
.fs-card--violet .fs-sub { color: var(--violet-soft); }
.fs-card .fs-stats { font-size: 11.5px; color: rgba(255,255,255,0.6); margin: 0 0 10px; }
.fs-card .fs-desc { font-size: 13px; color: rgba(255,255,255,0.78); line-height: 1.5; margin: 0 0 16px; max-width: 34ch; }

/* =========================================================================
   LATEST CHAPTERS
   ========================================================================= */
.latest-chapters { padding-top: 56px; padding-bottom: 64px; }
.lc-row-wrap { position: relative; }
.lc-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px;
  gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-behavior: smooth;
  scrollbar-width: none;
}
.lc-row::-webkit-scrollbar { display: none; }
.lc-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-panel); box-shadow: var(--shadow); }
.lc-card--violet { border-color: var(--border-violet); }
.lc-thumb {
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative;
  font-family: var(--display); font-size: 30px; color: rgba(255,255,255,0.9);
  background-color: #1A1108;
  background-image: linear-gradient(160deg, #3A2308, #180E04);
}
.lc-card--violet .lc-thumb { background-color: #120C28; background-image: linear-gradient(160deg, #241852, #0A0818); }
.lc-new {
  position: absolute; top: 8px; left: 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
  padding: 3px 7px; border-radius: var(--radius-pill); background: var(--gold); color: #1B1408;
}
.lc-card--violet .lc-new { background: var(--violet); color: #F5F2FF; }
.lc-body { padding: 10px 11px 12px; }
.lc-series { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--gold-soft); }
.lc-card--violet .lc-series { color: var(--violet-soft); }
.lc-badge { font-size: 10px; color: var(--muted); margin-top: 1px; }
.lc-ch { font-size: 12.5px; font-weight: 600; margin: 5px 0 2px; line-height: 1.3; }
.lc-title { font-size: 12px; color: var(--text-dim); line-height: 1.35; margin: 0 0 6px; }
.lc-time { font-size: 10.5px; color: var(--muted); }

.lc-arrow {
  position: absolute; top: 38%; right: -18px; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--gold); color: var(--gold);
  box-shadow: var(--shadow);
}
.lc-arrow svg { width: 16px; height: 16px; }

/* =========================================================================
   FOOTER
   ========================================================================= */
/* The footer moved to base.css — /js/shared/site-footer.js renders it on
   every page now, so its styles cannot live in a stylesheet only the
   homepage loads. */

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
/* The hamburger only exists below the nav breakpoint. */
/* .nav-toggle lives in base.css now — both headers use it, and this copy
   was overriding the shared one to 38px, under the 44px tap target the
   shared rule sets. */

@media (max-width: 1180px) {
  .site-header { position: relative; flex-wrap: wrap; }

  /* The panel itself is .rv-drawer now, styled in base.css, and .main-nav is
     a plain column inside it — see /js/shared/mobile-nav.js. These rules used
     to make .main-nav the positioned panel; leaving them would have it
     absolutely positioned INSIDE the drawer, which is a panel within a panel.
     What stays is the part still true: the nav-item drops its dropdown
     anchoring, and the chevrons mean nothing once the menus are flattened. */
  .main-nav .nav-item { position: static; }
  .main-nav .chev { display: none; }

  /* Hover dropdowns can't work on touch — flatten them so every link is
     reachable by tapping. */
  .nav-dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    min-width: 0; padding: 2px 0 6px 14px; margin: 0;
    background: transparent; border: 0; box-shadow: none;
  }
  .nav-item:hover .nav-dropdown { transform: none; }
  .nav-dropdown a { padding: 8px 4px; }

  .search-field { width: 180px; }
  .content-row { grid-template-columns: 1fr; }
  .cr-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hero { height: auto; }
  /* A column here, not a row: the half is a flex container holding the hero
     content AND the saga label, so side by side they squeezed the content to
     239px of a 390px screen and pushed the label off the edge to be clipped. */
  .hero__half {
    position: static; width: 100%; clip-path: none; padding: 32px 20px;
    flex-direction: column; align-items: flex-start; justify-content: center;
  }
  .hero__half--right { align-items: flex-start; text-align: left; }
  .hero__content { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }

  /* Phone header: brand + hamburger + theme + avatar is all that fits
     honestly. Search gets its own full-width row beneath. */
  .site-header { gap: 10px; padding: 10px 14px; }
  .brand-block .tag { display: none; }
  .header-right { gap: 8px; margin-left: auto; }
  .premium-pill { display: none; }
  .search-field { order: 10; width: 100%; }
  .lc-row { grid-auto-columns: 84%; }

  /* The saga label is pinned to the bottom-left of the left half on a wide
     screen. Here the halves stop being absolutely positioned and stack, but
     the label kept its own `position: absolute` — so it came to rest on top
     of the hero's buttons, printing "RAMAYAN / 1 Arc · 1 Chapter" straight
     through "Start Reading Now". It flows after them instead. */
  .hero__half--left .hero__saga-label {
    position: static; margin-top: 22px;
  }
  .hero__saga-label .name { font-size: 22px; }

  /* The carousel arrow is deliberately hung 18px outside its row so it sits
     off the edge of the cards. On a phone the row already reaches the edge of
     the screen, so those 18px became 18px of horizontal page scroll — which
     is what dragged every heading and card leftwards out of alignment. It
     tucks inside at this width; the row is swipeable here anyway. */
  .lc-arrow { right: 2px; }
}



@media (prefers-reduced-motion: reduce) {
  .rotate-lock .glyph { animation: none; }
}

/* Suggestion panel for the header search field (markup from
   js/shared/search-box.js; the shared styles live in site.css, which the
   homepage does not import). */
.search-field { position: relative; }
/* Moved to base.css: rendered by a script that runs on every page, so
   rules that live only here leave it unstyled on the other nineteen. */
