/* Magimo website – colours sampled from the supplied logo. */
:root {
  --gold: #BD8B3D;            /* logo gold: accents */
  --gold-soft: #D6B987;       /* page background: logo gold softened with ~35% white */
  --gold-light: #CFA764;
  --navy: #0E284B;
  --navy-soft: #2A4268;
  --grey: #9AA1B2;
  --white: #FFFFFF;
  --warm: #F7F2E8;
  --line: #E3D7C1;
  --error: #9B1C1C;
  --ok: #1F5F3A;
  --radius: 6px;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--navy);
  /* Gold is the main background, with faint construction lines. */
  background-color: var(--gold-soft);
  background-image:
    linear-gradient(rgba(14, 40, 75, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 40, 75, .045) 1px, transparent 1px);
  background-size: 48px 48px;
}

img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3, .h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
code { font-size: .9em; background: var(--warm); padding: .05em .3em; border-radius: 3px; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.site-footer :focus-visible, .admin-bar :focus-visible, .admin-header :focus-visible { outline-color: var(--white); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--white); padding: .6rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.stack > * + * { margin-top: 1.5rem; }

/* ---------- Header: deliberate white panel for the logo ---------- */
.site-header { background: var(--white); border-bottom: 4px solid var(--navy); position: relative; }
.header-inner { max-width: var(--wrap); margin: 0 auto; padding: .9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: block; line-height: 0; }
.brand img { height: 58px; width: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a { display: block; padding: .45rem .6rem; font-weight: 600; font-size: .95rem; text-decoration: none; border-radius: var(--radius); }
.site-nav a:hover { background: var(--warm); }
.site-nav a[aria-current="page"] { background: var(--navy); color: var(--white); }
.nav-toggle { display: none; }

@media (max-width: 1100px) {
  .nav-toggle {
    display: inline-block; font: inherit; font-weight: 600; color: var(--white); background: var(--navy);
    border: 0; border-radius: var(--radius); padding: .55rem 1rem; cursor: pointer;
  }
  .brand img { height: 46px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 4px solid var(--navy); z-index: 5; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  .site-nav a { padding: .7rem .6rem; }
  .no-js .site-nav { display: block; position: static; border: 0; }
}

/* ---------- Hero and page heads (on gold) ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { max-width: 22ch; }
.lead p { margin-bottom: .7em; }
.panel-statement { font-size: 1.12rem; border-left: 6px solid var(--gold); }
.panel-statement p:last-child { font-weight: 700; }
.cards-6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .cards-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards-6 { grid-template-columns: 1fr; } }
.principle { text-align: center; padding: 1.5rem 1rem; }
.principle h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .5rem; }
.principle p { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 600; font-style: italic; max-width: 38ch; margin: 0 auto; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
.content-table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: .98rem; }
.content-table th, .content-table td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.content-table th { background: var(--warm); }
.ticks { list-style: none; padding: 0; margin: 0 0 1.2em; }
.ticks li { padding-left: 1.4rem; position: relative; margin-bottom: .5em; }
.ticks li::before { content: "›"; position: absolute; left: .2rem; font-weight: 700; color: var(--gold); }
.contact-details { background: var(--warm); border-left: 5px solid var(--navy); padding: .9rem 1.1rem; margin-bottom: 1.5rem; border-radius: var(--radius); }
.contact-details p { margin: 0 0 .2em; }
.contact-name { font-weight: 700; font-size: 1.1rem; }
.side-stack { display: grid; gap: 1.2rem; align-content: start; }
.optin .choice { font-size: .95rem; }
.optin-fields { display: none; margin-top: .6rem; }
.optin-fields.open, .no-js .optin-fields { display: block; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 46rem; }
.lead-dark { font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.scope-note { margin-top: 1.6rem; font-weight: 600; max-width: 46rem; border-left: 4px solid var(--navy); padding-left: .9rem; }
.page-head { padding: clamp(2.2rem, 5vw, 3.8rem) 0 1.8rem; }
.page-head h1 { max-width: 28ch; }
.breadcrumbs { font-size: .95rem; margin-bottom: .8rem; }
.breadcrumbs a { font-weight: 600; }

.band { padding: 1.8rem 0; }
.band-title { display: flex; align-items: center; gap: .8rem; }
.band-title::after { content: ""; flex: 1; height: 2px; background: rgba(14, 40, 75, .35); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: .8rem 1.3rem; border-radius: var(--radius); border: 2px solid var(--navy);
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-soft); border-color: var(--navy-soft); }
.btn-secondary { background: transparent; color: var(--navy); }
.btn-secondary:hover { background: rgba(255, 255, 255, .35); }
.panel .btn-secondary:hover { background: var(--warm); }
.btn-danger { background: var(--white); color: var(--error); border-color: var(--error); }
.btn-block { display: block; text-align: center; width: 100%; }

/* ---------- Panels and cards (white / warm-white reading surfaces) ---------- */
.panel { background: var(--white); border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 2.2rem); box-shadow: 0 1px 0 rgba(14, 40, 75, .15); }
.panel > :last-child { margin-bottom: 0; }
.panel-cta { background: var(--warm); border-left: 6px solid var(--navy); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--white); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.card-link { text-decoration: none; border: 2px solid transparent; }
.card-link:hover { border-color: var(--navy); }
.card-link p { flex: 1; }
.card-index { font-weight: 700; color: var(--gold); font-size: .95rem; letter-spacing: .1em; margin-bottom: .6rem; }
.card .more { font-weight: 700; text-decoration: underline; text-underline-offset: .18em; }

/* ---------- Guide card ---------- */
.guide-card { display: grid; grid-template-columns: 10rem 1fr; gap: 2rem; align-items: start; }
@media (max-width: 640px) { .guide-card { grid-template-columns: 1fr; } .guide-cover { max-width: 9rem; } }
.guide-cover {
  aspect-ratio: 210 / 297; background: var(--warm); border: 2px solid var(--navy); border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; font-weight: 700; letter-spacing: .1em;
  background-image: linear-gradient(rgba(14, 40, 75, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 40, 75, .07) 1px, transparent 1px);
  background-size: 14px 14px;
}
.guide-cover img { width: 55%; }
.guide-body h3 { font-size: 1.45rem; margin-bottom: .2rem; }
.guide-body h3 a { text-decoration: none; }
.subtitle { font-weight: 600; color: var(--navy-soft); }
.free-note { font-weight: 700; }
.meta-list { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 0 0 1rem; }
.meta-list div { display: flex; gap: .4rem; }
.meta-list dt { font-weight: 700; }
.meta-list dt::after { content: ":"; }
.meta-list dd { margin: 0; }
.download-box .meta-list, .meta-list-wide { flex-direction: column; }

/* ---------- Prose ---------- */
.prose { max-width: none; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child, .prose > .alert + h2 { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--gold); font-weight: 700; }
.note { font-size: .95rem; background: var(--warm); border-left: 4px solid var(--grey); padding: .7rem .9rem; }
.small { font-size: .9rem; }
.eyebrow { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-soft); margin-bottom: .3rem; }

/* ---------- Workflow steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .8rem; counter-reset: none; }
.steps li { background: var(--white); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; gap: .7rem; align-items: flex-start; position: relative; }
.step-n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--navy); color: var(--white); font-weight: 700; display: grid; place-items: center; font-size: .95rem; }
.step-t { font-weight: 600; line-height: 1.35; padding-top: .2rem; }

/* ---------- Downloads ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters a { background: var(--white); padding: .45rem .9rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid var(--white); }
.filters a:hover { border-color: var(--navy); }
.filters a[aria-current="page"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.download-list { display: grid; gap: 1.2rem; }
.download-item h2 { font-size: 1.4rem; margin-bottom: .2rem; }
.download-item h2 a { text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-grid .side-stack { order: -1; } }
.side-stack { position: sticky; top: 1rem; }
@media (max-width: 900px) { .side-stack { position: static; } }

/* ---------- Forms ---------- */
.form .field { margin-bottom: 1.15rem; border: 0; padding: 0; min-width: 0; }
.form label, .form legend, .form .label { display: block; font-weight: 700; margin-bottom: .3rem; padding: 0; }
.form .choice { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; margin: .25rem 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .2rem 1rem; }
.req, .opt { font-weight: 400; font-size: .9rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; font: inherit; color: var(--navy); background: var(--white);
  border: 2px solid var(--grey); border-radius: var(--radius); padding: .6rem .7rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); }
input[type="file"] { font: inherit; max-width: 100%; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--navy); width: 1.05rem; height: 1.05rem; }
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--error) !important; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: 0 1rem; }
.help { font-size: .9rem; margin: .35rem 0 0; }
.field-error { color: var(--error); font-weight: 700; margin: .35rem 0 0; font-size: .95rem; }
.privacy-note { font-size: .95rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1.2rem; border-left: 5px solid; }
.alert p:last-child { margin: 0; }
.alert-error { background: #FBEAEA; border-color: var(--error); color: var(--error); }
.alert-ok { background: #E7F3EC; border-color: var(--ok); color: var(--ok); }
.alert-draft { background: var(--warm); border-color: var(--gold); color: var(--navy); }

/* ---------- Status page ---------- */
.status-table { width: 100%; border-collapse: collapse; }
.status-table caption { text-align: left; font-weight: 700; margin-bottom: .6rem; }
.status-table th, .status-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.status-table .pass { color: var(--ok); font-weight: 700; }
.status-table .fail { color: var(--error); font-weight: 700; }

/* ---------- Footer (navy) ---------- */
.site-footer { background: var(--navy); color: var(--white); margin-top: 3.5rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 2.5rem 1.25rem 1.6rem; display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem 3rem; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { flex: none; }
.site-footer a { color: var(--white); }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.site-footer li { margin-bottom: .5rem; break-inside: avoid; }
@media (max-width: 480px) { .site-footer ul { columns: 1; } }
.copyright { grid-column: 1 / -1; font-size: .9rem; color: #C9CFDA; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 1rem; margin: 0; }

/* ---------- Logged-in administrator bar ---------- */
.admin-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); color: var(--white); font-size: .9rem; padding: .45rem 1rem; z-index: 20; border-top: 2px solid var(--gold); }
.admin-bar a { color: var(--white); }
body:has(.admin-bar) { padding-bottom: 2.6rem; }

@media print {
  body { background: #fff; }
  .site-nav, .nav-toggle, .site-footer nav, .admin-bar { display: none; }
}

/* ---------- Blog ---------- */
.post-list { display: grid; gap: 1.2rem; }
.post-card.has-image { display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 700px) { .post-card.has-image { grid-template-columns: 1fr; } }
.post-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.post-card h2 { font-size: 1.4rem; margin-bottom: .4rem; }
.post-card h2 a, .eyebrow a { text-decoration: none; }
.more-link { font-weight: 700; }
.post-meta { font-weight: 600; }
.post-image { margin: 0 0 1.5rem; }
.post-image img { display: block; width: 100%; border-radius: var(--radius); }
.article { max-width: 52rem; }
.pagination { display: flex; gap: 1.2rem; align-items: center; justify-content: center; font-weight: 600; }
.pagination a { background: var(--white); padding: .45rem .9rem; border-radius: var(--radius); text-decoration: none; }
.comment { border-top: 1px solid var(--line); padding: .9rem 0; }
.comment-head { margin-bottom: .3rem; }
.comment-body { overflow-wrap: anywhere; }
.comment-pending { background: var(--warm); padding: .9rem; border-radius: var(--radius); }
.comment-actions { display: flex; gap: .6rem; margin-top: .6rem; }
.comment-actions form { margin: 0; }
.dl-count { font-size: .95rem; margin-top: -.4rem; }
.admin-thumb { max-width: 16rem; border-radius: var(--radius); }
