/* Shared components for every Moodie page: apps bar, header, footer, cookie banner.
   Loaded after moodie.css (which provides the base tokens and legal-page styles). */

:root {
  /* Brand colours from the Moodie logo: mint green + yellow on navy. No blue or purple accents. */
  --cosmos: #0b1224;
  --brand-green: #45ddc0;
  --brand-green-deep: #2bbfa3;
  --brand-yellow: #ffe600;
  --space-yellow: var(--brand-yellow);
  --accent: var(--brand-green);
  --accent-hover: var(--brand-green-deep);
  --ring: rgba(69, 221, 192, 0.3);
  --grad: linear-gradient(90deg, #ffe600 0%, #a6e95c 45%, #45ddc0 100%);
  --radius: 18px;
}
body { background-color: var(--cosmos); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 2000;
  background: #fff; color: #0f172a; padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

:where(a, button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Other apps bar ---------- */
.apps-bar {
  background: #060b18;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.apps-bar-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 38px; overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.apps-bar-inner::-webkit-scrollbar { display: none; }
.apps-bar-label { color: var(--text-secondary); font-weight: 500; }
.apps-bar-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-primary); text-decoration: none; font-weight: 600;
  padding: 4px 0; transition: color .2s;
}
.apps-bar-link:hover { color: var(--accent); }
.apps-bar-link img { width: 20px; height: 20px; border-radius: 5px; }
.apps-bar-kind { color: var(--text-secondary); font-weight: 400; }

/* ---------- Header ---------- */
.site-header { background: rgba(11, 18, 36, 0.82); }
.site-header .nav-container { gap: 24px; padding-top: 12px; padding-bottom: 12px; }
.site-header .brand img { width: 36px; height: 36px; }
.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color .2s; }
.site-nav a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-download {
  background: #fff; color: #0f172a; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  padding: 9px 16px; border-radius: 999px; transition: transform .2s, background .2s;
}
.nav-download:hover { background: #e2e8f0; transform: translateY(-1px); }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header .nav-container { position: relative; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 20px 16px;
    background: rgba(11, 18, 36, 0.98); border-bottom: 1px solid var(--border);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .site-nav a:last-child { border-bottom: 0; }
}
@media (max-width: 420px) {
  .nav-download { padding: 8px 12px; font-size: 0.85rem; }
  .apps-bar-label { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { background: #060b18; padding: 64px 0 110px; border-top: 1px solid var(--border); }
.site-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.site-footer-brand p { color: var(--text-secondary); margin: 14px 0 18px; max-width: 280px; }
.site-footer-stores { display: flex; gap: 10px; flex-wrap: wrap; }
.site-footer-stores a {
  font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--text-primary);
  border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; transition: background .2s;
}
.site-footer-stores a:hover { background: rgba(255,255,255,0.08); }
.site-footer-title { font-family: 'Inter', sans-serif; font-size: 0.8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0 0 24px; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a, .link-button {
  color: var(--text-primary); text-decoration: none; font-size: 0.92rem; opacity: .85; transition: opacity .2s, color .2s;
}
.site-footer li a:hover, .link-button:hover { opacity: 1; color: var(--accent); }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 0.92rem; }
.site-footer-bottom { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 860px) {
  .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .site-footer-brand { grid-column: 1 / -1; }
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1500;
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  background: #111a33; border: 1px solid rgba(255,255,255,0.14); border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }
.cookie-banner-text p + p { margin-top: 4px; }
.cookie-banner-text strong { color: var(--text-primary); }
.cookie-banner-text a { color: var(--accent); }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
/* Accept and Decline are deliberately styled the same (equal prominence). */
.cookie-btn {
  min-width: 96px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.9rem;
  background: #fff; color: #0f172a; border: 1px solid #fff; transition: background .2s;
}
.cookie-btn:hover { background: #e2e8f0; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 14px; }
  .cookie-banner-actions .cookie-btn { flex: 1; }
}

/* Shared buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--space-yellow); color: #111827; box-shadow: 0 8px 30px rgba(255, 230, 0, 0.18); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(255, 230, 0, 0.28); }

@media (prefers-reduced-motion: reduce) {
  /* Keep end states (e.g. fade-ins) but make them instant. */
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Sticky download bar + other apps (every page) ---------- */
.dl-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: rgba(8, 13, 28, 0.96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}
.dl-bar.is-visible { transform: translateY(0); }
.dl-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; }
.dl-bar-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dl-bar-logo { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.dl-bar-text { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.dl-bar-stores { display: flex; gap: 8px; }
.dl-btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 40px; padding: 8px 14px; border-radius: 10px;
  font-size: .88rem; font-weight: 600; text-decoration: none; transition: background .2s;
}
.dl-btn-light { background: var(--brand-yellow); color: #111827; }
.dl-btn-light:hover { background: #fff27a; }
.dl-btn-dark { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid var(--border); }
.dl-btn-dark:hover { background: rgba(255, 255, 255, .18); }
.dl-bar-apps { display: flex; align-items: center; gap: 14px; padding-left: 20px; border-left: 1px solid var(--border); }
.dl-bar-apps-label { color: var(--text-secondary); font-size: .8rem; white-space: nowrap; }
.dl-bar-apps a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-primary); text-decoration: none; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.dl-bar-apps a:hover span { color: var(--brand-green); }
.dl-bar-apps img { width: 24px; height: 24px; border-radius: 6px; }

/* Tablets and unfolded foldables: one row, app icons only */
@media (max-width: 1023px) {
  .dl-bar-apps a span { display: none; }
  .dl-bar-apps img { width: 30px; height: 30px; border-radius: 8px; }
}
/* Narrow tablets / unfolded foldables: keep logo + store buttons, drop the tagline so the row fits */
@media (min-width: 700px) and (max-width: 819px) {
  .dl-bar-text { display: none; }
}
/* Phones: two rows. Stores on top, other apps below. */
@media (max-width: 699px) {
  .dl-bar { padding-top: 8px; }
  .dl-bar-inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .dl-bar-main { justify-content: space-between; }
  .dl-bar-text { font-size: .9rem; }
  .dl-bar-apps { justify-content: center; padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--border); gap: 16px; }
  .dl-bar-apps a span { display: inline; font-size: .8rem; }
  .dl-bar-apps img { width: 22px; height: 22px; border-radius: 6px; }
  .site-footer { padding-bottom: 150px; }
}
@media (max-width: 420px) {
  .dl-bar-text { display: none; }
  .dl-bar-stores { flex: 1; }
  .dl-bar-stores .dl-btn { flex: 1; }
}
/* Fold cover screens and very narrow phones */
@media (max-width: 360px) {
  .dl-bar-apps-label { display: none; }
  .dl-bar-apps { gap: 12px; }
}

/* ---------- Robust layout for every screen (phones, foldables, tablets) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
main img, main video, main svg { max-width: 100%; height: auto; }
main { overflow-wrap: break-word; }
.article table { display: block; overflow-x: auto; }
@media (max-width: 360px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .site-header .nav-container { gap: 10px; padding-left: 14px; padding-right: 14px; }
  .nav-download { display: none; }
  .site-footer-grid { grid-template-columns: 1fr; }
}
@media (min-width: 861px) and (max-width: 1060px) {
  .site-nav { gap: 18px; }
  .site-nav a { font-size: .9rem; }
}

/* ---------- Topic pages (/all-topics/) ---------- */
.topic-page a, .topic-index a { color: var(--accent); }
.topic-page a:hover, .topic-index a:hover { color: var(--brand-yellow); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-secondary); margin-bottom: 18px; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { opacity: .5; }
.topic-page h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.15; }
.topic-byline { color: var(--text-secondary); font-size: .9rem; margin: 6px 0 24px !important; }
.in-short { border-left: 4px solid var(--brand-green); background: rgba(69, 221, 192, .08); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 0 0 28px; }
.in-short p { margin: 0 !important; color: var(--text-primary); line-height: 1.65; }
.topic-note { font-size: .9rem; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: rgba(255, 255, 255, .03); }
.topic-page .about-moodie { font-size: .95rem; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; background: rgba(255, 255, 255, .04); }
.topic-page .about-moodie strong { color: var(--text-primary); }
.topic-page .table-wrap { overflow-x: auto; margin: 0 0 24px; }
.topic-page table { border-collapse: collapse; width: 100%; font-size: .93rem; display: table; }
.topic-page th, .topic-page td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; color: var(--text-secondary); }
.topic-page th { color: var(--text-primary); background: rgba(255, 255, 255, .05); }
.topic-faq { margin-top: 12px; }
.topic-faq .faq-item { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.topic-faq .faq-item summary { cursor: pointer; padding: 16px 44px 16px 20px; font-weight: 600; color: var(--text-primary); list-style: none; position: relative; }
.topic-faq .faq-item summary::-webkit-details-marker { display: none; }
.topic-faq .faq-item summary::after { content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); }
.topic-faq .faq-item[open] summary::after { content: '\2212'; }
.topic-faq .faq-item p { padding: 0 20px 16px; margin: 0 !important; color: var(--text-secondary); line-height: 1.7; }
.topic-more ul { list-style: none; padding: 0; margin: 0 0 8px; }
.topic-more li { margin-bottom: 8px; }
.topic-cta { margin-top: 36px; padding: 24px; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(255, 230, 0, .08), rgba(69, 221, 192, .1)); }
.topic-cta h2 { margin: 0 0 8px !important; color: var(--text-primary) !important; font-size: 1.3rem !important; }
.topic-cta p { margin-bottom: 16px !important; }
.topic-cta-stores { display: flex; gap: 10px; flex-wrap: wrap; }
.topic-cta .dl-btn { color: #111827; text-decoration: none; }
.topic-cta .dl-btn-dark { color: #fff; }
.topic-index { max-width: 1000px; padding-top: 48px; padding-bottom: 60px; }
.topic-index h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 12px; }
.topic-lede { color: var(--text-secondary); font-size: 1.1rem; line-height: 1.7; max-width: 720px; margin-bottom: 28px; }
.topic-index-h { font-size: 1.2rem; margin: 32px 0 14px; color: var(--accent); }
.topic-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.topic-grid-one { grid-template-columns: 1fr; }
.topic-card a { display: block; height: 100%; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text-primary); text-decoration: none; transition: transform .15s, border-color .15s; }
.topic-card a:hover { transform: translateY(-2px); border-color: var(--brand-green); color: var(--text-primary); }
.topic-card-title { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.topic-card-text { display: block; color: var(--text-secondary); font-size: .92rem; line-height: 1.55; }
.topic-card-count { display: block; margin-top: 10px; color: var(--brand-green); font-size: .82rem; font-weight: 600; }
@media (max-width: 700px) {
  .topic-grid { grid-template-columns: 1fr; }
  .topic-index { padding-top: 28px; }
  .topic-cta { padding: 20px; }
}
