
/* ==========================================================================
   Daily media brief 3-Theme Styles
   Theme 1: News word cloud
   Theme 2: Top issues backed by stories
   Theme 3: Daily news word game
   ========================================================================== */

:root {
  --brief-red: #D21034;
  --brief-red-hover: #b90c2b;
  --brief-gold: #F59E0B;
  --brief-card-bg: #141D2B;
  --brief-card-border: #334155;
  --brief-text-bright: #F8FAFC;
  --brief-text-muted: #94A3B8;
  --brief-green: #15803D;
  --brief-amber: #B45309;
}

/* Theme Navigation */
.theme-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--brief-text-bright);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.18s ease, transform 0.15s ease;
}
.theme-pill:hover {
  background: var(--brief-red);
  color: #fff;
  border-color: var(--brief-red);
  transform: translateY(-1px);
}

/* Theme Section General */
.theme-section {
  background: var(--brief-card-bg);
  border: 1px solid var(--brief-card-border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.theme-header {
  margin-bottom: 24px;
}
.theme-badge {
  display: inline-block;
  background: var(--brief-red);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.theme-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--brief-text-bright);
  margin: 0 0 6px;
  line-height: 1.2;
}
.theme-dek {
  color: var(--brief-text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 48rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Theme 1: Word Cloud
   -------------------------------------------------------------------------- */
.cloud-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px auto;
}
.cloud-svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
}
.cloud-word {
  transition: opacity 0.15s ease;
}
.cloud-word:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Theme 2: Top Issues
   -------------------------------------------------------------------------- */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.issue-row {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 14px 18px;
  transition: background 0.15s ease;
}
.issue-row:hover {
  background: rgba(255, 255, 255, 0.06);
}
.issue-row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.issue-rank {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brief-gold);
  min-width: 1.4em;
  text-align: center;
}
.issue-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brief-text-bright);
  line-height: 1.3;
}
.issue-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brief-text-muted);
  white-space: nowrap;
}
.issue-row .headline-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 1.8em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.story-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--brief-text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.4;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.14s ease;
}
.story-link:hover {
  color: var(--brief-gold);
}
.story-title {
  flex: 1;
  font-weight: 500;
}
.story-source {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brief-red);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Theme 3: Trini News Wordle
   -------------------------------------------------------------------------- */
.wordle-app {
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}
.wordle-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #F8FAFC;
  color: #0F172A;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
  white-space: nowrap;
}
.wordle-toast.show {
  opacity: 1;
}
.wordle-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  margin: 18px auto;
  width: fit-content;
}
.wordle-row {
  display: flex;
  gap: 6px;
}
.wordle-row.shake {
  animation: wordleShake 0.4s ease;
}
@keyframes wordleShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.wordle-tile {
  width: 52px;
  height: 52px;
  border: 2px solid #334155;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  text-transform: uppercase;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.25s ease;
}
.wordle-tile.pop {
  animation: wordlePop 0.12s ease;
}
@keyframes wordlePop {
  50% { transform: scale(1.12); }
}
.wordle-tile.flip {
  animation: wordleFlip 0.5s ease forwards;
}
@keyframes wordleFlip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
.wordle-tile--correct {
  background: var(--brief-green) !important;
  border-color: var(--brief-green) !important;
  color: #FFFFFF !important;
}
.wordle-tile--present {
  background: var(--brief-amber) !important;
  border-color: var(--brief-amber) !important;
  color: #FFFFFF !important;
}
.wordle-tile--absent {
  background: #334155 !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

/* Wordle Keyboard */
.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
}
.wordle-kb-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.wordle-key {
  height: 48px;
  min-width: 32px;
  flex: 1;
  max-width: 42px;
  background: #334155;
  color: #F8FAFC;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  transition: filter 0.15s ease, background-color 0.2s ease;
}
.wordle-key:hover {
  filter: brightness(1.2);
}
.wordle-key--action {
  max-width: 64px;
  font-size: 0.75rem;
}
.wordle-key.correct {
  background: var(--brief-green) !important;
  color: #fff !important;
}
.wordle-key.present {
  background: var(--brief-amber) !important;
  color: #fff !important;
}
.wordle-key.absent {
  background: #1E293B !important;
  color: #64748B !important;
}

/* Modal */
.wordle-modal {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 20px;
  z-index: 30;
}
.wordle-modal[hidden] {
  display: none;
}
.wordle-modal-content {
  background: #1E293B;
  border: 1px solid var(--brief-card-border);
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wordle-modal-content h3 {
  margin: 0 0 8px;
  color: var(--brief-text-bright);
  font-size: 1.3rem;
}
.wordle-modal-content p {
  color: var(--brief-text-muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.wordle-context {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  color: #CBD5E1;
  margin-bottom: 18px;
}
.wordle-btn {
  background: var(--brief-red);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease;
}
.wordle-btn:hover {
  background: var(--brief-red-hover);
}

@media (max-width: 520px) {
  .theme-section { padding: 18px; }
  .wordle-tile { width: 44px; height: 44px; font-size: 1.5rem; }
  .wordle-key { height: 44px; min-width: 28px; font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wordle-row.shake,
  .wordle-tile.pop,
  .wordle-tile.flip {
    animation: none !important;
  }
  .cloud-word, .issue-row {
    transition: none !important;
  }
}
