/* PaliAnswers — Communicating Palestine identity
   Palette: Caribbean Current #055F6A · Imperial Red #EF3F48 · Raisin Black #282727 · Platinum #E8E8E8
   Type: Jaapokki (display) · Cairo (body) */

@font-face {
  font-family: "Jaapokki";
  src: url("/fonts/jaapokki.woff2") format("woff2"),
       url("https://fonts.cdnfonts.com/s/19687/Jaapokki-Regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

:root {
  --teal: #055F6A;
  --teal-dark: #04424a;
  --red: #EF3F48;
  --red-dark: #d32f38;
  --ink: #282727;
  --platinum: #E8E8E8;
  --paper: #fbfbfa;
  --card: #ffffff;
  --muted: #6b6a68;
  --radius: 14px;
  --font-body: "Cairo", system-ui, -apple-system, sans-serif;
  --font-display: "Jaapokki", "Cairo", sans-serif;
  --shadow: 0 1px 2px rgba(40,39,39,.06), 0 8px 24px rgba(40,39,39,.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(5,95,106,.07), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(239,63,72,.05), transparent 55%),
    var(--paper);
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  max-width: 980px; margin: 0 auto; padding: 22px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 9px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem; letter-spacing: .02em; color: var(--ink); text-transform: uppercase;
}
.site-header nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-link {
  font-weight: 700; text-decoration: none; color: var(--teal);
  border: 2px solid var(--teal); border-radius: 999px; padding: 8px 18px;
  transition: all .15s ease;
  white-space: nowrap;   /* without this it wraps to three lines and becomes a circle on a 320px screen */
}
.nav-link:hover { background: var(--teal); color: #fff; }
.nav-link.outbound { color: var(--muted); border-color: var(--platinum); }
.nav-link.outbound:hover { background: var(--muted); color: #fff; }

main { max-width: 980px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- hero / search ---------- */
.hero { text-align: center; padding: 34px 0 8px; }
.eyebrow {
  color: var(--red); font-weight: 800; text-transform: uppercase;
  letter-spacing: .14em; font-size: .8rem; margin: 0 0 10px;
}
.hero-title {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(2.1rem, 6vw, 3.4rem); letter-spacing: .015em;
  margin: 0 0 14px; color: var(--teal);
}
.hero-sub { max-width: 640px; margin: 0 auto 28px; color: var(--ink); }

#search-form { max-width: 640px; margin: 0 auto; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--platinum);
  border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(5,95,106,.25); }
.search-icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
#search-input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink); min-width: 0; padding: 10px 4px;
}
#search-input::placeholder { color: #9b9995; }
#search-button {
  /* --red-dark, not --red, as the background: white text on --red is only
     3.84:1 (fails WCAG AA's 4.5:1 for normal-weight-size text); --red-dark
     clears 4.5:1. --red stays reserved for non-text/decorative use. Hover
     darkens further via filter (multiplicative, so contrast only improves)
     rather than swapping to a lighter shade. */
  font: inherit; font-weight: 800; color: #fff; background: var(--red-dark);
  border: 0; border-radius: 999px; padding: 11px 26px; cursor: pointer;
  transition: filter .15s ease;
}
#search-button:hover { filter: brightness(0.9); }
.btn-short { display: none; }
.trust-line { margin: 18px auto 0; font-size: .875rem; color: var(--muted); }
.trust-line strong { font-weight: 600; }

/* ---------- results ---------- */
.results { margin-top: 34px; }
.state-header h2, .state-card h2 {
  font-family: var(--font-display); text-transform: uppercase;
  color: var(--teal); letter-spacing: .02em; margin: 0 0 4px; font-size: 1.45rem;
}
.state-lead { margin: 0; font-weight: 700; }
.state-hint { margin: 2px 0 18px; color: var(--muted); font-size: .875rem; }
.state-card {
  background: var(--card); border: 1px solid var(--platinum);
  border-left: 5px solid var(--teal); border-radius: var(--radius);
  padding: 22px 26px; box-shadow: var(--shadow);
}
.state-card ul { margin: 6px 0; padding-left: 22px; }

/* accordion cards (search results + browse) */
.myth-card {
  background: var(--card); border: 1px solid var(--platinum);
  border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow);
  overflow: hidden;
}
.myth-card.open { border-color: var(--teal); }
.myth-toggle {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink); padding: 16px 18px;
}
.myth-toggle:hover { background: rgba(5,95,106,.045); }
.myth-claim { flex: 1; font-weight: 700; line-height: 1.45; }
.score-pill {
  flex: none; font-size: .78rem; font-weight: 800; color: var(--teal);
  background: rgba(5,95,106,.09); border-radius: 999px; padding: 3px 10px;
}
.chevron {
  flex: none; width: 20px; height: 20px; color: var(--teal);
  transition: transform .2s ease;
}
.myth-card.open .chevron { transform: rotate(180deg); }
.myth-panel { display: none; padding: 0 18px 18px; }
.myth-card.open .myth-panel { display: block; }

.themes-row { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.theme-chip {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--teal); background: rgba(5,95,106,.08); border-radius: 999px; padding: 3px 10px;
}

.answers-label {
  font-size: .78rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--red); margin: 10px 0 6px;
}
.answer {
  position: relative;
  border-top: 1px solid var(--platinum); padding: 14px 0 10px;
}
.answer:first-of-type { border-top: 0; }
.answer-body p { margin: 0 0 10px; }
.answer-body a { word-break: break-word; }
.answer-tools { display: flex; justify-content: flex-end; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: .8rem; font-weight: 700; color: var(--teal);
  background: none; border: 1.5px solid var(--platinum); border-radius: 999px;
  padding: 4px 14px; cursor: pointer; transition: all .15s ease;
}
.copy-btn:hover { border-color: var(--teal); background: rgba(5,95,106,.05); }
.copy-btn.copied { color: #fff; background: var(--teal); border-color: var(--teal); }

.sources-block { margin-top: 14px; }
.sources-toggle {
  font: inherit; font-size: .95rem; font-weight: 800; color: var(--red);
  background: none; border: 0; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.sources-list { display: none; margin: 10px 0 0; padding-left: 18px; font-size: .82rem; color: var(--muted); }
.sources-block.open .sources-list { display: block; }
.sources-list li { margin-bottom: 6px; }

/* ---------- browse ---------- */
.browse-header { text-align: center; padding: 26px 0 12px; }
.browse-header h1 {
  font-family: var(--font-display); text-transform: uppercase;
  color: var(--teal); font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 6px;
}
.browse-header p { margin: 0; color: var(--muted); }
.theme-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 22px 0 26px;
}
.theme-tab, .crawl-theme-list a {
  font: inherit; font-size: .86rem; font-weight: 700;
  border: 1.5px solid var(--platinum); border-radius: 999px; padding: 7px 16px;
  transition: all .15s ease;
}
.theme-tab { cursor: pointer; color: var(--teal); background: var(--card); }
.theme-tab:hover { border-color: var(--teal); }
.theme-tab[aria-selected="true"] { color: #fff; background: var(--teal); border-color: var(--teal); }
.show-all-wrap { text-align: center; margin: 18px 0 4px; }
.show-all-btn {
  font: inherit; font-weight: 800; color: var(--teal); background: none;
  border: 2px solid var(--teal); border-radius: 999px; padding: 9px 24px; cursor: pointer;
  transition: all .15s ease;
}
.show-all-btn:hover { background: var(--teal); color: #fff; }

/* ---------- misc ---------- */
.loading { text-align: center; color: var(--muted); padding: 30px 0; }
.loading::after { content: "…"; animation: dots 1.2s infinite; }
@keyframes dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } 100% { content: "..."; } }

.site-footer {
  border-top: 1px solid var(--platinum); text-align: center;
  padding: 26px 20px 40px; font-size: .82rem; color: var(--muted);
}
.site-footer p { margin: 4px 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--teal); }

/* Crawlable theme links beneath the search hero -- ordinary <a> tags so
   the theme/myth pages aren't orphaned from the site's own link graph. */
.crawl-themes {
  max-width: 760px; margin: 8px auto 0; padding: 20px; text-align: center;
  border-top: 1px solid var(--platinum);
}
.crawl-themes h2 {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  font-size: 1.15rem; margin: 0 0 8px; color: var(--teal);
}
.crawl-themes > p { margin: 0 0 12px; color: var(--muted); font-size: .875rem; }
.crawl-theme-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 8px 10px;
}
.crawl-theme-list a { display: inline-block; color: var(--ink); text-decoration: none; }
.crawl-theme-list a:hover { border-color: var(--teal); color: var(--teal); }

@media (max-width: 560px) {
  .search-box { flex-wrap: nowrap; }
  #search-button { padding: 10px 18px; }
  /* "Find responses" leaves too little room for the placeholder to read on a
     phone-width input; "Search" says the same thing in a third of the space. */
  .btn-full { display: none; }
  .btn-short { display: inline; }
  .myth-toggle { padding: 14px; gap: 10px; }
  .score-pill { display: none; }

  /* 14 themes stacked one per line pushed every myth below the fold. A single
     horizontal strip keeps the content reachable without losing any theme. */
  .theme-tabs {
    flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    margin-inline: -20px; padding: 2px 20px 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .theme-tabs::-webkit-scrollbar { display: none; }
  .theme-tab { flex: 0 0 auto; scroll-snap-align: start; }
}

@media (max-width: 460px) {
  .nav-link { padding: 8px 12px; font-size: .82rem; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { width: 32px; height: 32px; }
  .site-header { padding: 18px 20px; gap: 10px; }
}

/* Bring interactive targets up to the 44px minimum on touch.
   Both conditions on purpose: `pointer: coarse` catches tablets and touch laptops at
   full width, and the width query catches phones — emulators and some browsers do not
   report the pointer type reliably, and a tap target is not something to leave to a
   media feature that might not resolve. */
@media (pointer: coarse), (max-width: 820px) {
  .copy-btn { min-height: 44px; padding: 6px 18px; }
  .sources-toggle { min-height: 44px; padding: 11px 0; }
  .theme-tab { min-height: 44px; }
  .nav-link { min-height: 44px; display: inline-flex; align-items: center; }
  .show-all-btn { min-height: 44px; }
  .brand { min-height: 44px; }
}
