/* komponenter.css — .lk-* komponentene fra stilguiden «Lankultur nettside» (docs/STYLEGUIDE.md §5).
   Bare tokens (var(--…)), ingen hex. Mobilreglene ligger i mobil.css (ADR-0003). */

/* Komponentene styrer sin egen luft. :where() gir null spesifisitet, så komponentreglene vinner. */
:where(.lk-hero, .lk-news, .lk-compo, .lk-widget, .lk-section-head, .lk-page-head, .lk-fact) :where(h1, h2, h3, h4, p, ul) { margin: 0; }

/* ---------- Button ---------- */
.lk-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-6); border-radius: var(--radius-md); border: 2px solid transparent; font-family: var(--font-body); font-weight: 800; font-size: 17px; line-height: 1; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease; }
.lk-btn:hover { transform: translateY(-2px); }
.lk-btn svg { width: 20px; height: 20px; flex: none; }
.lk-btn--primary { background: linear-gradient(90deg, var(--btn-grad-start), var(--brand-purple)); color: var(--text-invert); box-shadow: var(--shadow-glow-accent); }
.lk-btn--ghost { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.lk-btn--ghost:hover { border-color: var(--brand-highlight); }
.lk-btn--discord { background: var(--discord); color: var(--text-invert); }
.lk-btn--sm { min-height: 38px; padding: 0 var(--space-4); font-size: 15px; border-radius: var(--radius-sm); }
.lk-btn[disabled], .lk-btn.is-disabled { opacity: .5; pointer-events: none; }

/* ---------- Badge ---------- */
.lk-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--text-muted); font-weight: 800; font-size: 13px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; }
.lk-badge--free { background: var(--brand-gold); color: var(--text-on-gold); }
.lk-badge--live { background: var(--status-live); color: var(--text-invert); }
.lk-badge--live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lk-badge--tag { position: absolute; left: var(--space-3); top: var(--space-3); z-index: 2; border-radius: var(--radius-sm); background: var(--overlay-tag); color: var(--text-invert); font-size: 12px; letter-spacing: .1em; }
.lk-badge--source { display: none; padding: 3px 9px; font-size: 11px; letter-spacing: .1em; }
.lk-badge--source.is-hub { color: var(--brand-highlight); }
.lk-badge--source.is-manual { color: var(--ink-gold); }

/* ---------- SectionHead ---------- */
.lk-eyebrow { display: block; font-family: var(--font-body); font-weight: 800; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-highlight); margin-bottom: var(--space-2); }
.lk-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-6); }
.lk-section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.lk-section-head p { color: var(--text-muted); max-width: 560px; }
.lk-section-head a.lk-more { font-weight: 800; text-decoration: none; }

/* ---------- FactTile ---------- */
.lk-fact { display: flex; flex-direction: column; gap: 6px; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--card-bg); border: 1px solid var(--border-color); }
.lk-fact__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-2); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--brand-highlight); }
.lk-fact__icon svg { width: 24px; height: 24px; }
.lk-fact__label { font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.lk-fact__value { font-weight: 700; font-size: 18px; line-height: 1.35; color: var(--text-main); }
.lk-fact__sub { font-size: 15px; color: var(--text-muted); }

/* ---------- Countdown ---------- */
.lk-count { display: flex; flex-wrap: wrap; gap: 10px; }
.lk-count__label { width: 100%; font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.lk-count__box { min-width: 74px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-raised); border: 1px solid var(--border-color); text-align: center; }
.lk-count__box b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; color: var(--text-main); font-variant-numeric: tabular-nums; }
.lk-count__box small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- NewsCard ---------- */
.lk-news { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-xl); overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); transition: transform .2s ease, border-color .2s ease; }
.lk-news:hover { transform: translateY(-3px); border-color: var(--brand-accent); }
.lk-news__img { aspect-ratio: 16 / 9; background: var(--surface-raised); overflow: hidden; }
.lk-news__img img { width: 100%; height: 100%; object-fit: cover; }
.lk-news__body { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; padding: var(--space-4) var(--space-5) var(--space-5); }
.lk-news__meta { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-accent); }
.lk-news__meta time { color: var(--text-muted); }
.lk-news__title { font-family: var(--font-display); font-size: 20px; line-height: 1.2; color: var(--text-main); }
.lk-news__excerpt { font-size: 15px; color: var(--text-muted); flex: 1; }
.lk-news__more { font-weight: 800; font-size: 15px; text-decoration: none; }
.lk-news__more::after { content: ""; position: absolute; inset: 0; }
.lk-news--featured { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.lk-news--featured .lk-news__img { aspect-ratio: auto; min-height: 280px; }
.lk-news--featured .lk-news__body { justify-content: center; padding: var(--space-8); }
.lk-news--featured .lk-news__title { font-size: 30px; }
.lk-news--featured .lk-news__excerpt { font-size: 17px; flex: none; }
.lk-news--text .lk-news__body { border-top: 4px solid var(--brand-accent); }
.lk-news--featured.lk-news--text { display: flex; background: radial-gradient(120% 120% at 0% 0%, var(--glow-accent), transparent 60%), var(--card-bg); }
.lk-news--row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-4); align-items: center; background: none; border: 0; border-radius: 0; padding: var(--space-3) 0; border-top: 1px solid var(--border-color); }
.lk-news--row:hover { transform: none; }
.lk-news--row .lk-news__img { aspect-ratio: 1; border-radius: var(--radius-md); }
.lk-news--row .lk-news__body { padding: 0; gap: 2px; }
.lk-news--row .lk-news__title { font-size: 16px; }

/* ---------- CompoCard ---------- */
.lk-compo { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-xl); overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.lk-compo:hover { transform: translateY(-4px); border-color: var(--brand-accent); box-shadow: var(--shadow-glow-accent); }
.lk-compo__img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-raised); }
.lk-compo__img img { width: 100%; height: 100%; object-fit: cover; }
.lk-compo__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: var(--space-4) 18px 18px; }
.lk-compo__time { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-gold); }
.lk-compo__title { font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
.lk-compo__desc { font-size: 15px; color: var(--text-muted); flex: 1; }
.lk-compo__more { margin-top: var(--space-2); font-weight: 800; font-size: 15px; text-decoration: none; }
.lk-compo--text { border-top: 4px solid var(--brand-gold); }
.lk-compo__more::after { content: ""; position: absolute; inset: 0; z-index: 3; }

/* ---------- Widget + rutenett ---------- */
.lk-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid-gap); }
.lk-span-3 { grid-column: span 3; } .lk-span-4 { grid-column: span 4; } .lk-span-6 { grid-column: span 6; } .lk-span-8 { grid-column: span 8; } .lk-span-12 { grid-column: span 12; }
.lk-widget { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5) var(--space-6) var(--space-6); border-radius: var(--radius-xl); background: var(--card-bg); border: 1px solid var(--border-color); }
.lk-widget__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.lk-widget__title { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: 18px; line-height: 1.2; color: var(--text-main); }
.lk-widget__title svg { width: 20px; height: 20px; color: var(--brand-highlight); }
.lk-widget__body { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.lk-widget__foot { font-weight: 800; font-size: 15px; text-decoration: none; }
.lk-widget--muted { background: transparent; }
.lk-widget--muted .lk-widget__title { font-size: 16px; color: var(--text-muted); }
.lk-widget--feature { background: linear-gradient(135deg, var(--glow-purple), transparent 60%), var(--card-bg); border-color: var(--brand-purple); }
.lk-widget__img { width: 100%; height: auto; border-radius: var(--radius-md); }
.lk-widget__body > p:not(.lk-big) { color: var(--text-muted); }
.lk-widget__btn { align-self: flex-start; }
.lk-rows { display: flex; flex-direction: column; }
.lk-rows--to { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); }
.lk-rows--to .lk-row:nth-child(2) { border-top: 0; padding-top: 0; }
.lk-big { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--text-main); }
.lk-big span { font-size: 20px; color: var(--text-muted); }
.lk-meter { height: 10px; border-radius: var(--radius-pill); background: var(--surface-raised); overflow: hidden; }
.lk-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--btn-grad-start), var(--brand-purple)); }
.lk-partners { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-8); list-style: none; margin: 0; padding: 0; color: var(--text-muted); font-weight: 700; }
.lk-partners a { color: inherit; text-decoration: none; }
.lk-partners a:hover { color: var(--text-main); }
.lk-partners__logo { display: block; max-width: 140px; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.lk-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.lk-gallery--bred { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lk-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); }
.lk-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--border-color); }
.lk-row:first-child { border-top: 0; padding-top: 0; }
.lk-row__time { font-family: var(--font-display); font-size: 16px; color: var(--ink-gold); font-variant-numeric: tabular-nums; }
.lk-row__title { font-weight: 700; color: var(--text-main); }
.lk-row__meta { font-size: 14px; color: var(--text-muted); }
.lk-row.is-now .lk-row__time { color: var(--status-live); }

/* ---------- EventHero ---------- */
.lk-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: var(--space-10); align-items: center; padding: 48px; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--border-color); background: radial-gradient(120% 90% at 0% 0%, var(--glow-accent), transparent 55%), radial-gradient(90% 90% at 100% 100%, var(--glow-highlight), transparent 55%), var(--card-bg); }
.lk-hero__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 18px; }
.lk-hero__title { font-size: clamp(40px, 5.6vw, 76px); text-transform: uppercase; line-height: 1; }
.lk-hero__title span { display: block; background: linear-gradient(90deg, var(--brand-accent), var(--brand-highlight)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lk-hero__when { margin-top: 14px; font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); color: var(--brand-highlight); }
.lk-hero__lead { margin-top: var(--space-4); max-width: 600px; font-size: 19px; color: var(--text-muted); }
.lk-hero__lead strong { color: var(--text-main); }
.lk-hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: 26px; }
.lk-hero__poster { justify-self: center; width: 100%; max-width: 360px; border-radius: 14px; overflow: hidden; transform: rotate(2deg); box-shadow: var(--shadow-poster); }

/* ---------- Brødtekst fra editoren (nyheter, senere CMS-sider) ---------- */
.lk-prose { font-size: 18px; line-height: 1.7; color: var(--text-main); }
.lk-prose > * + * { margin-top: 1em; }
.lk-prose p, .lk-prose ul, .lk-prose ol, .lk-prose blockquote { margin-bottom: 0; }
.lk-prose > :first-child { margin-top: 0; }
.lk-prose h2 { margin: 1.6em 0 0; font-size: 28px; }
.lk-prose h3 { margin: 1.4em 0 0; font-size: 22px; }
.lk-prose ul, .lk-prose ol { padding-left: 1.4em; }
.lk-prose li + li { margin-top: .35em; }
.lk-prose blockquote { padding: var(--space-3) var(--space-5); border-left: 4px solid var(--brand-accent); background: var(--surface-raised); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-muted); }
.lk-prose img { border-radius: var(--radius-md); margin-top: 1em; }
.lk-prose a { font-weight: 700; }

/* ---------- Arrangementskort (arrangementer.php) ---------- */
.lk-event { position: relative; display: grid; grid-template-columns: 160px minmax(0, 1fr); border-radius: var(--radius-xl); overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); transition: transform .2s ease, border-color .2s ease; }
.lk-event:hover { transform: translateY(-3px); border-color: var(--brand-accent); }
.lk-event--text { grid-template-columns: 1fr; border-top: 4px solid var(--brand-purple); }
.lk-event__img { background: var(--surface-raised); }
.lk-event__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lk-event__body { display: flex; flex-direction: column; gap: 6px; padding: var(--space-4) var(--space-5) var(--space-5); }
.lk-event__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.lk-event__title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.2; color: var(--text-main); }
.lk-event__when { margin: 0; font-weight: 800; color: var(--brand-highlight); }
.lk-event__where { margin: 0; color: var(--text-muted); }
.lk-event__more { margin-top: auto; padding-top: var(--space-2); font-weight: 800; text-decoration: none; }
.lk-event__more::after { content: ""; position: absolute; inset: 0; }

/* ---------- Skjema (kontaktskjemaet, senere andre offentlige skjema) ---------- */
.lk-form { display: flex; flex-direction: column; gap: var(--space-4); }
.lk-form__rad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.lk-form__hint { margin: 0; font-size: 14px; color: var(--text-muted); }
.lk-form .lk-btn { align-self: flex-start; }
.lk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lk-field label { font-weight: 800; font-size: 15px; color: var(--text-main); }
.lk-input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--surface-raised); color: var(--text-main); font: inherit; font-size: 16px; }
textarea.lk-input { min-height: 160px; resize: vertical; line-height: 1.5; }
.lk-input:focus { outline: 3px solid var(--focus-ring); outline-offset: 1px; border-color: var(--brand-highlight); }
.lk-input[aria-invalid="true"] { border-color: var(--status-danger); }
.lk-field__feil { margin: 0; font-size: 14px; font-weight: 700; color: var(--status-danger); }
.lk-alert { padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--surface-raised); color: var(--text-main); }
.lk-alert--ok { border-color: var(--status-success); }
.lk-alert--feil { border-color: var(--status-danger); }
/* Honningfelle: skjult for mennesker (og skjermlesere), synlig for roboter som fyller ut alt */
.lk-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Filterbrikker og sidebla ---------- */
.lk-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lk-chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); font-weight: 800; font-size: 15px; text-decoration: none; }
.lk-chips a:hover { color: var(--text-main); border-color: var(--brand-highlight); }
.lk-chips a[aria-current="page"] { background: var(--brand-purple); border-color: var(--brand-purple); color: var(--text-invert); }
.lk-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-10); color: var(--text-muted); font-weight: 700; }

/* Henvisning: nyhet som går til Lanhubben */
.lk-news--ref .lk-news__more { color: var(--ink-accent); }

/* ---------- Kunngjøring (egen sone øverst på forsiden) ---------- */
.lk-notice { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-5); border-radius: var(--radius-lg); background: var(--surface-raised); border: 1px solid var(--border-color); }
.lk-notice p { flex: 1; margin: 0; color: var(--text-muted); }
.lk-notice strong { color: var(--text-main); }
.lk-notice a { font-weight: 800; text-decoration: none; white-space: nowrap; }

/* Forhåndsvisning fra adminpanelet (forsiden og nyhetssiden) */
.lk-preview-bar { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); border: 2px dashed var(--brand-gold); color: var(--text-main); }

/* «Rediger»-snarvei for innlogget redaktør (ROADMAP 3.5). Settes bare ut når man er logget inn. */
.lk-edit { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px dashed var(--border-color); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--text-muted); }
.lk-edit:hover { color: var(--text-main); border-color: var(--brand-highlight); }
.lk-widget__head .lk-edit { margin-left: auto; }
.lk-widget__head .lk-badge--source + .lk-edit { margin-left: 0; }

/* Kildemerket vises bare for innlogget redaktør/admin (header.php setter data-admin="on"). */
[data-admin="on"] .lk-badge--source { display: inline-flex; }

/* ---------- Sidehode på undersider ---------- */
.lk-page-head { margin-bottom: var(--space-8); }
.lk-page-head h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); }
.lk-page-head p { margin: var(--space-3) 0 0; max-width: 680px; font-size: 19px; color: var(--text-muted); }
