/* ============================================================
   PRAYAS PUBLICATIONS PAGE
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  color: #1f2933;
  background: #f6f7fb;
  font-family: "Segoe UI", Arial, sans-serif;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 12px clamp(16px, 4vw, 48px);
  background: #9e1b1b;
  box-shadow: 0 10px 28px rgba(98, 17, 17, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.brand span {
  min-width: 0;
  color: #fff;
  font-size: clamp(15px, 2.1vw, 22px);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topbar a:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.publications-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  width: 100%;
  padding: clamp(46px, 7vw, 86px) clamp(18px, 5vw, 72px) clamp(32px, 5vw, 60px);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.93), rgba(255, 246, 233, 0.86)),
    url("../IMAGES/Prayas/logo.jpg") right 8% center / min(38vw, 360px) no-repeat;
}

.hero-copy {
  max-width: 760px;
}

.kicker {
  margin: 0 0 10px;
  color: #9e1b1b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  color: #17202a;
  font-weight: 850;
  line-height: 1.05;
}

.hero-copy h1 {
  font-size: clamp(42px, 8vw, 84px);
}

.hero-copy p:last-child {
  max-width: 650px;
  margin: 18px 0 0;
  color: #46525f;
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.7;
}

.hero-panel {
  padding: 22px;
  border: 1px solid #eadfd6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 45px rgba(89, 42, 26, 0.12);
}

.hero-panel span,
.hero-panel small {
  display: block;
  color: #66717f;
}

.hero-panel strong {
  display: block;
  margin: 8px 0;
  color: #9e1b1b;
  font-size: 34px;
  line-height: 1.1;
}

.pub-section {
  width: 100%;
  padding: clamp(26px, 5vw, 56px) clamp(14px, 4vw, 52px) 64px;
}

.pub-container {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.pub-subsection {
  margin-top: 28px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.06);
}

.subsection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.subsection-header-with-image {
  align-items: center;
  justify-content: flex-start;
}

.subsection-image {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.14);
}

.subsection-header h3 {
  margin: 0;
  color: #1f2933;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.2;
}

.subsection-header p {
  margin: 6px 0 0;
  color: #697586;
  line-height: 1.5;
}

.pub-count {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff3e8;
  color: #9e1b1b;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 18px;
}

.pub-book-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.pub-book-card:hover {
  transform: translateY(-3px);
  border-color: #d6c4b4;
  box-shadow: 0 16px 34px rgba(31, 41, 51, 0.12);
}

.pub-book-image-container {
  flex: 0 0 118px;
  min-height: 100%;
  background: #f1f3f6;
}

.pub-book-image,
.pub-book-placeholder {
  width: 100%;
  height: 100%;
  min-height: 224px;
}

.pub-book-image {
  object-fit: cover;
}

.pub-book-placeholder {
  display: grid;
  place-items: center;
  padding: 16px;
  color: #9e1b1b;
  background:
    linear-gradient(150deg, rgba(158, 27, 27, 0.12), rgba(241, 166, 68, 0.12)),
    #faf4ed;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.pub-book-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
}

.pub-book-name {
  margin: 0 0 5px;
  color: #18212f;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pub-book-author,
.pub-book-description {
  color: #66717f;
  line-height: 1.45;
}

.pub-book-author {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.pub-book-description {
  margin: 0 0 14px;
  font-size: 13px;
}

.pub-book-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: auto 0 12px;
}

.pub-meta-item {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: #f6f7fb;
}

.pub-meta-label,
.pub-meta-value {
  display: block;
}

.pub-meta-label {
  margin-bottom: 2px;
  color: #697586;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pub-meta-value {
  color: #1f2933;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pub-book-rate {
  margin-bottom: 8px;
  color: #0f7a45;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.pub-book-stock {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.pub-stock-available {
  color: #0f7a45;
}

.pub-stock-warning {
  color: #bd1f2d;
}

.pub-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pub-btn,
.pub-show-more-btn {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  touch-action: manipulation;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 10px;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

.pub-btn:hover,
.pub-show-more-btn:hover {
  transform: translateY(-1px);
}

.pub-btn-pdf {
  background: #2d6cdf;
}

.pub-btn-order {
  background: #0f7a45;
}

.pub-btn-disabled,
.pub-btn:disabled {
  background: #aab3bf;
  cursor: not-allowed;
}

.pub-loading,
.pub-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #697586;
  text-align: center;
}

.pub-spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border: 4px solid #edf0f4;
  border-top-color: #9e1b1b;
  border-radius: 50%;
  animation: pub-spin 0.9s linear infinite;
}

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

.pub-error {
  padding: 16px;
  border-left: 4px solid #bd1f2d;
  border-radius: 6px;
  background: #fff0f1;
  color: #9f1824;
}

.pub-show-more-container {
  margin-top: 22px;
  text-align: center;
}

.pub-show-more-btn {
  min-height: 42px;
  padding: 12px 28px;
  background: #9e1b1b;
  color: #fff;
  font-size: 14px;
}

.footer {
  width: 100%;
  margin-top: 0;
  background: #9e1b1b;
  color: #fff;
}

.footer-container {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px 18px;
}

.footer-top {
  text-align: center;
}

.footer-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.footer-brand {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.footer-description {
  color: #ffe7e0;
  line-height: 1.5;
}

.footer-middle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.footer-column h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-column li {
  margin-bottom: 7px;
}

.footer a {
  color: #ffe7e0;
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  background: #7f1414;
  padding: 14px 18px;
}

.footer-bottom-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.footer-bottom p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.45;
}

.footer-created-by {
  color: #ffd8cf;
}

.footer-links {
  flex: 0 0 auto;
}

.separator {
  color: #ffd8cf;
  margin: 0 6px;
}

@media (max-width: 820px) {
  .publications-hero {
    grid-template-columns: 1fr;
    background-size: 260px;
    background-position: right -80px top 18px;
  }

  .hero-panel {
    max-width: 360px;
  }

  .pub-book-card {
    flex-direction: column;
  }

  .pub-book-image-container {
    flex-basis: auto;
  }

  .pub-book-image,
  .pub-book-placeholder {
    height: 210px;
    min-height: 210px;
  }
}

@media (max-width: 640px) {
  body {
    background: #fff;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1 1 auto;
    gap: 9px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand span {
    font-size: 14px;
    line-height: 1.15;
  }

  .topbar a {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .publications-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 28px 14px 22px;
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 239, 0.93)),
      url("../IMAGES/Prayas/logo.jpg") right -70px top 8px / 190px no-repeat;
  }

  .kicker {
    margin-bottom: 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy p:last-child {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
  }

  .hero-panel {
    width: 100%;
    max-width: none;
    padding: 14px 16px;
  }

  .hero-panel strong {
    margin: 4px 0;
    font-size: 25px;
  }

  .pub-section {
    padding: 22px 10px 42px;
  }

  .section-heading {
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  .pub-subsection {
    margin-top: 16px;
    padding: 13px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .subsection-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 13px;
  }

  .subsection-header-with-image {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .subsection-image {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .subsection-header h3 {
    font-size: 20px;
  }

  .subsection-header p {
    font-size: 13px;
    line-height: 1.45;
  }

  .pub-count {
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
    text-align: left;
  }

  .pub-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pub-book-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
    overflow: visible;
    border-radius: 8px;
  }

  .pub-book-card:hover {
    transform: none;
  }

  .pub-book-image-container {
    min-height: auto;
  }

  .pub-book-image,
  .pub-book-placeholder {
    height: 100%;
    min-height: 100%;
    aspect-ratio: auto !important;
  }

  .pub-book-content {
    min-width: 0;
    padding: 11px;
  }

  .pub-book-name {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .pub-book-author {
    margin-bottom: 0;
    font-size: 12px;
  }

  .pub-book-description {
    display: none;
  }

  .pub-book-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0;
  }

  .pub-meta-item {
    padding: 6px;
  }

  .pub-meta-label {
    font-size: 10px;
  }

  .pub-meta-value {
    font-size: 12px;
  }

  .pub-book-rate {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .pub-book-stock {
    margin-bottom: 8px;
    font-size: 12px;
  }

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

  .pub-btn,
  .pub-show-more-btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .pub-loading,
  .pub-empty {
    min-height: 140px;
  }

  .footer-container {
    padding: 24px 14px;
  }

  .footer-logo {
    width: 62px;
    height: 62px;
  }

  .footer-brand {
    font-size: 17px;
  }

  .footer-description {
    font-size: 13px;
    line-height: 1.45;
  }

  .footer-middle {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-bottom {
    padding: 12px 14px;
  }

  .footer-bottom-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-links {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brand span {
    font-size: 12px;
  }

  .topbar a {
    padding: 7px 9px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .pub-book-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .pub-book-content {
    padding: 9px;
  }

  .pub-book-name {
    font-size: 14px;
  }

  .pub-book-image,
  .pub-book-placeholder {
    height: 100%;
    min-height: 100%;
  }

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

  .pub-buttons {
    grid-template-columns: 1fr;
  }
}

/* Compact section spacing */
.publications-hero {
  gap: clamp(14px, 2.8vw, 28px) !important;
  padding-block: clamp(28px, 4.5vw, 50px) !important;
}

.pub-section {
  padding-block: clamp(22px, 3.6vw, 40px) !important;
}

.section-heading {
  margin-bottom: clamp(12px, 2vw, 18px) !important;
}

.pub-subsection {
  margin-top: clamp(16px, 2.6vw, 22px) !important;
  padding: clamp(14px, 2.4vw, 22px) !important;
}

.subsection-header {
  gap: clamp(10px, 2vw, 14px) !important;
  margin-bottom: clamp(10px, 2vw, 14px) !important;
}

.pub-grid,
.footer-middle,
.footer-bottom-container {
  gap: clamp(12px, 2vw, 18px) !important;
}

.footer {
  padding-block: clamp(18px, 3vw, 32px) !important;
}

.footer-middle {
  margin-top: clamp(14px, 2.4vw, 20px) !important;
}

@media (max-width: 640px) {
  .publications-hero,
  .pub-section {
    padding-block: clamp(18px, 5vw, 30px) !important;
  }

  .pub-subsection {
    margin-top: 14px !important;
  }
}
