/* ==========================================================================
   Bold Seal — layout.css
   Page-level layout: container, stack/grid utilities, header, footer, main.
   Loaded after base.css, before components.css.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Container & spacing utilities
   -------------------------------------------------------------------------- */

/* .bs-container — centered max-width wrapper. Used inside <section>s and */
/* inside <header>/<footer> to constrain content width.                    */
.bs-container {
  width: 100%;
  max-width: var(--bs-container-max);
  margin-inline: auto;
  padding-inline: var(--bs-container-pad);
}

/* .bs-stack — "owl" selector: spacing between siblings, nothing on ends. */
/* Variant classes control the gap. This is the #1 layout primitive.      */
.bs-stack > * + *           { margin-top: var(--bs-space-4); }
.bs-stack--sm > * + *        { margin-top: var(--bs-space-2); }
.bs-stack--lg > * + *        { margin-top: var(--bs-space-6); }
.bs-stack--xl > * + *        { margin-top: var(--bs-space-8); }

/* Grid utilities — only for the repeating grid patterns we actually use. */
.bs-grid-2up,
.bs-grid-3up {
  display: grid;
  gap: var(--bs-space-6);
}

.bs-grid-2up { grid-template-columns: 1fr; }
.bs-grid-3up { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .bs-grid-2up { grid-template-columns: repeat(2, 1fr); }
  .bs-grid-3up { grid-template-columns: repeat(2, 1fr); }  /* 2up on tablet */
}

@media (min-width: 1024px) {
  .bs-grid-3up { grid-template-columns: repeat(3, 1fr); }
  .bs-grid-2up,
  .bs-grid-3up  { gap: var(--bs-space-8); }
}


/* --------------------------------------------------------------------------
   2. <main> — pushed down by the fixed header
   -------------------------------------------------------------------------- */

main {
  display: block;
  /* The header is fixed; without this padding, main content hides under it. */
  padding-top: var(--bs-header-height);
  min-height: 100dvh;
}


/* --------------------------------------------------------------------------
   3. Header — fixed top, logo left, nav right, mobile menu toggle
   -------------------------------------------------------------------------- */

.bs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bs-header-height);
  background: var(--bs-color-ink);          /* black lets the logo feel at home */
  color: var(--bs-text-inverse);
  transition: box-shadow var(--bs-transition-base);
}

/* .is-scrolled is added by SiteNav when the page is scrolled. Subtle shadow */
/* gives the header weight once content moves under it.                      */
.bs-header.is-scrolled {
  box-shadow: var(--bs-shadow-md);
}

.bs-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.bs-header__logo {
  display: flex;
  align-items: center;
  gap: var(--bs-space-3);
  color: var(--bs-text-inverse);
  text-decoration: none;
  font-weight: var(--bs-font-weight-bold);
  font-size: var(--bs-font-size-lg);
}

.bs-header__logo img {
  /* Seal renders at 48px tall inside the 64px header. Source is 64px square,
     so the browser downsamples slightly — crisper than upscaling. */
  height: 48px;
  width: auto;
  display: block;
}

/* .bs-header__brand-text — the "BOLD SEAL" wordmark next to the seal.
   Rendered in HTML (not an image) so it stays crisp at any zoom, respects
   user font-size settings for the letter-forms themselves, and can be
   color-matched to brand tokens without a new image asset.

   Font stack: Arial Black is the closest widely-available system font to
   Archivo Black — both share the rounded, wide, geometric-sans character.
   Impact is intentionally NOT the primary fallback: it's much more
   condensed and would change the brand feel on Windows. Helvetica Neue
   (Mac) and Franklin Gothic Heavy (Windows) round out the stack.

   font-weight: 900 is belt-and-suspenders — Arial Black is already black
   by design, but if the browser falls back to Helvetica Neue it will
   render at its heaviest weight. */
.bs-header__brand-text {
  font-family: "Arial Black", "Helvetica Neue", Impact,
               "Franklin Gothic Heavy", sans-serif;
  font-weight: 900;
  font-size: var(--bs-font-size-xl);     /* ~22px — fits the 48px seal */
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bs-color-primary);        /* brand orange #d98c12 */
  line-height: 1;                        /* vertically centers next to seal */
  white-space: nowrap;                   /* never wrap "BOLD SEAL" */
}

.bs-header__logo:hover {
  color: var(--bs-color-primary);
}


/* --------------------------------------------------------------------------
   4. Navigation — desktop horizontal, mobile off-canvas
   -------------------------------------------------------------------------- */

.bs-nav {
  /* Mobile: hidden off-screen, slides in when toggle opens it.          */
  /* Desktop: inline flex. Mobile-first rules first, desktop override below. */
  position: fixed;
  top: var(--bs-header-height);
  right: 0;
  bottom: 0;
  width: min(320px, 80vw);
  padding: var(--bs-space-6);
  background: var(--bs-color-ink);
  border-left: 1px solid var(--bs-color-neutral-700);
  transform: translateX(100%);
  transition: transform var(--bs-transition-base);
  overflow-y: auto;
}

.bs-nav.is-open {
  transform: translateX(0);
}

.bs-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--bs-space-4);
}

.bs-nav__link {
  display: block;
  padding: var(--bs-space-2) 0;
  color: var(--bs-text-inverse);
  text-decoration: none;
  font-weight: var(--bs-font-weight-medium);
  transition: color var(--bs-transition-fast);
}

.bs-nav__link:hover,
.bs-nav__link.is-active {
  color: var(--bs-color-primary);
}

/* Mobile menu toggle — three-line icon, shown only under 1024px */
.bs-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--bs-text-inverse);
  border-radius: var(--bs-radius-sm);
  transition: background var(--bs-transition-fast);
}

.bs-nav-toggle:hover {
  background: var(--bs-color-neutral-700);
}

.bs-nav-toggle__bars {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  position: relative;
}

/* Pseudo-elements draw the top and bottom bars of the hamburger. */
.bs-nav-toggle__bars::before,
.bs-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--bs-transition-fast);
}

.bs-nav-toggle__bars::before { top: -7px; }
.bs-nav-toggle__bars::after  { top:  7px; }

/* Open state: bars morph into an X. Middle bar hidden via transparent color. */
.bs-nav-toggle[aria-expanded="true"] .bs-nav-toggle__bars {
  background: transparent;
}
.bs-nav-toggle[aria-expanded="true"] .bs-nav-toggle__bars::before {
  transform: translateY(7px) rotate(45deg);
}
.bs-nav-toggle[aria-expanded="true"] .bs-nav-toggle__bars::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop: nav becomes inline, toggle hides. */
@media (min-width: 1024px) {
  .bs-nav {
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    border-left: 0;
    transform: none;
    overflow: visible;
  }
  .bs-nav__list {
    flex-direction: row;
    align-items: center;
    gap: var(--bs-space-6);
  }
  .bs-nav-toggle {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   5. Footer — dark surface, NAP block, social, nav
   -------------------------------------------------------------------------- */

.bs-footer {
  background: var(--bs-surface-footer);
  color: var(--bs-text-inverse);
  padding-block: var(--bs-space-12) var(--bs-space-6);
  margin-top: var(--bs-space-24);
}

.bs-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bs-space-8);
}

@media (min-width: 640px) {
  .bs-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bs-footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.bs-footer h4 {
  font-size: var(--bs-font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bs-color-primary);
  margin-bottom: var(--bs-space-4);
}

.bs-footer a {
  color: var(--bs-text-inverse);
  text-decoration: none;
}

.bs-footer a:hover {
  color: var(--bs-color-primary);
}

.bs-footer__bottom {
  margin-top: var(--bs-space-12);
  padding-top: var(--bs-space-6);
  border-top: 1px solid var(--bs-color-neutral-700);
  font-size: var(--bs-font-size-sm);
  color: var(--bs-color-neutral-400);
  display: flex;
  flex-direction: column;
  gap: var(--bs-space-2);
  text-align: center;
}

@media (min-width: 640px) {
  .bs-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}


/* --------------------------------------------------------------------------
   6. Section wrapper — full-bleed vertical bands
   -------------------------------------------------------------------------- */

/* .bs-section gives each page section consistent vertical rhythm and lets */
/* us alternate backgrounds (white / neutral-50 / dark) for visual cadence. */
.bs-section {
  padding-block: var(--bs-space-12);
  background: var(--bs-surface-page);
}

@media (min-width: 1024px) {
  .bs-section {
    padding-block: var(--bs-space-16);
  }
}

.bs-section--raised { background: var(--bs-surface-raised); }
.bs-section--dark   {
  background: var(--bs-surface-footer);
  color: var(--bs-text-inverse);
}

/* When a section is dark, headings invert to white too. */
.bs-section--dark h1,
.bs-section--dark h2,
.bs-section--dark h3,
.bs-section--dark h4 {
  color: var(--bs-text-inverse);
}

/* When a dark section is the last thing in <main> before the footer, both
   share --bs-surface-footer. The footer's default margin-top would create a
   visible white gap between them — this zeroes it so they read as one dark
   band. :has() is baseline-supported in all major browsers since Dec 2023. */
main:has(> .bs-section--dark:last-child) + .bs-footer {
  margin-top: 0;
}


/* --------------------------------------------------------------------------
   7. Hero — text + photo side-by-side on desktop, stacked on mobile
   --------------------------------------------------------------------------
   Mobile-first: text above photo, full width. At desktop, two-column layout
   with text taking slightly more space (55/45 split) so the headline has
   room to breathe without competing with the image.
   -------------------------------------------------------------------------- */

.bs-hero {
  /* Extra vertical padding to give the hero visual weight above the fold. */
  padding-block: var(--bs-space-12) var(--bs-space-16);
}

.bs-hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--bs-space-8);
}

.bs-hero__text {
  display: flex;
  flex-direction: column;
  gap: var(--bs-space-4);
}

.bs-hero__sub {
  font-size: var(--bs-font-size-lg);
  color: var(--bs-text-muted);
  max-width: 600px;       /* keeps body text scannable at wide widths */
  line-height: var(--bs-line-height-base);
}

.bs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bs-space-4);
  margin-top: var(--bs-space-2);
}

.bs-hero__media {
  border-radius: var(--bs-radius-lg);
  overflow: hidden;        /* clips the image corners to the radius */
  box-shadow: var(--bs-shadow-lg);
}

.bs-hero__media img {
  /* Ensure the image fills its container and doesn't leave gaps */
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 1024px) {
  .bs-hero {
    padding-block: var(--bs-space-16) var(--bs-space-24);
  }

  .bs-hero__inner {
    flex-direction: row;
    align-items: center;
    gap: var(--bs-space-12);
  }

  .bs-hero__text {
    /* 55% of the row — gives the headline more room than the photo */
    flex: 1 1 55%;
    min-width: 0;
  }

  .bs-hero__media {
    /* 45% of the row — enough to show the photo clearly without
       overwhelming the text at wide viewports */
    flex: 1 1 45%;
    min-width: 0;
  }
}
