/*
Theme Name: Bluewater Energy
Theme URI: https://bluewaterenergy.ca
Author: Bluewater Energy
Description: Custom block theme for Bluewater Energy.
Version: 0.3.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: bluewater-energy
*/

:root {
  --bwe-site-gutter: clamp(1.25rem, 4vw, 4rem);
  --bwe-section-space: clamp(4.5rem, 9vw, 9rem);
  --bwe-header-height: 5.5rem;
  --bwe-max-content: 80rem;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
textarea,
select {
  transition:
    color var(--wp--custom--transition--fast),
    background-color var(--wp--custom--transition--fast),
    border-color var(--wp--custom--transition--fast),
    opacity var(--wp--custom--transition--fast),
    transform var(--wp--custom--transition--fast);
}

:focus-visible {
  outline: 3px solid var(--wp--preset--color--brand-blue);
  outline-offset: 3px;
}

.wp-site-blocks {
  overflow: clip;
}

.bwe-section {
  padding-block: var(--bwe-section-space);
  padding-inline: var(--bwe-site-gutter);
}

.bwe-container {
  width: min(100%, var(--bwe-max-content));
  margin-inline: auto;
}

.bwe-eyebrow {
  color: var(--wp--preset--color--brand-blue);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bwe-button-secondary .wp-block-button__link {
  background: transparent;
  border: 1px solid rgba(18, 40, 61, 0.24);
  color: var(--wp--preset--color--deep-navy);
}

.bwe-button-secondary .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--deep-navy);
  transform: translateY(-1px);
}


/* --------------------------------------------------------------
   Layout primitives
-------------------------------------------------------------- */

.bwe-stack {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--md);
}

.bwe-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--sm);
}

.bwe-grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

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

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

.bwe-card {
  border: 1px solid rgba(18, 40, 61, 0.12);
  border-radius: var(--wp--custom--radius--medium);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--wp--custom--shadow--soft);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.bwe-card--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.bwe-muted {
  color: rgba(58, 63, 69, 0.74);
}

.has-deep-navy-background-color .bwe-muted {
  color: rgba(255, 255, 255, 0.72);
}

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

.bwe-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(18, 40, 61, 0.08);
  backdrop-filter: blur(18px);
  background: rgba(250, 246, 240, 0.92);
}

.bwe-site-header__inner {
  min-height: var(--bwe-header-height);
}

.bwe-site-header .wp-block-navigation-item__content {
  color: var(--wp--preset--color--deep-navy);
}

.bwe-site-header .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--brand-blue);
}

.bwe-header-cta .wp-block-button__link {
  padding-inline: 1.2rem;
}

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

.bwe-hero {
  position: relative;
  min-height: min(860px, calc(100svh - var(--bwe-header-height)));
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.bwe-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 78% 24%, rgba(44, 133, 199, 0.34), transparent 28%),
    linear-gradient(120deg, #12283D 0%, #16354F 58%, #102236 100%);
}

.bwe-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 95%);
}

.bwe-hero__content {
  padding-block: clamp(7rem, 14vw, 12rem) clamp(4rem, 8vw, 7rem);
}

.bwe-hero__lede {
  max-width: 46rem;
  color: rgba(255, 255, 255, 0.78);
}

.bwe-hero__meta {
  margin-top: clamp(3rem, 7vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.bwe-hero__meta p {
  margin: 0;
  font-size: var(--wp--preset--font-size--sm);
  color: rgba(255, 255, 255, 0.68);
}

/* --------------------------------------------------------------
   Content sections
-------------------------------------------------------------- */

.bwe-section-heading {
  max-width: 52rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.bwe-section-heading p {
  max-width: 42rem;
}

.bwe-capability-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.bwe-capability-card h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.bwe-capability-card p:last-child {
  margin-top: auto;
  padding-top: 1rem;
}

.bwe-proof-stat {
  padding-block: 1rem;
}

.bwe-proof-stat strong {
  display: block;
  color: var(--wp--preset--color--deep-navy);
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.bwe-process-step {
  position: relative;
  padding-left: 4rem;
}

.bwe-process-step__number {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.75rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--wp--preset--color--brand-blue);
  color: white;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 700;
}

.bwe-cta-panel {
  border-radius: var(--wp--custom--radius--large);
  padding: clamp(2rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 90% 0%, rgba(44, 133, 199, 0.35), transparent 30%),
    var(--wp--preset--color--deep-navy);
  box-shadow: var(--wp--custom--shadow--lifted);
}

.bwe-site-footer {
  margin-top: 0;
}

@media (max-width: 900px) {
  .bwe-grid--3 {
    grid-template-columns: 1fr;
  }

  .bwe-grid--2 {
    grid-template-columns: 1fr;
  }

  .bwe-site-header .wp-block-buttons {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --bwe-header-height: 4.75rem;
  }

  .bwe-section {
    padding-inline: 1.25rem;
  }

  .bwe-hero__meta {
    display: grid;
    gap: 1rem;
  }

  .bwe-process-step {
    padding-left: 3.5rem;
  }
}


/* ==============================================================
   PHASE 2 — COMPONENT LIBRARY
============================================================== */

/* Shared section treatment */
.bwe-section--compact {
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

.bwe-section--navy {
  background: var(--wp--preset--color--deep-navy);
  color: var(--wp--preset--color--white);
}

.bwe-section--white {
  background: var(--wp--preset--color--white);
}

.bwe-section--blue-wash {
  background:
    radial-gradient(circle at 85% 15%, rgba(44, 133, 199, 0.12), transparent 28%),
    var(--wp--preset--color--warm-off-white);
}

.bwe-rule {
  border-top: 1px solid rgba(18, 40, 61, 0.14);
}

.has-deep-navy-background-color .bwe-rule,
.bwe-section--navy .bwe-rule {
  border-color: rgba(255, 255, 255, 0.16);
}

/* Split hero */
.bwe-hero-split {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.bwe-hero-split__copy {
  display: flex;
  align-items: end;
  padding:
    clamp(6rem, 11vw, 10rem)
    var(--bwe-site-gutter)
    clamp(4rem, 8vw, 7rem);
  background:
    radial-gradient(circle at 80% 12%, rgba(44, 133, 199, 0.28), transparent 26%),
    var(--wp--preset--color--deep-navy);
}

.bwe-hero-split__media {
  min-height: 520px;
  overflow: hidden;
  background: rgba(18, 40, 61, 0.08);
}

.bwe-hero-split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Icon / capability cards */
.bwe-icon-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bwe-icon-card__mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(44, 133, 199, 0.11);
  color: var(--wp--preset--color--brand-blue);
  font-weight: 800;
}

.bwe-icon-card .wp-block-heading {
  margin: 0;
}

.bwe-icon-card p:last-child {
  margin-top: auto;
}

/* Statistics */
.bwe-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(18, 40, 61, 0.14);
  border-bottom: 1px solid rgba(18, 40, 61, 0.14);
}

.bwe-stat {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-right: 1px solid rgba(18, 40, 61, 0.14);
}

.bwe-stat:last-child {
  border-right: 0;
}

.bwe-stat__value {
  margin: 0;
  color: var(--wp--preset--color--deep-navy);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.bwe-stat__label {
  margin: 0.75rem 0 0;
  color: rgba(58, 63, 69, 0.72);
}

/* Project feature */
.bwe-project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  border-radius: var(--wp--custom--radius--large);
  overflow: hidden;
  background: var(--wp--preset--color--deep-navy);
  box-shadow: var(--wp--custom--shadow--lifted);
}

.bwe-project-feature__media {
  min-height: 560px;
}

.bwe-project-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bwe-project-feature__content {
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(2rem, 5vw, 4rem);
  color: white;
}

.bwe-project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.bwe-project-meta strong {
  display: block;
  color: white;
}

.bwe-project-meta span {
  color: rgba(255, 255, 255, 0.68);
  font-size: var(--wp--preset--font-size--sm);
}

/* Testimonials */
.bwe-quote {
  position: relative;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-left: 4px solid var(--wp--preset--color--energy-orange);
  background: white;
  box-shadow: var(--wp--custom--shadow--soft);
}

.bwe-quote__text {
  margin: 0;
  color: var(--wp--preset--color--deep-navy);
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.bwe-quote__source {
  margin-top: 2rem;
  color: rgba(58, 63, 69, 0.7);
}

/* Logo / credential wall */
.bwe-logo-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(18, 40, 61, 0.12);
  border-left: 1px solid rgba(18, 40, 61, 0.12);
}

.bwe-logo-wall > * {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  border-right: 1px solid rgba(18, 40, 61, 0.12);
  border-bottom: 1px solid rgba(18, 40, 61, 0.12);
  background: rgba(255, 255, 255, 0.58);
}

.bwe-logo-wall img {
  max-width: 150px;
  max-height: 64px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.72;
}

/* FAQ */
.bwe-faq {
  border-top: 1px solid rgba(18, 40, 61, 0.14);
}

.bwe-faq details {
  border-bottom: 1px solid rgba(18, 40, 61, 0.14);
  padding: 1.25rem 0;
}

.bwe-faq summary {
  cursor: pointer;
  color: var(--wp--preset--color--deep-navy);
  font-size: var(--wp--preset--font-size--lg);
  font-weight: 600;
  list-style: none;
}

.bwe-faq summary::-webkit-details-marker {
  display: none;
}

.bwe-faq details p {
  max-width: 52rem;
  color: rgba(58, 63, 69, 0.78);
}

/* Contact panel */
.bwe-contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  border-radius: var(--wp--custom--radius--large);
  overflow: hidden;
  background: white;
  box-shadow: var(--wp--custom--shadow--lifted);
}

.bwe-contact-panel__copy {
  padding: clamp(2rem, 5vw, 4.5rem);
}

.bwe-contact-panel__aside {
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--wp--preset--color--deep-navy);
  color: white;
}

.bwe-contact-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.bwe-contact-list p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

/* Editorial card */
.bwe-editorial-card {
  overflow: hidden;
  border-radius: var(--wp--custom--radius--medium);
  background: white;
  box-shadow: var(--wp--custom--shadow--soft);
}

.bwe-editorial-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bwe-editorial-card__body {
  padding: 1.5rem;
}

/* Buttons on dark backgrounds */
.has-deep-navy-background-color .bwe-button-secondary .wp-block-button__link,
.bwe-section--navy .bwe-button-secondary .wp-block-button__link,
.bwe-hero-split__copy .bwe-button-secondary .wp-block-button__link {
  border-color: rgba(255, 255, 255, 0.32);
  color: white;
}

.has-deep-navy-background-color .bwe-button-secondary .wp-block-button__link:hover,
.bwe-section--navy .bwe-button-secondary .wp-block-button__link:hover,
.bwe-hero-split__copy .bwe-button-secondary .wp-block-button__link:hover {
  border-color: white;
}

/* Responsive */
@media (max-width: 1000px) {
  .bwe-hero-split,
  .bwe-project-feature,
  .bwe-contact-panel {
    grid-template-columns: 1fr;
  }

  .bwe-hero-split__media {
    order: -1;
    min-height: 420px;
  }

  .bwe-project-feature__media {
    min-height: 440px;
  }

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

  .bwe-stat:nth-child(2) {
    border-right: 0;
  }

  .bwe-stat:nth-child(-n+2) {
    border-bottom: 1px solid rgba(18, 40, 61, 0.14);
  }

  .bwe-logo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .bwe-stats {
    grid-template-columns: 1fr;
  }

  .bwe-stat {
    border-right: 0;
    border-bottom: 1px solid rgba(18, 40, 61, 0.14);
  }

  .bwe-stat:last-child {
    border-bottom: 0;
  }

  .bwe-project-meta {
    grid-template-columns: 1fr;
  }

  .bwe-logo-wall {
    grid-template-columns: 1fr;
  }
}


.is-style-bluewater-card {
  border: 1px solid rgba(18, 40, 61, 0.12);
  border-radius: var(--wp--custom--radius--medium);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--wp--custom--shadow--soft);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.is-style-bluewater-section {
  padding-block: var(--bwe-section-space);
  padding-inline: var(--bwe-site-gutter);
}
