/* =================================================================================================
   BeBrainer "static glass" theme, part 2 of 2: shared components and the g-* utility classes.
   Tokens live in theme-base.css. Icons: <x-med-icon name="steth" size="24" /> (App\Support\MedIcon), coloured by CSS.

   UTILITY CLASSES (use these on new or restyled pages)
     .g-page          page column: centred, content max 1216px (lines up with the header), 12px side room on phones, sections spaced by --g-gap
     .g-panel         big section panel (white glass, 1px white border, radius 22/28, soft shadow, padding)
       .g-panel--flush   no padding (for panels whose inside runs edge to edge)
       .g-panel--band    solid purple band (#4a27d6) with white text, for one strong call to action
     .g-tile          card / tile (white glass .72, 1px white border, radius 18). On an <a> it lifts on hover.
     .g-head          section heading row: <div class="g-head"><h2><x-med-icon .../> text <span class="g-accent">accent</span></h2>
                      <a class="g-head__more" href>সব দেখুন →</a></div>. Add .g-head--center to centre it from 1024px up.
     .g-sub           one muted line under a heading
     .g-accent        accent-coloured text (#532ceb)          .g-muted   muted text
     .g-btn           main button: gradient, 50px tall, radius 18, white bold text
       .g-btn--line      outline button: 2px #532ceb on white glass
       .g-btn--solid     solid brand purple #5b31e1 (card buttons)
       .g-btn--white     white button for purple bands
       .g-btn--green     outline in WhatsApp green
       .g-btn--sm        46px tall, radius 14         .g-btn--block   full width
     .g-swipe         sideways swipe row (snap). Children are --g-swipe-w wide (262px phone; set it per row).
                      On wider screens add .g-swipe--grid to turn it into a 4-column grid from 1024px.
     .g-grid          responsive grid: .g-grid--2 / --3 / --4 / --6 (columns at desktop; phones get 1, 2 or 3, see below)
     .g-ico           round icon chip (34px circle, lavender fill, accent icon). .g-ico--lg 44px.
     .g-ico-sq        small square colour chip with a white icon (uses --c)
     .g-c-purple .g-c-green .g-c-pink .g-c-orange .g-c-blue .g-c-magenta   set --c (fill) and --c-text (readable text)
     .g-chip          small status pill (white, bold, 12px). .g-chip--live green text.
     .g-table         clean table inside a .g-tile or .g-panel (wrap it in .g-table-wrap for sideways scroll)
     .g-note          info message box; .g-note--ok, .g-note--bad for success and error
     .g-faq           <details> list item in a tile with a + / − marker
     .g-sr            visually hidden text for screen readers

   SHARED COMPONENTS RESTYLED HERE FOR EVERY PAGE
     .btn (.outline .pill .soft .off) · .card (course and product cards) .thumb .tag .stats .price · .box .panel .sec .item
     .order .person .vcard .deck .q .cat · .title h2 · .sx-pager and partials/pager · .ok .err .err-box .state
     .chips · .auth form fields · tables inside main (low priority, any class rule wins)
   ================================================================================================= */

/* ---------- Page column and section spacing ---------- */
.g-page { width: 100%; max-width: 1264px; margin: 0 auto; padding: 16px 12px 0; display: flex; flex-direction: column; gap: var(--g-gap); }
@media (min-width: 768px) { .g-page { padding: 24px 24px 0; } }

/* ---------- Panels and tiles ---------- */
.g-panel { position: relative; padding: 18px 12px; border-radius: var(--g-r-panel); background: var(--g-panel); border: 1px solid var(--g-panel-line); box-shadow: var(--g-panel-shadow); }
@media (min-width: 768px) { .g-panel { padding: 28px; } }
.g-panel--band { background: var(--g-year); border-color: #7a5cf0; color: #fff; box-shadow: 0 10px 26px rgba(74, 39, 214, .25); }
.g-panel--band h2, .g-panel--band h3 { color: #fff; }
.g-tile { display: block; padding: 12px; border-radius: var(--g-r-tile); background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); }
a.g-tile { transition: transform .15s, box-shadow .15s, background .15s; }
a.g-tile:hover { background: var(--g-tile-hover); box-shadow: 0 8px 20px rgba(60, 40, 160, .12); }
@media (hover: hover) { a.g-tile:hover { transform: translateY(-2px); } }

/* ---------- Section heading row with its icon ---------- */
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.g-head h2 { margin: 0; font-size: 23px; line-height: 1.3; font-weight: 700; }
.g-head h2 svg { display: inline-block; width: 24px; height: 24px; margin-right: 8px; vertical-align: -4px; color: var(--g-accent); }
.g-head__more { flex: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--g-accent); white-space: nowrap; }
.g-head__more:hover { color: var(--g-accent-hover); }
@media (min-width: 1024px) {
  .g-head h2 { font-size: 32px; }
  .g-head h2 svg { width: 30px; height: 30px; vertical-align: -5px; }
  .g-head--center { flex-direction: column; align-items: center; gap: 0; text-align: center; }
  .g-head--center + .g-sub { text-align: center; }
}
.g-sub { margin: -6px 0 12px; font-size: 15px; color: var(--g-muted); }
.g-accent { color: var(--g-accent); }
.g-muted { color: var(--g-muted); }

/* ---------- Buttons ---------- */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 18px;
  border: 2px solid transparent; background: var(--g-grad); color: #fff; font: inherit; font-size: 17px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; }
.g-btn:hover { filter: brightness(1.08); color: #fff; }
.g-btn--line { background: rgba(255, 255, 255, .7); border-color: var(--g-accent); color: var(--g-accent); }
:root[data-theme="dark"] .g-btn--line { background: rgba(255, 255, 255, .06); }
.g-btn--line:hover { color: var(--g-accent); filter: none; background: var(--g-tile-hover); }
.g-btn--solid { background: var(--g-brand); }
.g-btn--white { background: #fff; color: #3a1fb0; }
.g-btn--white:hover { color: #3a1fb0; }
.g-btn--green { background: rgba(255, 255, 255, .7); border-color: #0e7a4b; color: #0e7a4b; }
:root[data-theme="dark"] .g-btn--green { background: rgba(255, 255, 255, .06); border-color: #34d399; color: #6ee7b7; }
.g-btn--sm { min-height: 46px; border-radius: 14px; font-size: 16px; }
.g-btn--block { display: flex; width: 100%; }
.g-btn svg { width: 20px; height: 20px; flex: none; }
/* The small "copy link" pill (app.css) keeps its look but is a full 44px tap target everywhere. */
.copybtn { min-height: 44px; }
/* Picture pickers (profile photo, book error photos): the browser's own small button becomes a 44px themed one. */
input[type="file"] { max-width: 100%; min-height: 44px; font: inherit; font-size: 15px; color: var(--g-muted); }
input[type="file"]::file-selector-button { min-height: 44px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--g-line); border-radius: 12px;
  background: var(--g-tile); color: var(--g-accent); font: inherit; font-weight: 700; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { a.g-tile, .g-btn { transition: none; } a.g-tile:hover { transform: none; } }

/* ---------- Sideways swipe rows (course and video rows only) ---------- */
.g-swipe { --g-swipe-w: 262px; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  margin: 0 -12px; padding: 2px 12px 10px; scroll-padding: 0 12px; scrollbar-width: none; }
.g-swipe::-webkit-scrollbar { display: none; }
.g-swipe > * { flex: 0 0 var(--g-swipe-w); width: var(--g-swipe-w); scroll-snap-align: start; }
@media (min-width: 768px) { .g-swipe { margin: 0 -24px; padding: 2px 24px 10px; scroll-padding: 0 24px; } }
@media (min-width: 1024px) {
  .g-swipe--grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; overflow: visible; margin: 0; padding: 0; }
  .g-swipe--grid > * { width: auto; }
}

/* ---------- Grids ---------- */
.g-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-grid--3, .g-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 768px) { .g-grid { gap: 14px; } .g-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-grid--6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .g-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; } }

/* ---------- Icon chips and the six colours ---------- */
.g-ico { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--g-icon-bg); border: 1px solid var(--g-tile-line); color: var(--g-accent); }
.g-ico svg { width: 20px; height: 20px; }
.g-ico--lg { width: 44px; height: 44px; }
.g-ico--lg svg { width: 24px; height: 24px; }
.g-ico-sq { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--c, var(--g-purple)); color: #fff; }
.g-ico-sq svg { width: 15px; height: 15px; }
.g-c-purple { --c: var(--g-purple); --c-text: var(--g-purple-text); }
.g-c-green { --c: var(--g-green); --c-text: var(--g-green-text); }
.g-c-pink { --c: var(--g-pink2); --c-text: var(--g-pink-text); }
.g-c-orange { --c: var(--g-orange); --c-text: var(--g-orange-text); }
.g-c-blue { --c: var(--g-blue); --c-text: var(--g-blue-text); }
.g-c-magenta { --c: var(--g-magenta); --c-text: var(--g-magenta-text); }

/* ---------- Small pills, notes, tables, FAQ ---------- */
.g-chip { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px; background: #fff; color: var(--g-accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.6; }
.g-note { padding: 12px 16px; border-radius: var(--g-r-small); background: var(--g-tile); border: 1px solid var(--g-line); color: var(--g-text); font-size: 16px; }
.g-note--ok { border-color: #34d399; background: rgba(16, 185, 129, .1); }
.g-note--bad { border-color: #f87171; background: rgba(239, 68, 68, .08); }
.g-table-wrap { overflow-x: auto; border-radius: var(--g-r-tile); }
.g-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.g-table th, .g-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--g-line); }
.g-table th { font-size: 14px; color: var(--g-muted); font-weight: 700; }
.g-table tr:last-child td { border-bottom: 0; }
/* Editor text tables (notices, blog, lessons, questions): a cell breaks between words, never inside one ("আস/ন");
   a table too wide for the phone scrolls sideways in its own box (richtext.css), the page does not. */
.rt th, .rt td { overflow-wrap: normal; }
.g-faq { border-radius: var(--g-r-tile); background: var(--g-tile); border: 1px solid var(--g-tile-line); }
.g-faq + .g-faq { margin-top: 8px; }
.g-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px; font-weight: 700; cursor: pointer; list-style: none; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; flex: none; font-size: 22px; line-height: 1; color: var(--g-accent); }
.g-faq[open] summary { color: var(--g-accent); }
.g-faq[open] summary::after { content: "\2212"; }
.g-faq > div { padding: 0 14px 14px; color: var(--g-muted); font-size: 16px; }
.g-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* =================================================================================================
   Older shared components, given the glass look so pages that are not rebuilt yet still fit in.
   ================================================================================================= */

/* Buttons */
.btn { min-height: 48px; border-radius: 14px; background: var(--g-grad); color: #fff; font-weight: 700; box-shadow: none; }
.btn:hover { filter: brightness(1.08); }
.btn.outline { background: rgba(255, 255, 255, .7); border: 2px solid var(--g-accent); color: var(--g-accent); }
:root[data-theme="dark"] .btn.outline { background: rgba(255, 255, 255, .06); }
.btn.pill { min-height: 46px; border-radius: 14px; background: var(--g-brand); }
.btn.pill.off, .btn.off { background: var(--g-field); color: var(--g-muted); }

/* Surfaces */
.card, .box, .cat, .panel, .q, .person, .vcard, .order, .sec, .item, .deck,
:root[data-theme="light"] .card, :root[data-theme="light"] .box, :root[data-theme="light"] .cat, :root[data-theme="light"] .panel, :root[data-theme="light"] .q,
:root[data-theme="light"] .person, :root[data-theme="light"] .vcard, :root[data-theme="light"] .order {
  background: var(--g-tile); border: 1px solid var(--g-tile-line); box-shadow: none;
}
.box, .panel { border-radius: var(--g-r-tile); }
.item:hover, .card:hover, .cat:hover { border-color: var(--g-tile-line); }
.card:hover, .cat:hover, .vcard:hover { background: var(--g-tile-hover); }

/* Course and product cards (partials/course-card, product-card, bbstore-card) */
.card { gap: 10px; padding: 10px; border-radius: var(--g-r-tile); }
.thumb, .thumb.cover { border: 0; border-radius: 12px; }
.card .thumb { color: #fff; font-size: 16px; }
.tag { top: 18px; left: auto; right: 18px; padding: 1px 10px; background: #fff; color: var(--g-accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.stats { gap: 6px; padding: 0; border: 0; }
.stats div { padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .8); border: 1px solid var(--g-line); font-size: 13px; color: var(--g-muted); }
:root[data-theme="dark"] .stats div { background: rgba(255, 255, 255, .05); }
.stats b { font-size: 15px; color: var(--g-text); }
.card h3 { font-size: 16px; line-height: 1.4; }
.card h3 a:hover { color: var(--g-accent); }
.price { border-top-color: var(--g-line); color: var(--g-accent); font-size: 20px; }
.price s { color: var(--g-muted); }
.card .btn.pill { min-height: 46px; }

/* Section titles on pages that are not rebuilt yet */
.title h2 { font-size: 23px; }
.title p { color: var(--g-muted); }
@media (min-width: 1024px) { .title h2 { font-size: 32px; } }

/* Category tiles (courses page chips and old grids) */
.cat { border-radius: var(--g-r-tile); font-size: 15px; color: var(--g-text); }
.cat.on { border-color: var(--g-accent); box-shadow: inset 0 0 0 1px var(--g-accent); }
.cat i, .cat img { background: var(--g-icon-bg); color: var(--g-accent); }

/* Questions in <details> */
.sec summary { min-height: 48px; }
.sec[open] summary { color: var(--g-accent); }

/* Pagers */
.sx-pager a, .sx-pager span { min-width: 44px; min-height: 44px; border-radius: 12px; }
.sx-pager a { background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); }
.sx-pager .on { background: var(--g-brand); color: #fff; }

/* Messages and status */
.ok { background: rgba(16, 185, 129, .1); border-color: #34d399; color: var(--good); }
.err-box { background: rgba(239, 68, 68, .08); border-color: #f87171; }
.state { background: rgba(245, 158, 11, .14); }

/* Filter chips */
.chips button { min-height: 44px; background: var(--g-tile); border-color: var(--g-tile-line); }

/* Sign-in and other forms */
.auth input, .phone span { background: var(--g-field); border-color: var(--g-line); }
.auth input:focus { border-color: var(--g-accent); }

/* Plain tables on content pages: lowest priority, so any page's own table style still wins. */
:where(main) table { border-collapse: collapse; }
:where(main) :where(th, td) { border-color: var(--g-line); }

/* Picture placeholders shimmer in brand lavender */
:root[data-theme="light"] .thumb, :root[data-theme="light"] .vthumb, :root[data-theme="light"] .product-img, :root[data-theme="light"] .shot {
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%), linear-gradient(135deg, #5b31e1, #3f47e0);
}
