/* DLAexpert site styles: "Paper & Ink" (warm paper, ink text, Lora headings, Inter body) in the
   DLAexpert palette: deep teal and terracotta. Distinct from PIPexpert (crimson and navy) and
   ESAexpert (blue and slate). Every page links this file. */
:root {
  --paper: #fbf8f2;
  --paper-2: #f4efe5;
  --white: #ffffff;
  --ink: #1f2430;
  --muted: #5b6170;
  --line: #e4ddd0;
  --teal: #0f4d4a;
  --teal-2: #136560;
  --teal-soft: #e8f1f0;
  --terra: #c2532d;
  --terra-2: #a8441f;
  --terra-soft: #f8ebe5;
  --gold: #e9b44c;
  --ok: #1d7a55;
  --ok-soft: #e6f4ec;
  --warn-soft: #fdf6e3;
  --warn-line: #ecd9a0;
  --shadow: 0 1px 3px rgba(31,36,48,0.07), 0 6px 18px rgba(31,36,48,0.06);
  --radius: 14px;
  --control-h: 52px;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.65; font-size: 17px; min-height: 100vh; }
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
a:hover { color: var(--terra-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--teal); color: #fff; padding: 0.6rem 1rem; z-index: 2000; }
.skip-link:focus { left: 1rem; top: 1rem; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

/* ---- header ---- */
.site-header { background: rgba(251,248,242,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; flex-wrap: wrap; }
.logo { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; color: var(--terra); text-decoration: none; letter-spacing: 0.2px; }
.logo em { font-style: italic; font-weight: 400; color: var(--teal); }
.logo:hover { color: var(--terra); }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.nav a:hover { color: var(--teal); }
.nav .btn { color: #fff; }
.menu-toggle { display: none; background: transparent; border: 0; padding: 0.4rem; border-radius: 8px; cursor: pointer; }
.menu-toggle svg { width: 26px; height: 26px; stroke: var(--teal); stroke-width: 2; fill: none; stroke-linecap: round; }
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 0.4rem 0 0.8rem; }
  .site-header.open .nav { display: flex; }
  .nav a { padding: 0.75rem 0.3rem; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav .btn { margin-top: 0.6rem; text-align: center; }
}

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; background: var(--terra); color: #fff; border: 0; border-radius: 999px; padding: 0.8rem 1.5rem; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; min-height: 46px; transition: background 0.15s, transform 0.15s; }
.btn:hover { background: var(--terra-2); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: var(--teal-2); }
.btn-ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal); }
.btn-block { width: 100%; }
.btn-small { padding: 0.5rem 1rem; min-height: 38px; font-size: 0.9rem; }

/* ---- type ---- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--teal); line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin: 0 0 0.75rem; }
h3 { font-size: 1.22rem; margin: 0 0 0.4rem; }
h1 em, h2 em { font-style: italic; color: var(--terra); font-weight: 700; }
p { margin: 0 0 1rem; }
.kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terra); margin: 0 0 0.5rem; }
.lead { font-size: 1.12rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }

/* ---- sections and cards ---- */
.section { padding: 3.2rem 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.note { border-left: 3px solid var(--terra); padding: 0.3rem 0 0.3rem 1rem; margin: 0 0 1.2rem; }
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
.panel-teal { background: var(--teal-soft); border-color: #cfe2e0; }
.panel-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.pill-terra { background: var(--terra-soft); color: var(--terra-2); }
.ticks { list-style: none; padding: 0; margin: 0 0 1rem; }
.ticks li { padding: 0.28rem 0 0.28rem 1.7rem; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 0.2rem; top: 0.72rem; width: 0.85rem; height: 0.45rem; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }

/* ---- forms ---- */
label { font-weight: 600; font-size: 0.95rem; }
.field { margin: 0 0 1rem; }
.field .hint { display: block; font-weight: 400; font-size: 0.86rem; color: var(--muted); margin-top: 0.15rem; }
.field .opt { font-weight: 400; font-size: 0.86rem; color: var(--muted); white-space: nowrap; }
input[type=text], input[type=email], input[type=number], input[type=date], select, textarea { width: 100%; padding: 0.72rem 0.9rem; border: 1.5px solid #d6cfc2; border-radius: 10px; background: #fff; font-size: 1rem; line-height: 1.4; }
/* One height for every single-line control, so a text box, a date box and a drop-down look the same
   and sit level in a row (the text boxes used to be taller than the drop-downs). */
input[type=text], input[type=email], input[type=number], input[type=date], select { height: var(--control-h); padding-top: 0; padding-bottom: 0; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
/* Two-column field rows. Each field spans three rows of the shared grid (label, control, message),
   so a label with an extra hint line, or a message under one control, never pushes its neighbour's
   control out of line. */
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 620px) { .fp-grid { grid-template-columns: 1fr; } }
@supports (grid-template-rows: subgrid) {
  .fp-grid > .field { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; align-content: start; }
  .fp-grid > .field[hidden] { display: none; }
  .fp-grid > .field > label { grid-row: 1; padding: 0.1rem 0; }
  .fp-grid > .field > input, .fp-grid > .field > select, .fp-grid > .field > textarea { grid-row: 2; align-self: start; }
  .fp-grid > .field > .err { grid-row: 3; }
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(15,77,74,0.15); }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--terra); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; font-size: 0.92rem; padding: 0.7rem 0.85rem; background: var(--white); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check input { margin-top: 0.25rem; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--teal); }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-row label { flex: 1 1 180px; display: flex; gap: 0.5rem; align-items: center; padding: 0.6rem 0.8rem; border: 1.5px solid #d6cfc2; border-radius: 10px; background: #fff; font-weight: 500; cursor: pointer; }
.radio-row input { accent-color: var(--teal); width: 18px; height: 18px; }
.err { color: #a12a17; font-weight: 600; font-size: 0.88rem; margin: 0.3rem 0 0; }

/* ---- footer ---- */
.site-footer { background: var(--teal); color: #d7e6e4; padding: 2.6rem 0 2rem; margin-top: 3rem; font-size: 0.9rem; }
.site-footer a { color: #ffffff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0 0 1rem; }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: #f2c9b6; margin: 0 0 0.6rem; }
.footer-brand em { color: #fff; font-weight: 400; }
.footer-legal { font-size: 0.8rem; color: #b9d0cd; line-height: 1.6; margin: 0; }

/* ---- cookie banner ---- */
#cookie-banner { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: var(--teal); color: #fff; padding: 1rem 1.25rem; z-index: 1000; box-shadow: 0 -6px 20px rgba(0,0,0,0.15); }
#cookie-banner .wrap { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 640px; }
#cookie-banner a { color: #f2c9b6; }
#cookie-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.6); }
#cookie-banner .btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---- breadcrumb and articles ---- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 1.4rem 0 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span[aria-current] { color: var(--ink); }
.article h1 { margin: 0 0 0.8rem; }
.article .meta { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.4rem; }
.article h2 { margin: 2.2rem 0 0.7rem; }
.article h3 { margin: 1.5rem 0 0.4rem; }
.article ul, .article ol { margin: 0 0 1.1rem 1.3rem; }
.article li { margin: 0 0 0.35rem; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 1.3rem; font-size: 0.95rem; background: #fff; }
.article th, .article td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
.article th { background: var(--teal-soft); color: var(--teal); }
.article blockquote { border-left: 3px solid var(--teal); background: var(--white); padding: 0.7rem 1rem; margin: 0 0 1.2rem; font-style: italic; }
.toc { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.6rem; }
.toc p { font-weight: 700; margin: 0 0 0.4rem; color: var(--teal); }
.toc ol { margin: 0 0 0 1.2rem; }
/* The subtle CTA box: white with a coloured left line. */
.cta-box { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--terra); border-radius: 0 12px 12px 0; padding: 1.1rem 1.3rem; margin: 1.8rem 0; }
.cta-box p { margin: 0 0 0.6rem; }
.cta-box .cta-title { font-family: var(--serif); font-weight: 700; color: var(--teal); font-size: 1.1rem; }
.cta-box a.cta-link { font-weight: 700; color: var(--terra-2); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem 1.1rem; margin: 0 0 0.6rem; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--teal); }
.faq details p { margin: 0.6rem 0 0; }
.related { margin: 2.2rem 0 0; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.related li a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; text-decoration: none; font-weight: 600; }
@media (max-width: 620px) { .related ul { grid-template-columns: 1fr; } }
.sources { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line); margin: 2rem 0 0; padding: 1rem 0 0; }
.sources ul { margin: 0.4rem 0 0 1.2rem; }

/* ---- blog index ---- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 860px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 0.4rem; box-shadow: var(--shadow); }
.post-card h3 { font-size: 1.08rem; }
.post-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.post-card:hover { border-color: var(--teal); color: var(--ink); }

/* ---- modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(20,24,32,0.62); z-index: 9000; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 18px; max-width: 760px; width: 100%; margin: 1.5rem auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-close { position: absolute; top: 0.7rem; right: 0.7rem; background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-weight: 700; z-index: 2; }
.modal-body { padding: 1.6rem 1.4rem; }
