
/* ==========================================
   DR PATHIK - POEMS & SHAYARI
   File: public/css/pathik-poems.css
   ========================================== */

.pathik {
  --poem-ink: #30271F;
  --poem-heading: #493321;
  --poem-muted: #6B5846;
  --poem-paper: #FFFDF9;
  --poem-card: #FFFDF9;
  --poem-border: #E0D0B8;
  --poem-accent: #805633;
  --poem-soft: #F0E4D2;
  --poem-dark: #493321;

  width: min(calc(100% - 48px), 1312px);
  margin: 0 auto;
  padding: 24px 0 64px;
  color: var(--poem-ink);
  background: var(--poem-paper);
  font: 15px/1.7 Inter, "Noto Sans Devanagari", sans-serif;
  box-sizing: border-box;
}

.pathik *,
.poem-reader * {
  box-sizing: border-box;
}

.pathik button,
.pathik input,
.pathik select,
.poem-reader button {
  font: inherit;
}

.pathik button,
.poem-reader button {
  cursor: pointer;
}

.pathik button:focus-visible,
.pathik input:focus-visible,
.pathik select:focus-visible,
.poem-reader button:focus-visible {
  outline: 2px solid var(--poem-accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* HERO */

.poems-hero {
  min-height: 420px;
  padding: 60px 24px 42px;
  text-align: center;
  color: var(--poem-paper);
  background:
    radial-gradient(ellipse at 15% 0%, #64452C 0%, transparent 50%),
    linear-gradient(120deg, #493321, #302014);
  border-radius: 24px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: inline-block;
  color: #E9A16B;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.poems-hero h1 {
  margin: 10px 0 8px;
  color: var(--poem-paper);
  font: 700 clamp(32px, 4.2vw, 46px)/1.2
    "Playfair Display", "Noto Sans Devanagari", serif;
}

.poems-hero > p {
  max-width: 590px;
  margin: 0 auto;
  color: #F0DFCE;
  font-size: 15px;
}

.hero-search {
  display: flex;
  align-items: center;
  width: min(100%, 620px);
  height: 57px;
  margin: 26px auto 0;
  padding: 5px 5px 5px 22px;
  background: var(--poem-paper);
  border-radius: 40px;
  box-shadow: 0 4px 18px #1D120B22;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--poem-ink);
  font-size: 14px;
}

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

.search-submit {
  display: grid;
  place-items: center;
  flex: 0 0 47px;
  width: 47px;
  height: 47px;
  border: 0;
  border-radius: 50%;
  background: var(--poem-accent);
  color: white;
}

.search-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.poem-stats {
  display: flex;
  justify-content: center;
  gap: 52px;
  margin-top: 26px;
}

.poem-stats div {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.poem-stats strong {
  font: 700 20px/1.35 "Playfair Display", serif;
  color: white;
}

.poem-stats span {
  font-size: 11px;
  letter-spacing: .7px;
  color: #E8C9A5;
}

/* TABS AND SORT */

.poems-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 12px;
}

.poem-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px;
  background: var(--poem-soft);
  border-radius: 30px;
}

.tab-button {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 30px;
  padding: 7px 15px;
  color: var(--poem-muted);
  background: transparent;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  text-decoration: none;
}

.tab-button:hover,
.tab-button.active {
  color: white;
  background: var(--poem-accent);
  border-color: var(--poem-accent);
}

#savedTotal {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 12px;
  background: var(--poem-soft);
  color: var(--poem-heading);
  font-size: 10px;
}

.tab-button.active #savedTotal {
  background: var(--poem-paper);
  color: var(--poem-heading);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: var(--poem-muted);
  font-size: 12px;
}

.sort-control select,
.filter-group select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--poem-ink);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 10px;
}

.sort-control select {
  width: auto;
  min-width: 155px;
  border-radius: 25px;
  padding: 8px 13px;
}

/* MAIN LAYOUT */

.poems-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.poem-filters {
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 20px;
  background: var(--poem-card);
  border: 1px solid var(--poem-border);
  border-radius: 17px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-heading h2,
.results-heading h2 {
  margin: 0;
  color: var(--poem-heading);
  font: 700 19px/1.35
    "Playfair Display", "Noto Sans Devanagari", serif;
}

.text-button {
  padding: 4px;
  border: 0;
  color: var(--poem-accent);
  background: transparent;
  font-size: 12px !important;
}

.filter-close {
  display: none;
  border: 0;
  background: transparent;
  font-size: 24px !important;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--poem-border);
}

.filter-group label {
  color: var(--poem-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.filter-group select {
  font-size: 13px;
}

.reset-button {
  width: 100%;
  padding: 10px;
  color: var(--poem-accent);
  background: var(--poem-soft);
  border: 1px solid var(--poem-border);
  border-radius: 10px;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.results-heading p {
  margin: 3px 0 0;
  color: var(--poem-muted);
  font-size: 13px;
}

.results-count {
  margin: 0 0 14px;
  color: var(--poem-muted);
  font-size: 13px;
}

/* POEM CARDS */

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

.poem-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 270px;
  padding: 20px;
  background: var(--poem-card);
  border: 1px solid var(--poem-border);
  border-radius: 19px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.poem-card:hover {
  transform: translateY(-2px);
  border-color: #D8B997;
  box-shadow: 0 8px 22px #4933210C;
}

.poem-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.poem-category {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  color: var(--poem-heading);
  background: var(--poem-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.poem-card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.poem-badge {
  padding: 3px 8px;
  border-radius: 18px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  color: white;
}

.trending-badge {
  background: #C9552A;
}

.poem-title-button {
  display: block;
  max-width: 100%;
  margin: 13px 0 8px;
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
}

.poem-title {
  margin: 0;
  color: var(--poem-heading);
  font: 700 18px/1.5
    "Playfair Display", "Noto Sans Devanagari", serif;
  overflow-wrap: anywhere;
}

.poem-title-button:hover .poem-title {
  color: var(--poem-accent);
}

.poem-preview-button {
  display: block;
  width: 100%;
  margin: 13px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.poem-preview-button:focus-visible {
  outline: 2px solid var(--poem-accent);
  outline-offset: 5px;
}

.poem-preview-button:hover .poem-title { color: var(--poem-accent); }
.poem-preview-button:hover .poem-excerpt { border-left-color: #C9552A; }

.poem-excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  min-height: 94px;
  margin: 0;
  padding-left: 11px;
  border-left: 2px solid var(--poem-accent);
  color: var(--poem-ink);
  font: 14px/1.9 "Noto Sans Devanagari", Inter, sans-serif;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.poem-preview-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 9px 0 0 11px;
  color: var(--poem-accent);
  font-size: 11px;
  font-weight: 700;
  opacity: .85;
  transition: gap .2s;
}

.poem-preview-button:hover .poem-preview-hint { gap: 9px; }

.poem-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--poem-border);
}

.poem-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--poem-accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.poem-author:hover,
.reader-poet:hover {
  text-decoration: underline;
}

.poem-author > span:last-child {
  overflow-wrap: anywhere;
}

.poet-avatar {
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid #B18A64;
  border-radius: 50%;
  color: var(--poem-heading);
  background: var(--poem-soft);
  font-family: "Playfair Display", serif;
  font-size: 13px;
}

.poem-save-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: var(--poem-accent);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 50%;
  font-size: 20px !important;
}

.poem-save-button.is-saved {
  color: #B33C46;
  background: #FFF0F1;
  border-color: #F0C6CA;
}

.poem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 10px;
  color: var(--poem-muted);
  font-size: 10px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 28px;
}

.load-more-button {
  padding: 11px 24px;
  color: var(--poem-heading);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 10px;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.load-more-button:hover {
  background: var(--poem-soft);
}

.load-more-button[hidden] {
  display: none;
}

.poems-empty {
  grid-column: 1 / -1;
  padding: 45px 20px;
  text-align: center;
  background: var(--poem-paper);
  border: 1px dashed var(--poem-border);
  border-radius: 12px;
}

.poems-empty h3 {
  margin: 0 0 8px;
  color: var(--poem-heading);
}

.poems-empty p {
  margin: 0;
  color: var(--poem-muted);
}

.mobile-filter-button {
  display: none;
  padding: 8px 12px;
  color: var(--poem-heading);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 9px;
  font-size: 12px !important;
}

/* POEM READER */

.poem-reader {
  --poem-ink: #30271F;
  --poem-heading: #493321;
  --poem-muted: #6B5846;
  --poem-paper: #FFFDF9;
  --poem-card: #FFFDF9;
  --poem-border: #E0D0B8;
  --poem-accent: #805633;
  --poem-soft: #F0E4D2;
  width: min(700px, calc(100% - 28px));
  max-width: 700px;
  max-height: 85dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;            /* scroll sirf .reader-body me: header / X hamesha upar tika rahe */
  color: var(--poem-ink);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 18px;
  box-shadow: 0 20px 80px #0003;
}

.poem-reader[open] {
  display: flex;
  flex-direction: column;
}

.poem-reader::backdrop {
  background: #1D1712A6;
  backdrop-filter: blur(3px);
  cursor: pointer;
}

/* Reader khula ho to peeche ka page scroll na ho */
html:has(.poem-reader[open]) {
  overflow: hidden;
}

/* Full width mode */
.poem-reader.is-full {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-radius: 0;
}

.poem-reader.is-full .reader-body {
  padding: 28px clamp(20px, 6vw, 96px) 40px;
}

.poem-reader.is-full .reader-content {
  max-width: none;
}

.reader-top {
  flex: 0 0 auto;              /* scroll par ghatega / hilega nahi */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--poem-border);
  background: var(--poem-paper);
  position: relative;
  z-index: 2;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  color: var(--poem-heading);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 999px;
  font-size: 12px !important;
  font-weight: 600;
  white-space: nowrap;
}

.reader-expand:hover,
.reader-close:hover {
  background: var(--poem-soft);
}

.reader-expand-icon {
  font-size: 15px;
  line-height: 1;
}

.reader-close {
  width: 36px;
  height: 36px;
  color: var(--poem-heading);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 50%;
  font-size: 23px !important;
}

.reader-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;            /* poem yahin scroll hoti hai */
  overscroll-behavior: contain;
  padding: 20px 32px 28px;
}

.reader-category {
  color: var(--poem-accent);
  font-size: 12px;
  font-weight: 700;
}

.reader-body h2 {
  margin: 9px 0;
  color: var(--poem-heading);
  font: 700 clamp(25px, 4vw, 34px)/1.4
    "Playfair Display", "Noto Sans Devanagari", serif;
}

.reader-poet {
  color: var(--poem-accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.reader-date {
  margin: 8px 0 22px;
  color: var(--poem-muted);
  font-size: 12px;
}

.reader-content {
  color: var(--poem-ink);
  font: 18px/2.1 "Noto Sans Devanagari", Inter, sans-serif;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.reader-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--poem-border);
}

.reader-tools button {
  padding: 8px 12px;
  color: var(--poem-heading);
  background: var(--poem-paper);
  border: 1px solid var(--poem-border);
  border-radius: 8px;
  font-size: 12px !important;
}

.reader-tools button:hover {
  background: var(--poem-soft);
}

/* TOAST */

.poem-toast {
  position: fixed;
  z-index: 9999;
  inset: auto 24px 24px auto;
  margin: 0;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: #fff;
  /* fallback colour: toast <main class="pathik"> ke bahar hai, isliye --poem-heading wahan nahi milta tha */
  background: var(--poem-heading, #493321);
  border: 0;
  border-radius: 9px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: none;
  animation: poemToastIn .22s ease-out;
}

@keyframes poemToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.poem-toast[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .poem-toast {
    inset: auto 12px 16px 12px;
    width: auto;
    text-align: center;
  }
}

/* Videos are browsed in the Poems page tab. */
.poem-video-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.poem-video-types[hidden],
.filter-group[hidden] { display: none !important; }

.poem-video-types button {
  border: 1px solid var(--poem-border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--poem-ink);
  background: var(--poem-paper);
  cursor: pointer;
  font: inherit;
}

.poem-video-types button.active {
  color: #fff;
  border-color: var(--poem-accent);
  background: var(--poem-accent);
}

.poems-grid.is-video-grid { align-items: start; }

.inline-video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--poem-border);
  border-radius: 18px;
  background: var(--poem-card);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.inline-video-card:hover, .inline-video-card:focus-visible {
  transform: translateY(-2px);
  border-color: #D8B997;
  box-shadow: 0 8px 22px #49332112;
  outline: none;
}

.inline-video-thumb {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  background: linear-gradient(135deg, #4b3323, #24170f);
  background-position: center;
  background-size: cover;
}

.inline-video-thumb::before { position: absolute; inset: 0; content: ""; background: #120b0660; }
.inline-video-badge { position: absolute; z-index: 1; top: 12px; left: 12px; border-radius: 999px; padding: 5px 9px; color: #352315; background: #f5e5cc; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.inline-video-badge.is-event { color: #25432c; background: #dcebd9; }
.inline-video-play { position: relative; z-index: 1; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: #fff; background: #24170fce; font-size: 22px; }
.inline-video-body { padding: 15px 16px 16px; }
.inline-video-body h3 { margin: 0; color: var(--poem-heading); font-size: 17px; line-height: 1.45; }
.inline-video-body p { margin: 7px 0 12px; color: var(--poem-muted); font-size: 13px; }
.inline-video-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--poem-muted); font-size: 11px; }

.poem-video-reader {
  box-sizing: border-box;
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  height: min(780px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--poem-border);
  border-radius: 20px;
  color: #30271F;
  background: #FFFDF9;
}
.poem-video-reader[open] { display: grid; }
.poem-video-reader::backdrop { background: #17100bd9; }
.poem-video-reader-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; padding: 16px 22px 12px; }
.poem-video-reader-top h2 { margin: 5px 0 2px; color: var(--poem-heading); font-size: clamp(19px, 3vw, 26px); }
.poem-video-reader-top p { margin: 0; color: var(--poem-muted); font-size: 13px; }
.poem-video-reader-stage { display: grid; width: 100%; min-width: 0; min-height: 0; place-items: center; background: #160f0a; }
.poem-video-reader-stage iframe, .poem-video-reader-stage video { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; border: 0; object-fit: contain; }
.poem-video-reader-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; padding: 10px 22px 14px; color: var(--poem-muted); line-height: 1.5; }
.inline-video-locked { padding: 28px; color: #fff; text-align: center; }
.inline-video-locked > span { font-size: 30px; }
.inline-video-locked h3 { margin: 8px 0; }
.inline-video-locked p { color: #e7d8c9; }
.inline-video-locked a { display: inline-block; margin-top: 6px; border-radius: 999px; padding: 10px 18px; color: #fff; background: #805330; text-decoration: none; }

@media (max-width: 760px) {
  .poems-grid.is-video-grid { grid-template-columns: 1fr; }
  .poem-video-reader { width: calc(100vw - 20px); height: min(700px, calc(100dvh - 20px)); border-radius: 15px; }
  .poem-video-reader-top { padding: 13px 16px 10px; }
  .poem-video-reader-description { padding: 9px 16px 12px; }
}

/* SELECT DROPDOWNS */

.pathik select,
.pathik option {
  color: var(--poem-ink);
  background-color: var(--poem-paper);
}

.pathik select:focus {
  border-color: var(--poem-accent);
  box-shadow: 0 0 0 3px var(--poem-soft);
}

.pathik option:checked {
  color: white;
  background-color: var(--poem-accent);
}

/* RESPONSIVE: TABLETS */

@media (min-width: 1500px) {
  .pathik {
    width: min(calc(100% - 64px), 1400px);
  }
}

@media (max-width: 1100px) {
  .poems-layout {
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 20px;
  }

  .poems-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .poem-card {
    padding: 17px;
  }

  .poems-hero {
    min-height: 390px;
  }
}

/* RESPONSIVE: MOBILE */

@media (max-width: 760px) {
  .pathik {
    width: calc(100% - 28px);
    padding-top: 14px;
  }

  .poems-hero {
    min-height: 0;
    padding: 42px 18px 32px;
    border-radius: 19px;
  }

  .poems-hero h1 {
    font-size: clamp(29px, 7vw, 40px);
  }

  .poems-hero > p {
    font-size: 13px;
  }

  .hero-search {
    height: 52px;
    margin-top: 22px;
    padding-left: 16px;
  }

  .search-submit {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .poem-stats {
    gap: 35px;
    margin-top: 22px;
  }

  .poem-stats strong {
    font-size: 19px;
  }

  .poems-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 16px;
  }

  .poem-tabs {
    width: 100%;
    gap: 3px;
    padding: 4px;
  }

  .tab-button {
    padding: 7px 10px;
    font-size: 12px !important;
  }

  .sort-control {
    width: 100%;
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
    max-width: 220px;
  }

  .poems-layout {
    display: block;
  }

  .poem-filters {
    position: fixed;
    z-index: 1000;
    inset: 0 0 0 auto;
    width: min(340px, 90vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    border-radius: 0;
    transform: translateX(110%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
  }

  .poem-filters.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .filter-close,
  .mobile-filter-button {
    display: inline-block;
  }

  .results-heading h2 {
    font-size: 18px;
  }

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

  .poem-card {
    min-height: 0;
    padding: 14px;
    border-radius: 15px;
  }

  .poem-title {
    font-size: 16px;
  }

  .poem-excerpt {
    min-height: 0;
    font-size: 13px;
    line-height: 1.8;
    -webkit-line-clamp: 4;
  }

  .poem-meta {
    font-size: 10px;
    gap: 4px 8px;
  }

  .poem-author {
    font-size: 11px;
  }

  .poet-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .poem-save-button {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .reader-body {
    padding: 22px 20px 25px;
  }

  .reader-top {
    padding: 14px 18px;
  }

  .reader-expand-text {
    display: none;             /* chhoti screen par sirf icon */
  }

  .reader-expand {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}

/* RESPONSIVE: SMALL PHONES */

@media (max-width: 480px) {
  .pathik {
    width: calc(100% - 20px);
  }

  .poems-hero {
    padding: 35px 15px 27px;
  }

  .poems-hero h1 {
    font-size: 29px;
  }

  .poems-hero > p {
    font-size: 12px;
  }

  .poem-stats {
    gap: 28px;
  }

  .poem-stats span {
    font-size: 10px;
  }

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

  .tab-button {
    padding: 7px 8px;
    font-size: 11px !important;
  }

  .poems-grid {
    grid-template-columns: 1fr;
  }

  .poem-card {
    padding: 17px;
  }

  .poem-title {
    font-size: 18px;
  }

  .poem-excerpt {
    font-size: 14px;
    min-height: 0;
    -webkit-line-clamp: 4;
  }

  .poem-meta {
    font-size: 11px;
  }

  .results-heading p {
    font-size: 12px;
  }

  .reader-content {
    font-size: 16px;
  }

  .reader-body {
    padding: 20px 16px;
  }

  .reader-tools button {
    padding: 8px 10px;
  }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* ==========================================
   FREE / PREMIUM (locked poems)
   ========================================== */

.premium-badge {
  background: #805633;
  color: #fff;
}

.poem-lock-bars {
  display: grid;
  gap: 9px;
  margin: 14px 0 6px;
  filter: blur(1.5px);
}

.poem-lock-bars i {
  display: block;
  height: 9px;
  border-radius: 99px;
  background: #E8D9C3;
}

.poem-lock-bars i:nth-child(1) { width: 100%; }
.poem-lock-bars i:nth-child(2) { width: 72%; }
.poem-lock-bars i:nth-child(3) { width: 90%; }

.poem-lock-bars-sm { margin: 8px 0 4px; }

.poem-lock-mini,
.poem-lock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--poem-muted, #6B5846);
  font-size: 13px;
}

.poem-lock-mini svg,
.poem-lock-note svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.poem-lock {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed #E0D0B8;
}

.poem-lock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.poem-lock-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 99px;
  background: #805633;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.poem-lock-btn:hover { background: #6a4529; }

.poem-lock-link {
  color: #493321;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.poem-lock-link:hover { text-decoration: underline; }

/* ---- Bina-JS filters panel (checkbox + label), tabs/links ko buttons jaisa dikhana ---- */
a.tab-button, a.poem-preview-button, a.load-more-button, a.text-button { text-decoration: none; color: inherit; }
a.poem-preview-button { display: block; }
.poem-save-button { cursor: pointer; text-decoration: none; }
.load-more-wrap { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
@media (max-width: 1100px) {
  .filters-toggle:checked ~ .poem-filters { transform: translateX(0); visibility: visible; }
}

/* ---- Kavita card: saaf layout (bina-JS version ke liye) ---------------------------------
   Links ke neeche line nahi; card ek jaise unche; title 2 line, kavita ka ansh 4 line,
   "कविता पढ़ें" ek chhota pill, neeche lekhak + save + meta. */
.poems-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; align-items: stretch; }
.pathik a { text-decoration: none; }
.poem-card { min-height: 0; padding: 20px 20px 16px; gap: 0; position: relative; }
.poem-card::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, #B5694A, #A8793A); opacity: .0; transition: opacity .25s; }
.poem-card:hover::before { opacity: 1; }
.poem-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -14px #49332155; }

a.poem-preview-button { margin: 14px 0 0; display: flex; flex-direction: column; flex: 1; }
.poem-title {
  margin: 0 0 10px; font-family: "Tiro Devanagari Hindi", "Noto Serif Devanagari", "Playfair Display", Georgia, serif;
  font-weight: 400; font-size: 1.22rem; line-height: 1.4; color: var(--poem-heading);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none;
}
.poem-excerpt {
  min-height: 0; flex: 1; margin: 0; padding: 2px 0 2px 13px;
  border-left: 3px solid #E3C9A9; -webkit-line-clamp: 4;
  font: 400 .95rem/1.85 "Noto Sans Devanagari", Inter, sans-serif; color: #4a3a2b;
}
.poem-preview-button:hover .poem-excerpt { border-left-color: #B5694A; }
.poem-preview-hint {
  align-self: flex-start; margin: 14px 0 0; padding: 6px 13px; border-radius: 999px;
  background: var(--poem-soft); color: var(--poem-heading); font-size: .78rem; font-weight: 700; opacity: 1;
  transition: background-color .2s, color .2s, gap .2s;
}
.poem-preview-button:hover .poem-preview-hint { background: #805633; color: #fff; }

/* sirf sadasyon ke liye wali pankti: halka dhundhla + ek saaf lock-patti */
.lock-blur { margin: 12px 0 0; padding: 0 2px; display: grid; gap: 2px; filter: blur(3.5px); opacity: .55; font-size: .85rem; line-height: 1.6; color: #4a3a2b; user-select: none; pointer-events: none; }
.poem-lock-mini { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; background: #F7EFE2; border: 1px dashed #D9C7AE; font-size: .8rem; font-weight: 600; }
.poem-lock-mini a { color: #805633; }
.poem-lock-mini a:hover { text-decoration: underline; }

.poem-card-footer { margin-top: 14px; }
.poem-author { color: var(--poem-heading); }
.poem-author:hover { text-decoration: none; color: #805633; }
.poem-save-button { display: grid; place-items: center; line-height: 1; transition: background-color .2s, transform .2s; }
.poem-save-button:hover { background: var(--poem-soft); transform: scale(1.06); }
.poem-meta { gap: 4px 12px; font-size: .72rem; }

/* sort form: "लागू करें" ab chhota button */
.sort-control .text-button { padding: 7px 14px; border-radius: 999px; background: #805633; color: #fff; font-size: .78rem; font-weight: 700; border: 0; cursor: pointer; text-decoration: none; }
.sort-control .text-button:hover { background: #6a4529; }
.results-heading h2 { font-family: "Tiro Devanagari Hindi", "Noto Serif Devanagari", "Playfair Display", Georgia, serif; font-weight: 400; }
