/* ============================================================
   Haakon Industries - shared site stylesheet
   Brand tokens (measured from the live site):
     Font: Lato (Google Fonts), fallback "Helvetica Neue", Arial, sans-serif
     Body text: #4A4A4A on white (WCAG AA); Headings: #333333
     Muted text (captions/dates): #777777
     Light section background: #F7F7F7
     Accent burgundy: #9F3A48 (primary buttons, highlights)
     Link blue: #1E73BE
     Buttons: square corners (border-radius 0)
   Type scale is fluid (clamp) between ~360px and ~1160px viewports.
   Spacing rhythm: 8px base, tokens --space-1..--space-8.
   ============================================================ */

:root {
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;

  /* Color */
  --c-body: #4A4A4A;
  --c-heading: #333333;
  --c-muted: #777777;
  --c-bg-light: #F7F7F7;
  --c-accent: #9F3A48;
  --c-accent-dark: #85303C;
  --c-link: #1E73BE;
  --c-white: #FFFFFF;
  --c-footer-bg: #F7F7F7;
  --c-footer-text: #4A4A4A;
  --c-border: #E5E5E5;

  /* Spacing (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 80px;

  /* Fluid type scale */
  --fs-body: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem); /* 17px -> 18px */
  --fs-h1: clamp(2.2rem, 1.75rem + 1.6vw, 3rem);
  --fs-h2: clamp(1.55rem, 1.3rem + 0.9vw, 2rem);
  --fs-h3: clamp(1.15rem, 1.08rem + 0.3vw, 1.3rem);
  --fs-hero: clamp(2.3rem, 1.7rem + 2.2vw, 3.3rem);

  /* Elevation */
  --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.10);

  --header-height: 90px;
  --container-max: 1160px;
}

/* ---------- Reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-body);
  background: var(--c-white);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  color: var(--c-heading);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; }

p { margin: 0 0 1.2em; }

a { color: var(--c-link); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

ul { margin: 0 0 1.2em; padding-left: 1.4em; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0;               /* square corners - brand rule */
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-white);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--c-accent-dark);
  border-color: var(--c-accent-dark);
  color: var(--c-white);
  text-decoration: none;
}

/* Ghost button for use on dark/photo backgrounds */
.btn-ghost {
  background: transparent;
  border-color: var(--c-white);
  color: var(--c-white);
}
.btn-ghost:hover, .btn-ghost:focus {
  background: var(--c-white);
  color: var(--c-heading);
  text-decoration: none;
}

/* ---------- Header / navigation ---------- */

.site-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 24px;
}

/* Header is full-bleed like the original site: logo hugs the left edge,
   nav the right edge, regardless of the content container width. */
.site-header .container { max-width: none; padding: 0 28px; }

.site-logo { flex: 0 0 auto; display: inline-flex; align-items: center; }
.site-logo img { max-height: 58px; width: auto; }

.site-nav { flex: 1 1 auto; display: flex; justify-content: flex-end; }

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-menu > li { position: relative; }

.nav-menu > li > a {
  display: block;
  padding: 12px 14px;
  color: var(--c-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;            /* labels never break mid-word like "INDUSTRIES / SERVED" */
}

.nav-menu > li > a:hover,
.nav-menu > li > a:focus {
  color: var(--c-accent);
  text-decoration: none;
}

.nav-cta { margin-left: 10px; }
/* Re-assert button colors: .nav-menu > li > a (0-1-2) would otherwise
   out-rank .btn-primary (0-1-0) and paint the CTA text dark grey. */
.nav-cta .btn { padding: 10px 22px; color: var(--c-white); white-space: nowrap; }
.nav-cta .btn:hover, .nav-cta .btn:focus { color: var(--c-white); }

/* Dropdown (desktop: open on hover / keyboard focus) */

.has-dropdown { display: flex; align-items: center; }

.submenu-toggle {
  display: none;                  /* shown on mobile only */
  background: none;
  border: 0;
  padding: 8px 10px;
  color: var(--c-heading);
  font-size: 0.8rem;
  cursor: pointer;
}

.dropdown {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 110;
}

.dropdown li a {
  display: block;
  padding: 9px 18px;
  color: var(--c-heading);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.dropdown li a:hover, .dropdown li a:focus {
  background: var(--c-bg-light);
  color: var(--c-accent);
}

@media (min-width: 900px) {
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Hamburger (mobile) */

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--c-heading);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background-color: var(--c-heading);
  background-size: cover;
  background-position: center;
  color: var(--c-white);
  text-align: center;
}

/* Gradient scrim: darkest at the bottom-left, fading to near-transparent
   at the top-right, so the photo reads through while text stays legible. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top right,
    rgba(15, 15, 15, 0.72) 0%,
    rgba(15, 15, 15, 0.45) 48%,
    rgba(15, 15, 15, 0.12) 100%
  );
}

.hero-inner {
  position: relative;
  padding: 130px 24px 140px;
  max-width: 860px;
  margin: 0 auto;
}

.hero h1 {
  color: var(--c-white);
  font-size: var(--fs-hero);
  margin-bottom: 0.5em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.hero p {
  font-size: 1.1rem;
  margin: 0 auto 2em;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Generic sections ---------- */

.section { padding: var(--space-8) 0; }
.section-light { background: var(--c-bg-light); }

.section-heading { text-align: center; margin-bottom: var(--space-6); }
.section-heading h2 { margin-bottom: 0.4em; }
.section-heading p { max-width: 720px; margin: 0 auto; }

.section-heading .heading-rule {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--c-accent);
  margin: 18px auto 0;
}

.text-center { text-align: center; }

/* ---------- Teaser tiles (Industries / Projects / Careers) ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.tile {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover, .tile:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.tile-image { overflow: hidden; }
.tile-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.tile:hover .tile-image img { transform: scale(1.04); }

.tile-body {
  padding: 28px 26px 32px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.tile-body h3 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.1rem;
}

.tile-body p { flex: 1 1 auto; }
.tile-body .btn { align-self: center; }

/* ---------- News list ---------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.news-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover, .news-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.news-card-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--c-bg-light);
}

.news-card-body { padding: 22px 24px 26px; flex: 1 1 auto; display: flex; flex-direction: column; }

.news-date {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}

.news-card-body h3 { font-size: 1.15rem; margin-bottom: 0.5em; }
.news-card-body h3 a { color: var(--c-heading); }
.news-card-body h3 a:hover { color: var(--c-accent); text-decoration: none; }

.news-readmore {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.news-readmore:hover { color: var(--c-accent-dark); }

/* ---------- Pillars (Engineering / Manufacturing / Industries) ---------- */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 20px;
}

.pillar h3 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-accent);
  display: inline-block;
}

/* ---------- Project filter bar + card grid ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
  margin-bottom: 40px;
  padding: 0;
  list-style: none;
}

.filter-btn {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 7px 13px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-body);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.filter-btn:hover { color: var(--c-accent); }

.filter-btn.is-active {
  background: var(--c-accent);
  color: var(--c-white);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.project-card {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover, .project-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.project-card.is-hidden { display: none; }

.project-card-image { position: relative; overflow: hidden; }

.project-card-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-card-image img { transform: scale(1.05); }

.project-card-body { padding: 18px 20px 22px; }

.project-card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.project-card-body h3 a { color: var(--c-heading); }
.project-card-body h3 a:hover { color: var(--c-accent); text-decoration: none; }

/* stretch the title link over the whole card */
.project-card-body h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-card-cats {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.filter-empty {
  display: none;
  text-align: center;
  padding: 40px 0;
}
.filter-empty.is-visible { display: block; }

/* ---------- Contact band ---------- */

.contact-band {
  position: relative;
  background-color: var(--c-heading);
  background-size: cover;
  background-position: center;
  color: var(--c-white);
  text-align: center;
}

.contact-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.6);
}

.contact-band-inner {
  position: relative;
  padding: 90px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.contact-band h2 { color: var(--c-white); }
.contact-band p { color: rgba(255, 255, 255, 0.92); }

/* ---------- Footer ----------
   Light footer, 3 columns. Column 1 carries the VERTICAL Haakon mark
   (trademark requirement - every page is a USPTO specimen for both marks;
   the horizontal wordmark stays in the header). The vertical file is a
   white-background JPG, so it sits inside a white padded chip. */

.site-footer {
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  font-size: 0.92rem;
  border-top: 3px solid var(--c-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: var(--space-6);
  padding: var(--space-7) 24px var(--space-6);
}

.site-footer h4 {
  color: var(--c-heading);
  font-size: 0.9rem;
  margin-bottom: 1.1em;
}

.site-footer p { color: var(--c-footer-text); }

.site-footer a { color: var(--c-footer-text); }
.site-footer a:hover, .site-footer a:focus { color: var(--c-accent); }

/* Keep the burgundy CTA button readable inside the footer (the generic
   .site-footer a rule above would otherwise repaint its text). */
.site-footer .btn-primary { color: var(--c-white); }
.site-footer .btn-primary:hover, .site-footer .btn-primary:focus { color: var(--c-white); }

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }

/* White padded chip for the vertical trademark mark (white-bg JPG). */
.footer-logo-chip {
  display: inline-block;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  padding: var(--space-2);
  margin: 0 0 var(--space-3);
}
.footer-logo-chip img { width: 150px; height: auto; }

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 18px 0;
  font-size: 0.8rem;
  color: var(--c-muted);
}
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .tile-grid, .news-grid, .project-grid { grid-template-columns: repeat(2, 1fr); }
  .pillar-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .site-nav.is-open { display: block; }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 20px;
  }

  .nav-menu > li { border-bottom: 1px solid var(--c-border); }
  .nav-menu > li:last-child { border-bottom: 0; }

  .nav-menu > li > a { padding: 14px 24px; }

  .has-dropdown { display: block; }

  .submenu-toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 8px;
    padding: 14px 16px;
  }
  .has-dropdown { position: relative; }

  .dropdown {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    border-top: 1px solid var(--c-border);
    box-shadow: none;
    background: var(--c-bg-light);
    padding: 4px 0;
  }

  .has-dropdown.is-open .dropdown { display: block; }

  .dropdown li a { padding: 11px 40px; }

  .nav-cta { padding: 16px 24px 4px; margin-left: 0; }
  .nav-cta .btn { display: block; text-align: center; }

  .hero h1 { font-size: 2rem; }
  .hero-inner { padding: 90px 24px 100px; }
  .section { padding: 56px 0; }
}

@media (max-width: 640px) {
  .tile-grid, .news-grid, .project-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
}
