/* ==========================================================================
   Pool Enclosures Naples - Coastal Teal & Coral
   Palette: deep teal #0e3d40 | mid teal #177e89 | coral #e0592a
            deep coral #bf4720 | teal-tint #f5fafa | hero accent #ffb184
   ========================================================================== */

:root {
  --navy: #0e3d40;
  --blue: #177e89;
  --red: #e0592a;
  --red-dark: #bf4720;
  --white: #ffffff;
  --offwhite: #f5fafa;
  --text: #1f2937;
  --muted: #4b5563; /* Enhanced contrast for accessibility */
  --line: #e5e7eb;
  --shadow: 0 12px 32px rgba(14,61,64,.08);
  --radius: 20px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }

.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

.topbar {
  background: var(--navy); color: #fff; font-size: 13px; padding: 10px 0; text-align: center;
}

/* Sticky Header & Nav */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,.85);
}
.nav {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text img { width: 52px; height: 52px; display: block; border-radius: 10px; flex: 0 0 auto; }
.brand-copy strong { display: block; color: var(--navy); font-size: 16px; font-weight: 800; }
.brand-copy span { display: block; color: var(--muted); font-size: 12px; }

/* Desktop Navigation */
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 700; font-size: 15px; color: var(--navy); padding: 8px 12px; }
.nav-links a:hover { color: var(--red); }

/* Mobile Hamburger Controls */
.hamburger {
  display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 60;
}
.hamburger span {
  display: block; width: 24px; height: 3px; background: var(--navy); margin: 4px 0;
  transition: all 0.3s ease; border-radius: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px;
  border-radius: 999px; font-weight: 700; font-size: 15px; transition: .2s ease; border: 1px solid transparent;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(224,89,42,.18); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

/* Hero Section */
.hero {
  position: relative; padding: 88px 0 120px;
  background: linear-gradient(to bottom, rgba(6,38,40,.88), rgba(6,38,40,.60) 55%, rgba(6,38,40,.78)),
              url('pool-hero.webp') center 40% / cover no-repeat;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 800; margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.3);
}
h1 {
  margin: 0 0 16px; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; color: #fff; letter-spacing: -.03em;
}
h1 .accent { color: #ffb184; }
.hero p { margin: 0 0 14px; color: rgba(255,255,255,.92); font-size: 18px; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.hero .btn-secondary:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.10); }

/* Stats Band */
.stats-band { margin-top: -72px; position: relative; z-index: 2; margin-bottom: 8px; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: #fff; border: 1px solid rgba(23,126,137,.10); border-radius: 28px; padding: 24px; box-shadow: var(--shadow);
}
.stat { background: var(--offwhite); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1; color: var(--navy); }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Content Cards & Sections */
.page-section { padding: 64px 0 80px; background: #fff; }
.content-card {
  background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px;
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.content-card h2, .content-card h3 { color: var(--navy); margin-top: 0; letter-spacing: -.02em; }
.content-card h4 { color: var(--navy); margin-top: 20px; margin-bottom: 6px; font-size: 18px; }
.content-card p, .content-card li { color: var(--text); font-size: 16px; line-height: 1.7; }
.content-card ul { padding-left: 22px; margin-bottom: 0; }

/* Table & Search Controls */
.table-search-container { margin-bottom: 18px; }
.table-search-input {
  width: 100%; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line);
  font-size: 15px; background: var(--offwhite); outline: none; transition: border-color .2s;
}
.table-search-input:focus { border-color: var(--blue); background: #fff; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ranking-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; min-width: 720px; }
.ranking-table th {
  text-align: left; color: var(--navy); font-size: 12px; text-transform: uppercase;
  letter-spacing: .07em; padding: 0 12px 8px; white-space: nowrap;
}
.ranking-table td {
  background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 12px; color: var(--text); vertical-align: middle; font-size: 15px;
}
.ranking-table td:first-child { border-left: 1px solid var(--line); border-radius: 14px 0 0 14px; font-weight: 800; color: var(--red); }
.ranking-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 14px 14px 0; }
.disclaimer { font-size: 13px; color: var(--muted); margin-top: 16px; }

/* Sister Site Banner */
.barrier-module {
  background: #f0f7f8; border: 1px solid #d1e5e8; border-radius: 24px; padding: 40px 24px;
  margin: 32px 0; text-align: center;
}
.barrier-eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); font-weight: 800; margin-bottom: 12px; }
.barrier-title { color: var(--navy); font-size: 17px; line-height: 1.65; margin: 0 0 20px; font-weight: 600; max-width: 780px; margin-left: auto; margin-right: auto; }
.barrier-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.barrier-btn-primary { padding: 12px 22px; background: var(--navy); color: #fff; border-radius: 8px; font-weight: 800; font-size: 14px; }
.barrier-btn-secondary { padding: 12px 22px; background: #fff; color: var(--navy); border: 1px solid var(--navy); border-radius: 8px; font-weight: 800; font-size: 14px; }
.barrier-footer { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Footer */
footer { padding: 32px 0 40px; border-top: 1px solid var(--line); background: #f4faf9; }
.footer-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer-links a { color: var(--navy); font-weight: 600; margin: 0 6px; }
.footer-links a:hover { color: var(--red); }

/* Mobile Responsive Logic */
@media (max-width: 920px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { width: min(var(--max), calc(100% - 24px)); }
  .hamburger { display: block; }
  
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: #fff; flex-direction: column; padding: 80px 24px 24px;
    box-shadow: -8px 0 24px rgba(0,0,0,.15); transition: right 0.3s ease;
    align-items: flex-start; gap: 16px;
  }
  .nav-links.open { right: 0; }
  .nav-cta { display: none; }

  .stats { grid-template-columns: 1fr; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy span { font-size: 11px; }
  .brand-text img { width: 42px; height: 42px; }
}

/* Interior Pages & Research Elements */
.breadcrumb { font-size: 13px; color: rgba(255,255,255,.75); margin-bottom: 20px; }
.breadcrumb a { color: rgba(255,255,255,.9); font-weight: 600; }
.breadcrumb a:hover { color: #ffb184; }

.note-badge {
  display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.note-meta { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 22px; line-height: 1.7; }

.lede { font-size: 19px; line-height: 1.75; }
.section-eyebrow {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); font-weight: 800; margin-bottom: 10px;
}
.pullquote {
  border-left: 5px solid var(--red); background: var(--offwhite);
  border-radius: 0 16px 16px 0; padding: 22px 26px; margin: 26px 0;
}
.pullquote .big { font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; }
.pullquote p { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.callout {
  background: var(--offwhite); border: 1px solid rgba(23,126,137,.25);
  border-radius: 20px; padding: 26px; margin: 26px 0;
}
.callout h4 { margin-top: 0; }

.card-badge {
  display: inline-block; padding: 4px 10px; background: var(--offwhite); color: var(--blue);
  border: 1px solid rgba(23,126,137,.2); border-radius: 8px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px;
}

.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }

.timeline-chart {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end;
  height: 220px; margin: 24px 0 6px; padding: 0 4px;
}
.tl-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.tl-count { font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.tl-bar { width: 100%; max-width: 64px; border-radius: 8px 8px 0 0; background: linear-gradient(to top, var(--blue), #2aa3ad); }
.tl-bar.current { background: linear-gradient(to top, var(--red), #f07d52); }
.tl-year { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.tl-note { font-size: 13px; color: var(--muted); }

.split-bar { display: flex; height: 22px; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.split-res { background: var(--blue); }
.split-com { background: var(--red); }
.split-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.split-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

.ranking-table tr.highlight td { background: var(--offwhite); border-color: rgba(23,126,137,.35); font-weight: 700; }
.ranking-table a { color: var(--blue); font-weight: 700; }
.ranking-table a:hover { color: var(--red); }

@media (max-width: 920px) {
  .grid-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pullquote .big { font-size: 27px; }
  .timeline-chart { gap: 6px; height: 170px; }
  .tl-count { font-size: 12px; }
  .tl-year { font-size: 11px; }
}