/*
Theme Name: HomeWaterIQ
Theme URI: https://homewateriq.com
Author: HomeWaterIQ
Description: Clear Water theme for HomeWaterIQ.com: light header, water-blue and leaf-green accents, calculators and buying guides.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: homewateriq
*/

:root {
  --navy: #0b2240;
  --navy-2: #12305a;
  --navy-line: #c9dcea;
  --blue: #0a7fd6;
  --blue-dark: #075fa3;
  --cyan: #12b5ea;
  --green: #2f9e33;
  --green-dark: #23802a;
  --green-bright: #3aa935;
  --green-glow: #5cc23a;
  --green-soft: #e9f6e6;
  --sky: #eaf5fc;
  --ink: #0b2240;
  --muted: #4a5d70;
  --muted-on-dark: #4a5d70;
  --bg: #f5f9fc;
  --surface: #ffffff;
  --line: #dce7ef;
  --display: "Poppins", "Segoe UI", Arial, sans-serif;
  --body: "DM Sans", "Segoe UI", Arial, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; color: var(--ink); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; background: #fff; color: var(--navy); padding: 10px 14px; z-index: 1000; }

/* Header */
.site-top { background: linear-gradient(180deg, #ffffff 0%, var(--sky) 100%); color: var(--ink); border-bottom: 1px solid var(--line); }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.site-logo img { display: block; height: 46px; width: auto; }
@media (max-width: 640px) { .site-logo img { height: 36px; } }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.main-nav a { color: var(--navy); text-decoration: none; font-weight: 500; font-size: 16px; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--blue); }

/* Hero */
.hero { text-align: center; padding-top: 64px; padding-bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.eyebrow { margin: 0; font-weight: 700; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--green); }
.hero h1 { margin: 0; color: var(--navy); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.75rem); line-height: 1.06; max-width: 15em; }
.hero .lede { margin: 0; font-size: 20px; color: var(--muted-on-dark); max-width: 36em; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 8px; }
.btn { display: inline-block; font-weight: 700; text-decoration: none; padding: 15px 24px; border-radius: 999px; font-size: 17px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { border: 2px solid var(--navy-line); color: var(--navy); background: #fff; padding: 13px 22px; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.stat-strip { margin-top: 32px; width: 100%; max-width: 860px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--navy-line); border: 1px solid var(--navy-line); border-radius: 16px; overflow: hidden; }
.stat-strip div { background: #fff; padding: 22px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.stat-strip strong { font-family: var(--display); font-size: 34px; color: var(--blue); line-height: 1.1; }
.stat-strip span { color: var(--muted-on-dark); font-size: 15px; }
@media (max-width: 640px) { .stat-strip { grid-template-columns: minmax(0, 1fr); } }

/* Sections */
.section { padding-top: 64px; padding-bottom: 24px; }
.section h2 { font-size: 34px; margin: 0 0 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.tool-card { background: var(--surface); border-radius: 16px; padding: 26px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(8,26,41,.08); }
.tool-card:hover { color: var(--ink); box-shadow: 0 4px 16px rgba(8,26,41,.10); }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--sky); display: flex; align-items: center; justify-content: center; }
.tool-card .title { font-family: var(--display); font-weight: 600; font-size: 21px; }
.tool-card .soon { font-size: 12px; color: #5b6b78; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.tool-card .desc { color: var(--muted); font-size: 16px; }
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.split > div { flex: 1 1 360px; min-width: 0; }
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; flex: 1 1 480px !important; }
@media (max-width: 640px) { .type-grid { grid-template-columns: minmax(0, 1fr); } }
.type-card { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.type-card .k { font-size: 13px; color: var(--green); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.type-card .v { font-weight: 700; }
.type-card .m { color: var(--muted-on-dark); font-size: 15px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.post-card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.post-card:hover { color: var(--blue-dark); }
.post-card .thumb { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--sky); display: flex; align-items: center; justify-content: center; color: #5b6e7c; font-size: 14px; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .t { font-weight: 700; font-size: 19px; line-height: 1.3; }
.post-card .x { color: var(--muted); font-size: 15px; }

/* Articles and pages */
.page-hero { padding-top: 40px; padding-bottom: 48px; }
.page-hero h1 { color: var(--navy); font-size: clamp(2rem, 4.2vw, 3rem); margin: 8px 0 12px; max-width: 22em; }
.page-hero .meta { color: var(--muted-on-dark); font-size: 15px; margin: 0; }
.content-area { padding-top: 40px; padding-bottom: 72px; }
.entry { max-width: 760px; margin: 0 auto; background: var(--surface); border-radius: 16px; padding: 40px clamp(20px, 5vw, 56px); }
.entry.wide { max-width: var(--wrap); }
.entry > *:first-child { margin-top: 0; }
.entry h2 { font-size: 30px; margin: 1.8em 0 .5em; }
.entry h3 { font-size: 23px; margin: 1.5em 0 .4em; }
.entry p, .entry li { color: #1d3040; }
.entry .wp-block-table { margin: 1.5em 0; overflow-x: auto; }
.entry table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry .wp-block-table figcaption, .entry figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.entry .wp-block-buttons { margin: 1.5em 0; }
.entry .has-small-font-size { font-size: 14px; color: var(--muted); }
.entry th, .entry td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.entry thead th { background: var(--navy); color: #fff; }
.entry blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--cyan); color: var(--muted); }
.entry .wp-block-button__link, .entry .button { background: var(--blue); color: #fff; border-radius: 999px; font-weight: 700; padding: 12px 22px; text-decoration: none; }
.disclosure-note { font-size: 14px; color: var(--muted); background: var(--sky); border-radius: 10px; padding: 10px 14px; margin: 0 0 24px; }
.pagination { display: flex; gap: 12px; justify-content: center; padding-top: 32px; }

/* Footer */
.site-footer { background: #fff; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 40px; padding-bottom: 40px; font-size: 14px; }
.site-footer img { height: 44px; width: auto; }
.site-footer p { margin: 0; max-width: 40em; }
.site-footer a { color: var(--blue); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Byline + author box */
.byline { display: flex; align-items: center; gap: 10px; }
.byline-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cyan); }
.author-box { display: flex; gap: 18px; align-items: flex-start; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.author-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; }
.author-box .author-name { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0 0 4px; color: var(--ink); }
.author-box .author-bio { margin: 0; font-size: 16px; color: var(--muted); }

/* Affiliate buttons */
.entry .buy-row { margin: 14px 0 28px; }
.entry .buy-btn { display: inline-block; background: #ffb81c; color: #111; font-weight: 700; text-decoration: none; padding: 11px 20px; border-radius: 999px; font-size: 16px; box-shadow: 0 1px 2px rgba(8,26,41,.15); }
.entry .buy-btn::after { content: " \2192"; }
.entry .buy-btn:hover { background: #ffa500; color: #111; }

/* Featured image */
.entry .entry-featured { margin: 0 0 28px; }
.entry .entry-featured img { display: block; width: 100%; height: auto; border-radius: 12px; }

/* Dropdown menus (e.g. Gear) */
.main-nav li { position: relative; }
.main-nav .menu-item-has-children > a::after { content: " \25BE"; font-size: 13px; }
.main-nav ul.sub-menu { display: none; position: absolute; top: 100%; left: -14px; z-index: 50; min-width: 210px; flex-direction: column; gap: 0; padding: 8px 0; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(11,34,64,.12); }
.main-nav ul.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.main-nav li:hover > ul.sub-menu, .main-nav li:focus-within > ul.sub-menu { display: flex; }
.main-nav ul.sub-menu a { display: block; padding: 9px 16px; font-size: 15px; white-space: nowrap; }
@media (max-width: 640px) {
  .main-nav ul.sub-menu { position: static; display: flex; margin: 4px 0 0; padding: 0 0 0 12px; border: 0; background: none; box-shadow: none; min-width: 0; }
  .main-nav .menu-item-has-children > a::after { content: ""; }
}

/* Keep reading */
.entry .related { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.entry .related h2 { margin: 0 0 18px; font-size: 26px; }
.entry .related .post-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.entry .related .post-card .t { font-size: 16px; }
.entry .related .post-card .x { display: none; }

/* HomeWaterIQ extras */
.hero { padding-bottom: 72px; }
.stat-strip { box-shadow: 0 1px 2px rgba(11,34,64,.06); }
.eyebrow { color: var(--green); }
.page-hero .eyebrow { color: var(--green); }
.callout { background: var(--sky); border-left: 4px solid var(--blue); border-radius: 10px; padding: 14px 18px; margin: 1.5em 0; }
