/* ===========================================================================
   Brand System — حمید طبائی
   One mark, one source. Color follows section via currentColor + overrides.
   Conventions (already referenced from runner-v2.css and gallery-page.css):
     .ht-brand        — root <a> link
     .ht-brand-icon   — wrapper around inline SVG mark
     .ht-brand-text   — wrapper around brand name + optional tagline
     .ht-brand-name   — main brand text
     .ht-brand-tag    — small tagline (only shown when footerIcon=true)
   =========================================================================== */

/* Defensive: a.ht-brand and .ht-brand both, so we win against context rules
   like `.tabaei-gallery-topbar a { color: #007aff }` that target plain <a>. */
.ht-brand,
a.ht-brand,
a.ht-brand:link,
a.ht-brand:visited,
a.ht-brand:hover,
a.ht-brand:focus {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ht-brand-color, #006a62);
  text-decoration: none;
  font-family: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

a.ht-brand:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 8px;
}

.ht-brand-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  color: inherit;
}

.ht-brand-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ht-brand-text {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.ht-brand-name {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: inherit;
}

.ht-brand-tag {
  font-weight: 500;
  font-size: 0.75rem;
  opacity: 0.65;
  color: inherit;
}

/* ============ Size variants ============ */

.ht-brand--navbar  .ht-brand-icon { width: 2.25rem; height: 2.25rem; }
.ht-brand--navbar  .ht-brand-name { font-size: 1.125rem; }

.ht-brand--footer  .ht-brand-icon { width: 2.5rem;  height: 2.5rem; }
.ht-brand--footer  .ht-brand-name { font-size: 1.25rem; }

.ht-brand--gallery .ht-brand-icon { width: 2rem;    height: 2rem; }
.ht-brand--gallery .ht-brand-name { font-size: 1rem; }

.ht-brand--auth {
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.ht-brand--auth .ht-brand-icon { width: 4rem; height: 4rem; }
.ht-brand--auth .ht-brand-text { align-items: center; }
.ht-brand--auth .ht-brand-name { font-size: 1.5rem; }

/* ============ Section color overrides (the magic) ============
   The brand color follows whichever section the user is in.
   Each landing page sets the brand color to its own primary tone.
   =========================================================================== */

.or-page .ht-brand,
body:has(.or-page) .ht-brand { color: var(--or-gold, #d4af6f); }

.sc-page .ht-brand,
body:has(.sc-page) .ht-brand { color: var(--sc-primary, #6b4cff); }

.fb-page .ht-brand,
body:has(.fb-page) .ht-brand { color: var(--fb-primary, #6b4cff); }

.dr-page .ht-brand,
body:has(.dr-page) .ht-brand { color: var(--dr-gold, #d4af6f); }

.pc-page .ht-brand,
body:has(.pc-page) .ht-brand { color: var(--pc-accent, #006a62); }
