/*
 * Kommuneportal (docs/04 S24, S26) in the kultiva design (the owner's mockup):
 * paper background, Unbounded headings, white rounded cards, pill buttons.
 * Tokens, fonts and atoms come from the shared tokens.css, base.css and fonts.css.
 * Kommune branding (/branding.css, T-55) overrides the brand tokens.
 */

.portal-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 32px;
}

/* ---------- Header and footer ---------- */

.portal-header {
  padding-block: 22px;
}

.portal-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  text-decoration: none;
  color: var(--ink);
}

.portal-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: var(--display-tracking);
}

.portal-footer {
  margin-top: 72px;
  border-top: 1px solid var(--hairline);
  color: var(--subtle);
  font-size: var(--text-s);
}

.portal-footer-inner {
  padding-block: 28px;
}

.portal-powered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

main:focus {
  outline: none;
}

/* ---------- List (S24) ---------- */

.portal-hero {
  padding-block: 24px 40px;
}

.portal-hero h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.04;
  max-width: 16ch;
}

.portal-lead {
  margin: 0;
  max-width: 46ch;
  font-size: 20px;
  color: var(--muted);
}

.result-count {
  margin: 0 0 var(--space-6);
  font-weight: 700;
  color: var(--subtle);
}

.day-group {
  margin-bottom: var(--space-8);
}

.day-heading {
  margin: 0 0 var(--space-3);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.day-heading::first-letter {
  text-transform: uppercase;
}

.occ-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.occ-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 22px 26px;
  border-radius: var(--radius-l);
  background: var(--surface);
}

.occ-time {
  flex: none;
  min-width: 64px;
  padding: 10px 0;
  border-radius: var(--radius-m);
  background: var(--paper);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.occ-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.occ-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.occ-title a {
  text-decoration: none;
}

.occ-title a:hover {
  text-decoration: underline;
}

/* The whole card is the link target size on touch (NFR-8). */
.occ-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.occ-card {
  position: relative;
}

.occ-where,
.occ-facts {
  margin: 0;
  color: var(--muted);
}

.occ-facts {
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--subtle);
}

.occ-cancelled {
  align-self: flex-start;
}

.is-cancelled .occ-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.more {
  margin-top: var(--space-6);
}

/* ---------- Detail (S26) ---------- */

.detail {
  padding-top: var(--space-2);
}

.back-link {
  margin-bottom: var(--space-4);
  font-weight: 700;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--target);
  text-decoration: none;
}

.cancel-banner {
  max-width: 52rem;
  margin: 0 0 var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-m);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
}

.detail-card {
  max-width: 52rem;
  padding: 40px;
  border-radius: var(--radius-l);
  background: var(--surface);
}

.detail-image {
  display: block;
  margin: -16px -16px var(--space-6);
}

.detail-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-m);
}

.detail-card h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
  margin-bottom: var(--space-6);
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4) var(--space-8);
  margin: 0 0 var(--space-8);
  padding: var(--space-6);
  border-radius: var(--radius-m);
  background: var(--paper);
}

.detail-facts dt {
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--subtle);
}

.detail-facts dd {
  margin: 0;
  font-weight: 700;
}

.detail-subhead {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.detail-description {
  max-width: 62ch;
  color: var(--muted);
}

.detail-organiser {
  margin-top: var(--space-6);
  font-weight: 700;
}

.not-found h1 {
  font-size: clamp(26px, 3vw, 36px);
}

@media (max-width: 600px) {
  .portal-wrap {
    padding-inline: 20px;
  }

  .occ-card {
    padding: 18px;
    gap: 14px;
  }

  .detail-card {
    padding: 24px 20px;
  }

  .detail-image {
    margin: -8px -8px var(--space-4);
  }
}

/* ---------- kultiva.dk: the nationwide list (owner decision 2026-11-12) ---------- */

.national-brand {
  gap: 10px;
}

.national-nav {
  margin-left: auto;
}

.national-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.national-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 18px;
  border-radius: var(--pill);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.national-nav a:hover {
  background: var(--surface);
}

.national-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface);
}

.national .portal-hero h1 {
  max-width: 14ch;
}

/* The filter bar: one white card, fields side by side, stacked on small screens. */
.national-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: 20px 24px;
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field label {
  font-weight: 700;
  font-size: var(--text-s);
}

.filter-field select {
  width: 100%;
  min-height: var(--target);
  padding: 0 40px 0 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--surface) url("../img/chevron-down.svg") no-repeat right 14px center;
  color: var(--ink);
  font: inherit;
  appearance: none;
}

.filter-field select:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.filter-reset {
  color: var(--ink);
  font-weight: 700;
}

.national-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.national-footer-links a {
  color: var(--ink);
}

@media (max-width: 799px) {
  .national-filters {
    grid-template-columns: 1fr;
  }

  .national-nav {
    margin-left: 0;
    flex-basis: 100%;
  }

  .national .portal-header-inner {
    flex-wrap: wrap;
  }
}

/* ---------- kultiva.dk front page (packages/views/src/home.tsx), in the mockup's language ---------- */

.home-hero {
  padding-block: 16px 72px;
}

.home-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding-block: 32px 40px;
}

.home-hero-text {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.home-hero h1 {
  margin: 0;
  /* The copy keeps "nær dig" together with a no-break space. */
  max-width: 12ch;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.02;
}

.home-lead {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 21px;
}

.home-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.home-quick-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 24px;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.home-quick-link:hover,
.home-quick-link:focus-visible {
  background: var(--ink);
  color: var(--surface);
}

.home-art {
  position: relative;
  flex: 1 1 420px;
  min-width: 0;
  width: 470px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}

.home-shapes {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero .national-filters {
  margin-top: 0;
}

/* Bands alternate paper and white, as in the mockup. */
.home-band {
  padding-block: 72px;
}

.home-band-white {
  background: var(--surface);
}

.home-band h2 {
  margin-bottom: 28px;
  font-size: clamp(30px, 3.6vw, 46px);
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}

.home-section-lead {
  max-width: 52ch;
  margin: -12px 0 28px;
  color: var(--muted);
  font-size: var(--text-m);
}

.home-more-link {
  color: var(--ink);
  font-weight: 700;
}

/* "Snart": picture cards. */
.event-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease;
}

.event-tile:hover,
.event-tile:focus-within {
  transform: translateY(-4px);
}

.event-tile-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.event-tile-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px 24px;
}

.event-tile-when {
  margin: 0;
  color: var(--cta-dark);
  font-size: var(--text-s);
  font-weight: 700;
}

.event-tile-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.event-tile-title a {
  color: var(--ink);
  text-decoration: none;
}

/* The whole card is the link's target area. */
.event-tile-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.event-tile-title a:focus-visible {
  outline: none;
}

.event-tile:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.event-tile-where,
.event-tile-category {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-s);
}

.event-tile-category {
  font-weight: 700;
}

.event-tile.is-cancelled .event-tile-title {
  text-decoration: line-through;
}

/* Categories: bright tiles in the four shape colours. */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 20px;
  border-radius: var(--radius-m);
  font-family: var(--font-display);
  font-weight: 700;
  /* 19 px bold is "large text" (WCAG 1.4.3), so ink on red at about 4:1 passes. */
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.category-tile:hover,
.category-tile:focus-visible {
  transform: translateY(-3px);
}

.category-tile .shape {
  flex: none;
  opacity: 0.9;
}

/* Text on the shape colours is large and bold (tokens.css: 3:1 minimum for large text). */
.tone-red {
  background: var(--red);
  color: var(--ink);
}

.tone-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.tone-teal {
  background: var(--teal);
  color: var(--ink);
}

.tone-ink {
  background: var(--ink);
  color: var(--surface);
}

/* Kommuner. */
.kommune-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kommune-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.kommune-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.kommune-tile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
}

.kommune-tile-links a {
  color: var(--ink);
  font-weight: 700;
}

.home-band .day-group:first-of-type {
  margin-top: 0;
}

/* Invitations for arrangører and kommuner. */
.invite-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.invite-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 40px;
  border-radius: var(--radius-l);
  color: var(--surface);
}

.invite-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.invite-card p {
  max-width: 44ch;
  margin: 0;
  font-size: var(--text-m);
}

.invite-card-teal {
  background: var(--teal);
  color: var(--ink);
}

.invite-card-ink {
  background: var(--ink);
}

.button-light {
  margin-top: 8px;
  border-color: var(--surface);
  background: var(--surface);
  color: var(--ink);
}

.button-light:hover,
.button-light:focus-visible {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

@media (max-width: 599px) {
  .home-hero h1 {
    font-size: 42px;
  }

  .home-band {
    padding-block: 48px;
  }

  .invite-card {
    padding: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-tile,
  .category-tile {
    transition: none;
  }
}

/* On a white band the list cards take the paper colour, so they stay visible as cards. */
.home-band-white .occ-card {
  background: var(--paper);
}

/* ---------- Pagination on kultiva.dk lists (T-84) ---------- */

.portal-results .event-tiles {
  margin-top: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 48px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-pages a,
.pagination-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target);
  min-height: var(--target);
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.pagination-pages a:hover,
.pagination-step:hover {
  background: var(--surface);
}

.pagination-pages a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface);
}

.pagination-gap {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 4px;
  color: var(--subtle);
}

/* Status chips in a card keep their own width. */
.event-tile-body .chip {
  align-self: flex-start;
}
