/* Hydronia brand overrides — authoritative palette from marketing/BRAND.md. */

:root {
  --md-primary-fg-color: #014589;
  --md-primary-fg-color--light: #5974B1;
  --md-primary-fg-color--dark: #0E367C;
  --md-accent-fg-color: #014589;

  --hy-hero-height: min(62vh, 500px);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #5974B1;
  --md-primary-fg-color--light: #8fa4ce;
  --md-primary-fg-color--dark: #014589;
  --md-accent-fg-color: #8fa4ce;
}

/* ----- Header identity ----- */

.md-header__button.md-logo img,
.md-nav__button.md-logo img {
  width: 1.55rem;
  height: 1.55rem;
}

.md-header__button.md-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.hy-site-wordmark {
  display: block;
  width: auto;
  height: 2.35rem;
  max-width: min(22rem, 48vw);
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 640px) {
  .hy-site-wordmark {
    height: 1.6rem;
    max-width: 13rem;
  }
}

/* ----- Home hero ----- */

.hy-hero {
  position: relative;
  min-height: var(--hy-hero-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  isolation: isolate;
  background-size: cover;
  background-color: #edf3f8;
  background-image:
    linear-gradient(90deg, rgba(237, 243, 248, 0.92) 0%, rgba(237, 243, 248, 0.58) 43%, rgba(237, 243, 248, 0.96) 100%),
    url("../assets/hero/hydronia-mesh-hero-bottom-left.png");
  background-position: center;
  background-repeat: no-repeat;
}

[data-md-color-scheme="slate"] .hy-hero {
  background-color: #101928;
  background-image:
    linear-gradient(90deg, rgba(16, 25, 40, 0.88) 0%, rgba(16, 25, 40, 0.62) 48%, rgba(16, 25, 40, 0.94) 100%),
    url("../assets/hero/hydronia-mesh-hero-bottom-left.png");
}

.hy-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: left;
}

.hy-hero__title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 0.75rem;
  color: #0E367C;
  letter-spacing: 0;
}

.hy-hero__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hy-hero__title > span {
  display: block;
}

.hy-hero__brand-icon {
  width: clamp(2.4rem, 7vw, 4rem);
  height: clamp(2.4rem, 7vw, 4rem);
  object-fit: contain;
  filter: drop-shadow(0 0.12rem 0.35rem rgba(14, 54, 124, 0.2));
}

[data-md-color-scheme="slate"] .hy-hero__title {
  color: #eaf1f8;
}

.hy-hero__tagline {
  font-size: 1.15rem;
  max-width: 42rem;
  margin: 0 0 1.75rem;
  color: #2c3e50;
  line-height: 1.5;
}

[data-md-color-scheme="slate"] .hy-hero__tagline {
  color: #c5d4e4;
}

/* Narrow: the hero adapts so it still looks intentional on mobile. */
@media (max-width: 600px) {
  .hy-hero {
    min-height: 460px;
  }

  .hy-hero__title {
    font-size: 2.25rem;
  }
  .hy-hero__tagline {
    font-size: 1rem;
  }
  .hy-hero__inner {
    padding: 2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
}

.hy-home-content {
  max-width: 64rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.hy-home-content > h1:first-child {
  display: none;
}

.hy-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0 2rem;
}

.hy-product-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-height: 8.4rem;
  padding: 1rem;
  border: 1px solid rgba(1, 69, 137, 0.14);
  border-radius: 0.45rem;
  background:
    linear-gradient(180deg, rgba(1, 69, 137, 0.055), rgba(1, 69, 137, 0.012)),
    var(--md-default-bg-color);
  color: var(--md-typeset-color);
  box-shadow: 0 0.2rem 0.8rem rgba(14, 54, 124, 0.06);
}

.hy-product-card:hover {
  border-color: var(--md-primary-fg-color);
  color: var(--md-typeset-color);
}

.hy-product-card__icon {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex: 0 0 auto;
}

.hy-product-card--river .hy-product-card__icon {
  background-image: url("../assets/product-brand/rf2d_large_icon.png");
}

.hy-product-card--oil .hy-product-card__icon {
  background-image: url("../assets/product-brand/of2d_large_icon.png");
}

.hy-product-card--hbf .hy-product-card__icon {
  background-image: url("../assets/product-brand/hbf_large_icon.png");
}

.hy-product-card strong,
.hy-product-card small,
.hy-path-card strong,
.hy-path-card span {
  display: block;
}

.hy-product-card > span:last-child {
  min-width: 0;
}

.hy-product-card strong {
  margin-bottom: 0.35rem;
  color: #0e367c;
  font-size: 0.9rem;
  line-height: 1.2;
}

.hy-product-card small {
  color: var(--md-default-fg-color--light);
  font-size: 0.68rem;
  line-height: 1.45;
}

.hy-product-card--oil strong {
  color: #30343c;
}

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

.hy-path-card {
  min-height: 6rem;
  padding: 0.9rem 1rem;
  border-left: 0.18rem solid var(--md-primary-fg-color);
  border-radius: 0.35rem;
  background: rgba(1, 69, 137, 0.055);
  color: var(--md-typeset-color);
}

.hy-path-card:hover {
  background: rgba(1, 69, 137, 0.09);
  color: var(--md-typeset-color);
}

.hy-path-card strong {
  margin-bottom: 0.35rem;
  color: #0e367c;
  font-size: 0.82rem;
}

.hy-path-card span {
  color: var(--md-default-fg-color--light);
  font-size: 0.68rem;
  line-height: 1.45;
}

@media (max-width: 800px) {
  .hy-product-card {
    min-height: 0;
  }

  .hy-product-grid,
  .hy-path-grid {
    grid-template-columns: 1fr;
  }
}

[data-md-color-scheme="slate"] .hy-product-card {
  border-color: rgba(143, 164, 206, 0.2);
  background:
    linear-gradient(180deg, rgba(143, 164, 206, 0.08), rgba(143, 164, 206, 0.02)),
    var(--md-default-bg-color);
  box-shadow: none;
}

[data-md-color-scheme="slate"] .hy-product-card strong,
[data-md-color-scheme="slate"] .hy-path-card strong {
  color: #c9d9f2;
}

[data-md-color-scheme="slate"] .hy-product-card small,
[data-md-color-scheme="slate"] .hy-path-card span {
  color: #b7c2d2;
}

/* ----- Navigation clarity ----- */

.md-nav--primary .md-nav__item--section > .md-nav__link {
  margin: 1rem 0 0.25rem;
  padding: 0.35rem 0.45rem;
  border-left: 0.18rem solid var(--md-primary-fg-color);
  border-radius: 0.18rem;
  background: rgba(1, 69, 137, 0.08);
  color: #0e367c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.md-nav--primary .md-nav__item--active.md-nav__item--section > .md-nav__link {
  background: #dceaf7;
  color: #014589;
}

.md-nav--primary .md-nav__item--active > .md-nav__container > .md-nav__link {
  border-radius: 0.25rem;
}

.md-nav--primary .md-nav__item--active > .md-nav__container {
  border-radius: 0.25rem;
  background: #dceaf7;
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__item--section > .md-nav__link {
  border-left-color: #8fa4ce;
  background: #343a49;
  color: #eaf1f8;
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__item--active.md-nav__item--section > .md-nav__link {
  background: #3c4456;
  color: #ffffff;
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__item--active > .md-nav__container > .md-nav__link {
  background: #343a49;
}

/* ----- Product page branding ----- */

body[data-hy-product="riverflow2d"] .md-header {
  background-color: #014589;
  background-image:
    linear-gradient(90deg, rgba(1, 69, 137, 0.98), rgba(1, 69, 137, 0.9) 58%, rgba(1, 69, 137, 0.74)),
    var(--hy-product-banner);
  background-position: center;
  background-size: cover;
}

body[data-hy-product="oilflow2d"] .md-header {
  background-color: #2f333c;
  background-image:
    linear-gradient(90deg, rgba(47, 51, 60, 0.98), rgba(47, 51, 60, 0.9) 58%, rgba(47, 51, 60, 0.76)),
    var(--hy-product-banner);
  background-position: center;
  background-size: cover;
}

body[data-hy-product="hydrobid-flood"] .md-header {
  background-color: #245985;
  background-image:
    linear-gradient(90deg, rgba(36, 89, 133, 0.98), rgba(36, 89, 133, 0.9) 58%, rgba(36, 89, 133, 0.76)),
    var(--hy-product-banner);
  background-position: center;
  background-size: cover;
}

body[data-hy-product="riverflow2d"] .md-tabs {
  background-color: #0e367c;
}

body[data-hy-product="oilflow2d"] .md-tabs {
  background-color: #252a32;
}

body[data-hy-product="hydrobid-flood"] .md-tabs {
  background-color: #1f4d73;
}

.hy-nav-product-icon {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  margin-right: 0.35rem;
  object-fit: contain;
  vertical-align: -0.2rem;
}

.md-tabs__link .hy-nav-product-icon {
  width: 0.95rem;
  height: 0.95rem;
  vertical-align: -0.16rem;
}

@media (max-width: 600px) {
  body[data-hy-product] .md-header__title {
    margin-left: 0.2rem;
  }
}

/* ----- Downloads page ----- */

.hy-downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.hy-download-card {
  border: 1px solid rgba(1, 69, 137, 0.16);
  border-radius: 0.4rem;
  background:
    linear-gradient(180deg, rgba(1, 69, 137, 0.06), rgba(1, 69, 137, 0.015)),
    var(--md-default-bg-color);
  padding: 1rem;
}

.hy-download-card h2 {
  margin: 0 0 0.75rem;
  color: #0e367c;
  font-size: 1.15rem;
  font-weight: 800;
}

.hy-download-card h2[id]::before {
  display: none;
}

.hy-download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.1rem;
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(1, 69, 137, 0.18);
  border-radius: 0.3rem;
  background: var(--md-default-bg-color);
  color: var(--md-typeset-color);
  box-shadow: 0 0.16rem 0.5rem rgba(14, 54, 124, 0.06);
}

.hy-download-link:hover {
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color);
}

.md-typeset .hy-download-link strong,
.md-typeset .hy-download-link small {
  display: block;
}

.md-typeset .hy-download-link strong {
  color: var(--md-typeset-color);
  font-size: 0.82rem;
  line-height: 1.25;
}

.md-typeset .hy-download-link small {
  margin-top: 0.2rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.66rem;
  line-height: 1.35;
}

.hy-download-link > span:last-child {
  flex: 0 0 auto;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: var(--md-primary-fg-color);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 800;
}

[data-md-color-scheme="slate"] .hy-download-card {
  border-color: rgba(143, 164, 206, 0.28);
  background:
    linear-gradient(180deg, rgba(143, 164, 206, 0.12), rgba(143, 164, 206, 0.03)),
    var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .hy-download-card h2 {
  color: #eaf1f8;
}

[data-md-color-scheme="slate"] .hy-download-link {
  border-color: rgba(143, 164, 206, 0.24);
  box-shadow: none;
}

[data-md-color-scheme="slate"] .md-typeset .hy-download-link strong {
  color: #eaf1f8;
}

[data-md-color-scheme="slate"] .md-typeset .hy-download-link small {
  color: #c5d4e4;
}

[data-md-color-scheme="slate"] .md-typeset .hy-download-link:hover strong {
  color: #ffffff;
}
