
/* ==========================================
   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 {
  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;
}

.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;
}

.video-badge {
  background: var(--poem-accent);
}

.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-excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  min-height: 94px;
  margin: 0 0 15px;
  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-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 {
  width: min(700px, calc(100% - 28px));
  max-width: 700px;
  max-height: 85dvh;
  padding: 0;
  overflow: auto;
  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::backdrop {
  background: #1D1712A6;
  backdrop-filter: blur(3px);
}

.reader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--poem-border);
}

.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 {
  padding: 28px 32px 32px;
}

.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;
  right: 24px;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: white;
  background: var(--poem-heading);
  border-radius: 9px;
  box-shadow: 0 8px 28px #0002;
  font-size: 13px;
}

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

/* 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;
  }
}

/* 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;
  }
}

