/* ==========================================================================
   55+ Community Guide — Main Stylesheet
   Warm California Coastal palette · Senior-friendly typography
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --navy:             #1b2d45;
  --blue:             #2e6b8a;
  --blue-light:       #eef5f9;
  --sky:              #5ba4c9;
  --warm-white:       #faf8f5;
  --cream:            #f0ebe3;
  --cream-dark:       #e0d8cc;
  --terracotta:       #c4653a;
  --terracotta-light: #fdf2ed;
  --sage:             #6b8f71;
  --sage-light:       #eef4ef;
  --gold:             #c49a3c;
  --gold-light:       #fdf8ed;
  --text:             #1b2d45;
  --text-mid:         #4a5568;
  --text-light:       #718096;
  --white:            #ffffff;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(27,45,69,.08);
  --shadow-md:  0 4px 12px rgba(27,45,69,.10);
  --shadow-lg:  0 8px 24px rgba(27,45,69,.12);
  --transition: .25s ease;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--warm-white);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
}

h1 { font-size: 2.4rem; margin-bottom: .6em; }
h2 { font-size: 1.8rem; margin-bottom: .5em; }
h3 { font-size: 1.35rem; margin-bottom: .4em; }
h4 { font-size: 1.15rem; margin-bottom: .35em; }

p { margin-bottom: 1em; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--navy);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}

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

/* ==========================================================================
   Navigation (.site-nav)
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(27, 45, 69, .08);
  transition: box-shadow var(--transition);
}

.site-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--navy);
  text-decoration: none;
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--terracotta);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy);
}

.nav-toggle svg,
.nav-toggle span {
  display: block;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger-line + .hamburger-line {
  margin-top: 6px;
}

/* ==========================================================================
   Hero Sections (.page-hero)
   ========================================================================== */
.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  padding: 60px 24px;
  background-size: cover;
  background-position: center;
  color: var(--white);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27,45,69,.55) 0%, rgba(27,45,69,.72) 100%);
  z-index: 1;
}

.page-hero > * {
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  color: var(--white);
  font-size: 2.6rem;
  margin-bottom: .35em;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.page-hero p {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto;
  opacity: .92;
}

/* Home hero — taller */
.page-hero--home {
  min-height: 480px;
}

.page-hero--home h1 {
  font-size: 3rem;
}

/* ==========================================================================
   Section Label
   ========================================================================== */
.section-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 8px;
}

/* ==========================================================================
   Community Cards (.community-card)
   ========================================================================== */
.community-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.community-card + .community-card {
  margin-top: 24px;
}

/* Card header */
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-header h3 {
  margin-bottom: 0;
}

.card-price {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--terracotta);
  white-space: nowrap;
}

/* Badges row */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

/* Card details — 2-col grid */
.card-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  font-size: .93rem;
  color: var(--text-mid);
  margin-bottom: 16px;
}

.card-details dt {
  font-weight: 600;
  color: var(--text);
}

/* Amenities */
.amenities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

/* Notes */
.card-notes {
  font-size: .92rem;
  color: var(--text-mid);
  padding: 12px 16px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border-left: 3px solid var(--cream-dark);
}

/* Card link / CTA button */
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--white);
  background: var(--blue);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.card-link:hover,
.card-link:focus-visible {
  background: var(--navy);
  text-decoration: none;
  color: var(--white);
  transform: translateY(-1px);
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-type {
  background: var(--blue-light);
  color: var(--blue);
}

.badge-beach {
  background: #e6f5f3;
  color: #2a7d6f;
}

.badge-social {
  background: #fde8e8;
  color: #c53030;
}

.badge-new {
  background: var(--gold-light);
  color: var(--gold);
}

.badge-gated {
  background: #f0e6f6;
  color: #6b3fa0;
}

.badge-rental {
  background: #e8eaf6;
  color: #3949ab;
}

/* ==========================================================================
   Amenity Tags
   ========================================================================== */
.amenity-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--sage-light);
  color: var(--sage);
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}

.data-table thead {
  background: var(--navy);
  color: var(--white);
}

.data-table th {
  font-weight: 600;
  text-align: left;
  padding: 14px 18px;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--cream);
}

.data-table tbody tr:nth-child(even) {
  background: var(--cream);
}

.data-table tbody tr:nth-child(odd) {
  background: var(--white);
}

.data-table tbody tr:hover {
  background: var(--blue-light);
}

/* ==========================================================================
   Region Banner
   ========================================================================== */
.region-banner {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

/* ==========================================================================
   Region Meta
   ========================================================================== */
.region-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.region-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--cream);
  color: var(--text-mid);
}

/* ==========================================================================
   Pick Cards (.pick-card)
   ========================================================================== */
.pick-card {
  background: var(--blue-light);
  border: 1px solid rgba(46,107,138,.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.pick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pick-card-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.pick-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.pick-card p {
  font-size: .92rem;
  color: var(--text-mid);
  margin-bottom: 0;
}

/* ==========================================================================
   Search
   ========================================================================== */
.search-container {
  position: relative;
  max-width: 560px;
  margin: 0 auto 32px;
}

.search-container input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--cream-dark);
  border-radius: 100px;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-container input::placeholder {
  color: var(--text-light);
}

.search-container input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,107,138,.15);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-btn {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  padding: 8px 18px;
  border: 1px solid var(--cream-dark);
  border-radius: 100px;
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-btn.active,
.filter-btn[aria-pressed="true"] {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.filter-select {
  font-family: inherit;
  font-size: .85rem;
  padding: 8px 16px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--blue);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 40px 24px;
  margin-top: 64px;
  font-size: .88rem;
}

.site-footer a {
  color: rgba(255,255,255,.85);
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer p {
  margin-bottom: .5em;
}

/* ==========================================================================
   Glossary
   ========================================================================== */
.glossary-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.glossary-item dt,
.glossary-term {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.glossary-item dd,
.glossary-def {
  font-size: .93rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ==========================================================================
   Tour Planner
   ========================================================================== */
.tour-group {
  margin-bottom: 36px;
}

.tour-group h3 {
  font-size: 1.25rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cream-dark);
  margin-bottom: 16px;
}

.tour-group ul {
  list-style: none;
  padding: 0;
}

.tour-group li {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: .93rem;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition);
}

.tour-group li:hover {
  background: var(--blue-light);
}

.tour-group-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.tour-region-image {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.tour-region-vibe {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-top: 4px;
  font-style: italic;
}

.tour-community {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s;
}

.tour-community:hover {
  background: var(--blue-light);
}

.tour-community-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tour-community-info strong {
  font-size: 0.95rem;
  color: var(--navy);
}

.tour-community-detail {
  font-size: 0.82rem;
  color: var(--text-light);
}

.tour-note {
  font-size: 0.88rem;
  color: var(--text-mid);
  font-style: italic;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--gold-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

.tour-community-list {
  margin-bottom: 8px;
}

.btn--small {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn--small:hover {
  background: var(--blue);
  color: var(--white);
}

.section {
  padding: 48px 0;
}

.section-intro {
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: 32px;
  max-width: 700px;
}

@media (max-width: 768px) {
  .tour-group-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tour-region-image {
    width: 100%;
    height: 120px;
  }
  .tour-community {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* ==========================================================================
   Utility Spacing
   ========================================================================== */
.section {
  padding: 56px 0;
}

.section--alt {
  background: var(--cream);
}

.text-center { text-align: center; }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 48px; }

/* ==========================================================================
   Responsive — 768px
   ========================================================================== */
@media (max-width: 768px) {

  html {
    font-size: 15.5px;
  }

  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.15rem; }

  /* Nav — hamburger mode */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 24px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    display: block;
    width: 100%;
    font-size: 1.05rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--cream);
  }

  /* Hero */
  .page-hero {
    min-height: 200px;
    padding: 40px 20px;
  }

  .page-hero h1 {
    font-size: 1.85rem;
  }

  .page-hero--home {
    min-height: 320px;
  }

  .page-hero--home h1 {
    font-size: 2.1rem;
  }

  /* Cards */
  .community-card {
    padding: 24px 20px;
  }

  .card-details {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
  }

  /* Grids → single column */
  .picks-grid,
  .region-grid {
    grid-template-columns: 1fr;
  }

  /* Search */
  .search-container {
    max-width: 100%;
  }

  /* Filter bar */
  .filter-bar {
    gap: 8px;
  }

  /* Region banner */
  .region-banner {
    height: 160px;
  }

  /* Table */
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: .85rem;
  }

  /* Section spacing */
  .section {
    padding: 36px 0;
  }

  .container {
    padding: 0 16px;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {

  .site-nav,
  .nav-toggle,
  .search-container,
  .filter-bar,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .community-card,
  .pick-card,
  .glossary-item {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .page-hero {
    min-height: auto;
    padding: 20px 0;
    color: #000;
    background: none !important;
  }

  .page-hero::before {
    display: none;
  }

  .page-hero h1 {
    color: #000;
    text-shadow: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .data-table thead {
    background: #333;
    color: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
