/* crohns.org.uk — one small stylesheet, no frameworks, system fonts. */
:root {
  --brand: #582ab5;        /* Crohn's UK purple (from the logo) */
  --brand-2: #4a1f9e;
  --accent: #f08a5d;       /* warm coral: calls to action */
  --ink: #16242c;
  --ink-2: #44535c;
  --muted: #66757e;
  --line: #dfe6ea;
  --bg: #ffffff;
  --bg-soft: #f7f5fc;
  --bg-tint: #efe9fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(56 24 120 / .06), 0 6px 20px rgb(56 24 120 / .07);
  --wrap: 1180px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; font: 17px/1.65 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--brand-2); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.vh, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* ------------------------------------------------------------ header */
.masthead { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.masthead__inner { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); }
.logo__mark { width: 34px; height: 34px; flex: none; border-radius: 8px; }
.logo__text { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--brand); }
.logo--light .logo__text { color: #fff; }
.logo--light .logo__mark { background: #fff; }
.mainnav { margin-left: auto; }
.mainnav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mainnav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.mainnav a:hover { background: var(--bg-tint); color: var(--brand); }
.mainnav a[aria-current] { background: var(--brand); color: #fff; }
.iconbtn, .menu summary { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--brand); cursor: pointer; }
.iconbtn:hover, .menu summary:hover { background: var(--bg-tint); }
.iconbtn svg, .menu svg { width: 22px; height: 22px; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu__panel { position: absolute; right: 0; top: 50px; width: min(320px, 90vw); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
.menu__panel ul { list-style: none; margin: 0; padding: 0; }
.menu__panel a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.menu__panel a:hover { background: var(--bg-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
@media (max-width: 980px) {
  .mainnav { display: none; }
  .menu { display: block; }
  .iconbtn { margin-left: auto; }
}

/* ------------------------------------------------------------ buttons & forms */
.btn, button { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 12px 22px; border-radius: 999px; background: var(--brand); color: #fff; text-decoration: none; }
.btn:hover, button:hover { background: var(--brand-2); color: #fff; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 12px 14px; border: 1px solid #c7d3d9; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(240 138 93 / .5); border-color: var(--accent); }
.form { max-width: 620px; }
.form__row { margin: 0 0 16px; }
.form__row label { display: block; font-weight: 600; margin-bottom: 6px; }

/* ------------------------------------------------------------ home */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #7c4ddb 0%, transparent 60%), linear-gradient(160deg, #2d1366 0%, #42199a 55%, #582ab5 100%); color: #fff; padding: 72px 0 84px; }
.hero__inner { max-width: 860px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: #cdb8f5; margin: 0 0 14px; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 18px; letter-spacing: -.01em; font-weight: 600; }
.hero__lead { font-size: 1.18rem; color: #e6dcfa; margin: 0 0 30px; max-width: 700px; }
.hero__lead strong { color: #fff; }
.hero__search { display: flex; gap: 8px; background: #fff; padding: 6px; border-radius: 999px; max-width: 640px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); }
.hero__search input { border: 0; border-radius: 999px; padding: 12px 18px; }
.hero__search input:focus { outline: none; }
.hero__search button { background: var(--accent); color: #2b1408; }
.hero__search button:hover { background: #f59b72; color: #2b1408; }
.prose .hero__search { box-shadow: none; border: 1px solid var(--line); }
.hero__popular { margin: 18px 0 0; font-size: .92rem; color: #cdb8f5; }
.hero__popular a { color: #fff; margin-left: 10px; white-space: nowrap; }

.topics { margin-top: -44px; position: relative; }
.topics__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.topic a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 22px 46px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.topic a:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgb(56 24 120 / .14); }
.topic strong { font-size: 1.15rem; color: var(--c); }
.topic span { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.topic em { position: absolute; right: 20px; bottom: 14px; font-style: normal; font-size: 1.3rem; color: var(--c); }

.feature { background: var(--bg-soft); margin: 64px 0; padding: 64px 0; border-block: 1px solid var(--line); }
.feature__inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.feature .eyebrow { color: #15803d; }
.feature h2, .posts h2, .author h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; margin: 0 0 14px; }
.feature p { color: var(--ink-2); font-size: 1.07rem; }
.feature__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature__list a { display: block; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-left: 4px solid #15803d; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.feature__list a:hover { border-color: #15803d; color: #15803d; }
@media (max-width: 860px) { .feature__inner { grid-template-columns: 1fr; gap: 28px; } }

.posts__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.posts__grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post-card a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; }
.post-card a:hover { border-color: var(--brand-2); box-shadow: var(--shadow); }
.post-card strong { font-size: 1.08rem; color: var(--brand); line-height: 1.35; }
.post-card span { color: var(--ink-2); font-size: .94rem; line-height: 1.55; }

.author { margin: 64px 0 24px; }
.author__inner { display: flex; gap: 32px; align-items: center; background: var(--bg-tint); border-radius: 22px; padding: 32px; }
.author img { border-radius: 50%; width: 140px; height: 140px; object-fit: cover; flex: none; }
.author p { color: var(--ink-2); max-width: 720px; }
@media (max-width: 640px) { .author__inner { flex-direction: column; text-align: center; } }
.home-article { border-top: 1px solid var(--line); padding-top: 32px; }
.home-article__title { margin-top: 0 !important; }

/* ------------------------------------------------------------ inner pages */
.pagehead { background: linear-gradient(180deg, var(--bg-soft), #fff); border-top: 4px solid var(--c); padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.pagehead h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 10px; color: var(--ink); max-width: 860px; letter-spacing: -.01em; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 760px; margin: 0 0 10px; }
.meta { color: var(--muted); font-size: .88rem; margin: 0; }
.byline { display: flex; gap: 12px; align-items: center; margin: 6px 0 0; font-size: .95rem; }
.byline img { border-radius: 50%; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 36px; padding-bottom: 56px; }
.layout--single { grid-template-columns: minmax(0, 760px); }
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.prose { max-width: 760px; font-size: 1.06rem; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; line-height: 1.25; margin: 2.2em 0 .6em; color: var(--ink); }
.prose h3 { font-size: 1.22rem; margin: 1.8em 0 .5em; color: var(--ink); }
.prose h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--brand-2); }
.prose img { border-radius: 12px; display: block; margin: 1.6em 0; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-soft); }
.prose strong { color: var(--ink); }

.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 0 0 2em; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 10px 0 2px; padding-left: 20px; columns: 2 260px; column-gap: 32px; }
.toc li { break-inside: avoid; margin: .25em 0; font-size: .95rem; }

.cards__title { margin-top: 2em !important; }
.cards { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; }
.card a:hover { box-shadow: var(--shadow); border-color: var(--c); }
.card strong { color: var(--ink); line-height: 1.35; }
.card span { color: var(--ink-2); font-size: .92rem; line-height: 1.5; }

.notice { margin: 2.6em 0 0; padding: 18px 20px; border-radius: 12px; background: #f6f7f9; border: 1px solid var(--line); font-size: .93rem; color: var(--ink-2); }
.notice p { margin: 4px 0 0; }
.notice--warn { background: #fff7ed; border-color: #fed7aa; margin: 0 0 2em; }

.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidenav { position: sticky; top: 90px; border-top: 4px solid var(--c); background: var(--bg-soft); border-radius: 0 0 var(--radius) var(--radius); padding: 16px 8px 10px; }
.sidenav h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 12px 8px; }
.sidenav h2 a { color: var(--muted); text-decoration: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .94rem; line-height: 1.4; }
.sidenav li a:hover { background: #fff; color: var(--brand); }
.sidenav li a[aria-current] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--c); }
@media (max-width: 980px) { .sidenav { position: static; } }

.signup { padding: 22px; border-radius: var(--radius); background: var(--brand); color: #fff; }
.signup h2 { font-size: 1.1rem; margin: 0 0 6px; }
.signup p { font-size: .92rem; color: #e6dcfa; margin: 0 0 14px; }
.signup form { display: grid; gap: 8px; }
.signup input { border: 0; }
.signup button { background: var(--accent); color: #2b1408; justify-content: center; }
.signup button:hover { background: #f59b72; color: #2b1408; }

.postlist { list-style: none; padding: 0 !important; }
.postlist li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.postlist h2 { margin: 0 0 6px !important; font-size: 1.35rem !important; }
.postlist a { text-decoration: none; }
.postlist p { margin: 0 0 6px !important; color: var(--ink-2); }

/* ------------------------------------------------------------ search (Pagefind) */
#search { --pagefind-ui-primary: var(--brand); --pagefind-ui-text: var(--ink); --pagefind-ui-border: #c7d3d9; --pagefind-ui-border-radius: 10px; --pagefind-ui-font: var(--font); }

/* ------------------------------------------------------------ footer */
.footer { background: #23104f; color: #ddd3f3; padding: 52px 0 28px; margin-top: 40px; font-size: .95rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #b39ce6; margin: 0 0 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 6px 0; }
.footer a { color: #f1ecfc; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__tag { color: #c4b5e8; max-width: 320px; }
.footer__disclaimer { margin: 36px 0 8px; padding-top: 20px; border-top: 1px solid #3a2273; color: #c4b5e8; font-size: .86rem; max-width: 900px; }
.footer__copy { color: #a593d6; font-size: .84rem; margin: 0; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .masthead, .footer, .sidebar, .toc, .signup { display: none !important; } .layout { display: block; } }

/* ------------------------------------------------------------ "All topics" menu (every page links to every topic page, as the old site did) */
.menu { display: block; position: static; }
.menu summary { width: auto; border-radius: 999px; padding: 0 12px; gap: 6px; display: flex; align-items: center; font-weight: 600; color: var(--brand); }
.menu__label { font-size: .95rem; }
.menu__panel { position: absolute; left: 0; right: 0; top: 66px; width: auto; max-height: calc(100vh - 80px); overflow: auto; border-radius: 0 0 var(--radius) var(--radius); padding: 24px; }
.mega { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.mega__hub { display: block; font-weight: 800 !important; color: var(--brand) !important; padding: 6px 8px !important; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega ul ul { padding-left: 12px; border-left: 2px solid var(--line); margin: 2px 0 6px 8px; }
.menu__panel .mega a { display: block; padding: 5px 8px; font-weight: 500; font-size: .9rem; border-radius: 6px; line-height: 1.35; }
@media (max-width: 980px) { .mega { grid-template-columns: 1fr 1fr; } .menu__label { display: none; } .menu summary { padding: 0; width: 42px; justify-content: center; } }
@media (max-width: 600px) { .mega { grid-template-columns: 1fr; } .menu__panel { padding: 12px; } }

