/* ============================================================
   Pine Forest of Oak Island — public consumer site (#publicApp)
   Brand identity matches the main pineforestoakisland.com site and the
   internal app: navy/blue, Georgia display serif + system sans. Loaded
   alongside css/styles.css; everything here is scoped under
   .public-app / #publicApp so it never touches the internal app's styling.
   Map-status colors (available/pending/sold) are a separate, functional
   palette — not brand colors — chosen for clear at-a-glance distinction.
   ============================================================ */

:root {
  --pub-navy: #0f2b45;
  --pub-blue: #135788;
  --pub-blue-dark: #0d3f63;
  --pub-blue-light: #4a8bc2;
  --pub-blue-pale: #eaf2f9;
  --pub-blue-pale-2: #dbe9f5;
  --pub-sand: #f6f4ef;
  --pub-cream: #ffffff;
  --pub-ink: #1b2733;
  --pub-ink-soft: #4c5b6b;
  --pub-ink-faint: #7c8896;
  --pub-line: #dde5ec;
  --pub-gold: #b8862f;

  /* Map status colors — functional, not brand colors */
  --pub-available: #135788;      /* blue */
  --pub-pending: #5b9bd5;        /* light blue */
  --pub-sold-building: #d98c1f;  /* orange — sold, still under construction */
  --pub-sold: #af0000;           /* red — sold, complete */
  --pub-model-ring: #b8862f;

  --pub-font-display: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --pub-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.public-app { font-family: var(--pub-font-body); color: var(--pub-ink); background: var(--pub-cream); }
.public-app * { box-sizing: border-box; }
.public-app section[id] { scroll-margin-top: 76px; }
.public-app h1, .public-app h2, .public-app h3 { font-family: var(--pub-font-display); color: var(--pub-navy); margin: 0 0 12px; font-weight: 700; }
.public-app p { line-height: 1.6; margin: 0 0 14px; color: var(--pub-ink-soft); }
.public-app a { color: var(--pub-blue); }

.pub-section-inner { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.pub-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pub-gold); margin: 0 0 10px; }
.pub-eyebrow-light { color: #cfe0ee; }

/* ---------------- Header ---------------- */
.pub-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--pub-line); }
.pub-header-inner { max-width: 1180px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 24px; }
.pub-logo { height: 40px; }
.pub-nav { display: flex; gap: 22px; flex: 1; }
.pub-nav a { color: var(--pub-ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.pub-nav a:hover { color: var(--pub-blue); }
.pub-header-actions { display: flex; align-items: center; gap: 12px; }
.pub-staff-link {
  appearance: none; background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--pub-ink-faint); text-decoration: underline; padding: 4px;
  font-family: var(--pub-font-body);
}
.pub-staff-link:hover { color: var(--pub-ink); }
.pub-learn-more {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  border: 1.5px solid var(--pub-blue); color: var(--pub-blue-dark); border-radius: 999px;
  padding: 7px 15px; font-size: 12.5px; font-weight: 700; font-family: var(--pub-font-body);
  white-space: nowrap;
}
.pub-learn-more:hover { background: var(--pub-blue-pale); }

/* ---------------- Hero ---------------- */
.pub-hero {
  background: linear-gradient(180deg, var(--pub-blue-pale), var(--pub-cream));
  padding: 64px 28px 48px;
  text-align: center;
}
.pub-hero-inner { max-width: 760px; margin: 0 auto; }
.pub-hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; }
.pub-hero-sub { font-size: 16px; max-width: 620px; margin: 0 auto 26px; }
.pub-hero-stats { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin: 0 0 30px; }
.pub-stat { min-width: 90px; }
.pub-stat-num { font-family: var(--pub-font-display); font-size: 30px; font-weight: 700; color: var(--pub-navy); }
.pub-stat-lbl { font-size: 12px; color: var(--pub-ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.pub-stat-skel, .pub-legend-skel { font-size: 13px; color: var(--pub-ink-soft); padding: 8px 0; }
.pub-hero-ctas { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.public-app .pf-btn-ghost-light {
  background: transparent; border: 1.5px solid var(--pub-blue); color: var(--pub-blue-dark);
  border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 14px; cursor: pointer;
  font-family: var(--pub-font-body);
}
.public-app .pf-btn-ghost-light:hover { background: var(--pub-blue-pale); }
.public-app .pf-btn-primary {
  background: var(--pub-blue); border: none; color: #fff; border-radius: 999px;
  padding: 12px 22px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--pub-font-body);
}
.public-app .pf-btn-primary:hover { background: var(--pub-blue-dark); }
.public-app .pf-btn-ghost {
  background: transparent; border: 1.5px solid var(--pub-line); color: var(--pub-ink);
  border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--pub-font-body);
}
.public-app .pf-btn-sm { padding: 8px 16px; font-size: 12.5px; }

/* ---------------- Map section ---------------- */
.pub-map-section { padding: 60px 0 70px; }
.pub-map-section h2, .pub-designs h2, .pub-community h2, .pub-faq h2 { font-size: clamp(24px, 3.4vw, 32px); }
.pub-section-sub { max-width: 560px; margin-bottom: 30px; }
.pub-map-layout { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .pub-map-layout { grid-template-columns: 1fr; } }

.pub-legend { background: var(--pub-sand); border: 1px solid var(--pub-line); border-radius: 16px; padding: 18px; position: sticky; top: 84px; }
.pub-legend-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--pub-ink-soft); margin: 0 0 8px; }
.pub-legend-row {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 7px 6px; border-radius: 8px;
  font-size: 13.5px; color: var(--pub-ink); font-family: var(--pub-font-body);
}
.pub-legend-row:hover { background: var(--pub-blue-pale-2); }
.pub-legend-row.active { background: var(--pub-blue-pale-2); font-weight: 700; }
.pub-legend-row.off { opacity: .45; }
.pub-legend-swatch { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.pub-legend-row .cnt { margin-left: auto; font-size: 12px; color: var(--pub-ink-soft); }
.pub-legend-note { font-size: 12px; color: var(--pub-ink-soft); margin: 10px 2px 0; line-height: 1.5; }

/* min-width: 0 overrides the grid item's default `min-width: auto` —
   without it, the zoomed .pub-map-canvas below (which can grow to several
   times the frame's width) leaks its intrinsic content width back up
   through this grid item, growing the whole frame/toolbar right along
   with the map instead of staying put while only the map scales/pans
   inside it. See .pub-map-scroll below for the other half of the fix. */
.pub-map-stage-wrap { position: relative; min-width: 0; }
.pub-map-toolbar { position: absolute; top: 12px; right: 12px; z-index: 15; display: flex; flex-direction: column; gap: 6px; }
.pub-map-toolbar button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--pub-line); background: #fff;
  color: var(--pub-navy); font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(15,43,69,.12);
}
.pub-map-toolbar button:hover { background: var(--pub-blue-pale); }
.pub-map-toolbar button#pubZoomReset { font-size: 11px; }

.pub-map-stage {
  position: relative; border-radius: 16px; border: 1px solid var(--pub-line);
  background: #eef2f6; box-shadow: 0 8px 30px rgba(15, 43, 69, 0.10);
  height: min(620px, 62vw, 66vh);
  min-height: 340px;
  overflow: hidden;
}
/* position:absolute + inset:0 (mirrors .map-scroll in the internal app's
   css/styles.css) takes this out of normal flow entirely, so the wide
   zoomed canvas inside it can never affect the size of this box or any
   ancestor — only .pub-map-stage's own fixed height/the grid track's
   width bound it, and overflow:auto here just scrolls/pans the content
   within that static frame. */
.pub-map-scroll { position: absolute; inset: 0; overflow: auto; cursor: grab; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.pub-map-scroll.grabbing { cursor: grabbing; }
.pub-map-canvas { position: relative; }
.pub-map-canvas img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

.pub-marker {
  position: absolute; width: 26px; height: 26px; margin-left: -13px; margin-top: -13px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: #fff; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  transition: transform .12s, opacity .15s;
}
.pub-marker:hover, .pub-marker.active { transform: scale(1.22); z-index: 5; }
.pub-marker.dim { opacity: .18; }
.pub-marker.status-available { background: var(--pub-available); }
.pub-marker.status-pending { background: var(--pub-pending); }
.pub-marker.status-soldBuilding { background: var(--pub-sold-building); }
.pub-marker.status-sold { background: var(--pub-sold); }
.pub-marker.model { box-shadow: 0 0 0 3px var(--pub-model-ring), 0 1px 4px rgba(0,0,0,.35); }

.pub-lot-pop {
  position: absolute; width: 290px; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(15,43,69,.28); opacity: 0; pointer-events: none;
  transform: translateY(4px); transition: opacity .12s, transform .12s; z-index: 20;
}
.pub-lot-pop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pub-pop-head { padding: 14px 16px; color: #fff; position: relative; }
.pub-pop-head .lotnum { font-family: var(--pub-font-display); font-size: 19px; font-weight: 700; }
.pub-pop-head .status-line { font-size: 12.5px; opacity: .92; margin-top: 1px; }
.pub-pop-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; opacity: .85; line-height: 1;
}
.pub-pop-body { padding: 12px 16px 16px; }
.pub-pop-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--pub-blue-pale-2); }
.pub-pop-row .k { color: var(--pub-ink-soft); }
.pub-pop-row .v { font-weight: 600; text-align: right; }
.pub-pop-featured {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: var(--pub-gold); background: #fbf3e4;
  border-radius: 6px; padding: 4px 8px; margin: 8px 0 2px;
}
.pub-builder-logo-chip { display: inline-flex; align-items: center; border-radius: 7px; padding: 6px 10px; margin: 8px 0 4px; }
.pub-builder-logo-chip.on-light { background: var(--pub-blue-pale); }
.pub-builder-logo-chip.on-dark { background: var(--pub-navy); }
.pub-builder-logo-chip img { height: 20px; display: block; }
.pub-pop-ctas { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---------------- Premier builder band ---------------- */
.pub-premier { background: var(--pub-navy); padding: 64px 0; }
.pub-premier-inner { display: flex; justify-content: center; }
.pub-premier-copy { max-width: 640px; text-align: center; }
.pub-premier .pub-eyebrow-light { justify-content: center; }
.pub-premier h2 { color: #fff; }
.pub-premier p { color: #cfd9e3; }
.pub-premier-logo { display: inline-block; background: #fff; border-radius: 12px; padding: 14px 26px; margin-bottom: 18px; }
.pub-premier-logo img { height: 46px; display: block; }
.pub-premier-list { text-align: left; color: #e3e9ee; margin: 0 0 24px; padding-left: 20px; }
.pub-premier-list li { margin-bottom: 8px; line-height: 1.5; }
.pub-premier-ctas { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.pub-premier .pf-btn-ghost-light { border-color: #5c85a8; color: #fff; }
.pub-premier .pf-btn-ghost-light:hover { background: rgba(255,255,255,.08); }

/* ---------------- Home Designs ---------------- */
.pub-designs { padding: 64px 0; background: var(--pub-sand); }
.pub-designs-highlight {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--pub-blue-pale); border: 1px solid var(--pub-blue-pale-2); border-radius: 14px;
  padding: 16px 20px; margin: 20px 0 26px;
}
.pub-designs-highlight strong { color: var(--pub-navy); }
.pub-designs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.pub-plan-card { background: var(--pub-cream); border: 1px solid var(--pub-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
/* Every plan photo renders at the same size/aspect ratio, cropped to fill
   the box with the home centered both horizontally and vertically —
   object-fit:cover + object-position:center does the crop; the source
   images are additionally pre-cropped to this same ratio in assets/plans/
   so nothing shifts oddly on very old browsers that ignore object-fit. */
.pub-plan-photo { width: 100%; aspect-ratio: 900 / 620; overflow: hidden; background: var(--pub-blue-pale); }
.pub-plan-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.pub-plan-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.pub-plan-card h3 { font-size: 18px; margin-bottom: 4px; }
.pub-plan-specs { font-size: 12.5px; color: var(--pub-blue-dark); font-weight: 700; margin-bottom: 10px; }
.pub-plan-card p { font-size: 13px; margin-bottom: 14px; flex: 1; }
.pub-plan-card-actions { display: flex; flex-direction: column; gap: 8px; }
.pub-designs-note { font-size: 12.5px; color: var(--pub-ink-faint); margin-top: 20px; }

/* ---------------- Virtual tour modal ---------------- */
.pub-tour-modal { width: min(920px, 92vw); }
.pub-tour-body { padding: 0 !important; }
.pub-tour-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b1b28; }
.pub-tour-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pub-tour-head-actions { display: flex; align-items: center; gap: 14px; }
.pub-tour-fs-btn {
  background: none; border: 1px solid var(--pub-line); border-radius: 8px; cursor: pointer;
  color: var(--pub-ink-soft); font-size: 12.5px; font-weight: 600; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1;
}
.pub-tour-fs-btn:hover { background: var(--pub-blue-pale); border-color: var(--pub-blue-pale-2); }
/* Browser Fullscreen API target is .pub-tour-frame-wrap itself, so it (not
   the aspect-ratio box) needs to actually fill the screen while active. */
.pub-tour-frame-wrap:fullscreen { aspect-ratio: unset; width: 100vw; height: 100vh; }
.pub-tour-frame-wrap:-webkit-full-screen { aspect-ratio: unset; width: 100vw; height: 100vh; }

/* ---------------- Community ---------------- */
.pub-community { padding: 64px 0; }
.pub-community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 20px; }
.pub-community-card { background: var(--pub-sand); border: 1px solid var(--pub-line); border-radius: 14px; padding: 22px; }
.pub-community-card h3 { font-size: 17px; margin-bottom: 8px; }
.pub-community-card p { font-size: 13.5px; margin: 0; }

/* ---------------- FAQ ---------------- */
.pub-faq { padding: 64px 0 76px; background: var(--pub-sand); }
.pub-faq-list { max-width: 760px; margin-top: 20px; }
.pub-faq-item { border-bottom: 1px solid var(--pub-line); padding: 16px 0; }
.pub-faq-item summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--pub-navy); list-style: none; }
.pub-faq-item summary::-webkit-details-marker { display: none; }
.pub-faq-item summary::before { content: "+"; display: inline-block; width: 18px; color: var(--pub-gold); font-weight: 800; }
.pub-faq-item[open] summary::before { content: "\2212"; }
.pub-faq-item p { margin: 10px 0 0 18px; font-size: 14px; }

/* ---------------- Footer ---------------- */
.pub-footer { background: var(--pub-navy); padding: 34px 0; }
.pub-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.pub-footer-logo { height: 28px; margin-bottom: 6px; }
.pub-footer-inner p { color: #9fb2c2; font-size: 12.5px; margin: 0; }
.pub-staff-link-footer { color: #9fb2c2; }
.pub-staff-link-footer:hover { color: #fff; }

/* ---------------- Lead modal ---------------- */
.pub-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,43,69,.5); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 200;
}
.pub-modal-backdrop.show { display: flex; }
.pub-modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 460px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(15,43,69,.35); font-family: var(--pub-font-body);
}
.pub-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--pub-line); }
.pub-modal-head h3 { margin: 0; font-size: 18px; }
.pub-modal-head button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--pub-ink-soft); line-height: 1; }
.pub-modal-body { padding: 20px 22px 24px; }
.pub-lead-lot { font-size: 13px; font-weight: 700; color: var(--pub-blue); margin: -6px 0 14px; }
.pub-field { margin-bottom: 14px; }
.pub-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--pub-ink); margin-bottom: 5px; }
.pub-field label span { font-weight: 400; color: var(--pub-ink-soft); }
.pub-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pub-checks { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--pub-ink-soft); }
.pub-checks label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.pub-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pub-lead-error { color: #b3372c; font-size: 13px; margin: -4px 0 12px; min-height: 1px; }
.pub-lead-success { text-align: center; padding: 10px 0; }
.pub-lead-success-icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--pub-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 22px;
}
.pub-lead-success h3 { margin-bottom: 8px; }

.public-app .pf-input {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1.5px solid var(--pub-line);
  font-size: 14px; font-family: var(--pub-font-body); outline: none; background: #fff; color: var(--pub-ink);
}
.public-app .pf-input:focus { border-color: var(--pub-blue); }
.public-app textarea.pf-input { resize: vertical; }

@media (max-width: 560px) {
  .pub-field-row { grid-template-columns: 1fr; }
  .pub-header-inner { flex-wrap: wrap; }
  .pub-nav { order: 3; width: 100%; justify-content: center; gap: 16px; }
  .pub-map-stage { height: 74vw; }
}
