/* ─────────────────────────────────────────────────────────────────────────
   Programmatic-SEO page styling (counties, areas, fishing, comparisons, homes).
   These pages sit between the site's dark header + footer, so the content
   column is an intentional LIGHT surface. All colors are explicit and scoped to
   `main` (this file is only linked by these pages), so nothing leaks site-wide
   and the dark body never shows through the content again.
   ───────────────────────────────────────────────────────────────────────── */

main {
    --ink: #0f1b2d;          /* headings / primary text */
    --ink-soft: #46566d;     /* body copy */
    --muted: #7b8aa0;        /* meta, captions */
    --accent: #1d6df2;       /* brand blue */
    --accent-d: #124fb8;
    --line: #e5ebf3;         /* hairlines */
    --card: #ffffff;
    --tint: #eef4fd;         /* faint blue wash */
    --shadow-sm: 0 1px 2px rgba(16, 32, 54, .05);
    --shadow: 0 2px 5px rgba(16, 32, 54, .05), 0 14px 34px rgba(16, 32, 54, .07);
    --shadow-lg: 0 4px 8px rgba(16, 32, 54, .06), 0 24px 60px rgba(16, 32, 54, .14);
    --r: 16px;
    /* The light surface: subtle top-down wash so the page isn't flat. */
    background:
        radial-gradient(1200px 460px at 78% -8%, #e7f0fd 0%, rgba(231, 240, 253, 0) 60%),
        linear-gradient(180deg, #ffffff 0%, #f4f8fd 30%, #eef3fb 100%);
    color: var(--ink-soft);
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    display: block;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.cty-hero {
    position: relative;
    padding: 9.5rem 1.5rem 3rem;
    background:
        radial-gradient(760px 320px at 88% -30%, #dcebff 0%, rgba(220, 235, 255, 0) 70%),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.cty-hero-inner { max-width: 1120px; margin: 0 auto; position: relative; z-index: 1; }
.cty-crumb { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 0 1.15rem; letter-spacing: .01em; }
.cty-crumb a { color: var(--accent); text-decoration: none; }
.cty-crumb a:hover { text-decoration: underline; }
.cty-hero h1 {
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.1rem, 4.6vw, 3.15rem);
    font-weight: 800; line-height: 1.04; letter-spacing: -.025em;
    margin: 0 0 1rem; color: var(--ink); text-wrap: balance; max-width: 20ch;
}
.cty-hero h1 span { color: var(--accent); }
.cty-lede { font-size: 1.16rem; line-height: 1.55; color: var(--ink-soft); max-width: 60ch; margin: 0; }

/* Stat chips */
.cty-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.cty-stat {
    display: flex; flex-direction: column; gap: .1rem;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: .7rem 1.15rem; min-width: 84px; box-shadow: var(--shadow-sm);
}
.cty-stat b { font-size: 1.5rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.cty-stat span { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ── Sections ─────────────────────────────────────────────────────────── */
.cty-section { max-width: 1120px; margin: 0 auto; padding: 3rem 1.5rem 0; }
.cty-section:last-of-type { padding-bottom: 1rem; }
.cty-section > h2 {
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 800; letter-spacing: -.02em;
    color: var(--ink); margin: 0 0 1.4rem; display: flex; align-items: center; gap: .7rem;
}
.cty-section > h2::before {
    content: ""; width: 4px; height: 1.15em; border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), #4f95ff); flex: none;
}

/* ── Card grid ────────────────────────────────────────────────────────── */
.cty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 1.25rem; }
.cty-card {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform .22s var(--ease-out, ease), box-shadow .22s ease, border-color .22s ease;
}
.cty-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d3e0f2; }
.cty-card-img {
    aspect-ratio: 16 / 10; background-size: cover; background-position: center;
    background-image: linear-gradient(135deg, #cddef3 0%, #9fc0e8 55%, #b9d0ec 100%);
    position: relative;
}
.cty-card-img::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(9, 22, 41, 0) 55%, rgba(9, 22, 41, .28) 100%);
}
.cty-card-body { padding: 1.05rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.cty-card-body h3 { font-size: 1.12rem; font-weight: 700; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.cty-card-meta { font-size: .82rem; font-weight: 700; color: var(--accent); margin: 0; letter-spacing: .01em; }
.cty-card-blurb { font-size: .9rem; line-height: 1.5; color: var(--muted); margin: .15rem 0 0; }

/* Image-less "directory tile" cards (index pages: /counties, /areas, /fishing,
   /compare) — a row with a chevron affordance + accent hover, so they read as
   intentional navigation tiles rather than empty boxes. */
.cty-card:not(:has(.cty-card-img)) {
    flex-direction: row; align-items: center; gap: 1rem;
    padding: 1.4rem 1.5rem; border-left: 3px solid transparent;
}
.cty-card:not(:has(.cty-card-img)):hover { border-left-color: var(--accent); }
.cty-card:not(:has(.cty-card-img)) .cty-card-body { padding: 0; flex: 1; gap: .2rem; }
.cty-card:not(:has(.cty-card-img)) .cty-card-body h3 { font-size: 1.18rem; }
.cty-card:not(:has(.cty-card-img)) .cty-card-blurb { color: var(--muted); font-weight: 600; margin: 0; }
.cty-card:not(:has(.cty-card-img))::after {
    content: "\2192"; font-size: 1.25rem; color: #c2ccdb; flex: none;
    transition: transform .2s var(--ease-out, ease), color .2s ease;
}
.cty-card:not(:has(.cty-card-img)):hover::after { transform: translateX(4px); color: var(--accent); }

/* ── Town / tag pills ─────────────────────────────────────────────────── */
.cty-towns { display: flex; flex-wrap: wrap; gap: .6rem; }
.cty-town {
    background: #fff; color: var(--accent); font-weight: 700; font-size: .92rem;
    text-decoration: none; padding: .55rem 1.05rem; border-radius: 999px;
    border: 1px solid #d6e6ff; box-shadow: var(--shadow-sm); transition: background .18s ease, transform .18s ease;
}
.cty-town:hover { background: var(--tint); transform: translateY(-1px); }

/* ── Comparison table ─────────────────────────────────────────────────── */
.cty-cmp {
    width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.cty-cmp th, .cty-cmp td { padding: .95rem 1.2rem; text-align: left; font-size: .96rem; border-bottom: 1px solid var(--line); }
.cty-cmp thead th { background: linear-gradient(180deg, #f5f9ff, #eef4fd); font-weight: 800; color: var(--ink); font-size: 1rem; }
.cty-cmp thead th:first-child { background: transparent; }
.cty-cmp tbody th { font-weight: 600; color: var(--muted); white-space: nowrap; width: 1%; }
.cty-cmp tbody td { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cty-cmp tbody tr:nth-child(even) td, .cty-cmp tbody tr:nth-child(even) th { background: #fafcff; }
.cty-cmp tr:last-child th, .cty-cmp tr:last-child td { border-bottom: none; }

/* ── Ranking leaderboard (rankings pages) ─────────────────────────────── */
.rank-list { display: flex; flex-direction: column; gap: .7rem; }
.rank-row {
    display: flex; align-items: center; gap: 1.1rem;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: .8rem 1.15rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
    transition: transform .18s var(--ease-out, ease), box-shadow .18s ease, border-color .18s ease;
}
.rank-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3e0f2; }
.rank-num {
    flex: none; width: 40px; text-align: center; font-variant-numeric: tabular-nums;
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, sans-serif;
    font-size: 1.55rem; font-weight: 800; color: #aeb9ca; line-height: 1;
}
.rank-row:nth-child(1) .rank-num { color: #d4a84a; }            /* gold */
.rank-row:nth-child(2) .rank-num, .rank-row:nth-child(3) .rank-num { color: var(--accent); }
.rank-thumb {
    flex: none; width: 74px; height: 56px; border-radius: 10px; background-size: cover; background-position: center;
    background-image: linear-gradient(135deg, #cddef3, #9fc0e8);
}
.rank-info { flex: 1; min-width: 0; }
.rank-info h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin: 0 0 .12rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: .84rem; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { flex: none; text-align: right; }
.rank-val b {
    display: block; font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, sans-serif;
    font-size: 1.3rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1;
}
.rank-val span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ── Buttons + CTA band ───────────────────────────────────────────────── */
.cty-btn-primary, .cty-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font-weight: 800; font-size: .96rem; text-decoration: none; padding: .9rem 1.7rem;
    border-radius: 12px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.cty-btn-primary {
    background: linear-gradient(180deg, #2f7bff, var(--accent)); color: #fff;
    box-shadow: 0 6px 18px rgba(29, 109, 242, .35);
}
.cty-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(29, 109, 242, .45); }
.cty-btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
.cty-btn-ghost:hover { background: rgba(255, 255, 255, .22); }

.cty-cta {
    max-width: 1120px; margin: 3.25rem auto; padding: 3rem 2rem;
    text-align: center; border-radius: 22px; position: relative; overflow: hidden;
    background:
        radial-gradient(700px 300px at 15% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%),
        linear-gradient(135deg, #123a86 0%, #1d6df2 55%, #2f8bff 100%);
    box-shadow: 0 24px 60px rgba(18, 58, 134, .35);
}
.cty-cta h2 { font-family: 'SF Pro Display', sans-serif; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; color: #fff; margin: 0 0 .6rem; letter-spacing: -.02em; }
.cty-cta p { color: rgba(255, 255, 255, .82); font-size: 1.05rem; margin: 0 auto 1.6rem; max-width: 46ch; }
.cty-cta-btns { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* Empty-state / alert panel (homes-for-sale with no listings) */
.cty-panel {
    max-width: 680px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent);
    border-radius: var(--r); padding: 1.9rem 2rem; box-shadow: var(--shadow); margin-top: .5rem;
}
.cty-panel h2 { margin: 0 0 .5rem; color: var(--ink); font-size: 1.25rem; font-weight: 800; }
.cty-panel p { color: var(--ink-soft); margin: 0 0 1.2rem; line-height: 1.55; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .cty-hero { padding: 7.5rem 1.25rem 2.25rem; }
    .cty-section { padding-top: 2.25rem; }
    .cty-grid { grid-template-columns: 1fr; gap: 1rem; }
    .cty-cmp { display: block; overflow-x: auto; white-space: nowrap; }
    .cty-cta { margin: 2.25rem 1rem; padding: 2.25rem 1.35rem; border-radius: 18px; }
    .rank-row { gap: .75rem; padding: .7rem .85rem; }
    .rank-num { width: 26px; font-size: 1.2rem; }
    .rank-thumb { display: none; }
    .rank-info h3 { font-size: 1rem; }
    .rank-val b { font-size: 1.1rem; }
}
