/* ==========================================================================
   Components — Fort Myers Beach Vacation Rentals
   Shared nav, footer, hero, cards, buttons, sections. Uses tokens.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--leading-tight); color: var(--color-text); margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
p { margin: 0 0 1em; }
a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--color-primary); color: #fff; padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-5); }
.container-narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: var(--space-10); }
.section__eyebrow {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--coral-700); margin-bottom: var(--space-2);
}
.section__title { margin-bottom: var(--space-3); }
.lede { font-size: var(--text-lg); color: var(--color-text-muted); }

/* --- Buttons --- */
.btn {
  display: inline-block; padding: 0.85rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: background 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--color-accent); color: var(--color-on-accent); }
.btn--accent:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.85); }
.btn--ghost:hover { background: rgba(255,255,255,0.14); color: #fff; }
.btn--lg { padding: 1rem 2rem; font-size: 1.1rem; }

/* --- Header / nav --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252, 249, 244, 0.92); backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--sand-200);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--color-text); font-weight: 700; }
.brand__mark { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ocean-700); color: #fff; font-family: var(--font-display); font-size: 1rem; }
.brand__name { font-size: 1.02rem; line-height: 1.2; }
.brand__name small { display: block; font-weight: 500; color: var(--color-text-muted); font-size: 0.72rem; }
.nav__links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; color: var(--color-text); font-weight: 500; font-size: 0.95rem; }
.nav__links a:hover { color: var(--color-primary); }
.nav__links a[aria-current="page"] { color: var(--color-primary); font-weight: 600; }
.nav__cta { margin-left: 0.5rem; }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem;
  font-size: 1.5rem; line-height: 1; color: var(--color-text);
}

/* --- Hero --- */
.hero {
  position: relative; min-height: clamp(24rem, 70vh, 40rem);
  display: flex; align-items: flex-end; color: #fff; overflow: hidden;
  background: var(--ocean-900);
}
.hero__media { position: absolute; inset: 0; }
.hero__media video, .hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,58,66,0.05) 0%, rgba(12,58,66,0.28) 45%, rgba(12,58,66,0.72) 100%);
}
.hero__inner { position: relative; width: 100%; padding-block: var(--space-14); }
.hero__inner h1 { color: #fff; max-width: 24ch; text-shadow: 0 2px 24px rgba(0,0,0,0.35); }
.hero__sub { color: #fff; max-width: 46ch; font-size: var(--text-lg); text-shadow: 0 1px 12px rgba(0,0,0,0.35); margin-bottom: var(--space-5); }
.hero__ctas { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero__ctas--center { justify-content: center; }

/* --- Cards --- */
.card-grid { display: grid; gap: var(--space-6); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  border: 1px solid var(--sand-200);
}
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--ocean-100); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.card__specs { display: flex; gap: var(--space-4); flex-wrap: wrap; color: var(--color-text-muted); font-size: var(--text-sm); }
.card__specs span { display: inline-flex; align-items: center; gap: 0.3rem; }
.card__body p { color: var(--color-text-muted); margin: 0; }
.card__cta { margin-top: auto; }

/* --- Spec strip --- */
.spec-strip {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  padding: var(--space-5) 0; border-block: 1px solid var(--sand-200); margin-block: var(--space-6);
}
.spec-strip__item {
  flex: 1 1 9rem; padding: var(--space-3); text-align: center;
  background: var(--color-surface); border: 1px solid var(--sand-200); border-radius: var(--radius-md);
}
.spec-strip__value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--ocean-700); }
.spec-strip__label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* --- Amenity list --- */
.amenities { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.amenities li { display: flex; gap: 0.6rem; align-items: flex-start; }
.amenities li::before { content: "✓"; color: var(--ocean-600); font-weight: 700; }

.mt-2 { margin-top: 2rem; }

/* --- Photo gallery --- */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.photo-thumb { padding: 0; border: 0; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; background: var(--ocean-100); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; display: block; transition: transform 0.3s ease; }
.photo-thumb:hover img, .photo-thumb:focus-visible img { transform: scale(1.05); }

/* --- Lightbox --- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(12, 42, 50, 0.97); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 90vw; max-height: 82vh; object-fit: contain; box-shadow: var(--shadow-lg); }
.lightbox__close { position: absolute; top: 1rem; right: 1rem; width: 3rem; height: 3rem; border-radius: 50%; background: rgba(0,0,0,0.45); color: #fff; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; background: rgba(0,0,0,0.45); color: #fff; border: 0; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__counter { position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.9rem; }
.lightbox__caption { position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.85); font-size: 0.95rem; text-align: center; max-width: 80vw; }
.no-scroll { overflow: hidden; }

/* --- Two-column prose --- */
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-10); align-items: start; }

/* --- Why band --- */
.why-band { background: var(--ocean-700); color: #fff; }
.why-band h2, .why-band h3 { color: #fff; }
.why-band .section__eyebrow { color: var(--coral-100); }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); margin-top: var(--space-6); }
.why-grid__item h3 { font-size: 1.15rem; }
.why-grid__item p { color: var(--ocean-100); font-size: var(--text-sm); }

/* --- CTA band --- */
.cta-band { background: var(--sand-100); text-align: center; }
.cta-band__inner { max-width: 46rem; margin-inline: auto; }

/* --- Footer --- */
.site-footer { background: var(--ink-900); color: var(--sand-100); padding-block: var(--space-8); }
.site-footer a { color: var(--sand-100); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-8); justify-content: space-between; }
.site-footer__col h3 { color: #fff; font-size: 1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col li { margin-bottom: 0.5rem; font-size: var(--text-sm); }
.site-footer__col a { text-decoration: none; }
.site-footer__col a:hover { text-decoration: underline; }
.site-footer__legal { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid rgba(255,255,255,0.15); font-size: var(--text-xs); color: var(--ink-300); }

/* --- Responsive --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card__media img { transition: none; }
}
@media (max-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: var(--space-6); }
  .amenities { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .card-grid--3 { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --section-y: 3.5rem; }
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 0 var(--space-5) var(--space-4);
    background: var(--color-bg); border-bottom: 1px solid var(--sand-200);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links li { padding: 0.6rem 0; border-bottom: 1px solid var(--sand-100); }
  .nav__cta { margin-left: 0; }
  .hero { min-height: 24rem; }
  .hero__sub { font-size: 1.05rem; }
}
