@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&display=swap');

/* westcenture-you dashboard — Teneo palette.
   Cool light-grey page, deep navy text, a single corporate-blue accent, white
   cards with cool hairline borders. Vanilla CSS, no build. Same layout as
   before — tokens only. Note: app.js sets category colors inline on .score and
   .cat-chip; the blue score and muted chips below are applied CSS-side. */

:root {
  color-scheme: light;          /* override the dark <meta> so chrome matches */
  --bg: #F1F4F7;               /* light cool grey */
  --bg-2: #E9EEF3;            /* faint cool floor for the gradient */
  --bg-raised: #E7EDF3;       /* toggles, chips, action buttons */
  --bg-card: #FFFFFF;         /* card surface */
  --bg-card-hover: #FBFCFD;
  --border: #E1E7ED;          /* cool hairline */
  --border-strong: #CDD6DF;
  --text: #14233F;            /* primary — deep navy */
  --text-dim: #5A6A7C;        /* secondary — cool grey */
  --text-faint: #8A97A5;
  --accent: #1C5BA5;          /* the single accent — Teneo corporate blue */
  --accent-deep: #11264F;     /* navy, for hover/strong states */
  --star: #E0A21A;            /* gold/amber — relevance stars */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,38,79,.05), 0 10px 28px rgba(16,38,79,.07);
  --maxw: 1240px;
  --gap: 30px;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(28,91,165,.05), transparent 60%),
    linear-gradient(180deg, #F4F7FA 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ----------------------------------------------------------------- header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(241,244,247,.82);
  backdrop-filter: saturate(120%) blur(16px);
  -webkit-backdrop-filter: saturate(120%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px clamp(20px, 4vw, 44px) 22px;
}
.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -.012em;
  font-weight: 500;
  color: var(--text);
}
.masthead-meta {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: .005em;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  row-gap: 8px;
}
.feed-count { color: var(--text); font-weight: 500; }
.feed-updated { color: var(--text-dim); }
.dot { color: var(--text-faint); }

/* sort dropdown — sits at the right of the meta row */
.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.sort-label { color: var(--text-faint); font-size: 13px; }
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 28px 6px 11px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5l3 3 3-3' fill='none' stroke='%238A97A5' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.sort-select:hover { border-color: var(--text-faint); }
.sort-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,91,165,.25); }
.sort-select option { color: #111; }

/* view toggle */
.view-toggle {
  display: inline-flex;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 17px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.view-btn:hover { color: var(--text); }
.view-btn.is-active {
  background: var(--accent);     /* active state — Teneo blue, used sparingly */
  color: #FFFFFF;
  font-weight: 560;
}

/* category chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}
.chip {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s, opacity .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip.is-active {
  color: #FFFFFF;
  border-color: transparent;
  filter: saturate(.85);         /* mute the inline category color ~15% */
}
.chip .chip-count { opacity: .6; margin-left: 6px; font-variant-numeric: tabular-nums; }
.chip.is-empty {
  opacity: .4;
  cursor: default;
  border-style: dashed;
}
.chip.is-empty:hover { color: var(--text-dim); border-color: var(--border-strong); }

/* ------------------------------------------------------------------- grid */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 44px) 120px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------- card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease, opacity .2s ease;
  cursor: pointer;
  outline: none;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  box-shadow: 0 2px 4px rgba(16,38,79,.06), 0 16px 38px rgba(16,38,79,.12);
}
.card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,91,165,.28); }

.card.is-dismissed {
  opacity: .5;
  filter: grayscale(.7);
}
.card.is-dismissed:hover { transform: none; }
.card.is-collapsing { opacity: 0; transform: scale(.97); }
.card.is-watched .title { color: var(--text-dim); }

/* thumbnail */
.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #11264F;
  overflow: hidden;
}
.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(11,22,42,.85);
  color: #EDF1F6;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: .02em;
}
/* Relevance as a 5-slot gold star row on a translucent pill (legible over any
   thumbnail). Filled = score, muted = remainder. Replaces the old number badge. */
.score {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(11,22,42,.72);
  box-shadow: 0 2px 8px rgba(11,22,42,.28);
  line-height: 1;
}
.score .star { font-size: 13px; color: rgba(255,255,255,.30); }   /* muted empty */
.score .star.is-filled { color: var(--star); }                    /* gold filled */

/* "NEW since last run" marker, top-right of the thumbnail */
.new-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 7px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(11,22,42,.3);
}

/* body */
.body { padding: 22px 24px 6px; flex: 1; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.channel { color: var(--text-dim); font-weight: 500; }
.cat-chip {
  margin-left: auto;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 5px;
  text-transform: uppercase;
  filter: saturate(.85);         /* mute the inline category color ~15% */
}
.title {
  margin: 14px 0 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.34;
  font-weight: 500;
  letter-spacing: -.003em;
  color: var(--text);
}
.why {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.58;
  color: var(--text-dim);
}

/* expand */
.expand {
  border-top: 1px solid var(--border);
  margin: 6px 0 10px;
  padding-top: 16px;
}
.summary { margin: 0 0 12px; font-size: 14px; line-height: 1.62; color: var(--text-dim); }
.key-points { margin: 0; padding-left: 20px; }
.key-points li { font-size: 13.5px; line-height: 1.55; color: var(--text-dim); margin-bottom: 7px; }
.key-points li::marker { color: var(--accent); }

/* the watch link app.js injects inline — pull it onto the blue accent */
.watch-link { color: var(--accent) !important; }

/* actions */
.actions {
  display: flex;
  gap: 9px;
  padding: 14px 24px 22px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
.card:hover .actions, .card:focus-within .actions { opacity: 1; transform: none; }
@media (hover: none) { .actions { opacity: 1; transform: none; } }

.act {
  appearance: none;
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.act:hover { color: var(--text); border-color: var(--text-faint); }
.act-save.is-on { color: #FFFFFF; background: var(--accent); border-color: var(--accent); }
.act-watched.is-on { color: var(--accent); background: #E4ECF5; border-color: var(--accent); }

/* ------------------------------------------------------------------ empty */
.empty {
  text-align: center;
  padding: 110px 20px;
  color: var(--text-faint);
}
.empty-art { font-size: 46px; opacity: .55; margin-bottom: 14px; color: var(--accent); }
.empty-title { font-family: var(--font-serif); font-size: 20px; color: var(--text-dim); font-weight: 500; margin: 0 0 8px; }
.empty-sub { font-size: 14px; margin: 0; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--accent-deep);
  border: 1px solid #1E3A66;
  color: #EAF0F7;
  padding: 13px 16px 13px 20px;
  border-radius: 11px;
  box-shadow: 0 12px 44px rgba(11,22,42,.3);
  font-size: 14px;
  animation: toast-in .18s ease;
}
.toast[hidden] { display: none; }
.toast-undo {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8FB6E6;                /* link / action accent — light blue on navy toast */
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}
.toast-undo:hover { text-decoration: underline; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
