/* HardWaterHQ — style.css */
/* Design: Clean water blues and greens, fresh and trustworthy */

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

:root {
  --deep:         #0a1a2e;
  --mid:          #0f2a3d;
  --light:        #163a4f;
  --white:        #ffffff;
  --off-white:    #f0f7f4;
  --muted:        #7ab8a8;
  --accent:       #10b981;
  --accent-hov:   #059669;
  --accent-blue:  #06b6d4;
  --text:         #d4e8e0;
  --border:       rgba(255,255,255,0.08);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--deep);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 26, 46, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: 1100px; margin: 0 auto;
}

.nav-logo {
  font-size: 1.2rem; font-weight: 800; color: var(--white); text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--white); }

.hero {
  padding: 100px 0 80px; text-align: center;
  background: linear-gradient(180deg, var(--deep) 0%, var(--mid) 100%);
}

.hero-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.15;
  color: var(--white); max-width: 800px; margin: 0 auto 24px;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 600px; margin: 0 auto 40px; }

.btn-primary {
  display: inline-block; background: var(--accent); color: var(--white);
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 14px 32px; border-radius: 6px; transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-hov); transform: translateY(-1px); }

.btn-secondary {
  display: inline-block; border: 1px solid var(--accent); color: var(--accent);
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 14px 32px; border-radius: 6px; margin-left: 12px; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--accent); color: var(--white); }

section { padding: 80px 0; }

.section-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800;
  color: var(--white); margin-bottom: 16px;
}
.section-sub { font-size: 1rem; color: var(--muted); max-width: 560px; margin-bottom: 48px; }

.guides {
  background: var(--mid);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}

.guides-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.guide-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 28px;
  background: var(--light); text-decoration: none; display: block;
  transition: border-color 0.2s, transform 0.15s;
}
.guide-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.guide-tag {
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.guide-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.guide-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

.about { background: var(--deep); }

.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-text p { font-size: 0.95rem; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-box {
  background: var(--mid); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; text-align: center;
}
.stat-box .number { font-size: 1.8rem; font-weight: 800; color: var(--accent); display: block; }
.stat-box .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.newsletter {
  background: var(--mid); text-align: center; border-top: 1px solid var(--border);
}
.newsletter h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; color: var(--white); margin-bottom: 16px; }
.newsletter p { font-size: 1rem; color: var(--muted); max-width: 480px; margin: 0 auto 32px; }

.email-form { display: flex; gap: 12px; max-width: 460px; margin: 0 auto; }
.email-form input {
  flex: 1; padding: 14px 18px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--deep); color: var(--white); font-size: 0.95rem;
}
.email-form input::placeholder { color: var(--muted); }
.email-form button {
  background: var(--accent); color: var(--white); border: none;
  padding: 14px 24px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.email-form button:hover { background: var(--accent-hov); }

footer {
  background: var(--deep); border-top: 1px solid var(--border); padding: 36px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo { font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.footer-logo span { color: var(--accent); }
.footer-copy { font-size: 0.82rem; color: var(--muted); }

/* Article pages */
.article-header {
  padding: 80px 0 40px; text-align: center;
  background: linear-gradient(180deg, var(--deep) 0%, var(--mid) 100%);
}
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  color: var(--white); max-width: 800px; margin: 0 auto 16px;
}
.article-meta { font-size: 0.85rem; color: var(--muted); }

.article-body { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; color: var(--white); margin: 40px 0 16px; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; color: var(--accent-blue); margin: 32px 0 12px; }
.article-body p { font-size: 1rem; color: var(--text); margin-bottom: 16px; line-height: 1.75; }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; color: var(--text); }
.article-body li { margin-bottom: 8px; line-height: 1.65; }

.product-box {
  background: var(--light); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; margin: 24px 0;
}
.product-box h4 { font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.product-box p { font-size: 0.9rem; color: var(--muted); }
.product-box .price { font-size: 1.2rem; font-weight: 700; color: var(--accent); margin-top: 8px; }
.affiliate-link {
  color: #fff !important;
  display: inline-block; background: var(--accent); color: var(--white);
  text-decoration: none; font-weight: 600; font-size: 0.9rem;
  padding: 10px 20px; border-radius: 6px; margin-top: 12px; transition: background 0.2s;
}
.affiliate-link:hover { background: var(--accent-hov); }

.affiliate-btn {
  display: inline-block; background: var(--accent); color: #fff !important;
  text-decoration: none !important; font-weight: 600; font-size: 0.9rem;
  padding: 10px 20px; border-radius: 6px; margin-top: 12px;
  transition: background 0.2s; letter-spacing: 0.02em;
}
.affiliate-btn:hover { background: var(--accent-hov, var(--accent)); opacity: 0.9; }

.affiliate-cta {
  background: var(--mid, var(--light, #1a1a2e)); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.affiliate-cta p { font-weight: 600; color: var(--white); margin: 0 0 0.5rem; }

.related-sites {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
}
.related-sites p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.related-sites ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.related-sites li { font-size: 0.85rem; }
.related-sites a { color: var(--accent); text-decoration: none; }
.related-sites a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 60px 0 56px; }
  section { padding: 60px 0; }
  .about-content { grid-template-columns: 1fr; }
  .email-form { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Article body link styling */
.article-body a:not(.affiliate-btn):not(.affiliate-link):not(.affiliate-cta) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.2);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.article-body a:not(.affiliate-btn):not(.affiliate-link):not(.affiliate-cta):hover {
  color: var(--accent-hov, var(--accent));
  text-decoration-color: var(--accent);
}
.article-body a:not(.affiliate-btn):not(.affiliate-link):not(.affiliate-cta):visited {
  color: var(--accent);
  opacity: 0.85;
}
/* Related Articles section link styling */
.related-articles a {
  color: var(--accent) !important;
  text-decoration: none !important;
}
.related-articles a:hover {
  text-decoration: underline !important;
}

.related-articles {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 2rem 0;
}
.related-articles h3 { color: var(--white); margin: 0 0 1rem; font-size: 1.1rem; }
.related-articles ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.related-articles li a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
.related-articles li a:hover { text-decoration: underline; }

/* Quick Answer Box */
.quick-answer {
  background: rgba(255,255,255,0.06);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}
.quick-answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.quick-answer a:hover { opacity: 0.85; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { opacity: 0.8; }
.quick-answer strong { color: var(--accent); }

.article-hero { width: 100%; height: 420px; overflow: hidden; background: var(--bg-alt, #f1f5f9); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* Article listing page */
.article-list { display: flex; flex-direction: column; gap: 1.5rem; }
.article-card { padding: 1.5rem; background: var(--mid, #1a2a1a); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; transition: border-color 0.2s; }
.article-card:hover { border-color: var(--accent, #4caf50); }
.article-card h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.article-card h2 a { color: var(--text, #d4e8d4); text-decoration: none; }
.article-card h2 a:hover { color: var(--accent, #4caf50); }
.article-card p { margin: 0; font-size: 0.92rem; opacity: 0.75; line-height: 1.5; }

/* ── Nav Search ── */
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search-toggle {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  color: var(--muted, #888); font-size: 1.1rem; line-height: 1;
  transition: color 0.2s; display: flex; align-items: center;
}
.nav-search-toggle:hover { color: var(--white, #fff); }
.nav-search-box {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 0;
  background: var(--mid, #1a2a2a); border: 1px solid var(--accent, #4caf50);
  border-radius: 6px; overflow: hidden;
  width: 0; opacity: 0; pointer-events: none;
  transition: width 0.25s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.nav-search-box.open { width: 260px; opacity: 1; pointer-events: all; }
.nav-search-box input {
  flex: 1; border: none; outline: none; padding: 7px 12px;
  background: transparent; color: var(--text, #e2e8f0);
  font-size: 0.9rem; min-width: 0;
}
.nav-search-box input::placeholder { color: var(--muted, #888); }
.nav-search-box button {
  background: none; border: none; padding: 7px 10px;
  color: var(--muted, #888); cursor: pointer; font-size: 0.85rem;
}
.nav-search-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  background: var(--deep, #0f1a1a); border: 1px solid var(--accent, #4caf50);
  border-radius: 8px; width: 320px; max-height: 360px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none;
}
.nav-search-dropdown a {
  display: block; padding: 0.6rem 1rem; text-decoration: none;
  color: var(--text, #e2e8f0); font-size: 0.88rem; border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s;
}
.nav-search-dropdown a:last-child { border-bottom: none; }
.nav-search-dropdown a:hover, .nav-search-dropdown a.nav-search-active { background: var(--mid, #1a2a2a); color: var(--accent, #4caf50); }
.nav-search-dropdown .ns-empty { padding: 0.75rem 1rem; opacity: 0.5; font-size: 0.85rem; }
mark.ns-hl { background: var(--accent, #4caf50); color: #fff; border-radius: 2px; padding: 0 2px; }
