/* ════════════════════════════════════════════════════════════════════
   SymposiON — subject-panel.css
   Subject panel + tile grid for the browse / subject pages
   ════════════════════════════════════════════════════════════════════ */

/* ─── Per-subject accent tints via data-subject ─────────────────────
   Uses --sp-accent for the border, banner bg, and CTA glow.
   Falls back to terra for unknown subjects.
──────────────────────────────────────────────────────────────────── */
[data-subject]                { --sp-accent: var(--sym-terra,  #D97B5C); }
[data-subject="odyssey"]      { --sp-accent: var(--sym-terra,  #D97B5C); }
[data-subject="iliad"]        { --sp-accent: var(--sym-gold,   #C4A448); }
[data-subject="grammar"]      { --sp-accent: var(--sym-sage,   #6A8752); }
[data-subject="ancient-greek"]{ --sp-accent: var(--sym-gold,   #C4A448); }
[data-subject="latin"]        { --sp-accent: var(--sym-gold,   #C4A448); }
[data-subject="history"]      { --sp-accent: var(--sym-sage,   #6A8752); }
[data-subject="literature"]   { --sp-accent: var(--sym-sage,   #6A8752); }
[data-subject="modern-greek"] { --sp-accent: var(--sym-sage,   #6A8752); }
[data-subject="tragedy"]      { --sp-accent: var(--sym-terra,  #D97B5C); }


/* ─── Subject tabs ───────────────────────────────────────────────── */
.subject-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding-bottom: 2px;
}
.subject-tab {
  font-family: var(--sym-font-sans, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 9px 18px;
  background: none;
  border: none;
  color: var(--sym-fg-muted, #867660);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
}
.subject-tab:hover { color: var(--sym-fg, #F0EBE0); }
.subject-tab.active {
  color: var(--sym-terra, #D97B5C);
  border-bottom-color: var(--sym-terra, #D97B5C);
}

/* Auto-advance progress bar under the active tab */
.subject-tab.active::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--sym-terra, #D97B5C);
  opacity: 0.45;
}
.subject-tab {
  position: relative; /* needed for ::after positioning */
}
/* Running animation — added by JS when auto-rotate is active */
.subject-tab.active.is-auto-running::after {
  animation: tabProgress var(--tab-duration, 6.5s) linear forwards;
}
@keyframes tabProgress {
  from { width: 0%; }
  to   { width: 100%; }
}


/* ─── Panel layout ───────────────────────────────────────────────── */
.subject-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--sp-accent) 18%, transparent);
  /* accent left-edge stripe for visual category cue */
  border-left: 3px solid color-mix(in srgb, var(--sp-accent) 55%, transparent);
  margin-bottom: 24px;
  background: var(--sym-bg-card, #1A130C);
  overflow: hidden;
  position: relative;
}
@media (max-width: 768px) {
  .subject-panel {
    grid-template-columns: 1fr;
    border-left-width: 3px;
  }
  /* On mobile the side panel becomes a compact horizontal strip */
  .subject-side {
    padding: 18px 18px 14px;
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--sp-accent) 14%, transparent);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .subject-roman { margin-bottom: 0; flex: 0 0 100%; }
  .subject-title { font-size: 22px; flex: 1 1 auto; }
  .subject-sub   { display: none; }        /* hidden on mobile – saves space */
  .subject-summary { display: none; }     /* hidden on mobile – click opens subject */
  .subject-ornament { display: none; }
  .subject-icon  { width: 32px; height: 32px; margin-top: 0; flex-shrink: 0; }
  .subject-meta  { flex: 0 0 100%; margin-top: 4px; }
  /* Tiles panel gets more padding on mobile */
  .subject-tiles-wrap { padding: 14px 14px 16px; }
  .subject-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
}


/* ─── Left side ──────────────────────────────────────────────────── */
.subject-side {
  position: relative;
  padding: 32px 28px 28px;
  border-right: 1px solid color-mix(in srgb, var(--sp-accent) 14%, transparent);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.subject-roman {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sp-accent);
  opacity: 0.7;
  margin-bottom: 4px;
}

.subject-title {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--sym-fg, #F0EBE0);
  margin: 0;
  line-height: 1.15;
}

.subject-sub {
  font-family: var(--sym-font-mono, monospace);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sym-fg-muted, #867660);
  margin: 2px 0 6px;
}

.subject-summary {
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(240,235,224,0.62);
  margin: 0;
  flex: 1;
}

/* Faint background ornament illustration */
.subject-ornament {
  position: absolute;
  right: -30px;
  bottom: -20px;
  width: 180px;
  height: 180px;
  color: var(--sp-accent);
  opacity: 0.07;
  pointer-events: none;
}
.subject-ornament svg { width: 100%; height: 100%; }

/* Small foreground icon */
.subject-icon {
  width: 40px;
  height: 40px;
  color: var(--sp-accent);
  margin-top: 8px;
}
.subject-icon svg { width: 100%; height: 100%; }

.subject-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sym-font-mono, monospace);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sym-fg-muted, #867660);
  margin-top: 12px;
}
.subject-meta .dot { opacity: 0.4; }
.subject-meta .levels { color: var(--sp-accent); opacity: 0.8; }


/* ─── Right side — tiles ─────────────────────────────────────────── */
.subject-tiles-wrap {
  display: flex;
  flex-direction: column;
  padding: 20px 20px 20px 24px;
  gap: 16px;
}

.subject-tiles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.subject-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* QR share button in the subject panel header */
.subject-qr-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sym-font-mono, monospace);
  font-size: 8.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sp-accent);
  background: color-mix(in srgb, var(--sp-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--sp-accent) 22%, transparent);
  padding: 6px 10px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.subject-qr-link:hover {
  background: color-mix(in srgb, var(--sp-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--sp-accent) 45%, transparent);
}

.subject-tagline {
  font-family: var(--sym-font-mono, monospace);
  font-size: 9.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sym-fg-muted, #867660);
}

.subject-all-link {
  font-family: var(--sym-font-sans, 'Inter', sans-serif);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sp-accent);
  background: color-mix(in srgb, var(--sp-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--sp-accent) 28%, transparent);
  cursor: pointer;
  padding: 7px 14px;
  transition: background .18s, border-color .18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.subject-all-link:hover {
  background: color-mix(in srgb, var(--sp-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--sp-accent) 50%, transparent);
}

.subject-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}


/* ─── Game tile ──────────────────────────────────────────────────── */
.tile {
  display: flex;
  flex-direction: column;
  background: var(--sym-bg-dark, #0D0A06);
  border: 1px solid color-mix(in srgb, var(--sp-accent) 15%, transparent);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Ensure minimum height for tap target */
  min-height: 140px;
}
.tile:hover {
  border-color: color-mix(in srgb, var(--sp-accent) 45%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.tile-banner {
  height: 72px;
  background: color-mix(in srgb, var(--sp-accent) 8%, var(--sym-bg-dark, #0D0A06));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--sp-accent);
}
.tile-banner svg {
  width: 52px;
  height: 52px;
  opacity: 0.75;
}

.tile-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.tile-title {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--sym-fg, #F0EBE0);
  margin: 0;
  line-height: 1.25;
}

.tile-meta {
  font-size: 10.5px;
  color: var(--sym-fg-muted, #867660);
  margin: 0;
  line-height: 1.4;
}

.tile-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--sym-font-mono, monospace);
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sp-accent);
}


/* ═══════════════════════════════════════════════════════════════════
   PANEL TAB GROUPS — animated carousel between grade tabs
   ═══════════════════════════════════════════════════════════════════ */
.panels-tab-group {
  display: none;
  animation: panelFadeIn 0.28s ease;
}
.panels-tab-group.active {
  display: block;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Global subject accents (grade page panels + wherever data-subject appears) ─── */
[data-subject="verbs"]       { --sp-accent: var(--sym-terra,  #D97B5C); }
[data-subject="tragedy"]     { --sp-accent: var(--sym-terra,  #D97B5C); }
[data-subject="literature"]  { --sp-accent: var(--sym-sage,   #6A8752); }
[data-subject="modern-greek"]{ --sp-accent: var(--sym-sage,   #6A8752); }

/* ─── Home-page tab overrides (scoped so they don't bleed into grade panels) ─── */
.panels-tab-group[data-tab="gym-a"] [data-subject="odyssey"] { --sp-accent: var(--sym-terra, #D97B5C); }
.panels-tab-group[data-tab="gym-c"] [data-subject="eleni"]   { --sp-accent: var(--sym-terra, #D97B5C); }
.panels-tab-group[data-tab="gram"]  [data-subject="verbs"]   { --sp-accent: var(--sym-terra, #D97B5C); }
.panels-tab-group[data-tab="gram"]  [data-subject="latin"]   { --sp-accent: var(--sym-gold,  #C4A448); }


/* ═══════════════════════════════════════════════════════════════════
   GRADE PAGE — subject-card uses main.css light editorial base styles.
   main.css + main-upgrade.css supply: warm-white bg, sage hover bar,
   espresso h3, stone desc, parchment border.
   Only structural tweaks that don't override colours are kept here.
   ═══════════════════════════════════════════════════════════════════ */
.subject-card {
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.subject-card .card-banner {
  height: 80px;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.subject-card .subj-body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subject-card .subj-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Track section header — main.css .grid-label supplies the light editorial style */


/* ═══════════════════════════════════════════════════════════════════
   SUBJECT PAGE — g-card: dark SymposiON theme, consistent with the
   grade page subject-panel tiles so the two pages share a visual language.
   ═══════════════════════════════════════════════════════════════════ */
.g-card {
  background-color: #0D0A06 !important;
  border: 1px solid rgba(240,235,224,0.09) !important;
  border-radius: 0 !important;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  overflow: hidden;
}
.g-card:hover {
  border-color: color-mix(in srgb, var(--sp-accent, #D97B5C) 45%, transparent) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.g-card .g-banner {
  height: 96px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 34px !important;
  position: relative;
}
.g-card .g-body {
  padding: 12px 14px 10px !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.g-card h3 {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.1px;
  color: var(--sym-fg, #F0EBE0) !important;
  margin: 0 0 2px !important;
}
.g-card .g-desc {
  font-size: 10.5px !important;
  color: var(--sym-fg-muted, #867660) !important;
  line-height: 1.45 !important;
}
.g-card .g-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.g-card .meta-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.g-card .tag {
  font-family: var(--sym-font-mono, monospace) !important;
  font-size: 9px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: var(--sym-fg-muted, #867660) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  padding: 2px 7px !important;
  background: none !important;
  border-radius: 0 !important;
}
.g-card .play-btn {
  font-size: 11px;
  color: var(--sym-terra, #D97B5C);
  letter-spacing: 1px;
}
.g-card .free-b, .g-card .multi-b {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  font-family: var(--sym-font-mono, monospace) !important;
  font-size: 8.5px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  padding: 3px 7px !important;
  background: rgba(0,0,0,0.55) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: var(--sym-sage, #6A8752) !important;
  border-radius: 0 !important;
}
.g-card .lock-b {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  font-family: var(--sym-font-mono, monospace) !important;
  font-size: 8.5px !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  padding: 3px 7px !important;
  background: rgba(0,0,0,0.55) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.45) !important;
  border-radius: 0 !important;
}

/* Subject hero on subject page — light editorial (paideia design system)
   Replaces the old dark-theme overrides that conflicted with the linen gradient
   applied by main-upgrade.css + navToSubject().
   padding has NO !important so main.css responsive breakpoints still apply.
   ──────────────────────────────────────────────────────────────────────────── */
.subject-hero {
  /* main-upgrade.css supplies the linen→alabaster gradient.
     Restore generous editorial padding (cascade position wins over main.css).
     No !important so main.css responsive breakpoints at ≤900 / ≤768 / ≤480 apply. */
  padding: 3.5rem 3rem 0;
  min-height: unset;
}
.subject-hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  /* No !important on font-size so main.css responsive clamps at ≤768 / ≤480 apply */
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300 !important;           /* light editorial weight */
  color: var(--espresso) !important;
  letter-spacing: -0.8px;
  line-height: 1.1 !important;
  margin: 8px 0 6px !important;
}
.subject-hero p {
  font-family: 'Raleway', 'Inter', sans-serif !important;
  font-size: 14px;
  color: var(--stone) !important;
  line-height: 1.7;
  max-width: 520px;
}
.subject-hero .grade-pill {
  /* Match the .grade-pill light-theme style from main.css */
  font-family: 'Inter', sans-serif !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: var(--sage) !important;
  background: none !important;
  border: none !important;
  border-bottom: 1px solid var(--sage-line) !important;
  padding: 0 0 4px !important;
  border-radius: 0 !important;
  display: inline-block;
  margin-bottom: 1rem !important;
}
.subject-hero .filter-tabs { margin-top: 2rem !important; }
.subject-hero .ftab {
  font-family: 'Raleway', 'Inter', sans-serif !important;
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
}
.subject-hero .ftab.active {
  font-weight: 600 !important;
  color: var(--espresso) !important;
}

/* Games section label — match the light editorial grid-label style */
.games-content .grid-label {
  font-family: 'Raleway', 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: var(--stone) !important;
  padding: 0 !important;               /* games-content owns the outer padding */
  margin-bottom: 1.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}
.games-content .grid-label::after {
  content: '' !important;
  display: block !important;
  flex: 1 !important;
  height: 1px !important;
  background: var(--parchment) !important;
}
.games-grid {
  gap: 10px !important;          /* spaced dark cards, not hairline parchment grid */
  background: transparent !important;
}


/* ═══════════════════════════════════════════════════════════════════
   BROWSE PAGE — browse-box restyled to match tile aesthetic
   ═══════════════════════════════════════════════════════════════════ */
.browse-box {
  background: var(--sym-bg-dark, #0D0A06) !important;
  border: 1px solid rgba(240,235,224,0.09) !important;
  border-radius: 0 !important;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  overflow: hidden;
}
.browse-box:not(.disabled):hover {
  border-color: rgba(217,123,92,0.4) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.browse-box .browse-box-banner {
  height: 80px !important;
  font-size: 32px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
}
.browse-box .browse-box-body h3 {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--sym-fg, #F0EBE0) !important;
}
.browse-box .browse-box-body p {
  font-size: 11px !important;
  color: var(--sym-fg-muted, #867660) !important;
}


/* ═══════════════════════════════════════════════════════════════════
   GRADE PAGE — panel layout spacing
   ═══════════════════════════════════════════════════════════════════ */
.grade-subjects-wrap--panels { padding: 0 0 60px; }
.grade-subjects-wrap--panels .subject-panel { margin-bottom: 18px; }

/* Track label (Γενική Παιδεία / Θεωρητική Κατεύθυνση) */
.grade-track-label {
  font-family: var(--sym-font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--sym-stone, #867660);
  margin: 28px 0 10px;
}
.grade-track-label:first-child { margin-top: 0; }

/* Featured tile gets a subtle accent edge */
.tile[data-featured] {
  border-color: color-mix(in srgb, var(--sp-accent) 40%, transparent);
  box-shadow:   0 0 0 1px color-mix(in srgb, var(--sp-accent) 18%, transparent);
}


/* ─── "Όλα τα παιχνίδια" overflow tile ──────────────────────────── */
.tile--all-games {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--sp-accent) 28%, transparent);
  background: transparent;
}
.tile--all-games:hover {
  border-color: color-mix(in srgb, var(--sp-accent) 55%, transparent);
  background: color-mix(in srgb, var(--sp-accent) 5%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Banner: shows the +N count instead of an illustration */
.tile--all-games .tile-banner--count {
  height: 72px;
  background: transparent;
  border-bottom: 1px dashed color-mix(in srgb, var(--sp-accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-overflow-count {
  font-family: var(--sym-font-serif, 'Cormorant Garamond', serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  color: var(--sp-accent);
  opacity: 0.80;
  letter-spacing: -1px;
}

/* Title inherits accent so it reads as a CTA, not a game name */
.tile--all-games .tile-title {
  color: var(--sp-accent);
  font-size: 13.5px;
  letter-spacing: 0.1px;
}


/* ═══════════════════════════════════════════════════════════════════
   SUBJECT PAGE — responsive breakpoints
   Must come after all base rules so they take precedence via cascade.
   subject-panel.css loads after main.css, so without these a mobile
   viewport would get the base 3.5rem padding instead of the breakpoint value.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .subject-hero   { padding: 3rem 2rem 0; }
  .games-content  { padding: 2rem; }
}

@media (max-width: 768px) {
  .subject-hero                { padding: 2.5rem 1.5rem 0; }
  .subject-hero h1             { font-size: clamp(26px, 7vw, 42px); }
  .subject-hero p              { font-size: 13px; }
  .games-grid                  { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 480px) {
  .subject-hero                { padding: 2rem 1rem 0; }
  .subject-hero h1             { font-size: clamp(22px, 8vw, 32px); letter-spacing: -0.4px; }
  .games-content               { padding: 1rem; }
  .games-grid                  { grid-template-columns: 1fr; }
}
