/* =====================================================================
   CSBT BRAND LAYER  (loaded after main.css)
   Source of truth: csbt-brand skill – brand-tokens.md, logo.md.
   Tokens live in main.css :root. Keep this file small and component-based.
   ===================================================================== */

/* ---------- 1. Logo (logo.md: current logo, no effects, clear space) ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  padding: 4px 0;               /* clear space around the lockup */
}
.brand-logo img {
  display: block;
  width: 180px;                 /* ≥ 120 px minimum on screen */
  height: auto;
}
.brand-logo .brand-logo__color { display: none; }

/* Sticky (white glass) header → colour logo with teal wordmark */
.site-header.is-stuck .brand-logo .brand-logo__white { display: none; }
.site-header.is-stuck .brand-logo .brand-logo__color { display: block; }
.site-header.is-stuck .brand-logo img { width: 150px; }

.brand-logo--footer img { width: 170px; }
.footer-logo-wrap { margin-bottom: 14px; }
.footer-company-name { color: var(--white); margin-bottom: 8px; }

@media (max-width: 480px) {
  .brand-logo img { width: 140px; }
  .site-header.is-stuck .brand-logo img { width: 130px; }
}

/* ---------- 2. Buttons: navy text on orange (5.8:1). White on orange (2.6:1) fails AA ---------- */
.btn-primary,
.btn-primary:visited {
  background: var(--orange);
  color: var(--navy-dark);
  font-weight: 700;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--orange-hover);
  color: var(--navy-dark);
}
/* Motion for all buttons lives in section 8. */

/* ---------- 3. Labels: orange tick + UPPERCASE label (signature motif 3) ---------- */
.badge-solid,
.badge-solid-dark,
.badge-outline,
.badge-text {
  display: block;
  width: fit-content;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}
.badge-solid::before,
.badge-solid-dark::before,
.badge-outline::before,
.badge-text::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin-bottom: 10px;
  background: var(--orange);
}
.text-center .badge-text,
.text-center .badge-solid,
.text-center .badge-solid-dark,
.section-header .badge-text { margin-left: auto; margin-right: auto; }
.text-center .badge-text::before,
.text-center .badge-solid::before,
.text-center .badge-solid-dark::before,
.section-header .badge-text::before { margin-left: auto; margin-right: auto; }

/* On navy (heroes, dark sections): orange label – passes on navy */
.badge-solid,
.badge-outline,
.page-hero .badge-text,
.hero-section .badge-text,
.stats-section .badge-text,
.cta-section .badge-text,
.testimonials-section .badge-text,
.site-footer .badge-text { color: var(--orange); }

/* Secondary text on dark sections: steel (≈8:1 on navy), never slate (2.7:1) */
.testimonials-section .section-header p,
.testimonials-section .text-center > p,
.testimonials-section .text-light-gray { color: var(--text-light-gray); }

/* On light sections: navy label + orange tick (orange text fails below 24px on white) */
.badge-solid-dark,
.badge-text { color: var(--navy-dark); }

/* ---------- 4. 62/38 band (signature motif 2) ---------- */
.csbt-band {
  height: 8px;
  background: linear-gradient(90deg, var(--orange) 0 62%, var(--green) 62% 100%);
}
.page-hero { position: relative; }
.page-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--orange) 0 62%, var(--green) 62% 100%);
}

/* ---------- 5. Forms: visible focus, brand success colour ---------- */
.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  outline: 2px solid var(--navy-dark);
  outline-offset: 2px;
  border-color: var(--orange);
}
.form-message.success,
.quote-form .form-message.success,
.review-message.success { color: var(--green); }

/* ---------- 6. Mobile header: 44 px tap targets, call button ---------- */
.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  padding: 13px 9px;
  justify-content: space-between;
  align-items: stretch;
}
.mobile-menu-toggle span {
  width: 100%;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-toggle span { transition: none; }
}

.mobile-call {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--orange);
  color: var(--navy-dark);
}
.mobile-call svg { width: 20px; height: 20px; }
@media (max-width: 992px) {
  .mobile-call { display: inline-flex; }
  .header-actions { margin-left: auto; }
}

/* ---------- 7. Small brand details ---------- */
.footer-menu a { display: inline-block; padding: 4px 0; min-height: 24px; }   /* WCAG 2.5.8 */
::selection { background: var(--orange); color: var(--navy-dark); }

/* ---------- 8. Button micro-interactions (micro-interaction skill) ----------
   Feedback, not decoration: lift on hover, instant press, arrow nudge, and an
   orange bar that draws in under outline buttons (echo of the brand tick/band).
   transform/opacity/box-shadow only; 80–220 ms; ease-out in, faster out.
   Hover effects only on devices that can hover (no sticky hover on phones). */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 80ms;
  --dur: 180ms;
  --dur-slow: 220ms;
  --lift: -2px;
  --shadow-orange: 0 10px 22px -8px rgba(245, 130, 31, 0.55);
  --shadow-navy: 0 10px 22px -10px rgba(10, 42, 51, 0.45);
}

.btn,
.filter-btn,
.mobile-call {
  position: relative;
  transform: translateZ(0);            /* own layer, no repaint jitter */
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur-slow) var(--ease-out),
    background-color var(--dur) ease,
    border-color var(--dur) ease,
    color var(--dur) ease;
  -webkit-tap-highlight-color: transparent;
}

/* Arrow nudge: the → glides forward on hover */
.btn .arrow,
.link-arrow .arrow,
.btn-view-all .arrow {
  display: inline-block;
  transition: transform var(--dur) var(--ease-out);
}

/* Outline buttons: orange bar draws in from the left along the bottom edge */
.btn-outline-light::after,
.btn-outline::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-slow) var(--ease-out);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  .mobile-call:hover { transform: translateY(var(--lift)); }

  .btn-primary:hover { box-shadow: var(--shadow-orange); }
  .btn-outline:hover { box-shadow: var(--shadow-navy); border-color: var(--navy-dark); color: var(--navy-dark); }
  .btn-outline-light:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.85); }

  .btn-outline-light:hover::after,
  .btn-outline:hover::after { transform: scaleX(1); }

  .btn:hover .arrow,
  .link-arrow:hover .arrow,
  .btn-view-all:hover .arrow { transform: translateX(4px); }

  .filter-btn:hover { transform: translateY(-1px); }
}

/* Keyboard focus gets the same lift + arrow + bar as hover, plus a clear ring */
.btn:focus-visible,
.filter-btn:focus-visible,
.mobile-call:focus-visible,
.link-arrow:focus-visible,
.btn-view-all:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.site-footer .btn:focus-visible,
.cta-section .btn:focus-visible,
.hero-section .btn:focus-visible,
.page-hero .btn:focus-visible { outline-color: var(--white); }
.btn:focus-visible .arrow,
.link-arrow:focus-visible .arrow { transform: translateX(4px); }
.btn-outline-light:focus-visible::after,
.btn-outline:focus-visible::after { transform: scaleX(1); }

/* Press: instant, slightly faster than the release */
.btn:active,
.filter-btn:active,
.mobile-call:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
  transition-duration: var(--dur-fast);
}

/* Filter pills: navy text on orange (white on orange fails contrast) */
.filter-btn.active,
.filter-btn:hover {
  color: var(--navy-dark);
}

/* View-all link: move the arrow with transform instead of animating gap (layout) */
.btn-view-all { transition: color var(--dur) ease; }
.btn-view-all:hover { gap: 6px; }

/* Small orange text on white fails contrast (brand: orange text on white only ≥24px).
   Use the safe dark orange for these text links; hover goes navy. */
.link-arrow,
.btn-view-all { color: var(--orange-text-safe); transition: color var(--dur) ease; }
.link-arrow:hover,
.btn-view-all:hover { color: var(--navy-dark); }

/* Reduced motion: keep colour/shadow feedback, drop all movement */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .filter-btn,
  .mobile-call,
  .btn .arrow,
  .link-arrow .arrow,
  .btn-view-all .arrow,
  .btn-outline-light::after,
  .btn-outline::after { transition-property: background-color, border-color, color, box-shadow, opacity; }
  .btn:hover,
  .btn:active,
  .filter-btn:hover,
  .filter-btn:active,
  .mobile-call:hover,
  .mobile-call:active,
  .btn:hover .arrow,
  .btn:focus-visible .arrow,
  .link-arrow:hover .arrow,
  .link-arrow:focus-visible .arrow,
  .btn-view-all:hover .arrow { transform: none; }
  .btn-outline-light::after,
  .btn-outline::after { transform: scaleX(1); opacity: 0; }
  .btn-outline-light:hover::after,
  .btn-outline:hover::after,
  .btn-outline-light:focus-visible::after,
  .btn-outline:focus-visible::after { opacity: 1; }
}

/* ---------- 9. Image placeholders (CSBT mark + shimmer while loading) ----------
   main.js adds .bss-img-loading to every content <img> that is still loading,
   swaps it for .bss-img-loaded when it arrives, and .bss-img-broken (with a
   transparent pixel as src) if it fails – so visitors never see a broken icon.
   .placeholder-image is the static version for cards without a photo. */
:root {
  --ph-bg: var(--bg-section);
  --ph-mark: url("../images/brand/csbt-mark-placeholder.png");
  --ph-mark-size: auto min(56px, 46%);
  --ph-shine: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 65%);
}

img.bss-img-loading,
img.bss-img-broken,
.placeholder-image {
  background-color: var(--ph-bg);
  background-image: var(--ph-mark);
  background-repeat: no-repeat;
  background-position: center;
  background-size: var(--ph-mark-size);
  color: transparent;                 /* hide alt text while loading / if broken */
}

/* Shimmer: a soft light band sweeps across while the photo is on its way */
img.bss-img-loading {
  background-image: var(--ph-shine), var(--ph-mark);
  background-repeat: no-repeat, no-repeat;
  background-size: 250% 100%, var(--ph-mark-size);
  background-position: 120% 0, center;
  animation: bss-shimmer 1.4s linear infinite;
}
@keyframes bss-shimmer {
  from { background-position: 120% 0, center; }
  to   { background-position: -120% 0, center; }
}

/* Photo arrives: gentle fade from the placeholder */
img.bss-img-loaded { animation: bss-img-in 250ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes bss-img-in {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

/* Failed photo: keep the branded box, give it a sensible shape if unsized */
img.bss-img-broken { object-fit: none; min-height: 120px; }
img.bss-img-broken:not([width]) { aspect-ratio: 4 / 3; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  img.bss-img-loading { animation: none; background-image: var(--ph-mark); background-size: var(--ph-mark-size); background-position: center; }
  img.bss-img-loaded { animation: none; }
}

/* ---------- 10. Developer credit (footer bottom) ---------- */
.footer-bottom .footer-credit { margin-top: 12px; }
.footer-credit a {
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: color var(--dur) ease, border-color var(--dur) ease;
}
.footer-credit a:hover,
.footer-credit a:focus-visible { color: var(--orange); border-bottom-color: var(--orange); }

/* ---------- 11. Membership logo (SBMA Bangladesh) in the footer ---------- */
/* Transparent partner logo (owner's choice): no chip, no background, keeps its own colours. */
.footer-iso-icon--logo {
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
}
.footer-iso-icon--logo img {
  display: block;
  width: auto;
  height: 36px; /* matches the two badge text lines; width follows the logo ratio (~56px) */
}
