/* ===================================================
   ICPalestina – Demands Page Styles
   =================================================== */

.demands-hero {
  padding-bottom: 4.5rem;
}

.demands-hero-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,168,75,0.45);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 1.25rem;
  position: relative;
  background: rgba(212,168,75,0.06);
}

.demands-hero-mark::before {
  content: '';
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(212,168,75,0.16);
  border-radius: 50%;
}

.demands-section {
  background:
    linear-gradient(to bottom, var(--white) 0%, var(--cream) 100%);
  min-height: 700px;
  padding: 3rem 2rem;
}

.demands-section .section-header {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Signed by: fixed label + continuously moving logos ── */
.signatories {
  max-width: 1120px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 18px var(--shadow);
  overflow: hidden;
}

.signatories-label {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: var(--green);
  color: var(--white);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

body.lang-ar .signatories-label {
  font-family: 'Noto Naskh Arabic', serif;
}

.signatories-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 1rem 0;
  /* soft fade at both ends */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.signatories-track {
  display: flex;
  width: max-content;
  list-style: none;
  animation: signatories-scroll calc(var(--logo-count, 10) * 3s) linear infinite;
}

/* Arabic: the label is on the right, so the logos move towards the right */
body.lang-ar .signatories-track {
  animation-name: signatories-scroll-rtl;
}

.signatories:hover .signatories-track {
  animation-play-state: paused;
}

/* A margin instead of a gap keeps both copies exactly the same width, so the loop is seamless */
.signatories-track li {
  flex-shrink: 0;
  width: 150px;
  height: 90px;
  margin-inline-end: 1.25rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--cream);
  border-radius: 6px;
}

.signatories-track img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@keyframes signatories-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes signatories-scroll-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

.document-card {
  max-width: 1120px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 30px var(--shadow);
  overflow: hidden;
}

.document-toolbar {
  min-height: 82px;
  padding: 1rem 1.25rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.document-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.document-icon {
  width: 42px;
  height: 48px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-mid);
  color: var(--white);
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(160,30,34,0.16);
}

.document-icon i {
  font-size: 1.1rem;
}

.document-info > div:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.document-info strong {
  color: var(--text-dark);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.35;
}

.document-info span {
  color: var(--text-muted);
  font-size: 0.73rem;
  margin-top: 0.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demands-download {
  flex-shrink: 0;
  padding: 0.7rem 1.2rem;
}

.pdf-viewer-wrap {
  position: relative;
  background: #d9d4ca;
  min-height: 780px;
}

.pdf-viewer {
  display: block;
  width: 100%;
  height: 780px;
  border: 0;
  background: #fff;
}

.pdf-loading {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--cream);
  pointer-events: none;
}

.pdf-viewer {
  position: relative;
  z-index: 1;
}

.pdf-fallback {
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--cream);
  font-size: 0.78rem;
  text-align: center;
}

.pdf-fallback i {
  color: var(--red-mid);
}

/* The document drawn page by page, for browsers without a PDF viewer of their own (see pdf-viewer.js) */
.pdf-pages {
  display: none;
  background: #d9d4ca;
  padding: 0.75rem;
  max-height: 780px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pdf-pages .pdf-page {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 0.75rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.pdf-pages .pdf-page:last-child {
  margin-bottom: 0;
}

.pdf-drawn .pdf-viewer {
  display: none;
}

.pdf-drawn .pdf-pages {
  display: block;
}

/* Room for the spinner while the first page is still being drawn */
.pdf-drawn .pdf-pages:empty {
  min-height: 60vh;
}

/* The document as a button, when it cannot be drawn either (see demands.js) */
.pdf-unavailable {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  background: var(--cream);
}

.pdf-unavailable i {
  font-size: 2.5rem;
  color: var(--red-mid);
}

.pdf-unavailable p {
  margin: 0;
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.no-inline-pdf .pdf-viewer,
.no-inline-pdf .pdf-loading,
.no-inline-pdf .pdf-fallback {
  display: none;
}

.no-inline-pdf .pdf-unavailable {
  display: flex;
}

.no-inline-pdf {
  min-height: 0;
}

/* Without scripts nothing can be drawn, so the button is offered on small screens */
@media (max-width: 768px) {
  .pdf-viewer-wrap .pdf-viewer,
  .pdf-viewer-wrap .pdf-loading,
  .pdf-viewer-wrap .pdf-fallback {
    display: none;
  }

  .pdf-viewer-wrap .pdf-unavailable {
    display: flex;
  }

  /* ... unless the pages are being drawn after all, with the spinner until the first one is ready */
  .pdf-drawn .pdf-unavailable {
    display: none;
  }

  .pdf-drawn .pdf-loading {
    display: flex;
  }

  .pdf-drawn .pdf-pages {
    max-height: none;
    padding: 0.5rem;
  }
}

@media (max-width: 600px) {
  .signatories {
    flex-direction: column;
    align-items: stretch;
  }

  .signatories-label {
    justify-content: center;
    padding: 0.6rem 1rem;
  }

  .signatories-track li {
    width: 120px;
    height: 76px;
  }
}

@media (max-width: 768px) {
  .demands-hero {
    padding-top: 4rem;
    padding-bottom: 3.5rem;
  }

  .demands-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .document-toolbar {
    padding: 1rem;
    align-items: stretch;
    flex-direction: column;
  }

  .document-info {
    justify-content: center;
  }

  .demands-download {
    width: 100%;
    justify-content: center;
  }

  .pdf-viewer-wrap {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .document-card {
    border-radius: 6px;
  }

  .pdf-unavailable {
    padding: 2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demands-hero-mark::before {
    animation: none;
  }

  /* No movement: show the logos once and let visitors scroll through them */
  .signatories-track {
    animation: none;
  }

  .signatories-viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .signatories-copy {
    display: none !important;
  }
}

/* Shown when no document has been uploaded for this language (see DemandsController) */
.demands-no-document {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.demands-no-document i {
  font-size: 2.5rem;
  color: var(--red-mid);
  margin: 1rem auto;
  display: block;
}

.demands-no-document p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.demands-other-language {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.demands-other-language:hover {
  background: var(--cream);
}
