/* Each subject's colour (Admin → Subjects & topics) on its quiz covers, icons and page headers.
   Loaded after the other stylesheets so the subject's colour wins over the colours the covers take by position. */

.test-card .test-cover.subject-cover,
.home-refreshed .test-card .test-cover.subject-cover {
  background: linear-gradient(110deg, color-mix(in srgb, var(--hue) 82%, #000), color-mix(in srgb, var(--hue) 88%, #fff));
}

.subject-symbol[style*="--hue"] { background: color-mix(in srgb, var(--hue) 13%, #fff); color: color-mix(in srgb, var(--hue) 85%, #000); }

.detail-cover[style*="--hue"],
.feature-panel[style*="--hue"] {
  background: linear-gradient(115deg, color-mix(in srgb, var(--hue) 12%, #fff), color-mix(in srgb, var(--hue) 4%, #fff));
  border-color: color-mix(in srgb, var(--hue) 24%, #fff);
  color: color-mix(in srgb, var(--hue) 85%, #000);
}
.detail-cover[style*="--hue"] h2,
.feature-panel[style*="--hue"] h2 { color: color-mix(in srgb, var(--hue) 45%, #0b1220); }
.detail-cover[style*="--hue"] > .bi,
.feature-panel[style*="--hue"] > .bi { color: var(--hue); }
.feature-panel[style*="--hue"] .eyebrow { color: color-mix(in srgb, var(--hue) 70%, #000); }
.detail-cover[style*="--hue"] .tag-pill,
.detail-cover[style*="--hue"] .tag-chip { background: #ffffffb3; border-color: color-mix(in srgb, var(--hue) 28%, #fff); color: color-mix(in srgb, var(--hue) 80%, #000); }

body.dark .subject-symbol[style*="--hue"] { background: color-mix(in srgb, var(--hue) 28%, #111c2e); color: color-mix(in srgb, var(--hue) 40%, #fff); }
body.dark .detail-cover[style*="--hue"],
body.dark .feature-panel[style*="--hue"] {
  background: linear-gradient(115deg, color-mix(in srgb, var(--hue) 30%, #14213a), color-mix(in srgb, var(--hue) 16%, #111c30));
  border-color: color-mix(in srgb, var(--hue) 38%, #14213a);
}
body.dark .detail-cover[style*="--hue"] h2,
body.dark .feature-panel[style*="--hue"] h2 { color: color-mix(in srgb, var(--hue) 18%, #fff); }
body.dark .detail-cover[style*="--hue"] > .bi,
body.dark .feature-panel[style*="--hue"] > .bi { color: color-mix(in srgb, var(--hue) 50%, #fff); }
body.dark .feature-panel[style*="--hue"] .eyebrow { color: color-mix(in srgb, var(--hue) 35%, #dfe7f3); }
body.dark .detail-cover[style*="--hue"] .tag-pill,
body.dark .detail-cover[style*="--hue"] .tag-chip { background: color-mix(in srgb, var(--hue) 30%, #14213a); border-color: color-mix(in srgb, var(--hue) 45%, #14213a); color: color-mix(in srgb, var(--hue) 25%, #fff); }

/* Subjects page: each card opens with a banner in the subject's colour, its icon on a white tile */
.subject-detail-card.subject-tile{padding:0;overflow:hidden;display:flex;flex-direction:column;text-decoration:none;color:inherit}
.subject-banner{position:relative;height:118px;flex:none;color:#fff;
  background:linear-gradient(110deg,color-mix(in srgb,var(--hue) 82%,#000),color-mix(in srgb,var(--hue) 88%,#fff))}
.subject-banner-art{position:absolute;right:-12px;bottom:-30px;font-size:122px;line-height:1;opacity:.16;transform:rotate(-8deg);pointer-events:none}
.subject-banner-stats{position:absolute;top:14px;right:16px;font-size:11px;font-weight:600;padding:4px 9px;border-radius:999px;background:#ffffff26;border:1px solid #ffffff4d;color:#fff;white-space:nowrap}
.subject-banner-icon{position:absolute;left:24px;bottom:-26px;width:56px;height:56px;border-radius:15px;display:grid;place-items:center;font-size:26px;
  background:#fff;color:color-mix(in srgb,var(--hue) 88%,#000);border:3px solid var(--surface);box-shadow:0 6px 16px #10203a1f}
.subject-tile-body{display:flex;flex-direction:column;flex:1;padding:42px 24px 20px}
.subject-tile-body h2{font-size:18px;font-weight:700;margin:0 0 8px;color:var(--text)}
.subject-tile-body p{font-size:13px;line-height:1.75;color:var(--muted);min-height:0;margin:0 0 16px}
.subject-tile-body .topic-chips{margin-bottom:18px}
.subject-tile-body .subject-card-foot{margin-top:auto;padding-top:14px;border-top:1px solid var(--border);display:flex;align-items:center;gap:6px;font-size:13px;font-weight:650;color:var(--purple)}
.subject-tile:hover .subject-card-foot .bi{transform:translateX(3px)}
.subject-card-foot .bi{transition:transform .15s}
.subject-tile:hover .subject-banner-art{opacity:.22}
body.dark .subject-banner-icon{background:#f5f8ff;border-color:var(--surface)}

/* A subject's own page: the same banner, larger */
.feature-panel.subject-hero{position:relative;overflow:hidden;min-height:200px;display:flex;align-items:flex-end;gap:24px;padding:32px 34px;border:0;color:#fff;
  background:linear-gradient(110deg,color-mix(in srgb,var(--hue) 82%,#000),color-mix(in srgb,var(--hue) 88%,#fff))}
.feature-panel.subject-hero .subject-banner-art,body.dark .feature-panel.subject-hero .subject-banner-art{position:absolute;right:-6px;bottom:-34px;font-size:190px;opacity:.15;color:#fff;transform:rotate(-8deg)}
.feature-panel.subject-hero .subject-banner-icon{position:relative;left:auto;bottom:auto;flex:none;width:68px;height:68px;font-size:32px;border-radius:18px;border:0;box-shadow:0 8px 22px #0b183326}
.feature-panel.subject-hero .subject-hero-text{position:relative}
.feature-panel.subject-hero h2,body.dark .feature-panel.subject-hero h2{color:#fff;font-size:28px;font-weight:700;line-height:1.2;margin:12px 0 0}
.feature-panel.subject-hero .tag-pill{background:#ffffff26;border:1px solid #ffffff4d;color:#fff}
.subject-hero-stats{display:flex;flex-wrap:wrap;gap:8px}
body.dark .feature-panel.subject-hero{background:linear-gradient(110deg,color-mix(in srgb,var(--hue) 70%,#000),color-mix(in srgb,var(--hue) 80%,#1a2740))}
@media (max-width:767px){.feature-panel.subject-hero .subject-banner-art{font-size:140px}.feature-panel.subject-hero{flex-direction:column;align-items:flex-start;padding:24px 22px}.feature-panel.subject-hero h2{font-size:22px}.subject-banner{height:104px}}

