/* Profil efter mhvarberg.se: turkos botten, gult och mörka knappar, Roboto Slab i rubriker. */
.theme-brand {
  --teal: #15a3ae;
  --teal-dark: #0e7f88;
  --teal-ink: #0c3a3e;
  --yellow: #ecd925;
  --red: #d9341f;
  --green: #00806a;
  --charcoal: #32373c;
  --header: #222222;

  --bg: var(--teal);
  --surface: #ffffff;
  --text: #13262a;
  --muted: #4c6266;
  --border: #d5e3e5;
  --accent: var(--charcoal);
  --accent-text: #ffffff;
  --accent-soft: #e5f4f5;
  --raffle: var(--green);
  --ok: #10734a;
  --warn: #b5430b;
  --danger: #b3261e;
  --radius: 22px;
  --shadow: 0 2px 4px rgb(0 40 45 / 12%), 0 10px 30px rgb(0 40 45 / 14%);
  --slab: "Roboto Slab", Georgia, serif;
  color-scheme: light;

  /* Bakgrundsfärgen matchar notbilden så att ingen skarv syns där bilden tar slut. */
  background: #009aa4 url(/static/brand/bakgrund.jpg) top center / max(1400px, 100%) auto no-repeat;
  color: var(--text);
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.theme-brand h1, .theme-brand h2, .theme-brand h3 { font-family: var(--slab); font-weight: 800; }
.theme-brand a { color: var(--teal-dark); }

/* Sidhuvud */
.theme-brand .site-header { background: var(--header); border: 0; color: #fff; flex-wrap: nowrap; }
.theme-brand .brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; font-family: var(--slab); font-weight: 700; }
.theme-brand .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-brand .site-header nav { flex-wrap: nowrap; flex-shrink: 0; }
@media (max-width: 520px) {
  .theme-brand .site-header nav .muted { display: none; }
}
.theme-brand .brand img { border-radius: 50%; }
.theme-brand .site-header nav { color: #fff; }
.theme-brand .site-header .muted { color: #c9d4d6; }
.theme-brand .site-header .link { color: #fff; }
.theme-brand .button.bidra { background: var(--yellow); color: #111; padding: 6px 14px; font-size: .9rem; }

/* Knappar */
.theme-brand .button {
  background: var(--charcoal); color: #fff; font-family: var(--slab); font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
}
.theme-brand .button.big { background: var(--yellow); color: #111; border-radius: 12px; }
.theme-brand .button.secondary { background: #fff; color: var(--charcoal); border: 2px solid var(--charcoal); }
.theme-brand .link { color: var(--teal-dark); }
.theme-brand input:focus, .theme-brand select:focus, .theme-brand textarea:focus { outline-color: var(--teal-dark); }

/* Hero */
.theme-brand .hero { position: relative; text-align: center; padding: 16px 0 8px; }
.theme-brand .hero-logo { width: min(440px, 80%); height: auto; margin: 8px auto 0; }
.theme-brand .hero h1 { color: var(--yellow); font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin: 12px 0 6px; text-shadow: 0 2px 0 rgb(0 0 0 / 15%); }
.theme-brand .hero .lead { color: #0b2629; font-size: 1.1rem; max-width: 560px; margin: 0 auto; }
/* Jubileumsmärket hänger från sidhuvudets underkant, ända ut i högerkanten som på mhvarberg.se. */
.theme-brand .site-header { position: relative; z-index: 2; }
.theme-brand .jubileum { position: absolute; top: 100%; right: 0; width: clamp(130px, 14vw, 180px); height: auto; pointer-events: none; }
.theme-brand .goal { margin: 20px auto 0; max-width: 460px; }
.theme-brand .goal-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.theme-brand .goal-tiles > div { background: rgb(255 255 255 / 18%); padding: 8px 10px; }
.theme-brand .goal-tiles .label { color: #fff; font-weight: 700; }
.theme-brand .goal-tiles strong { display: block; color: #fff; font-size: clamp(1.3rem, 3.5vw, 1.9rem); font-weight: 300; font-variant-numeric: tabular-nums; }
.theme-brand .bar { background: rgb(255 255 255 / 25%); height: 12px; }
.theme-brand .bar span { background: var(--yellow); }

@media (max-width: 760px) {
  .theme-brand .jubileum { display: none; }
}

/* Flikar */
.theme-brand .tabs { justify-content: center; margin: 24px 0 18px; }
.theme-brand .tab { background: rgb(255 255 255 / 22%); color: #0b2629; border: 0; font-weight: 700; font-family: var(--slab); }
.theme-brand .tab.active { background: var(--charcoal); color: #fff; }

/* Kort: 3 kolumner på dator, 2 på surfplatta, 1 på mobil */
.theme-brand .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .theme-brand .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .theme-brand .grid { grid-template-columns: 1fr; } }
.theme-brand .card { border: 0; }
.theme-brand .card-media { background: var(--accent-soft); }
.theme-brand .placeholder { color: var(--teal-dark); font-family: var(--slab); background: var(--accent-soft); }
.theme-brand .card-body h2 { color: var(--teal-ink); font-size: 1.2rem; }
.theme-brand .stats > div { background: var(--accent-soft); }
.theme-brand .badge { font-family: var(--slab); }
.theme-brand .badge.auction { background: var(--red); color: #fff; }
.theme-brand .badge.raffle { background: var(--green); color: #fff; }
.theme-brand .outcome { background: #fdf7c6; color: #3d3600; }
.theme-brand .urgent { color: var(--red); }
.theme-brand #empty { color: #0b2629; }

/* Navigering i sidhuvudet, döljs på smala skärmar */
.theme-brand .nav-links { display: flex; gap: 18px; margin-right: 8px; }
.theme-brand .nav-links a { color: #fff; text-decoration: none; font-weight: 500; white-space: nowrap; }
.theme-brand .nav-links a:hover { color: var(--yellow); }
@media (max-width: 900px) { .theme-brand .nav-links { display: none; } }
html:has(body.theme-brand) { scroll-behavior: smooth; scroll-padding-top: 16px; }

/* Startsidans sektioner */
.theme-brand .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px auto 0; }
.theme-brand .hero-actions .button { width: auto; min-width: 200px; }
.theme-brand .hero-actions .button.secondary { background: transparent; color: #0b2629; border-color: #0b2629; border-radius: 12px; padding: 12px 20px; }
.theme-brand main > section > h2 { color: #fff; font-size: clamp(1.5rem, 3.5vw, 2rem); text-shadow: 0 2px 0 rgb(0 0 0 / 12%); }
/* Föremålssidan ligger på en vit panel. */
.theme-brand .item-page > section > h2 { color: var(--teal-ink); font-size: 1.4rem; text-shadow: none; }
.theme-brand .how { margin: 40px 0 0; }
.theme-brand .how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.theme-brand .how li {
  counter-increment: step; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.theme-brand .how li::before {
  content: counter(step); width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: #111; font-family: var(--slab); font-weight: 800; font-size: 1.1rem; margin-bottom: 4px;
}
.theme-brand .how strong { font-family: var(--slab); color: var(--teal-ink); font-size: 1.1rem; }
.theme-brand .how span { color: var(--muted); }
@media (max-width: 760px) { .theme-brand .how ol { grid-template-columns: 1fr; } }

.theme-brand .catalog { margin-top: 48px; }
.theme-brand .filters { display: grid; gap: 12px; margin-bottom: 18px; }
.theme-brand .filters .tabs { margin: 0; justify-content: flex-start; }
.theme-brand .filter-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 170px; gap: 10px; }
.theme-brand .filter-row input, .theme-brand .filter-row select {
  border: 0; border-radius: 12px; padding: 11px 14px; font: inherit; background: #fff; color: var(--text); box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .theme-brand .filter-row { grid-template-columns: 1fr 1fr; }
  .theme-brand .filter-row input { grid-column: 1 / -1; }
}
.theme-brand .filter-count { margin: 0; color: #0b2629; font-size: .9rem; font-weight: 500; }
.theme-brand .empty-state { text-align: center; color: #0b2629; padding: 24px 0; }
.theme-brand .empty-state p { font-size: 1.1rem; margin: 0 0 12px; }
.theme-brand .empty-state .button { width: auto; border-radius: 12px; }

.theme-brand .donate {
  margin-top: 56px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px;
}
.theme-brand .donate h2 { color: var(--teal-ink); }
.theme-brand .donate-steps { padding-left: 1.3em; margin: 12px 0 20px; display: grid; gap: 6px; }
.theme-brand .donate .button.big { width: auto; display: inline-block; }
.theme-brand .donors { background: var(--accent-soft); border-radius: 16px; padding: 18px 20px; align-self: start; }
.theme-brand .donors h3 { color: var(--teal-ink); margin-bottom: 10px; }
.theme-brand .donors ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.theme-brand .donors li { background: #fff; border-radius: 99px; padding: 3px 12px; font-size: .9rem; color: var(--teal-ink); font-weight: 500; }
@media (max-width: 760px) { .theme-brand .donate { grid-template-columns: 1fr; } }

.theme-brand .faq { margin-top: 48px; max-width: 760px; margin-inline: auto; }
.theme-brand .faq details { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.theme-brand .faq summary { cursor: pointer; padding: 14px 18px; font-family: var(--slab); font-weight: 700; color: var(--teal-ink); }
.theme-brand .faq details p { margin: 0; padding: 0 18px 16px; color: var(--text); }
.theme-brand .faq code { background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; }

/* Vita paneler för föremål, registrering och betalning */
.theme-brand main.panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  margin: 24px auto; padding: clamp(18px, 4vw, 32px);
}
.theme-brand main.panel h1 { color: var(--teal-ink); }
@media (max-width: 600px) {
  .theme-brand main.panel { margin: 12px; }
}
.theme-brand .flash { background: var(--accent-soft); }
.theme-brand .pay-status { background: #fdf7c6; color: #3d3600; }
.theme-brand .pay-status.paid { background: #dff3e7; color: var(--ok); }
.theme-brand .pay-code strong { font-family: var(--slab); color: var(--teal-ink); }
.theme-brand .qr { box-shadow: inset 0 0 0 2px var(--border); }

/* Sidfot med Varbergssiluett */
.theme-brand .site-footer { color: #0b2629; padding: 40px 0 0; margin-top: auto; }
.theme-brand > main { width: 100%; }
.theme-brand > main.panel { width: calc(100% - 24px); }
.theme-brand .site-footer a { color: #0b2629; font-weight: 700; }
.theme-brand .site-footer p { padding: 0 16px; }
.theme-brand .site-footer .organizer { margin: 28px 0 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.theme-brand .footer-logo { display: block; width: min(320px, 70vw); height: auto; margin: 8px auto 0; }
.theme-brand .skyline { width: 100%; max-width: none; height: auto; margin-top: 24px; display: block; }

/* ---------- Storskärm ---------- */
.theme-brand.screen {
  --bg: var(--teal); --surface: #ffffff; --text: #13262a; --muted: #4c6266; --border: #d5e3e5;
  background: var(--teal) url(/static/brand/bakgrund.jpg) center / cover no-repeat;
  color: #0b2629;
}
.theme-brand .screen-head { align-items: center; }
.theme-brand .screen-title { display: flex; align-items: center; gap: 1em; }
.theme-brand .screen-title img { height: 4.6em; width: auto; }
.theme-brand .screen-title h1 { color: var(--yellow); font-size: 2.2em; text-shadow: 0 2px 0 rgb(0 0 0 / 15%); }
.theme-brand .screen-total { text-align: right; }
.theme-brand .screen-total .label { color: #fff; font-weight: 700; }
.theme-brand .screen-total #s-total { color: #fff; font-family: Roboto, sans-serif; font-weight: 300; font-size: 2.6em; line-height: 1.1; display: block; }
.theme-brand .screen-goal { color: #0b2629; font-weight: 500; }
.theme-brand .screen-side { background: rgb(255 255 255 / 94%); box-shadow: var(--shadow); color: var(--text); }
.theme-brand .screen-side h2 { color: var(--teal-dark); font-family: var(--slab); }
.theme-brand .feature-info h2 { color: #fff; text-shadow: 0 2px 0 rgb(0 0 0 / 15%); }
.theme-brand .feature-info .muted, .theme-brand .feature-hint { color: #0b2629; }
.theme-brand .feature-stats > div { background: rgb(255 255 255 / 92%); color: var(--text); box-shadow: var(--shadow); }
.theme-brand .feature-stats strong { font-family: var(--slab); color: var(--teal-ink); }
.theme-brand .feature-media img { box-shadow: var(--shadow); background: #fff; }
.theme-brand .feature-empty h2 { color: #fff; font-size: 2.4em; }
.theme-brand .screen-foot { color: #0b2629; }
.theme-brand .screen-foot .qr { box-shadow: none; }
.theme-brand .overlay { background: rgb(9 70 76 / 94%); }
.theme-brand .overlay-kicker { color: var(--yellow); }
.theme-brand .overlay-box h2 { color: #fff; }
.theme-brand .overlay-name { color: var(--yellow); font-family: var(--slab); }
.theme-brand .overlay-name.spinning { color: rgb(255 255 255 / 55%); }
.theme-brand .overlay-sub { color: #d6eef0; }

/* Rutnät: kolumner och rader styrs med ?kolumner=&rader= */
.theme-brand.grid-mode .screen-grid {
  grid-template-columns: 1fr; grid-template-rows: auto 1fr auto;
  grid-template-areas: "head" "grid" "foot"; gap: 1em;
}
.tile-grid {
  grid-area: grid; min-height: 0; display: grid; gap: 1em;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
}
.tile {
  background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
  min-height: 0; container-type: size;
}
.tile.ended { opacity: .72; }
.tile.bumped { animation: bump 2.2s ease-out; }
@keyframes bump {
  0% { box-shadow: 0 0 0 .35em var(--yellow), var(--shadow); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 0 transparent, var(--shadow); transform: none; }
}
/* Höga rutor: bild överst. Breda rutor (vanligt på 16:9): bild till vänster. */
.tile-inner { height: 100%; display: flex; flex-direction: column; }
.tile-media { position: relative; flex: 1 1 auto; min-height: 0; background: var(--accent-soft); }
.tile-body { flex: 0 0 auto; padding: .6em .8em .7em; color: var(--text); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
@container (min-aspect-ratio: 3 / 2) {
  .tile-inner { flex-direction: row; }
  .tile-media { flex: 0 0 44%; }
  .tile-body { flex: 1 1 auto; padding: .7em .9em; }
  .tile .tile-body h2 { -webkit-line-clamp: 2; }
}
.tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-media .placeholder { position: absolute; inset: 0; min-height: 0; font-size: 1.2em; }
.tile-media .badge { position: absolute; top: .6em; left: .6em; font-size: .7em; }
.tile-nr { position: absolute; bottom: .55em; left: .6em; background: rgb(0 0 0 / 60%); color: #fff; border-radius: 99px; padding: .05em .6em; font-size: .75em; font-weight: 700; }
.tile-body h2 {
  font-size: 1.05em; margin: 0 0 .3em; color: var(--teal-ink); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: .5em; }
.tile-main { font-family: var(--slab); font-size: 1.55em; color: var(--teal-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-time { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-sub { margin: .15em 0 0; color: var(--muted); font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-grid .feature-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; }
.theme-brand.grid-mode .screen-foot { justify-content: flex-start; }
.theme-brand.grid-mode .screen-foot .qr { width: 5.5em; }
.ticker { flex: 1; text-align: center; font-size: 1.1em; color: #0b2629; }
.ticker strong { color: #fff; }
.ticker .label { display: inline; color: #0b2629; font-size: .8em; font-weight: 700; margin-right: .4em; }
.pager { display: flex; gap: .4em; }
.pager span { width: .7em; height: .7em; border-radius: 50%; background: rgb(255 255 255 / 40%); }
.pager span.on { background: var(--yellow); }

/* ---------- Affisch ---------- */
.theme-brand.poster { background: #fff; }
.theme-brand .poster-logo { width: 300px; height: auto; margin: 0 auto 12px; background: var(--teal); padding: 14px 22px; border-radius: 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.theme-brand .poster-page h1 { color: var(--teal-ink); }
.theme-brand .poster-cta { font-family: var(--slab); color: var(--teal-ink); }
.theme-brand .poster-kicker { display: none; }

/* ---------- Inbäddning (/inbadda) ---------- */
/* Samma färgschema som WordPress-sidan, annars målar webbläsaren iframen ogenomskinlig i mörkt läge. */
:root:has(> body.theme-brand) { color-scheme: light; }
.theme-brand.embed { background: transparent; min-height: 0; display: block; overflow: hidden; }
.theme-brand.embed.bg-turkos { background: var(--teal); }
.theme-brand.embed.bg-vit { background: #fff; }
.theme-brand.embed main { max-width: none; padding: 8px 8px 4px; }
/* Högst --cols kolumner, färre när iframen är smal. */
.theme-brand.embed .grid {
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - (var(--cols) - 1) * 20px) / var(--cols))), 1fr));
}
.theme-brand.embed .tabs { margin: 4px 0 16px; justify-content: flex-start; }
.theme-brand.embed.bg-vit .tab, .theme-brand.embed.bg-transparent .tab { background: rgb(0 0 0 / 8%); }
.theme-brand.embed.bg-vit .tab.active, .theme-brand.embed.bg-transparent .tab.active { background: var(--charcoal); }
.theme-brand.embed.bg-vit .card { box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.theme-brand .embed-goal { margin: 0 0 16px; max-width: 460px; }
.theme-brand.embed.bg-vit .embed-goal .goal-tiles > div { background: var(--accent-soft); }
.theme-brand.embed.bg-vit .embed-goal .label, .theme-brand.embed.bg-vit .embed-goal strong { color: var(--teal-ink); }
.theme-brand.embed.bg-vit .embed-goal .bar { background: var(--accent-soft); }
.embed-note { margin: 18px 0 0; font-size: .85rem; color: #0b2629; }
.embed-note a { color: inherit; font-weight: 700; }

/* Avslutade kort: gråa bilden i stället för att göra hela kortet genomskinligt mot den turkosa botten. */
.theme-brand .item-card.ended { opacity: 1; }
.theme-brand .item-card.ended .card-media { filter: grayscale(.85); opacity: .75; }
.theme-brand .item-card.ended .card-body h2 { color: var(--muted); }
