/* =========================
1. CSS RESET & BASE
========================= */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #d2d4cd;
  background-color: #18275b;
}

body.high-contrast {
  background-color: #000000;
  color: #ffffff;
}

body.large-text {
  font-size: 18px;
}

/* increased line spacing for a11y */
body.more-spacing {
  line-height: 1.8;
}

/* underline links as an a11y preference */
body.underline-links a,
body.underline-links a:visited {
  text-decoration: underline;
}

/* =========================
2. GLOBAL LINK STYLES
========================= */

a {
  color: inherit;
  text-decoration: none;
}
a:visited {
  color: inherit;
  text-decoration: none;
}
a:hover,
a:focus {
  color: #ca2538;
  text-decoration: underline;
}

.footer-links a,
.footer-contact a,
.policy-links a,
.cookie-banner a {
  color: #ca2538;
  text-decoration: none;
}

.footer-links a:visited,
.footer-contact a:visited,
.policy-links a:visited,
.cookie-banner a:visited {
  color: #ca2538;
}

.policy-links {
  font-size: 0.8rem;
  white-space: nowrap;
}

.policy-links a {
  margin: 0 0.2rem;
}

.site-logo-lockup .site-tagline,
.site-logo-lockup:hover .site-tagline,
.site-logo-lockup:focus .site-tagline {
  text-decoration: none;
}

/* =========================
3. COLOR UTILITIES
========================= */

.bg-black-bar {
  background-color: #000000;
}

.bg-blue {
  background-color: #18275b;
}

.bg-lightgray {
  background-color: #e6e8e7;
}

.text-red {
  color: #ca2538;
}

.text-white {
  color: #d2d4cd;
}

.text-gray {
  color: #9f9f9f;
}

.text-gray-soft {
  color: #afafaf;
}

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

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

/* =========================
4. LAYOUT HELPERS
========================= */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-header {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: #d2d4cd;
}

.section-subtitle {
  font-size: 0.95rem;
  color: #9f9f9f;
  margin-bottom: 2rem;
}

.section-note {
  font-size: 0.9rem;
  color: #9f9f9f;
}

section[id] {
  scroll-margin-top: 120px;
}

/* =========================
5. STICKY HEADER – DESKTOP
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #000000;
  color: #d2d4cd;
  transition: all 0.25s ease;
}

/* Desktop: flex row – logo left, hero text middle, nav right */
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

/* shrink padding limited to desktop only */
@media (min-width: 769px) {
  .site-header.shrink .site-header-inner {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

/* Logo + tagline (desktop) */
.site-logo-lockup {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-left: -32px;
}

.site-logo-lockup img.site-logo {
  display: block;
  max-height: 200px;
  width: auto;
  height: auto;
}

/* SHRINKED LOGO: desktop only */
@media (min-width: 769px) {
  .site-header.shrink .site-logo-lockup img.site-logo {
    max-height: 140px;
  }
}

/* Desktop tagline under logo mark */
.site-logo-lockup .site-tagline {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ca2538;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-13px, 52px);
}

/* Desktop hero header text (middle block) */
.hero-header-text {
  font-size: 1rem;
  font-weight: 600;
  color: #ca2538;
  margin: 0 1.5rem 0 1.5rem;
  white-space: nowrap;
}

/* DESKTOP: force single line and move down */
@media (min-width: 769px) {
  .hero-header-text br {
    display: none;
  }

  .hero-header-text {
    transform: translateY(44px);
  }
}

/* Right side: nav column (desktop) */
.site-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
  margin-top: 88px;
  position: static;
}

/* =========================
5a. A11Y FLOATING BUTTON
========================= */

.accessibility-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #18275b;
  background: linear-gradient(to bottom, #ffffff, #e6e8e7);
  border-radius: 999px;
  border: 1px solid #c2c2c2;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

.a11y-floating-button {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 1200;
}

@media (min-width: 992px) {
  .a11y-floating-button {
    left: 3.3rem;
  }
}

.accessibility-toggle:hover,
.accessibility-toggle:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45);
}

.accessibility-toggle:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* =========================
5b. NAVIGATION
========================= */

.site-nav {
  order: 1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  text-decoration: none;
  color: #d2d4cd;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus {
  color: #ca2538;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #ca2538;
  transition: width 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a:focus::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #d2d4cd;
  color: #d2d4cd;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.nav-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background-color: #d2d4cd;
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background-color: #d2d4cd;
}

.nav-toggle-icon::before {
  top: -5px;
}

.nav-toggle-icon::after {
  top: 5px;
}

/* =========================
6. HERO & MAJOR SECTIONS
========================= */

.hero {
  background-color: #18275b;
  color: #d2d4cd;
  padding: 5rem 0 4rem;
}

.hero-inner {
  display: block;
}

#engineered-power .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 32px;
  align-items: flex-start;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.hero-subtext {
  font-size: 0.95rem;
  color: #9f9f9f;
}

#engineered-power .hero-aside {
  margin-top: 2.5rem;
}

/* Hero media card and tabs */
.hero-media {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  color: #18275b;
}

.hero-media video {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.hero-media-caption {
  font-size: 0.85rem;
  color: #555555;
  margin-top: 0.5rem;
}

.hero-media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hero-media-tab {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #4a4f54;
  background-color: #ffffff;
  color: #18275b;
  cursor: pointer;
}

.hero-media-tab[aria-selected="true"] {
  background-color: #4a4f54;
  color: #ffffff;
  border-color: #4a4f54;
}

/* =========================
7. BUTTONS & LINKS
========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.1s ease;
}

/* Ensure links styled as buttons do not pick up global link decoration */
a.btn,
a.btn:visited {
  text-decoration: none !important;
  color: inherit;
}

.btn-primary,
.btn-primary:visited {
  background-color: #ca2538;
  color: #ffffff !important;
  border-color: #ca2538;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #ffffff;
  color: #ca2538 !important;
  border-color: #ca2538;
  transform: translateY(-1px);
}

.btn-outline-light {
  background-color: transparent;
  color: #d2d4cd;
  border-color: #d2d4cd;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background-color: #d2d4cd;
  color: #000000;
}

.btn-block {
  width: 100%;
}

/* Ensure product-section primary buttons stay solid on light cards */
.product-section .btn-primary,
.product-section .btn-primary:visited {
  background-color: #ca2538;
  color: #ffffff !important;
  border-color: #ca2538;
}

.product-section .btn-primary:hover,
.product-section .btn-primary:focus {
  background-color: #ffffff;
  color: #ca2538 !important;
  border-color: #ca2538;
}

/* =========================
8. CARDS & GRID SECTIONS
========================= */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

/* Services grid: 2x2 layout on desktop */
@media (min-width: 769px) {
  #services .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  color: #d2d4cd;
}

.card-light {
  background-color: #ffffff;
  color: #18275b;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.95rem;
}

.card-subtext {
  font-size: 0.9rem;
  color: #9f9f9f;
}

/* =========================
9. PRODUCTS & BEAUTY SHOTS
========================= */

.product-section {
  background-color: #18275b;
  color: #d2d4cd;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.product-image {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  border-radius: 8px;
}

.product-subtitle {
  font-size: 0.95rem;
  color: #9f9f9f;
}

/* =========================
10. CAPABILITIES / SERVICES
========================= */

.capabilities-page,
.services-page,
.contact-page,
.equipment-page {
  background-color: #e6e8e7;
  color: #18275b;
}

.capabilities-page .section-header,
.services-page .section-header,
.contact-page .section-header,
.equipment-page .section-header {
  color: #18275b;
}

.capabilities-page .card,
.services-page .card,
.contact-page .card,
.equipment-page .card {
  background-color: #ffffff;
  color: #18275b;
}

/* =========================
11. CAPABILITY DETAIL PAGES
========================= */

.capability-detail {
  background-color: #18275b;
  color: #d2d4cd;
}

.capability-detail .section-header {
  color: #d2d4cd;
}

.capability-detail .section-note {
  color: #9f9f9f;
}

.detail-footer-bar {
  background-color: #000000;
  color: #d2d4cd;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.92rem;
}

/* =========================
12. REFERENCES / PROJECTS
========================= */

.references-page {
  background-color: #18275b;
  color: #d2d4cd;
}

.references-page .section-header {
  color: #d2d4cd;
}

.references-page .section-note {
  color: #9f9f9f;
}

.reference-download {
  font-size: 0.95rem;
  color: #afafaf;
}

.reference-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reference-list li {
  margin-bottom: 0.5rem;
}

.reference-item {
  display: inline-block;
  max-width: 100%;
}

/* Promotion strip */
.promo-section {
  background-color: #ffffff;
  color: #18275b;
  padding-top: 0;
  padding-bottom: 4px; /* adds ~4px space below the image */
}

.promo-image {
  display: block;
  width: 100%;
  height: auto; /* maintain aspect ratio */
  border-radius: 0;
}

/* Desktop: limit promo width to avoid upscaling/fuzziness */
@media (min-width: 769px) {
  .promo-section .container {
    display: flex;
    justify-content: center;
  }

  .promo-image {
    max-width: 960px;  /* adjust down/up as needed */
    width: 100%;
  }
}


/* =========================
13. CONTACT & FORMS
========================= */

.form {
  max-width: 640px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row > .form-field {
  flex: 1;
}

.form-field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid #c2c2c2;
  font-size: 0.95rem;
  font-family: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #ca2538;
  outline-offset: 1px;
}

.form-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.form-message.success {
  color: #4caf50;
}

.form-message.error {
  color: #f44336;
}

/* =========================
14. FOOTER
========================= */

.site-footer {
  background-color: #000000;
  color: #d2d4cd;
  padding: 2.5rem 0 1.5rem;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.footer-logo {
  margin-left: 0;
}

.footer-logo img {
  max-height: 200px;
  width: auto;
  height: auto;
  display: block;
  margin-left: -24px;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-links,
.footer-contact {
  font-size: 0.9rem;
}

.site-footer-bottom {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: #9f9f9f;
  white-space: nowrap;
}

/* =========================
15. COOKIE BANNER
========================= */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #18275b;
  color: #d2d4cd;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  z-index: 1100;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.85rem;
}

.cookie-banner-buttons {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

/* =========================
16. IMAGES & MEDIA
========================= */

img,
video {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

/* =========================
17. A11Y DIALOG (LIGHT CARD)
========================= */

.a11y-dialog {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
}

.a11y-dialog[aria-hidden="false"] {
  display: block;
}

.a11y-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.a11y-dialog-panel {
  position: relative;
  max-width: 420px;
  margin: 7vh auto 0 auto;
  background-color: #ffffff;
  color: #18275b;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  padding: 1.5rem 1.75rem 1.25rem 1.75rem;
}

.a11y-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.a11y-dialog-header h2 {
  font-size: 1.2rem;
  margin: 0;
}

.a11y-dialog-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #666666;
}

.a11y-dialog-body {
  font-size: 0.95rem;
}

.a11y-options-form {
  margin-top: 0.75rem;
}

.a11y-options-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 0.85rem 0;
}

.a11y-options-form legend {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.a11y-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.a11y-option input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.a11y-dialog-footer {
  margin-top: 1rem;
  text-align: right;
}

/* Make dialog adapt on small screens */
@media (max-width: 480px) {
  .a11y-dialog-panel {
    margin: 6vh 1rem 0 1rem;
    padding: 1.25rem 1.25rem 1rem 1.25rem;
  }
}

/* =========================
18. RESPONSIVE BREAKPOINTS
========================= */

@media (max-width: 992px) {
  .site-header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* MOBILE: swap to compact logo.png */
  .site-logo-lockup img.site-logo {
    content: url("/images/logo.png");
    max-height: 40px;
    width: auto;
    height: auto;
  }

  /* Header as 2 rows: top = logo + nav toggle, bottom = tagline */
  .site-header-inner {
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo nav"
      "tagline tagline";
    column-gap: 0.75rem;
    align-items: center;
  }

  .site-logo-lockup {
    grid-area: logo;
    margin-left: 0;
    display: flex;
    align-items: center;
  }

  .hero-header-text {
    grid-area: tagline;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ca2538;
    margin: 0.25rem 0 0;
    text-align: left;
    white-space: nowrap;
    transform: none;
  }

  .hero-header-text br {
    display: none;
  }

  .site-header-right {
    grid-area: nav;
    margin-top: 0;
    position: static;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .site-header-right nav.site-nav {
    display: none;
  }

  .site-header.open .site-header-right nav.site-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 260px;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    border-radius: 0 0 8px 8px;
    padding: 0.75rem 1rem 1rem 1rem;
  }

  /* Avoid double underline in mobile dropdown nav */
  .site-header.open .site-nav a,
  .site-header.open .site-nav a:hover,
  .site-header.open .site-nav a:focus {
    text-decoration: none;
  }

  .site-header.open .site-nav a {
    color: #000000;
  }

  /* Hide Engineered Power link only on mobile */
  .site-nav .nav-engineered {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    background: transparent;
    border: none;
    padding: 0.35rem 0.35rem;
  }

  .nav-toggle-icon {
    width: 20px;
    height: 2px;
    background-color: #d2d4cd;
    position: relative;
  }

  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: #d2d4cd;
  }

  .nav-toggle-icon::before {
    top: -6px;
  }

  .nav-toggle-icon::after {
    top: 6px;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  #engineered-power .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .grid,
  .grid-2,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-logo img {
    margin-left: -19px;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner-buttons {
    margin-left: 0;
  }

  .form-row {
    flex-direction: column;
  }

  section[id] {
    scroll-margin-top: 140px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section {
    padding: 3rem 0;
  }
}
