/* Quince Cottage — a MediaWright demo (the house is fictional).
 * Hand-maintained, not generated. The same one-page personal-sales layout
 * as orangebob.uk, with its own warm identity: cream paper, brick-red and
 * sage, a serif for headings, and Atkinson Hyperlegible Next (reused from
 * /fonts/, no third-party requests) for everything else.
 *
 * Contrast, computed from relative luminance (WCAG 2.1), not eyeballed.
 * AA needs 4.5:1 for text, 3:1 for large text and UI.
 *   light  ink on paper / paper-alt / card     14.62 / 13.07 / 15.48
 *          muted on paper / paper-alt / card    7.17 /  6.41 /  7.59
 *          brick on paper / paper-alt / card    6.01 /  5.37 /  6.36
 *          sage on paper / paper-alt / card     6.91 /  6.17 /  7.31
 *          on-brick on brick (buttons, price)   6.36
 *          ink / sage / muted on sage-wash     13.04 /  6.16 /  6.39
 *          band-ink on band (banner, contact)  14.62
 *          band-link on band                   10.32
 *   dark   ink on paper / paper-alt / card     15.46 / 14.33 / 13.16
 *          muted on paper / paper-alt / card    9.66 /  8.96 /  8.22
 *          brick on paper / paper-alt / card    8.82 /  8.17 /  7.50
 *          sage on paper / paper-alt / card     9.94 /  9.21 /  8.46
 *          on-brick on brick                    8.82
 *          ink / sage / muted on sage-wash     11.69 /  7.51 /  7.30
 *          band-ink on band                    15.46
 *          band-link on band                    6.95
 *   Focus ring (UI, 3:1): brick on paper 6.01 light / 8.82 dark; band-link
 *   on the band 10.32 / 6.95. Form field borders use muted: 7.59 / 8.22 on card.
 *   Energy chart bands (same in both themes), text on band colour:
 *          A white 5.12  B #1A1A1A 5.05  C #1A1A1A 9.15  D #1A1A1A 12.24
 *          E #1A1A1A 9.18  F #1A1A1A 6.45  G white 4.53
 * --line is decorative only, never text.
 * Any new text/background pair must be computed and added here.
 */

@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/fonts/atkinson-next-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/fonts/atkinson-next-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FBF6EE;
  --paper-alt: #F2E9DB;
  --card: #FFFDF9;
  --ink: #2B211A;
  --muted: #5F5046;
  --brick: #A13F22;
  --on-brick: #FFFDF9;
  --sage: #3E5C47;
  --sage-wash: #E4ECE3;
  --band: #2B211A;
  --band-ink: #FBF6EE;
  --band-link: #F6C9A0;
  --line: #DCCDB8;
  --focus: var(--brick);

  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max: 1100px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #1B1512;
    --paper-alt: #241C18;
    --card: #2C231E;
    --ink: #F5ECE2;
    --muted: #CBBBAB;
    --brick: #F2A27F;
    --on-brick: #1B1512;
    --sage: #A8C8B0;
    --sage-wash: #26302A;
    --band: #F5ECE2;
    --band-ink: #1B1512;
    --band-link: #8A3419;
    --line: #4A3C33;
  }
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

a { color: var(--brick); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 18px;
}
.skip-link:focus { left: 0; }

/* The demo banner: always first, always visible. */
.demo-banner { --focus: var(--band-link); background: var(--band); color: var(--band-ink); font-size: .95rem; }
.demo-banner p { margin: 0 auto; padding-top: 10px; padding-bottom: 10px; }
.demo-banner a { color: var(--band-link); font-weight: 700; }

/* Header */
.masthead { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 0; }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand .tag { font-family: var(--sans); font-size: .9rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.header-price { background: var(--brick); color: var(--on-brick); font-weight: 700; border-radius: 999px; padding: 4px 14px; }

.site-nav { background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.site-nav ul { list-style: none; margin: 0 -10px; padding: 4px 0; display: flex; flex-wrap: wrap; }
.site-nav a { display: block; padding: 8px 10px; color: var(--ink); font-size: .95rem; text-decoration: none; }
.site-nav a:hover { color: var(--brick); text-decoration: underline; }
/* Phones: one row that scrolls sideways inside the nav (never the page),
 * so the house picture still makes the first screen. The focus ring is
 * drawn inside each link, as the scrolling row would clip one outside it;
 * focusing a link off the end scrolls the row to it. */
@media (max-width: 699.98px) {
  .site-nav ul { flex-wrap: nowrap; overflow-x: auto; }
  .site-nav li { flex: none; }
  .site-nav a { white-space: nowrap; }
  .site-nav a:focus-visible { outline-offset: -3px; }
}

/* Sections */
section { padding: 56px 0; }
.section-alt { background: var(--paper-alt); }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head p { color: var(--muted); }

/* Hero */
.hero { padding: 40px 0 56px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.eyebrow { color: var(--sage); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .75em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hero-image { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
@media (max-width: 699.98px) {
  .hero { padding-top: 24px; }
  .hero-image { order: -1; }   /* picture first on a phone, text below */
}
.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hero-facts div { background: var(--card); padding: 12px 14px; }
.hero-facts dt { color: var(--muted); font-size: .85rem; }
.hero-facts dd { margin: 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn { display: inline-block; font: inherit; font-weight: 700; padding: 12px 22px; border-radius: 999px; text-decoration: none; cursor: pointer; border: 2px solid var(--brick); }
.btn-primary { background: var(--brick); color: var(--on-brick); }
.btn-ghost { background: transparent; color: var(--brick); }
.btn:hover { text-decoration: underline; }
.btn:disabled { cursor: not-allowed; opacity: .6; }   /* only ever without JavaScript */

/* Meet the house */
.about-grid { display: grid; gap: 32px; }
.quote { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--brick); border-left: 4px solid var(--brick); padding-left: 16px; }
.fact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-self: start; }
.fact-list { margin: 0; }
.fact-list div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fact-list div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; font-weight: 700; text-align: right; }

/* Room by room */
.room-grid { display: grid; gap: 20px; }
.room-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.room-card img { width: 100%; border-bottom: 1px solid var(--line); }
.room-body { padding: 18px 20px 6px; }
.room-body p { color: var(--muted); }

/* Pictures */
.gallery-grid { display: grid; gap: 16px; }
.gallery-grid figure { margin: 0; }
.gallery-grid .lead { grid-column: 1 / -1; }
.gallery-grid img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.gallery-grid figcaption { color: var(--muted); font-size: .95rem; padding-top: 6px; }

/* Floor plan and tables */
.plan-grid { display: grid; gap: 28px; }
.plan-link { display: block; text-decoration: none; }
.plan-floors { display: grid; gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); width: 100%; }
.plan-zoom { display: inline-block; margin-top: 8px; text-decoration: underline; text-underline-offset: .15em; }
.plan-link:hover .plan-zoom { text-decoration-thickness: 2px; }
.room-sizes td:last-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-size: .9rem; }

/* Energy rating (illustrative) */
.epc { margin: 0; max-width: 640px; }
.epc figcaption { font-weight: 700; margin-bottom: 14px; }
.epc-tag { display: inline-block; background: var(--sage-wash); color: var(--sage); border: 1px solid var(--sage); border-radius: 4px; padding: 0 8px; margin-right: 6px; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.epc-scale { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.epc-scale li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.epc-bar { display: inline-block; min-width: 7.5em; padding: 4px 12px; font-weight: 700; color: #1A1A1A; border-radius: 0 999px 999px 0; }
.epc-range { font-weight: 400; margin-left: 6px; }
.epc-a { width: 40%; background: #007F3D; color: #FFFFFF; }
.epc-b { width: 48%; background: #2C9F29; }
.epc-c { width: 56%; background: #9DCB3C; }
.epc-d { width: 64%; background: #FFD500; }
.epc-e { width: 72%; background: #FCAA65; }
.epc-f { width: 80%; background: #EF8023; }
.epc-g { width: 88%; background: #E9153B; color: #FFFFFF; }
.epc-mark { font-weight: 700; color: var(--ink); }
.epc-mark::before { content: "◀ " / ""; color: var(--brick); }

/* The local area */
.area-grid { display: grid; gap: 16px; }
.area-card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--sage); border-radius: var(--radius); padding: 20px 20px 6px; }
.area-card p { color: var(--muted); }

/* Arrange a viewing */
.contact-section { --focus: var(--band-link); background: var(--band); color: var(--band-ink); }
.contact-section .section-head p { color: var(--band-ink); }
.contact-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.contact-card { border: 1px solid var(--band-link); border-radius: var(--radius); padding: 18px 20px; }
.contact-card h3 { margin-bottom: .25em; }
.contact-card .value { color: var(--band-link); font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.enquiry-card { --focus: var(--brick); background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 22px 20px 8px; max-width: 640px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--muted); border-radius: 8px; padding: 10px 12px; }
.enquiry-status:empty { display: none; }
.enquiry-status, .form-note { background: var(--sage-wash); color: var(--ink); border-left: 4px solid var(--sage); padding: 12px 14px; font-weight: 700; }

/* Footer */
.site-footer { background: var(--paper-alt); border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .95rem; }
.site-footer p { margin: 0; }

/* Wider screens */
@media (min-width: 600px) {
  .hero-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .room-grid, .gallery-grid, .area-grid, .contact-grid, .plan-floors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; }
  .about-grid { grid-template-columns: 1.5fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .area-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
