/* ==========================================================================
   ShongZog Public — Base / Reset / Bootstrap harmonisation
   Scoped to body.sz-ui so the Admin area is never affected.
   ========================================================================== */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body.sz-ui {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.sz-ui.lang-bn { font-family: var(--font-bn); line-height: 1.75; }

.sz-ui h1, .sz-ui h2, .sz-ui h3,
.sz-ui h4, .sz-ui h5, .sz-ui h6 {
  color: var(--c-heading);
  font-weight: 750;
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
}
.sz-ui h1, .sz-ui h2 { letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.sz-ui.lang-bn h1, .sz-ui.lang-bn h2, .sz-ui.lang-bn h3,
.sz-ui.lang-bn h4, .sz-ui.lang-bn h5, .sz-ui.lang-bn h6 {
  letter-spacing: 0; line-height: 1.35; font-weight: 700;
}

.sz-ui p { margin-bottom: 1rem; }
.sz-ui a { color: var(--c-primary); text-decoration: none; transition: color var(--dur-fast) ease; }
.sz-ui a:hover { color: var(--c-primary-hover); }
.sz-ui img { max-width: 100%; }
.sz-ui ::selection { background: var(--brand-200); color: var(--ink-900); }
.sz-ui .text-muted { color: var(--c-muted) !important; }
.sz-ui .lead { font-size: var(--fs-lg); color: var(--c-muted); font-weight: 400; }

.sz-ui :focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; border-radius: 6px; }

/* Container — a little wider and with generous gutters */
.sz-ui .container { max-width: var(--container-max); padding-inline: clamp(1rem, 3vw, 1.5rem); }

/* Sections */
.section { position: relative; padding-block: var(--section-y); isolation: isolate; }
.section-sm { position: relative; padding-block: var(--section-y-sm); isolation: isolate; }
.section--canvas { background: var(--c-canvas); }
.section--sand { background: var(--sand-100); }
.section--muted { background: var(--ink-50); }
.section--ink { background: var(--grad-ink); color: var(--ink-300); }
.section--ink h1, .section--ink h2, .section--ink h3,
.section--ink h4, .section--ink h5, .section--ink h6 { color: #fff; }
.section--ink .text-muted { color: var(--ink-400) !important; }

/* ---------- Bootstrap form controls ---------- */
.sz-ui .form-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-800); margin-bottom: .45rem; }
.sz-ui .form-control,
.sz-ui .form-select {
  min-height: 48px;
  padding: .7rem 1rem;
  font-size: .95rem;
  color: var(--ink-900);
  background-color: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-xs);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.sz-ui textarea.form-control { min-height: 120px; line-height: 1.6; }
.sz-ui .form-control::placeholder { color: var(--ink-400); }
.sz-ui .form-control:hover, .sz-ui .form-select:hover { border-color: var(--ink-300); }
.sz-ui .form-control:focus, .sz-ui .form-select:focus {
  border-color: var(--brand-400);
  box-shadow: var(--ring);
  outline: 0;
}
.sz-ui .form-control.input-validation-error,
.sz-ui .form-select.input-validation-error { border-color: var(--rose-500); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); }
.sz-ui .form-text { color: var(--c-muted); font-size: .8rem; }
.sz-ui .form-check-input { width: 1.15em; height: 1.15em; border-color: var(--ink-300); }
.sz-ui .form-check-input:checked { background-color: var(--brand-500); border-color: var(--brand-500); }
.sz-ui .form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand-400); }
.sz-ui .field-validation-error, .sz-ui .text-danger { color: var(--rose-500) !important; font-size: .8rem; font-weight: 500; }
.sz-ui .input-group-text { background: var(--ink-50); border-color: var(--ink-200); color: var(--ink-500); border-radius: var(--r-sm); }

/* ---------- Alerts ---------- */
.sz-ui .alert { border: 1px solid transparent; border-radius: var(--r-md); padding: .9rem 1.1rem; font-size: .92rem; }
.sz-ui .alert-danger  { background: var(--rose-50); border-color: #F8CDD0; color: #9B1C22; }
.sz-ui .alert-success { background: var(--teal-50); border-color: #BDEBDD; color: #0B6B58; }
.sz-ui .alert-info    { background: var(--sky-50);  border-color: #C8DCFC; color: #1D4FA3; }
.sz-ui .alert-warning { background: #FFF7E6; border-color: #FBE2B0; color: #8A5A00; }
.sz-ui .validation-summary-valid { display: none; }

/* ---------- Breadcrumb ---------- */
.sz-ui .breadcrumb { font-size: var(--fs-sm); margin-bottom: 0; gap: .15rem; }
.sz-ui .breadcrumb-item a { color: var(--ink-500); font-weight: 500; }
.sz-ui .breadcrumb-item a:hover { color: var(--brand-500); }
.sz-ui .breadcrumb-item.active { color: var(--ink-800); font-weight: 600; }
.sz-ui .breadcrumb-item + .breadcrumb-item::before { content: "\F285"; font-family: 'bootstrap-icons'; font-size: .65rem; color: var(--ink-300); padding-top: .3rem; }

/* ---------- Pagination ---------- */
.sz-ui .pagination { gap: .4rem; }
.sz-ui .page-link {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm) !important; border: 1px solid var(--ink-200); color: var(--ink-700);
  font-weight: 600; font-size: .9rem; background: #fff; transition: all var(--dur-fast) ease;
}
.sz-ui .page-link:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.sz-ui .page-item.active .page-link { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.sz-ui .page-item.disabled .page-link { opacity: .45; }

/* ---------- Tables ---------- */
.sz-ui .table { --bs-table-bg: transparent; color: var(--c-text); margin-bottom: 0; }
.sz-ui .table > :not(caption) > * > * { padding: 1rem 1.1rem; border-bottom-color: var(--ink-100); }
.sz-ui .table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); font-weight: 700; background: var(--ink-50); }

/* ---------- Dropdown ---------- */
.sz-ui .dropdown-menu {
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: .5rem;
  font-size: .92rem;
}
.sz-ui .dropdown-item { border-radius: var(--r-xs); padding: .55rem .8rem; color: var(--ink-700); font-weight: 500; }
.sz-ui .dropdown-item:hover, .sz-ui .dropdown-item:focus { background: var(--brand-50); color: var(--brand-700); }
.sz-ui .dropdown-divider { border-color: var(--ink-100); margin: .4rem 0; }

/* ---------- Scroll reveal (progressive; only hides when JS is present) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Hero (first screen): same fade-up, but as a CSS animation that starts at first paint instead of waiting
   for site.js (loaded at the end of the body, after the Bootstrap bundle). Keeps the largest text and image
   visible early on slow mobile connections (LCP). The delays mirror data-reveal-delay. */
.js :is(.home-hero, .page-hero, .pd-head) [data-reveal] { transition: none; animation: sz-reveal .7s var(--ease-out) var(--reveal-delay, 0ms) both; }
[data-reveal-delay="80"] { --reveal-delay: 80ms; }
[data-reveal-delay="100"] { --reveal-delay: 100ms; }
[data-reveal-delay="120"] { --reveal-delay: 120ms; }
[data-reveal-delay="160"] { --reveal-delay: 160ms; }
[data-reveal-delay="200"] { --reveal-delay: 200ms; }
[data-reveal-delay="220"] { --reveal-delay: 220ms; }
[data-reveal-delay="240"] { --reveal-delay: 240ms; }
[data-reveal-delay="280"] { --reveal-delay: 280ms; }
[data-reveal-delay="300"] { --reveal-delay: 300ms; }
[data-reveal-delay="320"] { --reveal-delay: 320ms; }
@keyframes sz-reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js :is(.home-hero, .page-hero, .pd-head) [data-reveal] { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Headings on dark / brand surfaces (beats `.sz-ui hN` specificity) */
.sz-ui :is(.section--ink, .bg-ink-glow, .bg-brand-glow, .card-sz--ink, .page-hero--ink, .form-aside__card--ink) :is(h1, h2, h3, h4, h5, h6) { color: #fff; }
.sz-ui :is(.bg-ink-glow, .section--ink) .section-sub { color: var(--ink-400); }
.sz-ui :is(.bg-brand-glow) .section-sub { color: rgba(255,255,255,.85); }
/* Bangla glyphs render larger optically — scale display sizes down a notch */
.lang-bn .section-title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); }
.lang-bn .page-hero__title { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

/* A section's `isolation: isolate` would trap modals/offcanvases (z-index) beneath the sticky header.
   Sections hosting one drop isolation (their .deco layer then sits under the section background). */
.section:has(.modal, .offcanvas), .section-sm:has(.modal, .offcanvas), .page-hero:has(.modal, .offcanvas) { isolation: auto; }

/* Opt-out: a light card inside a dark section keeps dark headings */
.sz-ui :is(.section--ink, .bg-ink-glow, .bg-brand-glow) .on-light :is(h1, h2, h3, h4, h5, h6) { color: var(--c-heading); }
