/* ================================================================
   City landing pages (/adu-plans/<city>/). Loaded after ds.css and
   styles.css; everything here is page-specific and prefixed cp-.
   Generated markup: scripts/build-cities.mjs.
   ================================================================ */

/* ---------- Photos and parallax ----------
   A photo sits in a clipped box and is taller than the box. Where the browser supports
   scroll-driven animations, the photo drifts as its box crosses the screen, so it reads
   as sitting behind the page. Everywhere else, and for anyone who has asked their device
   for less motion, it is a still photo. No JavaScript, and nothing is fixed to the
   viewport (which is what makes parallax stutter on phones). */
.cp-photo { position: absolute; inset: 0; overflow: hidden; overflow: clip; view-timeline: --cp-photo block; }
.cp-photo img { position: absolute; left: 0; top: -18%; width: 100%; height: 136%; max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }
.cp-photo::after { content: ''; position: absolute; inset: 0; }
@keyframes cp-drift { from { transform: translate3d(0, -12%, 0); } to { transform: translate3d(0, 12%, 0); } }
@keyframes cp-lift { from { transform: translate3d(0, 22px, 0); } to { transform: translate3d(0, -22px, 0); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .cp-photo img { animation: cp-drift linear both; animation-timeline: --cp-photo; animation-range: cover; }
    .cp-band { view-timeline: --cp-band block; }
    .cp-band__inner { animation: cp-lift linear both; animation-timeline: --cp-band; animation-range: cover; }
  }
}

/* ---------- Hero: copy on the left over navy, the photo on the right ---------- */
.cp-hero {
  position: relative; isolation: isolate; padding-top: 68px; padding-bottom: 148px; color: var(--dbp-white);
  background-color: var(--dbp-dark);
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}
.cp--hub .cp-hero { padding-bottom: 72px; }
/* The photo box is masked, so it fades out to the left and the hero's own navy and grid
   show through where the copy sits. A light tint keeps the copy readable where the two
   overlap, and darkens the foot, where the "at a glance" card sits on top. */
.cp-hero .cp-photo {
  left: 32%; z-index: -1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.3) 20%, #000 56%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.3) 20%, #000 56%);
}
.cp-hero .cp-photo img { object-position: var(--pos-wide, var(--pos, 50% 50%)); }
.cp-hero .cp-photo::after {
  background:
    linear-gradient(90deg, rgba(26, 26, 46, 0.5) 0%, rgba(26, 26, 46, 0.16) 55%, rgba(26, 26, 46, 0.06) 100%),
    linear-gradient(0deg, rgba(26, 26, 46, 0.6) 0%, rgba(26, 26, 46, 0) 36%);
}
.cp-hero-copy { max-width: 560px; }
.cp-hero h1 { color: var(--dbp-white); font-size: clamp(36px, 5.2vw, 58px); line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
.cp-hero .lc-kicker { color: #8FC4F2; }
.cp-hero .dbp-hero__sub { font-size: 18px; font-weight: 400; color: rgba(255, 255, 255, 0.9); max-width: 54ch; margin-bottom: 14px; }
.cp-hero .lc-hero-trust { color: rgba(255, 255, 255, 0.74); }
.cp-hero a:not(.dbp-btn) { color: var(--dbp-white); text-decoration: underline; text-underline-offset: 2px; }
.cp-hero .dbp-btn--outline { color: var(--dbp-white); border-color: rgba(255, 255, 255, 0.85); }
.cp-hero .dbp-btn--outline:hover { background: rgba(255, 255, 255, 0.12); }
.cp-hero :focus-visible { outline-color: var(--dbp-white); }
.cp-price { font-size: 16px; color: rgba(255, 255, 255, 0.8); margin-bottom: 18px; }
.cp-price strong { color: var(--dbp-white); }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cp-actions .dbp-btn { text-decoration: none; text-align: center; }
.cp a.dbp-btn { text-decoration: none; display: inline-block; }

/* ---------- The city's numbers: a card that overlaps the foot of the hero ---------- */
.cp-glance-band { background: var(--dbp-warm); padding: 0 20px; }
.cp-glance { position: relative; z-index: 2; max-width: 1040px; margin: -96px auto 0; background: var(--dbp-white); border: 1.5px solid var(--dbp-dark); border-radius: var(--dbp-radius-sm); padding: 0; overflow: hidden; box-shadow: 0 18px 44px rgba(26, 26, 46, 0.18); }
.cp-glance__title { font-family: var(--dbp-font-head); font-size: 12px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--dbp-white); background: var(--dbp-dark); margin: 0; padding: 12px 20px; line-height: 1.4; }
/* The 1px gaps over a gray ground draw the rules between the cells at any column count. */
.cp-glance__list { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--dbp-gray-200); }
.cp-glance__row { background: var(--dbp-white); padding: 14px 20px 16px; }
.cp-glance__row dt { font-size: 13px; color: var(--dbp-gray-500); line-height: 1.45; margin-bottom: 3px; }
.cp-glance__row dd { margin: 0; font-family: var(--dbp-font-head); font-weight: 600; font-size: 15px; color: var(--dbp-dark); line-height: 1.4; }
.cp-glance__src { font-size: 12px; color: var(--dbp-gray-500); padding: 10px 20px 12px; border-top: 1px solid var(--dbp-gray-200); font-style: italic; }

/* ---------- Photo band: a full-width photo with one line over it ---------- */
.cp-band { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: clamp(300px, 52vh, 500px); padding: 56px 20px; background: var(--dbp-dark); color: var(--dbp-white); overflow: hidden; overflow: clip; }
.cp-band .cp-photo { z-index: -1; }
.cp-band .cp-photo::after { background: linear-gradient(0deg, rgba(26, 26, 46, 0.92) 0%, rgba(26, 26, 46, 0.62) 38%, rgba(26, 26, 46, 0.14) 100%); }
.cp-band__inner { width: 100%; max-width: 1040px; margin: 0 auto; }
.cp-band__line { font-family: var(--dbp-font-head); font-weight: 800; font-size: clamp(27px, 4.4vw, 46px); line-height: 1.14; letter-spacing: -0.012em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.cp-band__line span { display: block; text-wrap: balance; }
.cp-band__accent { color: #8FC4F2; }
.cp-band__sub { margin-top: 12px; font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, 0.9); max-width: 50ch; }
.cp-band__sub a { color: var(--dbp-white); text-decoration: underline; text-underline-offset: 2px; }

/* Links to a section (#check from the phone bar, for one) land below the sticky header. */
.cp section[id] { scroll-margin-top: 110px; }

/* ---------- Lot Check band ---------- */
.cp-check .lc-form { margin-top: 6px; }
.cp-check .lc-microcopy { margin-top: 12px; }

/* ---------- Chooser: pick what you have, read your way through ---------- */
.cp-chooser__picks { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cp-path { border: 1px solid var(--dbp-gray-200); border-radius: var(--dbp-radius); padding: 24px; margin-bottom: 16px; background: var(--dbp-white); }
.cp-path__for { font-family: var(--dbp-font-head); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--dbp-blue); margin-bottom: 6px; }
.cp-path h3 { font-family: var(--dbp-font-head); font-size: 21px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.cp-path > p { font-size: 16px; color: var(--dbp-gray-700); max-width: 68ch; margin-bottom: 10px; }
.cp-path__cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 28px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--dbp-gray-200); }
.cp-path h4 { font-family: var(--dbp-font-head); font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dbp-gray-500); margin-bottom: 6px; }
.cp-path__next p { font-size: 15px; color: var(--dbp-gray-700); margin-bottom: 14px; }
/* With JavaScript, only the picked way through shows. Without it, all of them do. */
.cp-chooser--js .cp-path[hidden] { display: none; }
.cp-chooser--js .cp-path__for { display: none; }

/* ---------- Tables ---------- */
.cp-tablewrap { overflow-x: auto; background: var(--dbp-white); border: 1px solid var(--dbp-gray-200); border-radius: var(--dbp-radius); margin: 8px 0 16px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cp-table th, .cp-table td { text-align: left; vertical-align: top; padding: 13px 16px; border-top: 1px solid var(--dbp-gray-200); line-height: 1.5; }
.cp-table thead th { border-top: 0; font-family: var(--dbp-font-head); font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--dbp-gray-500); }
.cp-table tbody th { font-weight: 600; color: var(--dbp-dark); }
.cp-table td { color: var(--dbp-gray-700); }
.cp-amount { font-family: var(--dbp-font-head); font-weight: 700; color: var(--dbp-dark); font-variant-numeric: tabular-nums; }
.cp-table--costs tbody th { width: 32%; }
.cp-table--costs .cp-amount { width: 26%; }

.cp-prose { font-size: 15.5px; color: var(--dbp-gray-700); max-width: 70ch; margin-top: 10px; }
.cp-source { font-size: 13px; color: var(--dbp-gray-500); margin-top: 10px; }
.cp-source a, .cp-prose a, .cp-path a:not(.dbp-btn), .cp-rules a, .cp-hall a, .cp-sources a { color: var(--dbp-blue-dark); }
.cp-caveat { font-size: 15px; color: var(--dbp-dark); background: #FDF3E7; border-left: 3px solid #D97706; padding: 12px 16px; border-radius: 4px; margin-top: 16px; max-width: 70ch; }
.cp-rules li { max-width: 72ch; }

/* ---------- Ready to call + the City ---------- */
.cp-two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 36px; align-items: start; }
.cp-hall h3 { font-family: var(--dbp-font-head); font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.cp-hall ul { list-style: none; margin: 0; padding: 0; }
.cp-hall__lines li { font-size: 15px; color: var(--dbp-gray-700); padding: 5px 0; }
.cp-hall__links { margin-top: 10px !important; padding-top: 10px !important; border-top: 1px solid var(--dbp-gray-200); }
.cp-hall__links li { font-size: 14.5px; padding: 4px 0; }

/* ---------- Callback form ---------- */
.cp-callback { max-width: 560px; margin: 26px auto 10px; padding: 22px; background: var(--dbp-white); border: 1px solid var(--dbp-gray-200); border-radius: var(--dbp-radius); text-align: left; }
.cp-callback__title { font-family: var(--dbp-font-head); font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.cp-callback__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 14px; }
.cp-callback .dbp-input { width: 100%; }
.cp-callback__done { font-size: 15.5px; color: #0E7A37; font-weight: 600; }

/* ---------- Sources ---------- */
.cp-sources { padding-top: 36px; padding-bottom: 36px; border-top: 1px solid var(--dbp-gray-200); }
.cp-sources__title { font-size: 17px !important; margin-bottom: 8px !important; }
.cp-sources__list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--dbp-gray-700); }
.cp-sources__list li { padding: 2px 0; }

/* ---------- Hub ---------- */
.cp-citygrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 18px; }
.cp-citycard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--dbp-dark); transition: border-color .15s; }
.cp-citycard:hover { border-color: var(--dbp-blue); }
.cp-citycard h2 { font-size: 22px !important; margin-bottom: 0 !important; }
.cp-citycard dl { margin: 0; display: grid; gap: 8px; }
.cp-citycard dt { font-size: 12.5px; color: var(--dbp-gray-500); }
.cp-citycard dd { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.cp-citycard__go { margin-top: auto; font-family: var(--dbp-font-head); font-weight: 700; font-size: 14.5px; color: var(--dbp-blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Phone action bar ---------- */
.cp-bar { display: none; }

@media (max-width: 900px) {
  .cp-two { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .cp-glance__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Narrow screens: the photo runs across the top of the hero and fades down into the
     navy, with the headline sitting on the fade. */
  .cp-hero { padding-top: 0; padding-bottom: 124px; }
  .cp--hub .cp-hero { padding-bottom: 48px; }
  .cp-hero .cp-photo {
    left: 0; bottom: auto; height: 340px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 97%);
    mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 97%);
  }
  .cp-hero .cp-photo img { object-position: var(--pos, 50% 50%); }
  .cp-hero .cp-photo::after { background: linear-gradient(180deg, rgba(26, 26, 46, 0.18) 0%, rgba(26, 26, 46, 0.55) 55%, rgba(26, 26, 46, 0.7) 100%); }
  .cp-hero .dbp-hero__inner { padding-top: 176px; }
  .cp-hero h1, .cp-hero .lc-kicker { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); }
  .cp-hero-copy { max-width: 620px; }
  .cp-glance { margin-top: -84px; }
}

@media (max-width: 760px) {
  .cp-actions .dbp-btn { flex: 1 1 100%; }
  .cp-path { padding: 18px; }
  .cp-path__cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cp-callback__fields { grid-template-columns: minmax(0, 1fr); }
  .cp-callback .dbp-btn { width: 100%; }
  .cp-hero { padding-bottom: 108px; }
  .cp-hero .cp-photo { height: 300px; }
  .cp-hero .dbp-hero__inner { padding-top: 150px; }
  .cp-glance { margin-top: -72px; }
  .cp-glance__list { grid-template-columns: minmax(0, 1fr); }
  .cp-glance__row { padding: 12px 18px 13px; }
  .cp-band { padding: 40px 20px; min-height: 300px; }

  /* Tables read as stacked cards on a phone, so nothing scrolls sideways. */
  .cp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cp-table, .cp-table tbody, .cp-table tr, .cp-table th, .cp-table td { display: block; }
  .cp-table tr { padding: 12px 16px; border-top: 1px solid var(--dbp-gray-200); }
  .cp-table tbody tr:first-child { border-top: 0; }
  .cp-table th, .cp-table td { padding: 2px 0; border: 0; }
  .cp-table td:empty { display: none; }
  .cp-amount { font-size: 17px; }
  .cp-table--costs tbody th, .cp-table--costs .cp-amount { width: auto; }

  /* Two actions, always in reach. The page leaves room for it at the bottom. */
  .cp-bar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--dbp-white); border-top: 1px solid var(--dbp-gray-200); box-shadow: 0 -4px 16px rgba(26, 26, 46, 0.08);
  }
  .cp-bar .dbp-btn { flex: 1 1 0; padding: 13px 10px; font-size: 15px; text-align: center; white-space: nowrap; }
  body.cp { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}
