/* ==========================================================================
   AliveWater Theme Base Styles
   Purpose:
   - Global reset / foundation
   - Typography defaults
   - Content readability
   - Generic Drupal content styling
   - No header / footer / slider specific styling here
   ========================================================================== */

/* ==========================================================================
   Box sizing
   ========================================================================== */

html {
  box-sizing: border-box;
  height: 100%;
  scroll-behavior: smooth;
}

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

/* ==========================================================================
   Root / body
   ========================================================================== */

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: var(--font-size-base, 1rem);
  line-height: 1.65;
  color: var(--text, #231f20);
  background-color: var(--white, #ffffff);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Media
   ========================================================================== */

img,
picture,
video,
canvas,
iframe {
  max-width: 100%;
}

svg {
  max-width: 100%;
}

img,
picture,
video,
canvas {
  display: block;
  height: auto;
}

svg {
  max-width: 100%;
  height: auto;
}

iframe {
  border: 0;
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
  color: var(--primary, #0084cb);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus {
  color: var(--primary-dark, #0054a9);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(0, 132, 203, 0.4);
  outline-offset: 2px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text, #231f20);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin: 0 0 1rem;
}

small {
  font-size: 0.875em;
}

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

mark {
  background: rgba(255, 230, 0, 0.35);
  padding: 0.05em 0.2em;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary, #0084cb);
  background: rgba(0, 132, 203, 0.05);
  border-radius: 0.5rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border, #dbe7f3);
  margin: 2rem 0;
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul,
ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

li + li {
  margin-top: 0.35rem;
}

dl {
  margin: 0 0 1rem;
}

dt {
  font-weight: 700;
}

dd {
  margin: 0 0 0.75rem 0;
}

/* ==========================================================================
   Tables
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
}

th,
td {
  padding: 0.75rem;
  border: 1px solid var(--border, #dbe7f3);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 700;
  background: rgba(0, 132, 203, 0.05);
}

/* ==========================================================================
   Forms
   ========================================================================== */

form {
  margin: 0;
}

label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(35, 31, 32, 0.15);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--text, #231f20);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 132, 203, 0.7);
  box-shadow: 0 0 0 3px rgba(0, 132, 203, 0.12);
  outline: 0;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border: 0;
  border-radius: 0.625rem;
  background: var(--primary, #0084cb);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background: var(--primary-dark, #0054a9);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Code
   ========================================================================== */

code,
kbd,
pre,
samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #f6f8fb;
  border: 1px solid var(--border, #dbe7f3);
}

/* ==========================================================================
   Generic content areas
   ========================================================================== */

.text-formatted,
.field__item,
.node__content {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.text-formatted > *:last-child,
.field__item > *:last-child,
.node__content > *:last-child {
  margin-bottom: 0;
}

/* Drupal CKEditor/media images inside content */
.text-formatted img {
  border-radius: 0.75rem;
  height: auto;
}

/* Embedded media spacing */
.media,
.embedded-entity,
.drupal-media {
  margin: 1rem 0;
}

/* ==========================================================================
   Generic utility helpers
   ========================================================================== */

.visually-hidden-focusable:not(:focus):not(:focus-within),
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.clearfix::after {
  content: "";
  display: block;
  clear: both;
}

/* ==========================================================================
   Main page wrappers
   ========================================================================== */

main,
.site-main,
.layout-content {
  min-width: 0;
}

/* Prevent long text from breaking layouts */
.aw-homepage,
.aw-footer,
.aw-header,
.aw-hero-slider,
.region,
.block {
  min-width: 0;
}

/* ==========================================================================
   Selection
   ========================================================================== */

::selection {
  background: rgba(0, 132, 203, 0.18);
  color: var(--text, #231f20);
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 767.98px) {
  body {
    font-size: 0.98rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  th,
  td {
    padding: 0.65rem;
  }
}

.aw-system-messages {
  margin-top: 20px;
}

.aw-system-messages .messages {
  border-radius: 10px;
  padding: 12px 16px;
}

.aw-page-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

.aw-sidebar {
  position: relative;
}


/* =========================================================
   GLOBAL PAGE SHELL
   Matches header/footer spacing
   ========================================================= */

.aw-page-shell {
  width: 100%;
}

.aw-main {
  min-width: 0;
}

.aw-page-content,
.aw-main-content,
.aw-main-inner,
.aw-sidebar-first,
.aw-sidebar-second {
  min-width: 0;
}


/* =========================================================
   GLOBAL HEADER BANNER TITLE OVERLAY
   ========================================================= */

.aw-header-banner {
  position: relative;
  overflow: hidden;
}

.aw-header-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.aw-header-banner__title-wrap {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 20px 20px;
  pointer-events: none;
}

.aw-header-banner__title {
  pointer-events: auto;
}

.aw-header-banner__title h1 {
  margin: 0;
  display: inline-block;
  padding: 14px 26px;
  background: rgba(17, 75, 95, 0.88);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 2rem;
  line-height: 1.2;
}

@media (max-width: 991.98px) {
  .aw-header-banner__title-wrap {
    padding: 0 0 16px 16px;
  }

  .aw-header-banner__title h1 {
    font-size: 1.65rem;
    padding: 12px 20px;
  }
}

@media (max-width: 575.98px) {
  .aw-header-banner__title-wrap {
    padding: 0 0 12px 12px;
  }

  .aw-header-banner__title h1 {
    font-size: 1.3rem;
    padding: 10px 16px;
    border-radius: 12px;
  }
}


.page-route-view-gallery-gallery #block-alivewater-page-title,
.page-node-type-hero-page #block-alivewater-page-title,
.page-node-type-guide-page #block-alivewater-page-title,
.page-node-type-blog-post #block-alivewater-page-title,
.page-node-type-water-problems-page #block-alivewater-page-title,
.page-node-type-research-page #block-alivewater-page-title,
.page-node-type-commercial-page #block-alivewater-page-title,
.page-node-type-benefits-page #block-alivewater-page-title,
.page-node-type-vortex-application-page #block-alivewater-page-title,
.path-commercial-applications #block-alivewater-page-title,
.aw-node-108 #block-alivewater-page-title {
  display: none !important;
}



/* =========================================================
   GLOBAL FLEXIBLE SITE LAYOUT
   ========================================================= */

.aw-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

/* both sidebars */
.aw-layout.layout--three {
  grid-template-columns: 240px minmax(0, 1fr) 240px;
}

/* only left sidebar */
.aw-layout.layout--left {
  grid-template-columns: 240px minmax(0, 1fr);
}

/* only right sidebar */
.aw-layout.layout--right {
  grid-template-columns: minmax(0, 1fr) 240px;
}

/* no sidebar */
.aw-layout.layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.aw-main-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* =========================================================
   SHARED SMALL PAGE ELEMENTS
   ========================================================= */

.aw-system-messages {
  margin-top: 20px;
}

.aw-system-messages .messages {
  border-radius: 10px;
  padding: 12px 16px;
}

.aw-page-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

.aw-sidebar {
  position: relative;
}

/* =========================================================
   SIDEBAR BLOCK LOOK
   ========================================================= */

.aw-sidebar .block {
  margin-bottom: 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 132, 203, 0.10);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(14, 50, 67, 0.06);
  overflow: hidden;
}

.aw-sidebar .block > h2 {
  margin: 0;
  padding: 1rem 1.15rem;
  font-size: 1rem;
  font-weight: 700;
  color: #173a56;
  background: linear-gradient(180deg, #f6fbfe 0%, #edf7fc 100%);
  border-bottom: 1px solid rgba(0, 132, 203, 0.10);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1199.98px) {
  .aw-layout.layout--three {
    grid-template-columns: 210px minmax(0, 1fr) 210px;
  }

  .aw-layout.layout--left {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .aw-layout.layout--right {
    grid-template-columns: minmax(0, 1fr) 210px;
  }
}

@media (max-width: 991.98px) {
  .aw-layout,
  .aw-layout.layout--three,
  .aw-layout.layout--left,
  .aw-layout.layout--right,
  .aw-layout.layout--full {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}


/* ============================================================
   Breadcrumbs for shop/category/product pages
   ============================================================ */

.aw-breadcrumb-wrap {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--aw-shop-border, #dbe7f3);
}

.aw-breadcrumb-wrap .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.75rem 0;
  color: var(--aw-shop-muted, #6f8392);
  font-size: 0.86rem;
  font-weight: 650;
}

.aw-breadcrumb-wrap .breadcrumb-item,
.aw-breadcrumb-wrap .breadcrumb li {
  color: var(--aw-shop-muted, #6f8392);
}

.aw-breadcrumb-wrap .breadcrumb a {
  color: var(--aw-shop-primary-dark, #0054a9);
  font-weight: 750;
  text-decoration: none;
}

.aw-breadcrumb-wrap .breadcrumb a:hover,
.aw-breadcrumb-wrap .breadcrumb a:focus {
  color: var(--aw-shop-primary, #0084cb);
  text-decoration: underline;
}

.aw-breadcrumb-wrap .breadcrumb-item + .breadcrumb-item::before,
.aw-breadcrumb-wrap .breadcrumb li + li::before {
  color: var(--aw-shop-muted, #6f8392);
}

/* ============================================================
   AliveWater system messages / add-to-cart alerts
   ============================================================ */

.region-highlighted,
.region-highlighted .messages,
.region-highlighted .alert {
  max-width: 1180px;
  margin: 1rem auto;
}

.alert,
.messages {
  border-radius: 16px !important;
  border: 1px solid rgba(0, 132, 203, 0.18) !important;
  box-shadow: 0 14px 34px rgba(20, 55, 80, 0.12);
  font-weight: 700;
}

.alert-success,
.messages--status {
  background: linear-gradient(135deg, #eefdf6 0%, #ffffff 100%) !important;
  color: #0b6b45 !important;
  border-color: rgba(20, 166, 106, 0.28) !important;
}

.alert-success::before,
.messages--status::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.55rem;
  color: #14a66a;
}

.alert-danger,
.messages--error {
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%) !important;
  color: #9f1d1d !important;
  border-color: rgba(216, 41, 41, 0.25) !important;
}

.messages a,
.alert a {
  color: #0054a9;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}
