/* ============================================================
   Sensory Readable Help — help.css
   Branded with readablebrand.css tokens
   Font: Poppins | Brand: Sensory App House Ltd
   ============================================================ */

/* ── Brand tokens (from readablebrand.css) ── */
:root {
  --brand-indigo:   #6e68ca;   /* Nav bg, accents, borders, section labels  */
  --title-indigo:   #3d31be;   /* Headings, active states, CTA colour       */
  --brand-sky:      #b8ddff;   /* Highlight backgrounds, card borders       */
  --brand-lavender: #e3c7ff;   /* Footer background                         */
  --body-black:     #000000;   /* Body text                                 */
  --pure-white:     #ffffff;   /* Page / card backgrounds                   */
  --transition:     all 0.3s ease;

  /* Help-site derived tokens */
  --sky-faint:    #f0f6ff;    /* Sidebar hover, section backgrounds         */
  --sky-mid:      #dbeeff;    /* Active sidebar item bg                     */
  --text-body:    #1a1a2e;    /* Rich dark body text (readable on white)    */
  --text-soft:    #55527a;    /* Secondary / muted text                     */
  --border:       rgba(110,104,202,0.18); /* Subtle indigo border            */
  --border-sky:   rgba(110,104,202,0.3);  /* Stronger border on cards        */
  --shadow:       0 2px 16px rgba(61,49,190,0.10);
  --shadow-hover: 0 6px 24px rgba(61,49,190,0.18);
  --radius:       12px;
  --radius-sm:    8px;
  --sidebar-w:    300px;
  --topbar-h:     62px;
  --font:         'Poppins', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--pure-white);
}

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--title-indigo); color: #fff;
  padding: 10px 18px; z-index: 9999;
  font-weight: 600; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ═══════════════════════════════════════
   TOP BAR — matches .nav in readablebrand
   ═══════════════════════════════════════ */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--brand-indigo);
  border-bottom: 4px solid var(--title-indigo);
  z-index: 200;
  box-shadow: 0 2px 10px rgba(61,49,190,0.25);
}
.top-bar-inner {
  display: flex; align-items: center;
  height: 100%; padding: 0 24px; gap: 16px;
}

/* Logo */
.site-logo {
  text-decoration: none; display: flex;
  align-items: center; gap: 10px; flex: 1;
}
.logo-img {
  width: 32px; height: 32px;
  border-radius: 6px;
}
.logo-readable {
  font-size: 1.15rem; font-weight: 800;
  color: #fff; letter-spacing: -0.01em;
}
.logo-help {
  font-size: 0.72rem; font-weight: 700;
  color: var(--brand-sky);
  text-transform: uppercase; letter-spacing: 0.12em;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px; border-radius: 20px;
}

/* Top bar CTA */
.top-bar-cta {
  background: var(--brand-sky);
  color: var(--body-black) !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: var(--transition);
}
.top-bar-cta:hover {
  background: #fff;
  color: var(--title-indigo) !important;
}

/* Mobile toggle */
.menu-toggle {
  display: none; flex-direction: column;
  justify-content: space-between;
  width: 26px; height: 18px;
  background: none; border: none;
  cursor: pointer; padding: 0;
}
.menu-toggle span {
  display: block; width: 100%; height: 2px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px; transition: all .25s;
}

/* ═══════════════════════
   LAYOUT
   ═══════════════════════ */
.page-wrap {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ═══════════════════════
   SIDEBAR
   ═══════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--pure-white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar-inner {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}

/* Search */
.sidebar-search {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--sky-faint);
}
.sidebar-search input {
  width: 100%; padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem;
  color: var(--text-body); background: var(--pure-white);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.sidebar-search input::placeholder { color: var(--text-soft); }
.sidebar-search input:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px rgba(110,104,202,0.15);
}

/* Nav tree */
.sidebar nav {
  flex: 1; overflow-y: auto; padding: 10px 0;
}
.sidebar nav::-webkit-scrollbar { width: 4px; }
.sidebar nav::-webkit-scrollbar-thumb {
  background: var(--brand-sky); border-radius: 4px;
}
.nav-list, .nav-sub { list-style: none; }

.nav-item a {
  display: block;
  padding: 8px 20px;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s; line-height: 1.4;
}
.nav-item a:hover {
  color: var(--title-indigo);
  background: var(--sky-faint);
  border-left-color: var(--brand-indigo);
}
.nav-item.active > a {
  color: var(--title-indigo);
  background: var(--sky-mid);
  border-left-color: var(--title-indigo);
  font-weight: 700;
}
.nav-sub .nav-item a {
  padding-left: 36px;
  font-size: 0.84rem; font-weight: 400;
}
.nav-sub .nav-item a:hover { color: var(--title-indigo); }
.nav-sub .nav-item.active > a {
  color: var(--title-indigo); font-weight: 700;
}
.nav-item.hidden { display: none; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--sky-faint);
  font-size: 0.82rem;
}
.sidebar-footer a {
  color: var(--brand-indigo); text-decoration: none; font-weight: 600;
}
.sidebar-footer a:hover {
  color: var(--title-indigo); text-decoration: underline;
}

/* Overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(61,49,190,0.35); z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ═══════════════════════
   MAIN CONTENT
   ═══════════════════════ */
.main-content-area {
  margin-left: var(--sidebar-w); flex: 1; min-width: 0;
}
.content-inner {
  max-width: 800px;
  padding: 40px 48px 60px;
  margin: 0 auto;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 22px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.breadcrumb a {
  color: var(--brand-indigo); text-decoration: none; font-weight: 600;
}
.breadcrumb a:hover { color: var(--title-indigo); text-decoration: underline; }
.breadcrumb .sep { color: var(--brand-sky); }

/* ═══════════════════════
   ARTICLE
   ═══════════════════════ */
.article-title {
  font-size: 1.9rem; font-weight: 800;
  color: var(--title-indigo);
  line-height: 1.2; letter-spacing: -0.02em;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--brand-sky);
}

.article-body { color: var(--text-body); }
.article-body p { margin-bottom: 1em; }

/* Headings in article body */
.article-body h1,
.article-body h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--title-indigo);
  margin: 2em 0 0.75em;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--brand-sky);
}
.article-body h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text-body);
  margin: 1.5em 0 0.5em;
}

/* Lists */
.article-body ul, .article-body ol {
  padding-left: 1.5em; margin-bottom: 1em;
}
.article-body li { margin-bottom: 0.4em; }

/* Links */
.article-body a {
  color: var(--brand-indigo); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
}
.article-body a:hover { color: var(--title-indigo); }

/* Images — matches .screenshot-img in brand CSS */
.article-body img {
  max-width: 100%; height: auto;
  border-radius: var(--radius);
  border: 1px solid #d2d2d7;
  margin: 16px 0; display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
/* Inline ambient sound icons */
.article-body img[style*="vertical-align"] {
  display: inline; border: none; box-shadow: none;
  border-radius: 0; margin: 0 4px;
  vertical-align: middle; max-width: 36px; max-height: 36px;
}

/* Video iframes */
.article-body iframe {
  max-width: 100%; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius); border: none;
  margin: 20px 0; display: block;
  box-shadow: var(--shadow);
}

/* ── Article footer — lavender, matches brand footer ── */
.article-footer {
  margin-top: 48px; padding: 28px 32px;
  background: var(--brand-lavender);
  border-radius: var(--radius);
  font-size: 0.875rem; color: var(--text-body);
}
.article-footer a { color: var(--title-indigo); font-weight: 600; }
.article-footer a:hover { text-decoration: underline; }
.copyright {
  margin-top: 8px; font-size: 0.78rem;
  color: var(--text-soft);
}

/* ═══════════════════════════════
   FAQ SECTION
   ═══════════════════════════════ */
.faq-section {
  margin-top: 48px; padding-top: 32px;
  border-top: 3px solid var(--brand-sky);
}
.faq-section h2 {
  font-size: 1.1rem; font-weight: 800;
  color: var(--title-indigo);
  margin-bottom: 18px;
  /* Matches .section-label from brand CSS */
  text-transform: uppercase;
  letter-spacing: 1.5px; font-size: 13px;
  color: var(--brand-indigo);
}
.faq-list { list-style: none; }
.faq-item {
  border: 1.5px solid var(--border-sky);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--pure-white);
  overflow: hidden;
}
.faq-item dt {
  font-weight: 600; font-size: 0.92rem;
  padding: 13px 18px;
  color: var(--title-indigo);
  background: var(--sky-faint);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.faq-item dt::before {
  content: "Q";
  display: inline-block;
  background: var(--brand-indigo); color: white;
  font-size: 0.68rem; font-weight: 800;
  padding: 1px 6px; border-radius: 4px;
  margin-right: 8px; vertical-align: middle;
  letter-spacing: 0.05em;
}
.faq-item dd {
  padding: 13px 18px;
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.75; margin: 0;
}
.faq-item dd::before {
  content: "A";
  display: inline-block;
  background: var(--title-indigo); color: white;
  font-size: 0.68rem; font-weight: 800;
  padding: 1px 6px; border-radius: 4px;
  margin-right: 8px; vertical-align: middle;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════
   RELATED TOPICS
   ═══════════════════════════════ */
.related-topics {
  margin-top: 40px; padding: 22px 26px;
  background: var(--sky-faint);
  border-radius: var(--radius);
  border-left: 4px solid var(--brand-indigo);
}
.related-topics h2 {
  /* Section label style from brand CSS */
  font-size: 13px !important; font-weight: 800;
  color: var(--brand-indigo) !important;
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 14px;
  border: none !important; padding: 0 !important;
}
.related-topics ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.related-topics li a {
  display: inline-block;
  background: var(--pure-white);
  color: var(--title-indigo);
  border: 1.5px solid var(--brand-indigo);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem; font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.related-topics li a:hover {
  background: var(--brand-indigo);
  color: white; border-color: var(--brand-indigo);
}

/* ═══════════════════════════════
   INDEX / HOME PAGE
   ═══════════════════════════════ */
.index-hero {
  /* Gradient from title-indigo → brand-indigo, matches brand CTA style */
  background: linear-gradient(135deg, var(--title-indigo) 0%, var(--brand-indigo) 100%);
  padding: 52px;
  border-radius: 20px;
  margin-bottom: 44px;
  color: white;
}
.index-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: white !important;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  border: none !important; padding: 0 !important;
}
.index-hero p {
  font-size: 1rem; opacity: 0.9;
  max-width: 580px; line-height: 1.7;
}
.index-hero .badges {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px;
}
.badge {
  /* matches .trust-item in brand CSS */
  background: var(--brand-sky);
  color: var(--title-indigo);
  padding: 5px 13px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.03em;
}

/* Section labels on index — exact match to .section-label in brand CSS */
.section-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-indigo);
  margin: 36px 0 14px;
  display: block;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-sky);
}

/* Topic cards — based on .card in brand CSS */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 6px;
}
.topic-card {
  background: var(--pure-white);
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 20px 22px;
  text-decoration: none; color: var(--text-body);
  transition: var(--transition);
  border-top: 3px solid var(--brand-indigo);
  display: block;
}
.topic-card:hover {
  border-top-color: var(--title-indigo);
  border-color: var(--brand-indigo);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.topic-card h3 {
  font-size: 0.9rem; font-weight: 700;
  color: var(--title-indigo);
  margin-bottom: 5px; line-height: 1.3;
}
.topic-card p {
  font-size: 0.8rem; color: var(--text-soft); line-height: 1.5;
}

/* ═══════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════ */
:focus-visible {
  outline: 3px solid var(--title-indigo);
  outline-offset: 3px; border-radius: 3px;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--title-indigo);
  outline-offset: 3px;
}
.nav-item a:focus-visible {
  outline: 2px solid var(--title-indigo);
  outline-offset: -2px; border-radius: 0;
}

/* ═══════════════════════════════
   PRINT
   ═══════════════════════════════ */
@media print {
  .top-bar, .sidebar, .sidebar-overlay, .menu-toggle,
  .breadcrumb, .related-topics, .sidebar-search,
  .skip-link { display: none !important; }
  .main-content-area { margin-left: 0 !important; }
  .content-inner { padding: 0 !important; max-width: 100% !important; }
  .article-title { font-size: 1.4rem; border-bottom: 2px solid #000; color: #000; }
  .article-body img { max-width: 80%; box-shadow: none; border: 1px solid #ccc; }
  .article-body iframe { display: none; }
  .article-body a { color: #000; }
  .article-body a[href]::after { content: " (" attr(href) ")"; font-size: 0.72rem; color: #555; }
  .article-footer { background: #f5f5f5; }
  body { font-size: 11pt; color: #000; background: white; }
  .faq-item { border: 1px solid #ccc; margin-bottom: 6px; break-inside: avoid; }
}

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
  .menu-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(61,49,190,0.2);
  }
  .main-content-area { margin-left: 0; }
  .content-inner { padding: 24px 20px 40px; }
  .article-title { font-size: 1.5rem; }
  .top-bar-cta { display: none; }
  .index-hero { padding: 28px 24px; }
  .index-hero h1 { font-size: 1.5rem; }
  .topic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .content-inner { padding: 18px 16px 32px; }
}
