/* ============================================
   Brandmaxx Outdoor — Custom Styles
   Overrides Bulma with brand palette and tweaks.
   ============================================ */

:root {
  --brand-red: #C8102E;
  --brand-red-dark: #A00D24;
  --brand-red-light: #E63147;
  --text-dark: #1F1F1F;
  --text-muted: #555555;
  --bg-white: #FFFFFF;
  --bg-subtle: #F7F7F7;
  --border: #E5E5E5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* Bulma primary override */
html {
  --bulma-primary-h: 350deg;
  --bulma-primary-s: 85%;
  --bulma-primary-l: 42%;
  --bulma-link-h: 350deg;
  --bulma-link-s: 85%;
  --bulma-link-l: 42%;
}

/* Global typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1F1F1F;
  background-color: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #1F1F1F;
  line-height: 1.2;
}

/* Override Bulma .title CSS-variable chain so Lighthouse can verify contrast */
.title { color: #1F1F1F; }
.subtitle { color: #555555; }
/* White text on dark/red backgrounds */
.hero.home-hero .title,
.hero.home-hero .subtitle,
.bg-red .title,
.bg-red .subtitle { color: #ffffff; }
/* Dark text on light page-hero background (#F7F7F7) */
.hero.page-hero .title { color: #1F1F1F; }
.hero.page-hero .subtitle { color: #555555; }

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-red);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* Navbar tweaks */
.navbar {
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}
.navbar-item.is-active-page {
  color: var(--brand-red);
  border-bottom: 2px solid var(--brand-red);
}
.navbar-brand .logo {
  height: 40px;
  width: auto;
}
/* Bulma 1.x CSS variable chain can resolve to dark on hover — force light */
a.navbar-item:hover,
a.navbar-item:focus {
  background-color: #f5f5f5 !important;
  color: #1f1f1f !important;
}

/* Hero — home */
.hero.home-hero {
  background: linear-gradient(rgba(0,0,0,0.55), rgba(200,16,46,0.35)), var(--bg-subtle);
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 60vh;
}
.hero.home-hero .title,
.hero.home-hero .subtitle {
  color: #fff;
}

/* Hero — inner pages */
.hero.page-hero {
  background: var(--bg-subtle);
  border-bottom: 4px solid var(--brand-red);
  min-height: 25vh;
  display: flex;
  align-items: center;
}

/* Section spacing */
.section-block {
  padding: 5rem 1.5rem;
}
@media (max-width: 768px) {
  .section-block { padding: 3rem 1rem; }
}

/* Bg helpers */
.bg-subtle { background-color: #F7F7F7; }
.bg-red { background-color: #C8102E; color: #fff; }
.bg-red .title, .bg-red .subtitle { color: #fff; }

/* Bulma box override — explicit bg so Lighthouse resolves contrast */
.box { background-color: #ffffff; }

/* Card tweaks */
.card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  background-color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-content { background-color: #ffffff; }
.card .card-image {
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
  overflow: hidden;
}
.card .card-image img,
.card .card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Principle / service tile */
.principle-tile {
  text-align: center;
  padding: 2rem 1.5rem;
}
.principle-tile .icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(200,16,46,0.07);
  color: var(--brand-red);
  font-size: 1.3rem;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter chips (Our Work) */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.filter-chip {
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--brand-red); }
.filter-chip.is-active {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}

/* Portfolio item */
.portfolio-item {
  cursor: pointer;
  display: block;
}
.portfolio-item .caption {
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid var(--border);
}
.portfolio-item .caption .name {
  font-weight: 600;
  color: var(--text-dark);
}
.portfolio-item .caption .industry {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.portfolio-item.is-hidden { display: none; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  display: block;
  margin: 0 auto;
  background: #000;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close { top: 1rem; right: 1rem; position: fixed; }
.lightbox-prev { top: 50%; left: 1rem; position: fixed; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 1rem; position: fixed; transform: translateY(-50%); }
.lightbox-caption {
  color: #fff;
  text-align: center;
  padding-top: 1rem;
  font-size: 0.95rem;
}

/* Footer */
.footer {
  background: #1a1a1a;
  color: #ddd;
  padding: 3rem 1.5rem 1.5rem;
}
.footer a { color: #fff; }
.footer a:hover { color: var(--brand-red-light); }
.footer .footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
  color: #999;
}

/* Accessibility: explicit text + background on Bulma containers so Lighthouse
   can compute contrast ratios (Bulma 1.x uses CSS vars Lighthouse can't trace) */
.box, .card-content, .card-content p, .card-content .title,
.notification, .section-block p, .section-block address {
  color: #1F1F1F;
}
.box { background-color: #ffffff; }
strong { color: #1F1F1F; }
.bg-red strong, .hero.home-hero strong { color: #ffffff; }

/* Bulma .icon-text uses CSS vars — override so Lighthouse resolves contrast */
.icon-text span { color: #1F1F1F; }
.bg-red .icon-text span, .hero.home-hero .icon-text span { color: #ffffff; }

/* Override Bulma's .has-text-grey (#7a7a7a = 4.29:1) to pass WCAG AA */
.has-text-grey { color: #595959 !important; }

/* Portfolio video thumbnail play icon */
.portfolio-video-thumb {
  position: relative;
  background: #111;
}
.portfolio-video-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(200,16,46,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  pointer-events: none;
}
.portfolio-video-thumb .play-icon i { margin-left: 3px; }

/* Mobile grid: prevent 4-col grids collapsing to tiny cells on phones */
@media (max-width: 767px) {
  main .columns.is-multiline > .column.is-3,
  main .columns.is-multiline > .column.is-3-desktop,
  main .columns.is-multiline > .column.is-4,
  main .columns.is-multiline > .column.is-4-desktop {
    flex: none !important;
    width: 50% !important;
  }
}

/* Inline SVG icon sizing — replaces Font Awesome webfonts */
.svg-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}
