/* Sedley Court, Cambridge — student accommodation
   Palette is taken from the rooms themselves: the teal feature wall, the ochre
   bedding, the warm oak herringbone. It should feel like the building. */

:root {
  --ink:        #16221f;
  --ink-soft:   #40534e;
  --teal:       #3d5f5d;
  --teal-deep:  #22403e;
  --teal-tint:  #e7eeec;
  --ochre:      #d2911f;
  --ochre-soft: #f0c96a;
  --oak:        #c9a277;
  --cream:      #faf8f3;
  --sand:       #ece5d9;
  --white:      #fff;
  --line:       #dcd6ca;

  --shadow-sm: 0 1px 2px rgba(22,34,31,.06), 0 2px 8px rgba(22,34,31,.05);
  --shadow-md: 0 4px 12px rgba(22,34,31,.08), 0 12px 32px rgba(22,34,31,.08);
  --shadow-lg: 0 10px 30px rgba(22,34,31,.12), 0 30px 70px rgba(22,34,31,.12);

  --wrap: 1180px;
  --r:    14px;

  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: 1.2rem; line-height: 1.25; }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ochre); margin: 0 0 14px;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: 15px 30px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  line-height: 1;
}
.btn--primary { background: var(--ochre); color: #2a1d00; box-shadow: var(--shadow-md); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); background: #e0a02a; }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--dark { background: var(--teal-deep); color: #fff; }
.btn--dark:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250,248,243,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; text-decoration: none; letter-spacing: -.02em; }
.brand small { display: block; font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-top: 1px; }
.nav { display: flex; align-items: center; gap: 28px; }
/* Lives here, NOT as an inline style: an inline display:flex beats a media
   query, which silently kept the full nav on phones and pushed the page wider
   than the viewport. */
.nav__links { display: flex; gap: 28px; }
.nav a { font-size: .95rem; font-weight: 500; text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.header .btn { padding: 11px 22px; font-size: .92rem; white-space: nowrap; }
@media (max-width: 860px) { .nav__links { display: none; } }

/* Nothing should ever scroll the page sideways on a phone. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(15,29,27,.94) 0%, rgba(15,29,27,.80) 42%, rgba(15,29,27,.34) 100%);
}
.hero__in { position: relative; padding: clamp(70px, 11vw, 130px) 0 clamp(60px, 9vw, 110px); max-width: 44rem; }
.hero h1 { color: #fff; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--ochre-soft); }
.hero__sub { font-size: 1.2rem; color: rgba(255,255,255,.9); margin: 22px 0 0; max-width: 40ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero__price {
  display: inline-flex; align-items: baseline; gap: 10px;
  margin-top: 34px; padding: 12px 22px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px; backdrop-filter: blur(4px);
}
.hero__price b { font-family: var(--serif); font-size: 1.9rem; line-height: 1; }
.hero__price span { font-size: .92rem; color: rgba(255,255,255,.82); }

.availability {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 26px; font-size: .95rem; color: rgba(255,255,255,.92);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #57d38f; box-shadow: 0 0 0 4px rgba(87,211,143,.22); }
.dot--none { background: #e2704f; box-shadow: 0 0 0 4px rgba(226,112,79,.22); }

/* ---------- facts strip ---------- */
.facts { background: var(--teal-deep); color: #fff; }
.facts__in { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2px; }
.fact { padding: 30px 24px; background: var(--teal-deep); }
.fact b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1; margin-bottom: 6px; color: var(--ochre-soft); }
.fact span { font-size: .93rem; color: rgba(255,255,255,.78); }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--sand { background: var(--sand); }
.section--white { background: var(--white); }
.section--teal { background: var(--teal-deep); color: #fff; }
.section--teal h2, .section--teal h3 { color: #fff; }
.section--teal .lede { color: rgba(255,255,255,.82); }
.section__head { max-width: 58rem; margin-bottom: 48px; }

/* ---------- included grid ---------- */
/* Fixed 3 / 2 / 1 columns rather than auto-fit. There are exactly six cards, and
   auto-fit made four columns on a wide screen — leaving two empty slots on the
   second row. 3x2, 2x3 and 1x6 all divide six exactly, so there is no orphan
   card at any width. */
.incl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1000px) { .incl { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .incl { grid-template-columns: 1fr; } }
.incl__card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 28px 26px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.incl__card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.incl__card h3 { margin-bottom: 8px; }
.incl__card p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.incl__icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center; background: var(--teal-tint); color: var(--teal);
}
.incl__icon svg { width: 23px; height: 23px; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.gallery figure { margin: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-md); position: relative; background: var(--sand); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery figure:hover img { transform: scale(1.03); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 22px 18px;
  background: linear-gradient(transparent, rgba(15,29,27,.82));
  color: #fff; font-size: .92rem; font-weight: 500;
}
/* Heights are set per ROW, not per tile.
   These used to share aspect-ratio: 4/3 across different column spans — and a
   4/3 box seven columns wide is taller than a 4/3 box five columns wide, so the
   right-hand tile came up short and left a gap under it. Fixing the row height
   and letting object-fit: cover crop makes every row flush. */
.g-tall  { grid-column: span 7; height: clamp(300px, 34vw, 470px); }
.g-side  { grid-column: span 5; height: clamp(300px, 34vw, 470px); }
.g-third { grid-column: span 4; height: clamp(210px, 23vw, 310px); }

@media (max-width: 900px) {
  /* The two big tiles stack; the three small ones stay a 3-across strip.
     Three tiles at span 6 would put two on one row and orphan the third —
     the same empty-slot problem, moved to a smaller screen. 3 x span 4
     divides 12 exactly at every width, so it never orphans. */
  .g-tall  { grid-column: span 12; height: clamp(260px, 52vw, 400px); }
  .g-side  { grid-column: span 12; height: clamp(240px, 46vw, 340px); }
  .g-third { grid-column: span 4;  height: clamp(130px, 22vw, 200px); }
}
@media (max-width: 560px) {
  .gallery { gap: 10px; }
  .g-tall, .g-side { grid-column: span 12; height: clamp(230px, 62vw, 330px); }
  .g-third { grid-column: span 4; height: clamp(96px, 26vw, 150px); }
  /* Captions become unreadable at thumbnail size — the images carry it. */
  .g-third figcaption { display: none; }
}

/* ---------- location ---------- */
.loc { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }
@media (max-width: 900px) { .loc { grid-template-columns: 1fr; gap: 32px; } }
.loc__list { list-style: none; margin: 28px 0 0; padding: 0; }
.loc__list li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 1rem; }
.loc__list b { color: var(--ochre-soft); min-width: 4.6rem; font-variant-numeric: tabular-nums; }
.loc__img { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-lg); }

/* ---------- booking ---------- */
.booking { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 940px) { .booking { grid-template-columns: 1fr; gap: 34px; } }

.flats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 8px; }
.flat {
  position: relative; border: 2px solid var(--line); background: var(--white);
  border-radius: 12px; padding: 15px 12px; text-align: left; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
  font: inherit; color: inherit;
}
.flat:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.flat[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-tint); }
.flat b { display: block; font-family: var(--serif); font-size: 1.15rem; }
.flat span { font-size: .82rem; color: var(--ink-soft); }
.flat:disabled { opacity: .45; cursor: not-allowed; }
.flat--any { grid-column: 1 / -1; }
.flat--any b::after { content: " — recommended"; font-family: var(--sans); font-size: .74rem; font-weight: 600; color: var(--ochre); letter-spacing: .04em; }

.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 32px 30px; box-shadow: var(--shadow-md);
}
.field { margin-bottom: 17px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1px solid var(--line); border-radius: 9px; background: var(--cream); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 3px rgba(61,95,93,.14);
}
.field textarea { min-height: 84px; resize: vertical; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field--row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: .84rem; color: var(--ink-soft); margin: 14px 0 0; }
.form-err { background: #fdecea; border: 1px solid #f3b6ae; color: #8a1c1c; padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: .92rem; }
.form-err:empty { display: none; }

.success { text-align: center; padding: 22px 6px; }
.success__ref {
  font-family: var(--serif); font-size: 2rem; letter-spacing: .04em;
  background: var(--teal-tint); border-radius: 10px; padding: 12px 22px;
  display: inline-block; margin: 14px 0 18px; color: var(--teal-deep);
}

/* ---------- offer ribbon (off by default) ---------- */
.offer-off .js-offer { display: none !important; }
.ribbon {
  background: var(--ochre); color: #2a1d00; text-align: center;
  padding: 11px 20px; font-size: .94rem; font-weight: 600;
}

/* ---------- faq ---------- */
.faq { max-width: 60rem; }
.faq details {
  border-bottom: 1px solid var(--line); padding: 20px 0;
}
.faq summary {
  cursor: pointer; font-family: var(--serif); font-size: 1.18rem; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: 20px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--ochre); line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2013"; }
.faq p { color: var(--ink-soft); margin: 14px 0 0; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 56px 0 40px; font-size: .93rem; }
.footer a { color: rgba(255,255,255,.9); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; }
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; gap: 26px; } }
.footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); margin: 0 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 7px; }
.footer__legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: rgba(255,255,255,.5); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
