/*
Theme Name:  Coastal Preferred Properties
Theme URI:   https://coastalmry.com/
Description: Child theme of Estatik Realtor Theme. Supplies the homepage and the
             Coastal house style; property templates stay with the parent.
Author:      Coastal Preferred Properties
Template:    estatik-realtor-theme
Version:     1.0.0
*/

/* ---------------------------------------------------------------------------
   Palette and type are shared with blshinc.com and beutel.net so the estate
   reads as one family. The colours are SAMPLED FROM THE HERO PHOTOGRAPH — the
   gold is the horizon glow, the ink is the sky above it — which is why they sit
   on the image without fighting it. Don't swap them for generic brand colours.
   ------------------------------------------------------------------------ */

:root{
  --ink:#16232E; --ink-soft:#4A5A66; --paper:#FAFAF8; --surface:#FFFFFF;
  --line:#E4E4DF; --gold:#C07C22; --ember:#B33E1A; --mist:#8E9BA3;
  --serif:"Instrument Serif",Georgia,"Times New Roman",serif;
  --sans:"Karla","Helvetica Neue",Helvetica,Arial,sans-serif;
  --wrap:1180px;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --ink:#ECEFEF; --ink-soft:#A3B0B8; --paper:#11191F; --surface:#18232B;
    --line:#28353E; --gold:#E4A03C; --ember:#E06438; --mist:#7E8C95;
  }
}
:root[data-theme="dark"]{
  --ink:#ECEFEF; --ink-soft:#A3B0B8; --paper:#11191F; --surface:#18232B;
  --line:#28353E; --gold:#E4A03C; --ember:#E06438; --mist:#7E8C95;
}

.cm-home{background:var(--paper);color:var(--ink);font-family:var(--sans);}
.cm-home *{box-sizing:border-box}
.cm-wrap{max-width:var(--wrap);margin:0 auto;padding-inline:20px}
/* Colour is set explicitly here, not inherited. The PARENT theme ships a bare
   `h3{color:#212121}` and its stylesheet is enqueued AFTER this one, so any
   heading we leave uncoloured turns near-black — invisible on the dark
   surfaces in dark mode. Same reasoning for links. */
.cm-home h1,.cm-home h2,.cm-home h3{font-family:var(--serif);font-weight:400;
  letter-spacing:.005em;color:var(--ink)}
.cm-hero h1,.cm-hero h2,.cm-hero h3{color:#fff}
.cm-home a{color:inherit}
.cm-prose a,.cm-meta a{color:var(--gold);text-decoration:underline;text-underline-offset:3px}
.cm-callout h3{color:var(--ink)}
.cm-home :focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* ---- hero ------------------------------------------------------------- */
/* The photograph and its darkening scrim are BOTH backgrounds on this one
   element, first layer on top. This looks less elegant than an <img> plus an
   ::after overlay, and it is deliberate: that arrangement needs the image on a
   lower stacking layer than the scrim, and in this theme the image then failed
   to paint at all — the hero rendered as a flat grey gradient while the photo
   sat loaded and invisible in the DOM. Two stacked backgrounds on a single box
   have no stacking context to get wrong.

   The photo is decorative (the headline carries the meaning), so nothing is
   lost to assistive technology by it not being an <img>. */
.cm-hero{
  position:relative;color:#fff;overflow:hidden;
  padding-block:clamp(72px,13vw,150px);
  background-color:#20323f;                 /* shows while the photo loads */
  background-image:
    linear-gradient(180deg,rgba(10,18,25,.58) 0%,rgba(10,18,25,.34) 42%,rgba(10,18,25,.72) 100%),
    url("img/hero-wide-1600-20260913.jpg");
  background-size:cover,cover;
  background-position:center,center 58%;
  background-repeat:no-repeat,no-repeat;
}
@media (min-width:1500px){
  .cm-hero{background-image:
    linear-gradient(180deg,rgba(10,18,25,.58) 0%,rgba(10,18,25,.34) 42%,rgba(10,18,25,.72) 100%),
    url("img/hero-wide-2400-20260913.jpg");}
}
/* Narrow screens get the taller crop, or the horizon is cropped away. */
@media (max-width:700px){
  .cm-hero{background-image:
    linear-gradient(180deg,rgba(10,18,25,.58) 0%,rgba(10,18,25,.36) 40%,rgba(10,18,25,.74) 100%),
    url("img/hero-tall-900-20260913.jpg");}
}

/* hero typography — measure matters more than size here: the headline is
   capped at ~16 characters so it breaks to two lines on a desktop and reads as
   a statement rather than a banner. */
.cm-eyebrow{font-size:.8rem;letter-spacing:.16em;text-transform:uppercase;
  color:#F3D9A9;margin:0 0 .9rem}
.cm-hero h1{font-size:clamp(2.3rem,6vw,4rem);line-height:1.04;margin:0 0 .7rem;
  max-width:16ch;text-shadow:0 2px 24px rgba(0,0,0,.4)}
.cm-hero p.cm-lede{font-size:clamp(1rem,1.7vw,1.18rem);line-height:1.55;
  margin:0 0 1.8rem;max-width:52ch;color:#EAF0F3;text-shadow:0 1px 12px rgba(0,0,0,.45)}

/* ---- search ----------------------------------------------------------- */
.cm-search{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch;
  background:rgba(255,255,255,.13);backdrop-filter:blur(7px);
  border:1px solid rgba(255,255,255,.28);border-radius:3px;padding:10px;max-width:760px}
.cm-search input,.cm-search select{font:inherit;font-size:.97rem;color:var(--ink);
  background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:2px;padding:12px 13px;min-width:0}
.cm-search .cm-q{flex:2 1 240px}
.cm-search .cm-p{flex:1 1 130px}
.cm-search button{flex:0 0 auto;font:inherit;font-weight:600;letter-spacing:.04em;
  background:var(--gold);color:#1b1206;border:0;border-radius:2px;padding:12px 24px;cursor:pointer}
.cm-search button:hover{background:#D08B2A}
.cm-hero__stat{margin:1.1rem 0 0;font-size:.9rem;color:#D7E1E6}
.cm-hero__stat strong{color:#fff;font-weight:600}

/* ---- sections --------------------------------------------------------- */
.cm-sec{padding-block:clamp(48px,7vw,86px)}
.cm-sec--alt{background:var(--surface);border-block:1px solid var(--line)}
.cm-sec h2{font-size:clamp(1.7rem,3.4vw,2.4rem);margin:0 0 .3rem}
.cm-sec .cm-sub{color:var(--ink-soft);margin:0 0 2rem;max-width:60ch;line-height:1.6}
.cm-head{display:flex;align-items:baseline;justify-content:space-between;gap:20px;flex-wrap:wrap}
.cm-more{font-size:.92rem;color:var(--gold);text-decoration:none;border-bottom:1px solid currentColor;
  padding-bottom:2px;white-space:nowrap}

/* ---- listing cards ---------------------------------------------------- */
.cm-grid{display:grid;gap:22px;grid-template-columns:repeat(auto-fill,minmax(290px,1fr))}
.cm-card{background:var(--surface);border:1px solid var(--line);border-radius:3px;
  overflow:hidden;display:flex;flex-direction:column;text-decoration:none;color:inherit;
  transition:transform .16s ease,box-shadow .16s ease}
.cm-card:hover{transform:translateY(-3px);box-shadow:0 10px 28px rgba(22,35,46,.13)}
.cm-card__ph{aspect-ratio:4/3;width:100%;object-fit:cover;background:var(--line);display:block}
.cm-card__body{padding:15px 17px 18px}
.cm-card__price{font-family:var(--serif);font-size:1.5rem;line-height:1.1;margin:0 0 .25rem}
.cm-card__addr{margin:0 0 .1rem;font-size:.98rem}
.cm-card__city{margin:0 0 .7rem;font-size:.88rem;color:var(--ink-soft)}
.cm-card__facts{display:flex;flex-wrap:wrap;gap:10px;font-size:.84rem;color:var(--ink-soft);
  border-top:1px solid var(--line);padding-top:9px;margin-top:2px}
.cm-card__facts span{white-space:nowrap}
/* MLS attribution sits on the card because the listing is someone else's work.
   Another brokerage's line is shaded to 40% so it reads as a credit rather
   than competing with the price; our own listings keep full contrast.
   Both places the credit appears use the same value — keep them in step. color-mix does this against whichever surface is current, so it
   stays correct in both light and dark mode.

   NOTE: this is low contrast by intent. See the measured figures in NOTES.md
   before reducing it further — it is the MLS attribution line, not
   decoration. */
.cm-card__src{font-size:.72rem;color:var(--mist);margin:.55rem 0 0;line-height:1.35}
.cm-card__src--other{color:color-mix(in srgb, var(--mist) 40%, var(--surface))}
.cm-card__src--own{color:var(--ink-soft)}
@supports not (color: color-mix(in srgb, red 50%, blue)){
  /* Older engines: a fixed mid-tone rather than no de-emphasis at all. */
  .cm-card__src--other{opacity:.4}
}

/* Another brokerage's name on the SINGLE listing page (parent theme markup).
   Mixed against `transparent` rather than var(--surface) on purpose: that page
   is rendered by the parent theme, which stays light even when the rest of the
   site is in dark mode, so mixing toward our own --surface would push the text
   the wrong way. Taking 40% of the inherited colour and letting the background
   supply the rest shades it against whatever is actually behind it. */
.cm-credit{color:color-mix(in srgb, currentColor 40%, transparent)}
.cm-credit--line{margin:1.4rem 0 0;font-size:.85rem;line-height:1.5}
/* End of the listing page, after the last content section. */
.cm-credit--footer{margin:26px 0 0;padding:0 4px;font-size:.85rem;line-height:1.5}
/* Search-result and area cards (parent theme markup). */
.cm-credit--card{margin:.5rem 0 0;font-size:.76rem;line-height:1.4}
@supports not (color: color-mix(in srgb, red 50%, blue)){
  .cm-credit{opacity:.4}
}

/* ---- area tiles --------------------------------------------------------
   Each tile takes a photograph dropped in as img/area-<slug>.jpg. Until one
   exists the tile paints a gradient built from the site's own palette — the
   same sunset colours as the hero — rather than a grey box or a stock photo.
   A placeholder should look like a decision, not like something failed to
   load, and a stock coastal image would be both a licence risk and a claim
   about a place we have not actually photographed.

   --tile is set per card so consecutive placeholders differ; without it eight
   identical gradients read as a rendering bug.
   --------------------------------------------------------------------- */
.cm-tiles{display:grid;gap:20px;grid-template-columns:repeat(auto-fill,minmax(268px,1fr))}

.cm-tile{position:relative;display:flex;flex-direction:column;
  background:var(--surface);border:1px solid var(--line);border-radius:3px;
  overflow:hidden;text-decoration:none;color:inherit;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.cm-tile:hover{transform:translateY(-3px);border-color:var(--gold);
  box-shadow:0 10px 28px rgba(22,35,46,.14)}

.cm-tile__img{display:block;width:100%;aspect-ratio:3/2;
  background-size:cover;background-position:center;background-color:var(--line)}

/* Placeholder: a coastal gradient, rotated per tile. */
.cm-tile--noimg .cm-tile__img{
  background-image:
    linear-gradient(145deg,
      hsl(calc(200 - var(--tile) * 9) 30% 26%) 0%,
      hsl(calc(206 - var(--tile) * 7) 24% 38%) 48%,
      hsl(calc(32 + var(--tile) * 3) 52% 58%) 100%);
  position:relative;
}
/* A horizon line, so the placeholder reads as a landscape rather than a swatch. */
.cm-tile--noimg .cm-tile__img::after{
  content:"";position:absolute;left:0;right:0;bottom:34%;height:1px;
  background:rgba(255,255,255,.28);
}

.cm-tile__body{padding:15px 17px 18px;display:flex;flex-direction:column;gap:3px}
.cm-tile__name{font-family:var(--serif);font-size:1.35rem;line-height:1.15;color:var(--ink)}
.cm-tile__count{font-size:.84rem;color:var(--gold);font-variant-numeric:tabular-nums}
.cm-tile__blurb{font-size:.88rem;line-height:1.5;color:var(--ink-soft);margin-top:.35rem}

/* ---- about / contact -------------------------------------------------- */
.cm-two{display:grid;gap:clamp(28px,5vw,60px);grid-template-columns:1.15fr .85fr;align-items:start}
@media (max-width:820px){.cm-two{grid-template-columns:1fr}}
.cm-prose p{line-height:1.68;color:var(--ink-soft);margin:0 0 1rem;max-width:62ch}
.cm-prose strong{color:var(--ink)}
.cm-creds{list-style:none;margin:1.4rem 0 0;padding:0;border-top:1px solid var(--line)}
.cm-creds li{display:flex;justify-content:space-between;gap:16px;padding:11px 0;
  border-bottom:1px solid var(--line);font-size:.93rem}
.cm-creds dt{color:var(--ink-soft)}
.cm-creds b{font-weight:600;font-variant-numeric:tabular-nums}
.cm-callout{background:var(--surface);border:1px solid var(--line);border-radius:3px;padding:24px}
.cm-callout h3{font-size:1.35rem;margin:0 0 .5rem}
.cm-callout p{color:var(--ink-soft);line-height:1.6;margin:0 0 1.1rem;font-size:.95rem}
.cm-tel{display:inline-block;font-family:var(--serif);font-size:1.7rem;
  text-decoration:none;color:var(--ink);margin-bottom:.3rem}
.cm-tel:hover{color:var(--gold)}
.cm-meta{font-size:.88rem;color:var(--ink-soft);line-height:1.6;margin:.2rem 0 0}
.cm-meta a{color:var(--gold)}

@media (max-width:560px){
  .cm-search{padding:8px}
  .cm-search button{width:100%}
}

/* ---- parent theme header ------------------------------------------------
   The parent theme renders the site title as a 40px <h1> with
   white-space:nowrap inside .navbar-brand. On a 375px phone that is a 505px
   box, so the name is visibly cut off mid-word. Allow it to shrink and wrap,
   and while we are here put it in the house serif so the header belongs to the
   same design as the page under it. */
.navbar-brand h1{
  font-family:var(--serif);
  font-weight:400;
  letter-spacing:.005em;
}
@media (max-width:900px){
  .navbar-brand{max-width:calc(100vw - 92px)}
  .navbar-brand h1{
    font-size:clamp(1.2rem,5.2vw,1.9rem);
    white-space:normal;
    line-height:1.12;
  }
}
