/* ============================================
   HomeGuardPicks.com — Premium Security Editorial
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&family=Libre+Franklin:wght@400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  --bg-primary: #FAFAFA;
  --bg-secondary: #F1F2F4;
  --bg-card: #FFFFFF;
  --bg-dark: #0B0E1A;
  --bg-dark-secondary: #161B2F;
  --border: #D4D4D8;
  --border-accent: rgba(220,38,38,0.3);
  --text-primary: #0F1419;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-on-dark: #E4E4E7;
  --accent: #DC2626;
  --accent-hover: #B91C1C;
  --accent-dim: rgba(220,38,38,0.08);
  --navy: #0B0E1A;
  --success: #059669;
  --success-dim: rgba(5,150,105,0.08);
  --danger: #DC2626;
  --winner-bg: rgba(5,150,105,0.07);
  --winner-border: rgba(5,150,105,0.2);
  --cta-gradient: linear-gradient(135deg, #DC2626, #F97316);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --font-display: 'Inter', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --transition: 0.25s ease;
  --max-width: 1140px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
ul, ol { list-style: none; }

/* --- Utilities --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; color: var(--text-primary); }
h1 { font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.8rem); margin-top: 2.5rem; margin-bottom: 0.8rem; }
h3 { font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.3rem); margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }

/* --- Label / Badge --- */
.label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.3em 0.9em;
  border-radius: 50px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75em 1.7em;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--cta-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232,146,10,0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(232,146,10,0.3);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-sm { font-size: 0.82rem; padding: 0.5em 1.2em; }
.btn-on-dark { background: var(--cta-gradient); color: #fff; }

/* ============ NAVIGATION ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.8rem 0;
  background: rgba(248,247,244,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy);
  display: flex;
  align-items: baseline;
  gap: 0.15em;
}
.logo .mark { color: var(--accent); font-style: italic; }
.nav-links { display: flex; gap: 1.8rem; align-items: center; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248,247,244,0.98);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============ HERO ============ */
.hero {
  padding: 9rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 45%;
  height: 100%;
  background: radial-gradient(circle at 80% 40%, rgba(232,146,10,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 640px; }
.hero h1 { margin: 0.75rem 0; }
.hero p { font-size: 1.08rem; max-width: 520px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ============ TRUST BAR ============ */
.trust-bar {
  background: var(--bg-secondary);
  padding: 1.2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  gap: 1rem;
}
.trust-item {}
.trust-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--navy);
  line-height: 1.3;
}
.trust-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============ SECTION ============ */
.section { padding: 4.5rem 0; }
.section-header { margin-bottom: 2rem; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}
.section-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-top: 0.3rem; }

/* ============ CATEGORY CARDS ============ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}
.cat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: inherit;
}
.cat-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}
.cat-card h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.cat-card p { font-size: 0.82rem; margin: 0; color: var(--text-muted); }

/* ============ FEATURED CARD ============ */
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition);
}
.featured-card:hover { box-shadow: var(--shadow-lg); }
.featured-card h3 { font-size: 1.4rem; margin: 0; }

/* ============ COMPARISON CARDS ============ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.card h3 { margin-top: 0.75rem; font-size: 1.1rem; }
.card p { font-size: 0.88rem; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.5rem;
}
.card-link:hover { gap: 0.6rem; }

/* ============ DARK CTA SECTION ============ */
.dark-cta {
  background: var(--bg-dark);
  padding: 4rem 0;
}
.dark-cta h2 { color: var(--text-on-dark); margin-top: 0; }
.dark-cta p { color: rgba(232,228,220,0.7); max-width: 500px; }
.dark-cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ============ COMPARISON TABLE ============ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}
.comp-table thead { background: var(--bg-secondary); }
.comp-table th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}
.comp-table th:hover { color: var(--accent); }
.comp-table th .sort-icon { font-size: 0.6rem; margin-left: 0.3rem; opacity: 0.3; }
.comp-table th.sorted .sort-icon { opacity: 1; color: var(--accent); }
.comp-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #EEEDEA;
  color: var(--text-secondary);
  font-size: 0.83rem;
}
.comp-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 2;
}
.comp-table tbody tr:nth-child(even) { background: #FCFBF9; }
.comp-table tbody tr:nth-child(even) td:first-child { background: #FCFBF9; }
.comp-table tbody tr:hover { background: rgba(232,146,10,0.04); }
.comp-table tbody tr:hover td:first-child { background: rgba(248,246,242,0.97); }
td.winner {
  color: var(--success) !important;
  font-weight: 600;
}
td.winner:not(:last-child):not(:nth-last-child(2)) {
  background: var(--winner-bg) !important;
}
/* Sticky Price + Link columns (always visible — this is how we earn) */
.comp-table th:last-child,
.comp-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #FFFFFF;
  box-shadow: -4px 0 8px rgba(0,0,0,0.04);
}
.comp-table th:nth-last-child(2),
.comp-table td:nth-last-child(2) {
  position: sticky;
  right: 72px;
  z-index: 3;
  background: #FFFFFF;
}
.comp-table td.winner:last-child,
.comp-table td.winner:nth-last-child(2) {
  background: #E0F5E8 !important;
}
.comp-table tbody tr:nth-child(even) td:last-child,
.comp-table tbody tr:nth-child(even) td:nth-last-child(2) { background: #FCFBF9; }
.comp-table tbody tr:nth-child(even) td.winner:last-child,
.comp-table tbody tr:nth-child(even) td.winner:nth-last-child(2) { background: #DAF0E2 !important; }
.comp-table tbody tr:hover td:last-child,
.comp-table tbody tr:hover td:nth-last-child(2) { background: rgba(248,246,242,0.97); }

td .view-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: var(--cta-gradient);
  padding: 0.4em 1em;
  border-radius: 50px;
  transition: all var(--transition);
  display: inline-block;
  white-space: nowrap;
  border: none;
}
td .view-link:hover { transform: scale(1.05); color: #fff; }

/* ============ NEWSLETTER ============ */
.newsletter { padding: 4rem 0; }
.newsletter-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.newsletter-form { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.newsletter-form input {
  flex: 1;
  padding: 0.75em 1.2em;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form input::placeholder { color: var(--text-muted); }
.newsletter-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.75rem; }

/* ============ FOOTER ============ */
.footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 3.5rem 0 2rem;
  font-size: 0.82rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
}
.footer-brand p { color: rgba(232,228,220,0.5); font-size: 0.82rem; margin-top: 0.75rem; }
.footer-col-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(232,228,220,0.4);
  margin-bottom: 0.75rem;
}
.footer-col a { display: block; color: rgba(232,228,220,0.65); padding: 0.25em 0; font-size: 0.85rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(232,228,220,0.35);
}
.footer-bottom a { color: rgba(232,228,220,0.5); }
.footer-bottom a:hover { color: var(--accent); }

/* ============ ARTICLE PAGE ============ */
.article-header { padding: 7rem 0 2rem; }
.breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.article-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 1rem; }
.article-disclosure {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}
.article-body { min-width: 0; }
.article-body p { font-size: 0.95rem; }

/* --- TOC Sidebar --- */
.toc { position: sticky; top: 5rem; font-size: 0.8rem; }
.toc-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.toc a {
  display: block;
  padding: 0.35em 0;
  padding-left: 1rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  transition: all var(--transition);
}
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* --- Verdict Cards --- */
.verdict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 2rem 0; }
.verdict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.verdict-card .verdict-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.verdict-card h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.verdict-card p { font-size: 0.85rem; margin-bottom: 1rem; }

/* --- Recommendation List --- */
.rec-list { margin: 1.5rem 0; }
.rec-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.rec-item:last-child { border-bottom: none; }
.rec-label { font-size: 0.82rem; color: var(--text-muted); min-width: 200px; flex-shrink: 0; }
.rec-value { font-weight: 600; color: var(--text-primary); }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid var(--border); padding: 1.2rem 0; }
.faq-q {
  font-weight: 600; color: var(--text-primary); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem;
}
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform 0.3s ease; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; font-size: 0.9rem; color: var(--text-secondary); }
.faq-item.open .faq-a { max-height: 400px; padding-top: 0.8rem; }

/* --- Related --- */
.related { padding: 4rem 0; border-top: 1px solid var(--border); margin-top: 3rem; }

/* ============ STATIC PAGES ============ */
.page-header { padding: 8rem 0 2rem; text-align: center; }
.page-content { max-width: 680px; margin: 0 auto; padding: 2rem var(--gutter) 5rem; }
.page-content p { font-size: 0.95rem; }

/* --- Contact Form --- */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.75em 1em;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.9rem;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 140px; }

/* --- 404 --- */
.page-404 {
  min-height: 80vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 2rem;
}
.page-404 .big-code {
  font-family: var(--font-display); font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800; color: var(--navy); opacity: 0.08; line-height: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .hero { padding: 7rem 0 3rem; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; justify-content: center; }
  .newsletter-form { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .rec-item { flex-direction: column; gap: 0.3rem; }
  .rec-label { min-width: auto; }
  .verdict-grid { grid-template-columns: 1fr; }
}

/* --- Print --- */
@media print {
  .nav, .footer, .newsletter, .dark-cta { display: none; }
  body { background: #fff; }
  .comp-table td, .comp-table th { border: 1px solid #ccc; }
}

/* --- Byline (author attribution) --- */
.byline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.75rem 0 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.byline a { color: var(--accent); font-weight: 500; }
.byline a:hover { text-decoration: underline; }
.byline-sep { opacity: 0.5; }
.byline time { color: var(--text-muted); }

/* Live Amazon rating badge (populated by scripts/refresh-amazon-prices.py) */
.amzn-rating {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.4;
}
.verdict-card .amzn-rating {
  text-align: center;
}

/* Disabled affiliate link (auto-managed by refresh-amazon-prices.py) */
.unavailable-link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: not-allowed;
  user-select: none;
}
