/*
Theme Name: There's a Better Way
Author: There's a Better Way
Description: A clean, accessible WordPress theme for practical, free everyday problem-solving tools.
Version: 2.0.3
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: better-way
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-logo, custom-menu, featured-images, accessibility-ready, one-column, blog
*/

:root {
  --bw-navy: #02112e;
  --bw-ink: var(--bw-navy);
  --bw-font: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bw-muted: #536276;
  --bw-paper: #f8fbfc;
  --bw-surface: #ffffff;
  --bw-mint: #e5f7f2;
  --bw-teal: #00b286;
  --bw-teal-dark: #007d63;
  --bw-teal-soft: #b9efdf;
  --bw-focus: #007d63;
  --bw-border: #d6e4e5;
  --bw-shadow: 0 18px 55px rgba(2, 17, 46, 0.10);
  --bw-radius: 22px;
  --bw-container: 1200px;
  --bw-heading-weight: 700;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--bw-ink);
  background: var(--bw-paper);
  font-family: var(--bw-font);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--bw-heading-weight);
}

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

a {
  color: var(--bw-teal-dark);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--bw-teal-dark);
}

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

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

:focus-visible {
  outline: 3px solid var(--bw-focus);
  outline-offset: 3px;
}

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

.screen-reader-text:focus {
  z-index: 100000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  color: var(--bw-ink);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--bw-shadow);
}

.bw-container {
  width: min(calc(100% - 40px), var(--bw-container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgba(248, 251, 252, 0.96);
  border-bottom: 1px solid rgba(214, 228, 229, 0.85);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 28px;
}

.site-branding {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-right: auto;
}

.site-branding a {
  color: var(--bw-ink);
  text-decoration: none;
}

.site-title {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.site-title::before {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-right: 10px;
  content: "↗";
  color: #fff;
  background: var(--bw-teal);
  border-radius: 11px;
  font-size: 18px;
  vertical-align: -2px;
}

.bw-brand-logo,
.custom-logo-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  max-width: 100%;
}

.bw-brand-logo img,
.custom-logo-link img {
  width: 270px;
  max-width: 100%;
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
}

.site-footer__branding .bw-brand-logo img,
.site-footer__branding .custom-logo-link img {
  width: 292px;
}

.primary-navigation ul {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-navigation a {
  color: var(--bw-ink);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
  color: var(--bw-teal-dark);
}

.menu-toggle {
  display: none;
  padding: 9px 12px;
  color: var(--bw-ink);
  background: #fff;
  border: 1px solid var(--bw-border);
  border-radius: 10px;
  font-weight: 700;
}

.bw-button,
.wp-block-button__link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  color: #fff;
  background: var(--bw-teal-dark);
  border: 2px solid var(--bw-teal-dark);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.bw-button:hover,
.wp-block-button__link:hover {
  color: #fff;
  background: var(--bw-navy);
  border-color: var(--bw-navy);
  box-shadow: 0 10px 26px rgba(0, 178, 134, 0.18);
  transform: translateY(-1px);
}

.bw-button--small {
  min-height: 42px;
  padding: 9px 16px;
}

.bw-button--ghost {
  color: var(--bw-ink);
  background: transparent;
  border-color: var(--bw-border);
}

.bw-button--ghost:hover {
  color: var(--bw-teal-dark);
  background: #fff;
  border-color: var(--bw-teal);
}

.bw-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 5vw, 64px) 0 clamp(40px, 5vw, 64px);
}

.bw-hero::after {
  position: absolute;
  z-index: -1;
  top: 7%;
  right: -6%;
  width: min(47vw, 620px);
  aspect-ratio: 1;
  content: "";
  background: radial-gradient(circle at 35% 35%, rgba(0, 178, 134, 0.22), rgba(229, 247, 242, 0.55) 52%, transparent 70%);
  border-radius: 50%;
}

.bw-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 70px);
}

.bw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--bw-teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bw-eyebrow::before {
  width: 9px;
  height: 9px;
  content: "";
  background: var(--bw-focus);
  border-radius: 50%;
}

.bw-hero h1,
.entry-title,
.bw-section h2 {
  margin-top: 0;
  color: var(--bw-ink);
  font-weight: var(--bw-heading-weight);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.bw-hero h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 6.25rem);
}

.bw-hero h1 span {
  color: var(--bw-teal-dark);
}

.bw-hero__lede {
  max-width: 650px;
  margin: 0 0 32px;
  color: var(--bw-muted);
  font-size: clamp(1.06rem, 2vw, 1.25rem);
}

.bw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bw-hero__art {
  position: relative;
  min-width: 0;
  width: 100%;
  justify-self: center;
  text-align: center;
}

.bw-hero__art::before {
  position: absolute;
  z-index: -1;
  inset: 8% 3% 12%;
  content: "";
  background: var(--bw-mint);
  border-radius: 48% 52% 40% 60%;
  transform: rotate(-7deg);
}

.bw-hero__illustration {
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  filter: drop-shadow(0 14px 20px rgba(2, 17, 46, 0.06));
}

.bw-hero__caption {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 14px;
  margin: -6px 0 0;
  color: var(--bw-teal-dark);
  background: #fff;
  border: 1px solid var(--bw-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.bw-hero__caption-icon {
  display: grid;
  flex: 0 0 20px;
  height: 20px;
  place-items: center;
  color: var(--bw-navy);
  background: var(--bw-teal-soft);
  border-radius: 999px;
}

.bw-hero__caption-text {
  white-space: nowrap;
}

.bw-section {
  padding: clamp(72px, 9vw, 116px) 0;
}

.bw-section--sage {
  background: var(--bw-mint);
}

.bw-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}

.bw-section__head h2 {
  max-width: 750px;
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5vw, 4.35rem);
}

.bw-section__head p {
  max-width: 440px;
  margin: 0;
  color: var(--bw-muted);
}

.bw-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.bw-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 330px;
  padding: clamp(24px, 4vw, 38px);
  color: var(--bw-ink);
  background: linear-gradient(145deg, #fff 55%, #f1fcf8);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.bw-tool-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  content: "";
  background: var(--bw-teal-soft);
  border-radius: 0 0 0 100%;
  opacity: 0.4;
  pointer-events: none;
}

.bw-tool-card:nth-child(even) {
  background: linear-gradient(145deg, #fff 55%, #eef6fb);
}

.bw-tool-card:hover {
  color: var(--bw-ink);
  border-color: #7ad9c1;
  box-shadow: var(--bw-shadow);
  transform: translateY(-5px);
}

.bw-tool-card__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.bw-tool-card__icon img {
  width: 88px;
  height: 88px;
}

.bw-tool-card__number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--bw-teal-dark);
  background: #fff;
  border: 1px solid var(--bw-border);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 600;
}

.bw-tool-card__arrow {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  color: #fff;
  background: var(--bw-teal-dark);
  border-radius: 50%;
  transition: transform 180ms ease, background 180ms ease;
}

.bw-tool-card__arrow svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bw-tool-card:hover .bw-tool-card__arrow {
  background: var(--bw-navy);
  transform: translateX(2px);
}

.bw-tool-card h3 {
  margin: 24px 0 12px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.bw-tool-card p {
  margin: 0 0 26px;
  color: var(--bw-muted);
}

.bw-tool-card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  margin-top: auto;
  color: var(--bw-teal-dark);
  border-top: 1px solid var(--bw-border);
  font-size: 0.9rem;
  font-weight: 600;
}

.bw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.bw-step {
  position: relative;
  min-width: 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--bw-border);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(2, 17, 46, 0.04);
}

.bw-step__number {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 22px;
  color: var(--bw-teal-dark);
  background: linear-gradient(145deg, #e5f7f2, #b9efdf);
  border: 1px solid #a4dfcd;
  border-radius: 19px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 5px 12px rgba(0, 125, 99, 0.08);
  font-size: 1.55rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.04em;
}

.bw-step h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.bw-step p {
  margin: 0;
  color: var(--bw-muted);
}

#how-it-works {
  padding-bottom: clamp(32px, 4vw, 48px);
}

.bw-section--callout {
  padding-top: clamp(8px, 1.5vw, 20px);
}

.bw-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 30px;
  padding: clamp(34px, 6vw, 70px);
  color: #fff;
  background: var(--bw-navy);
  border-radius: 30px;
}

.bw-callout h2 {
  max-width: 760px;
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.bw-callout p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.bw-callout .bw-button {
  color: #fff;
  background: var(--bw-teal-dark);
  border-color: var(--bw-teal-dark);
}

.site-main {
  min-height: 55vh;
}

.entry-shell {
  padding: clamp(58px, 8vw, 100px) 0;
}

.entry-header {
  max-width: 850px;
  margin-bottom: 38px;
}

.entry-title {
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 6vw, 5.25rem);
}

.entry-meta {
  color: var(--bw-muted);
  font-size: 0.9rem;
}

.entry-content {
  max-width: 880px;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3 {
  font-weight: var(--bw-heading-weight);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.entry-content h2 {
  margin-top: 2.1em;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  color: #3f5068;
}

.entry-content .better-way-tool,
.entry-content .better-way-tools-index {
  max-width: none;
}

.entry-shell--tools {
  padding-top: clamp(36px, 5vw, 64px);
}

.entry-shell--tools .entry-content {
  width: 100%;
  max-width: none;
}

.entry-shell--tools .entry-content > p {
  max-width: 800px;
}

.entry-header--tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: center;
  gap: 36px;
  max-width: none;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--bw-border);
}

.entry-header__copy {
  min-width: 0;
}

.entry-header--tool .entry-title {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 4.7vw, 4.4rem);
  overflow-wrap: anywhere;
}

.entry-header__art {
  pointer-events: none;
}

.entry-header__art img {
  width: 100%;
}

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

.post-card {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
}

.post-card h2 {
  margin: 0 0 12px;
  line-height: 1.2;
}

.post-card h2 a {
  color: var(--bw-ink);
  text-decoration: none;
}

.pagination {
  margin-top: 40px;
}

.site-footer {
  padding: 54px 0 28px;
  background: #e5f7f2;
  color: var(--bw-muted);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  padding-bottom: 42px;
}

.site-footer .site-title,
.site-footer a {
  color: var(--bw-navy);
}

.site-footer__about {
  max-width: 520px;
  margin-top: 16px;
}

.site-footer .bw-footer-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.site-footer nav ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.site-footer nav a {
  text-decoration: none;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--bw-border);
  font-size: 0.85rem;
}

.site-footer__bottom p {
  margin: 0;
}

@media (max-width: 900px) {
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-navigation {
    position: absolute;
    top: 100%;
    right: 20px;
    left: 20px;
    display: none;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--bw-border);
    border-radius: 16px;
    box-shadow: var(--bw-shadow);
  }

  .primary-navigation.is-open {
    display: block;
  }

  .primary-navigation ul {
    display: grid;
    gap: 8px;
  }

  .primary-navigation a {
    display: block;
    padding: 9px 8px;
  }

  .bw-hero__grid {
    grid-template-columns: 1fr;
  }

  .bw-hero__art {
    width: min(100%, 500px);
  }

  .bw-section__head,
  .bw-callout {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 680px) {
  .bw-container {
    width: min(calc(100% - 28px), var(--bw-container));
  }

  .site-header__inner {
    min-height: 80px;
    gap: 14px;
  }

  .site-branding .bw-brand-logo,
  .site-branding .custom-logo-link {
    width: min(62vw, 255px);
  }

  .site-title::before {
    width: 30px;
    height: 30px;
  }

  .bw-hero {
    padding-top: 32px;
  }

  .bw-hero h1 {
    font-size: clamp(2.75rem, 15vw, 4.3rem);
  }

  .bw-tool-grid,
  .bw-steps,
  .posts-grid,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .bw-tool-card {
    min-height: 0;
  }

  .entry-header--tool {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 20px;
  }

  .entry-header__art {
    display: none;
  }

  .bw-hero__caption {
    font-size: clamp(0.72rem, 3vw, 0.8rem);
    padding-inline: 10px;
  }

  .bw-section__head {
    align-items: start;
  }

  .site-footer__bottom {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


.bw-callout :focus-visible {
  outline-color: var(--bw-teal-soft);
}

.bw-callout .bw-button:hover {
  color: var(--bw-navy);
  background: #fff;
  border-color: #fff;
}

.site-footer nav a:hover {
  color: var(--bw-teal-dark);
  text-decoration: underline;
}

.bw-directory-link { margin-top: 32px; text-align: center; }
