/**
 * Autisme 4700 — "Spektrumfeltet"
 * The page is the spectrum made legible: an ordered field of counted cells.
 * One committed blue owns large regions; spectrum tones are taxonomy accents.
 * Low-sensory: one authored reveal, still under reduced motion.
 */

/* Self-hosted variable face (400–900), served from the theme — no CDN. */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------------------
   Tokens
--------------------------------------------------------------------------- */
:root {
  --paper: #f4f3ef;
  --tile: #ffffff;
  --ink: #1d1f24;
  --ink-muted: #605e57;
  --ink-faint: #8f8d86;
  --rule: #dcdad3;
  --dark: #101322;

  --blue: #1c3a94;         /* committed region color */
  --blue-deep: #14276b;    /* hover / pressed */
  --on-blue: #ffffff;
  --on-blue-soft: #dfe6f7;
  --on-blue-label: #9db4e8;

  --coral: #c04a4a;        /* CTA surface (AA on white text) */
  --coral-bright: #d05353; /* top-rule accent */
  --teal: #0e7c86;         /* top-rule accent */
  --teal-ink: #0a6b74;     /* teal as text */
  --violet: #7a6fc9;       /* top-rule accent */
  --violet-ink: #5a50a8;
  --amber: #e0a419;        /* emphasis on blue only + rules */
  --amber-deep: #a8790f;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --band-h: 68px;
  --gutter: 6px;
  --radius: 0;
  --shadow-tile: 0 8px 24px rgba(28, 58, 148, 0.10);
  --shadow-tile-soft: 0 4px 14px rgba(28, 58, 148, 0.07);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --content-width: 1280px;
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
body.mce-content-body { background: #fff; }

img, svg, video { display: block; max-width: 100%; height: auto; }
p, ul, ol, blockquote, figure { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }

/* Browser surfaces carry the design */
::selection { background: var(--blue); color: var(--on-blue); }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-dark :focus-visible,
.tile--blue :focus-visible,
.tile--coral :focus-visible,
.tile--ink :focus-visible {
  outline-color: var(--amber);
}
::placeholder { color: var(--ink-muted); opacity: 1; }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.55em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }

.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Numeric data */
.tnum { font-variant-numeric: tabular-nums; }

/* Authored moments: one slow traveling reveal across the field */
@keyframes cell-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.reveal .cell {
  animation: cell-in 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal .cell { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------------------
   The band — navigation as labeled cells
--------------------------------------------------------------------------- */
.band {
  display: grid;
  grid-template-columns: minmax(230px, 320px) 1fr auto;
  background: var(--dark);
  height: var(--band-h);
}
.band__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--blue);
  color: var(--on-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.band__brand strong { font-variant-numeric: tabular-nums; font-weight: 800; }
.band__brand:hover { background: var(--blue-deep); color: var(--on-blue); }

.band__nav { min-width: 0; }
.band__nav > ul {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}
.band__nav > ul > li {
  flex: 1 1 auto;
  display: flex;
  min-width: 0;
}
.band__nav > ul > li + li { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.band__nav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: #e8e9ea;
  text-decoration: none;
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
}
.band__nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.band__nav .current-menu-item > a,
.band__nav .current_page_item > a {
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--amber);
}

.band__toggle {
  display: none;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--dark);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  align-items: center;
}
.band__toggle:hover { background: rgba(255, 255, 255, 0.08); }
.band__toggle svg { display: block; }

.band__cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  background: var(--coral);
  color: var(--on-blue);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}
.band__cta:hover { background: #a83e3e; color: var(--on-blue); }

/* Mobile band */
@media (max-width: 900px) {
  .band {
    grid-template-columns: 1fr auto;
    height: auto;
    align-items: stretch;
  }
  .band__brand { min-height: 56px; }
  .band__toggle { display: flex; }
  .band__nav {
    display: none;
    grid-column: 1 / -1;
  }
  .band--open .band__nav { display: block; }
  .band__nav > ul {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .band__nav > ul > li + li { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.10); }
  .band__nav a { justify-content: flex-start; padding: 14px 24px; font-size: 17px; }
  .band__nav .current-menu-item > a,
  .band__nav .current_page_item > a { box-shadow: inset 3px 0 0 var(--amber); }
  .band__cta { padding: 14px 26px; min-height: 56px; justify-content: flex-start; }
}

/* ---------------------------------------------------------------------------
   The field — content as counted cells
--------------------------------------------------------------------------- */
.field-wrap { padding: var(--gutter); }
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  margin-bottom: var(--gutter);
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}
.row { padding-left: 0; }

/* Cell widths — class-driven so media queries can collapse the field */
.cell--full    { grid-column: 1 / 13; }
.cell--hero    { grid-column: 1 / 9; }
.cell--rail    { grid-column: 9 / 13; }
.cell--lead    { grid-column: 1 / 8; }
.cell--aside   { grid-column: 8 / 13; }
.cell--w4      { grid-column: span 4; }

/* Page-head tile: committed blue opener on inner templates */
.tile--head {
  padding: 34px 48px 38px;
}

.tile {
  background: var(--tile);
  border: 1px solid var(--rule);
  padding: 28px 28px 24px;
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.tile .tile__rule, .rule-t { border-top: 6px solid var(--blue); }
a.tile { transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out); }
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-tile); }
a.tile:focus-visible { outline-offset: 4px; }

.tile--teal    { border-top: 6px solid var(--teal); }
.tile--violet  { border-top: 6px solid var(--violet); }
.tile--amber   { border-top: 6px solid var(--amber); }
.tile--coral-r { border-top: 6px solid var(--coral-bright); }

.tile__title { font-size: 1.35rem; margin: 0 0 8px; }
.tile__caption { color: var(--ink-muted); font-size: 16px; }
.tile__go { margin-top: 18px; font-weight: 700; font-size: 16px; color: var(--teal-ink); display: inline-flex; align-items: center; gap: 8px; }
.tile--amber .tile__go { color: var(--amber-deep); }
.tile--violet .tile__go { color: var(--violet-ink); }
.tile--blue .tile__go { color: var(--amber); }
a.tile:hover .tile__go { text-decoration: underline; text-underline-offset: 4px; }

/* Blue welcome tile — the committed region */
.tile--blue {
  background: var(--blue);
  border: 0;
  color: var(--on-blue-soft);
  overflow: hidden;
  padding: 52px 56px 56px;
}
.tile--blue h1, .tile--blue h2, .tile--blue h3 { color: var(--on-blue); }
.tile--blue em { font-style: normal; color: var(--amber); }
.tile--blue a { color: var(--amber); }
.tile--blue a:hover { color: #f2bc4e; }
.arc {
  position: absolute;
  top: -55%;
  right: -18%;
  width: 120%;
  height: 150%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 50%;
  pointer-events: none;
}
.arc--soft { border-color: rgba(28, 58, 148, 0.25); top: -80%; right: auto; left: -30%; }

/* Coral contact tile — the primary action */
.tile--coral {
  background: var(--coral);
  border: 0;
  color: var(--on-blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tile--coral h2 { color: var(--on-blue); font-size: 1.35rem; }
.tile--coral .contact-mail {
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  font-weight: 700;
  color: var(--on-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.tile--coral .contact-mail:hover { color: #fff; }
.tile--coral p { color: var(--on-blue); margin-top: 16px; font-size: 16px; }

/* Ghost cell — designed absence, real words */
.tile--ghost {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  font-size: 16px;
}

/* Icon chips — inside tile titles, not above headings */
.tile__icon {
	display: inline-flex;
	margin-right: 10px;
	vertical-align: -3px;
}
.tile__icon svg { width: 22px; height: 22px; }
.tile__go .icon { width: 18px; height: 18px; }
.cell-link-strong {
	color: var(--amber);
	font-weight: 700;
	font-size: 1.1rem;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.cell-link-strong:hover { text-decoration: underline; text-underline-offset: 5px; }
.doclist--tight .icon { color: var(--teal-ink); margin-right: 8px; flex: none; align-self: flex-start; margin-top: 1px; }
.doclist--tight a { align-self: baseline; }

/* Icon chips */
.chip {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  margin-bottom: 18px;
  color: var(--gray);
}
.chip svg { color: var(--gray, var(--blue)); }

/* ---------------------------------------------------------------------------
   Events rows — data, not cards
--------------------------------------------------------------------------- */
.evlist { list-style: none; margin: 0; padding: 0; }
.evlist li {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 13px 0;
  border-top: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.evlist li:first-child { border-top: 0; }
.evlist .ev-date { color: var(--teal-ink); font-weight: 600; font-size: 15.5px; }
.evlist .ev-title { font-weight: 700; font-size: 17px; color: var(--blue); text-decoration: none; }
.evlist a.ev-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.evlist .ev-where { color: var(--ink-muted); font-size: 15px; text-align: right; }
@media (max-width: 720px) {
  .evlist li { grid-template-columns: 1fr; gap: 2px; }
  .evlist .ev-where { text-align: left; }
}

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { padding: 13px 0; border-top: 1px solid var(--rule); display: flex; gap: 14px; align-items: baseline; }
.doclist li:first-child { border-top: 0; }
.doclist a { font-weight: 700; color: var(--blue); text-decoration: none; }
.doclist a:hover { text-decoration: underline; text-underline-offset: 3px; }
.doclist .doc-meta { color: var(--ink-muted); font-size: 15px; margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------------------
   Inner pages
--------------------------------------------------------------------------- */
.page-head {
  position: relative;
  overflow: hidden;
}
.page-head h1 { margin: 0; }
.prose {
  /* inner-page text cell: capped measure, cell grammar inside */
  max-width: 68ch;
}
.prose > * { max-width: none; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.45rem;
  margin-top: 2.4em;
  padding-top: 16px;
  border-top: 6px solid var(--teal);
}
.prose > h2:first-child { margin-top: 0.4em; }
.prose h3 { font-size: 1.15rem; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  border-top: 3px solid var(--blue);
  margin: 1.4em 0;
  padding: 8px 0 0 8px;
  color: var(--ink-muted);
  font-size: 1.05em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 15.5px;
}
.prose th, .prose td { border-top: 1px solid var(--rule); padding: 9px 10px; text-align: left; }
.prose thead th { border-top: 6px solid var(--teal); font-weight: 700; }
.wp-caption-text, figcaption { color: var(--ink-muted); font-size: 14.5px; }
.prose .wp-block-button__link, .prose button, .prose input[type="submit"] {
  background: var(--blue);
  color: var(--on-blue);
  border: 0;
  padding: 12px 22px;
  font: 700 16px var(--font);
  cursor: pointer;
}
.prose .wp-block-button__link:hover, .prose button:hover { background: var(--blue-deep); }
.prose input[type="text"], .prose input[type="email"], .prose textarea, .prose input[type="search"] {
  font: 400 16px var(--font);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 460px;
}

/* Two-column layout with sidebar */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gutter); max-width: var(--content-width); margin: 0 auto var(--gutter); }
.layout--stacked { grid-template-columns: 1fr; max-width: var(--content-width); margin: 0 auto var(--gutter); }
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Sidebar widgets
--------------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: var(--gutter); align-self: start; position: sticky; top: 12px; }
.sidebar .widget {
  background: var(--tile);
  border: 1px solid var(--rule);
  padding: 22px 24px;
}
.sidebar .widget__title { font-size: 1.05rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-top: 1px solid var(--rule); }
.widget li:first-child { border-top: 0; }
.widget a { color: var(--blue); text-decoration: none; font-weight: 500; }
.widget a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Sponsors */
.sponsors { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; }
.sponsors a { display: inline-flex; }
.sponsors img { height: 44px; width: auto; filter: grayscale(1) opacity(0.62); transition: filter 0.2s var(--ease-out); }
.sponsors a:hover img, .sponsors a:focus-visible img { filter: none; }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.footer {
  background: var(--dark);
  color: #c9ccd6;
  margin-top: var(--gutter);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  max-width: var(--content-width);
  margin: 0 auto;
}
.footer__grid > * { border-left: 1px solid rgba(255, 255, 255, 0.12); padding: 34px 30px; }
.footer__grid > *:first-child { border-left: 0; }
.footer h2, .footer h3 { color: #fff; font-size: 15px; letter-spacing: 0.10em; text-transform: uppercase; margin: 0 0 16px; }
.footer a { color: #e8e9ea; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.footer li { margin-bottom: 9px; }
.footer__byline { font-size: 14.5px; color: #8b8ea0; }
.footer__byline strong { color: #fff; font-variant-numeric: tabular-nums; }
.footer__fb {
  background: var(--coral);
  color: #fff;
  margin: 26px 0 0;
  padding: 18px 20px;
}
.footer__fb a:not(:last-child) { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.footer__fb p { margin: 8px 0 0; font-size: 14px; color: #fff; }
.footer__fb a svg { color: #fff; }
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__grid > * { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
  .footer__grid > *:first-child { border-top: 0; }
}

/* ---------------------------------------------------------------------------
   The Events Calendar compatibility
--------------------------------------------------------------------------- */
#tribe-events, .tribe-events, .tribe-common, .tribe-events-pg-template {
  background: transparent;
}
.tribe-events .tribe-events-c-top-bar,
.tribe-events .tribe-events-calendar-list__event-row { background: var(--tile); }
.tribe-common--breakpoint-medium.tribe-common h2,
.tribe-events-calendar-list__event-title { font-family: var(--font); }
.tribe-events-calendar-list__event-datetime-wrapper time { font-variant-numeric: tabular-nums; }
.tribe-events-c-viewport__calendar:not(.tribe-events-view--month) .tribe-events-view { background: var(--tile); }
.tribe-common .tribe-common-c-btn, .tribe-common .tribe-common-c-btn-border, .tribe-events .tribe-events-button {
  background: var(--blue) !important;
  color: var(--on-blue) !important;
  border-radius: 0 !important;
  font-family: var(--font) !important;
}
.tribe-common .tribe-common-c-btn:hover, .tribe-common .tribe-common-c-btn-border:hover { background: var(--blue-deep) !important; }
#tribe-events .tribe-events-month-event-title a, .tribe-events-calendar-list__event-title a { color: var(--blue); }
tribe-events .tribe-events-empty, .tribe-events-calendar-day__event, .tribe_events { border-color: var(--rule); }

/* ---------------------------------------------------------------------------
   Responsive field
--------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .tile--blue { padding: 40px 36px 44px; }
  .tile--head { padding: 30px 36px 34px; }
}
@media (max-width: 720px) {
  /* The field collapses to one column of cells, top to bottom. */
  .row { display: block; }
  .row > .cell + .cell { margin-top: var(--gutter); }
  .cell--full, .cell--hero, .cell--rail, .cell--lead, .cell--aside, .cell--w4 { grid-column: auto; }
  .tile--blue { padding: 32px 26px 36px; }
  .tile--head { padding: 28px 26px 32px; }
  .prose { max-width: 100%; }
  .sidebar { position: static; }
  .contact-mail { font-size: 1.45rem; }
  .tile--coral { padding: 26px 24px 28px; }
  .doclist li { flex-wrap: wrap; }
  .doclist .doc-meta { margin-left: 0; width: 100%; text-align: left; }
  .tile { padding: 24px 22px 22px; }
  h1 { font-size: clamp(2rem, 8.5vw, 2.6rem); }
}
@media (max-width: 480px) {
  .contact-mail { font-size: 1.2rem; }
}

/* Admin bar offset handled by WordPress; keep sticky sidebar below it. */
.admin-bar .sidebar { top: 60px; }
