/* =====================================================
   film-concepts.css  — design tokens + all components
   ===================================================== */

/* ── Design Tokens ─────────────────────────────────── */
:root {
  color-scheme: light;

  /* Backgrounds */
  --bg:          #f8f7f4;
  --surface:     #ffffff;
  --surface-2:   #f3f1ec;
  --border:      #e5e1d8;

  /* Brand */
  --brand:       #0f3460;
  --brand-dark:  #1a1a2e;
  --brand-light: #e8f4fd;

  /* Category colours */
  --cat-psy:     #0f3460;   --cat-psy-bg:  #e8f4fd;
  --cat-phi:     #5c0f8b;   --cat-phi-bg:  #f0e8fd;
  --cat-soc:     #7a3d0f;   --cat-soc-bg:  #fdf0e8;
  --cat-neu:     #0f6b3c;   --cat-neu-bg:  #e8fdf4;

  /* Semantic blocks */
  --cbt:         #1a5276;   --cbt-bg:      #eaf3fb;
  --nd:          #4a235a;   --nd-bg:       #f4eafc;

  /* Accuracy levels */
  --acc-high:    #1a7a3e;   --acc-high-bg: #e8f8ee;
  --acc-med:     #7a5c0f;   --acc-med-bg:  #fdf6e8;
  --acc-low:     #7a1a1a;   --acc-low-bg:  #fde8e8;

  /* Typography */
  --text:        #1a1a2e;
  --text-2:      #555060;
  --text-3:      #888;

  /* Spacing */
  --r:           10px;
  --r-lg:        16px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.18);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ── Hero ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 60%, #1a4080 100%);
  color: #fff;
  padding: 56px 24px 48px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; }
.hero p  { font-size: 1.1rem; opacity: .8; max-width: 560px; margin: 0 auto; }

/* ── Anchor Case Study ─────────────────────────────── */
.anchor {
  max-width: 780px;
  margin: 40px auto;
  padding: 0 20px;
}
.anchor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.anchor-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-light);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.anchor-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.anchor-card .anchor-meta { font-size: .9rem; color: var(--text-3); margin-bottom: 16px; }
.anchor-quote {
  border-left: 3px solid var(--brand);
  padding: 10px 16px;
  margin: 16px 0;
  font-style: italic;
  color: var(--text-2);
  background: var(--brand-light);
  border-radius: 0 var(--r) var(--r) 0;
}
.anchor-body { font-size: .95rem; color: var(--text-2); }
.anchor-body p + p { margin-top: 10px; }

/* ── Filters ───────────────────────────────────────── */
.filters {
  max-width: 1160px;
  margin: 32px auto 16px;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
#search {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
#search:focus { border-color: var(--brand); }
#search::placeholder { color: var(--text-3); }

.filter-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: .84rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-btn[data-cat="psy"].active { background: var(--cat-psy); border-color: var(--cat-psy); }
.filter-btn[data-cat="phi"].active { background: var(--cat-phi); border-color: var(--cat-phi); }
.filter-btn[data-cat="soc"].active { background: var(--cat-soc); border-color: var(--cat-soc); }
.filter-btn[data-cat="neu"].active { background: var(--cat-neu); border-color: var(--cat-neu); }

/* ── Grid ──────────────────────────────────────────── */
.grid-header {
  max-width: 1160px;
  margin: 0 auto 12px;
  padding: 0 20px;
  font-size: .85rem;
  color: var(--text-3);
}
#grid {
  max-width: 1160px;
  margin: 0 auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 1.05rem;
}

/* ── Card ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.card:hover  { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card:active { transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.card-num  { font-size: .75rem; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; }
.card-year  { font-size: .8rem; color: var(--text-3); margin-bottom: 10px; }
.card-cat {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.card-concepts { font-size: .8rem; color: var(--text-3); margin-bottom: 10px; }
.card-concepts span {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  margin: 2px 2px 2px 0;
}
.card-desc { font-size: .88rem; color: var(--text-2); line-height: 1.5; }
.card-arrow {
  position: absolute;
  bottom: 16px; right: 16px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: background .15s;
}
.card:hover .card-arrow { background: var(--brand-light); }

/* ── Modal Overlay ─────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.on { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 720px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.94) translateY(14px);
  transition: transform .26s cubic-bezier(.34,1.56,.64,1);
  outline: none;
  overflow: hidden;
}
.overlay.on .modal { transform: scale(1) translateY(0); }

/* Modal header */
.modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: #f00; color: #fff; }
.modal-num  { font-size: .75rem; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
.modal-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.modal-year  { font-size: .9rem; color: var(--text-3); }

/* Modal body */
.modal-body { padding: 24px 28px 32px; }
.modal-body > * + * { margin-top: 24px; }

/* Quote block */
.quote-block {
  border-left: 3px solid var(--brand);
  padding: 12px 16px;
  background: var(--brand-light);
  border-radius: 0 var(--r) var(--r) 0;
}
.quote-block blockquote { font-style: italic; font-size: 1rem; color: var(--text-2); margin-bottom: 6px; }
.quote-block cite { font-size: .8rem; color: var(--text-3); font-style: normal; }

/* Section headings */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.section-body  { font-size: .93rem; color: var(--text-2); line-height: 1.65; }
.section-body p + p { margin-top: 8px; }
.researcher-tag {
  display: inline-block;
  font-size: .78rem;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 6px;
}

/* Accuracy badge */
.acc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.acc-badge.acc-high { color: var(--acc-high); background: var(--acc-high-bg); }
.acc-badge.acc-med  { color: var(--acc-med);  background: var(--acc-med-bg);  }
.acc-badge.acc-low  { color: var(--acc-low);  background: var(--acc-low-bg);  }
.acc-text { font-size: .9rem; color: var(--text-2); }

/* Related films */
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.related-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* CBT block */
.cbt-block {
  background: var(--cbt-bg);
  border: 1px solid rgba(26,82,118,.2);
  border-radius: var(--r-lg);
  padding: 20px;
}
.cbt-block .block-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.cbt-block .block-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--cbt);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.cbt-block .block-title { font-size: 1rem; font-weight: 700; color: var(--cbt); }
.cbt-block .block-subtitle { font-size: .8rem; color: var(--text-3); }
.cbt-block .block-intro { font-size: .9rem; color: var(--text-2); margin-bottom: 14px; }

/* ND block */
.nd-block {
  background: var(--nd-bg);
  border: 1px solid rgba(74,35,90,.2);
  border-radius: var(--r-lg);
  padding: 20px;
}
.nd-block .block-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.nd-block .block-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--nd);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.nd-block .block-title { font-size: 1rem; font-weight: 700; color: var(--nd); }
.nd-block .block-subtitle { font-size: .8rem; color: var(--text-3); }
.nd-block .block-intro { font-size: .9rem; color: var(--text-2); margin-bottom: 14px; }
.nd-basis {
  font-size: .78rem;
  color: var(--nd);
  background: rgba(74,35,90,.08);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
  display: inline-block;
}

/* Technique cards */
.techniques { display: flex; flex-direction: column; gap: 10px; }
.technique {
  background: rgba(255,255,255,.7);
  border-radius: var(--r);
  padding: 12px 14px;
}
.technique-name { font-size: .88rem; font-weight: 700; margin-bottom: 4px; }
.technique-body { font-size: .85rem; color: var(--text-2); line-height: 1.55; }

.cbt-block .technique { border-left: 3px solid var(--cbt); }
.cbt-block .technique-name { color: var(--cbt); }
.nd-block  .technique { border-left: 3px solid var(--nd); }
.nd-block  .technique-name { color: var(--nd); }

/* ── Footer ────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 20px;
  font-size: .82rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 40px 16px 32px; }
  .anchor-card { padding: 20px; }
  .modal-header { padding: 20px 20px 16px; }
  .modal-body   { padding: 18px 20px 24px; }
  .modal-title  { font-size: 1.3rem; }
  #grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters { gap: 8px; }
}
@media (max-width: 420px) {
  #grid { grid-template-columns: 1fr; }
}
