/* ============================================================
   Kalendarium (/kalendarium/, event app): every event as a card.
   Light band as the other editorial pages (Skribenter, Om oss, Topp 20),
   then a card grid. Cards follow the site's card rules: hairline, 12 px,
   no shadow, the whole card is the link, hover turns title and arrow green.
   ============================================================ */

/* The band runs full-bleed; the rest stays inside main.container. */
body.page-home main.container:has(.kal-hero) {
  padding-top: 0;
}

.kal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Band (sand + satin, as .skrib-hero) ---------- */
.kal-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: var(--hr-sand);
  background-image: url("../media/images/skribenter-hero-satin.jpg");
  background-size: cover;
  background-position: center 42%;
  border-bottom: 1px solid var(--hr-rule);
}

.kal-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--hr-space-7);
}

.kal-hero__crumb {
  padding: var(--hr-space-6) 0 var(--hr-space-10);
  font-size: var(--hr-meta-sm);
  color: var(--hr-graphite);
}

.kal-hero__crumb a {
  color: inherit;
  text-decoration: none;
  transition: color var(--hr-dur-color) var(--hr-ease);
}

.kal-hero__crumb a:hover {
  color: var(--hr-green-link);
}

.kal-hero__crumb-sep {
  margin: 0 var(--hr-space-2);
  color: var(--hr-middot);
}

.kal-hero__crumb [aria-current] {
  color: var(--hr-ink);
}

/* Same height on every platform page (Parts.jsx HeroBand): at least 290 px + 48 px. */
.kal-hero__body {
  min-height: 290px;
  padding-bottom: var(--hr-space-12);
  box-sizing: content-box;
}

body.page-home main .kal-hero__kicker {
  margin: 0 0 var(--hr-space-4);
  font-size: var(--hr-kicker);
  font-weight: var(--hr-w-bold);
  letter-spacing: var(--hr-track-xwide);
  text-transform: uppercase;
  color: var(--hr-green-link);
}

body.page-home main h1.kal-hero__title {
  margin: 0 0 var(--hr-space-5);
  max-width: 22ch;
  font-family: var(--hr-font-display);
  font-weight: var(--hr-w-bold);
  font-size: clamp(30px, 4vw, 44px);
  line-height: var(--hr-lh-tight);
  color: var(--hr-ink);
}

body.page-home main .kal-hero__lead {
  margin: 0;
  max-width: 760px;
  font-size: 19px;
  font-weight: var(--hr-w-semibold);
  line-height: 1.45;
  color: var(--hr-ink);
}

/* ---------- Sections and grid ---------- */
/* One card per row, in date order, in a centred column at reading width
   (720 px), so the order is easy to follow. */
.kal-section {
  max-width: var(--hr-maxw-read);
  margin: var(--hr-space-14) auto 0;
}

.kal-section--past {
  padding-top: var(--hr-space-9);
  border-top: var(--hr-section-rule);
  /* /kalendarium/#tidigare-event (links in e-mails): clear the header. */
  scroll-margin-top: 150px;
}

body.page-home main h2.kal-section__title {
  margin: 0 0 var(--hr-space-7);
  font-family: var(--hr-font-display);
  font-weight: var(--hr-w-bold);
  font-size: 30px;
  line-height: 1.15;
  color: var(--hr-ink);
}

/* A list of cards (<ul role="list">: Safari drops list semantics from a
   styled list without the role); each <li> stretches its card. */
.kal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--hr-space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}

.kal-grid > li {
  display: flex;
  min-width: 0;
}

.kal-grid > li > * {
  flex: 1;
}

body.page-home main .kal-empty {
  margin: 0;
  font-size: var(--hr-dek-sm);
  color: var(--hr-ink);
}

/* ---------- Event card ---------- */
.kal-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--hr-space-7) 26px var(--hr-space-6);
  border: var(--hr-card-border);
  border-radius: var(--hr-radius);
  background: var(--hr-paper);
  color: inherit;
  text-decoration: none;
}

/* Keyboard focus: a 2 px ink outline (as the menu), clearly visible (3:1)
   and kept in forced-colors mode; title and arrow also turn green. */
.kal-card:focus-visible {
  outline: 2px solid var(--hr-ink);
  outline-offset: 2px;
}

.kal-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hr-space-3);
  margin-bottom: 20px;
}

/* The date as in the start page's Kalendarium: Playfair number, month under it. */
.kal-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 46px;
}

.kal-date__day {
  font-family: var(--hr-font-display);
  font-size: var(--hr-num-date);
  font-weight: var(--hr-w-bold);
  line-height: 1;
  color: var(--hr-ink);
}

.kal-date__month {
  margin-top: 5px;
  font-size: var(--hr-kicker-xs);
  font-weight: var(--hr-w-medium);
  letter-spacing: var(--hr-track-wide);
  text-transform: uppercase;
  color: var(--hr-ink);
}

.kal-card__type {
  font-size: var(--hr-kicker);
  font-weight: var(--hr-w-bold);
  letter-spacing: var(--hr-track-kicker);
  text-transform: uppercase;
  color: var(--hr-label);
  text-align: right;
}

body.page-home main h3.kal-card__title {
  margin: 0 0 var(--hr-space-2);
  font-family: var(--hr-font-display);
  font-weight: var(--hr-w-bold);
  font-size: var(--hr-h-card);
  line-height: var(--hr-lh-card);
  color: var(--hr-ink);
  text-wrap: pretty;
  overflow-wrap: break-word;
  transition: color var(--hr-dur-title) var(--hr-ease);
}

body.page-home main .kal-card__meta {
  margin: 0 0 20px;
  font-size: var(--hr-meta);
  line-height: var(--hr-lh-title);
  color: var(--hr-graphite);
}

/* "torsdag 26 november 2026" starts the line: capital T. */
.kal-card__meta::first-letter {
  text-transform: uppercase;
}

.kal-card__arrow {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  color: var(--hr-ink);
  transition: color var(--hr-dur-title) var(--hr-ease);
}

a.kal-card:hover .kal-card__title,
a.kal-card:hover .kal-card__arrow,
a.kal-card:focus-visible .kal-card__title,
a.kal-card:focus-visible .kal-card__arrow {
  color: var(--hr-green-brand);
}

/* ---------- Past events ---------- */
body.page-home main .kal-section__lead {
  margin: calc(-1 * var(--hr-space-3)) 0 var(--hr-space-7);
  font-size: var(--hr-dek-sm);
  line-height: var(--hr-lh-title);
  color: var(--hr-ink);
}

/* Image cards two per row (one per row was tried 2026-11-18 and dropped);
   one column on phones. */
.kal-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hr-space-7) 20px;
}

/* Image card (the site's article card): hairline, 12 px, no shadow, image
   1200/630, the whole card is the link, title and arrow turn green on hover. */
.kal-rec {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: var(--hr-card-border);
  border-radius: var(--hr-radius);
  background: var(--hr-paper);
  color: inherit;
  text-decoration: none;
}

/* Keyboard focus: a 2 px ink outline (as the menu), clearly visible (3:1)
   and kept in forced-colors mode; title and arrow also turn green. */
.kal-rec:focus-visible {
  outline: 2px solid var(--hr-ink);
  outline-offset: 2px;
}

.kal-rec__media {
  aspect-ratio: 1200 / 630;
  background: var(--hr-sand);
}

.kal-rec__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kal-rec__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 20px var(--hr-space-4);
}

body.page-home main .kal-rec__label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: var(--hr-kicker);
  font-weight: var(--hr-w-bold);
  letter-spacing: var(--hr-track-kicker);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--hr-label);
}

.kal-rec__icon {
  flex: none;
  color: var(--hr-ink);
}

body.page-home main h3.kal-rec__title {
  margin: 0 0 var(--hr-space-2);
  font-family: var(--hr-font-display);
  font-weight: var(--hr-w-bold);
  font-size: var(--hr-h-card);
  line-height: var(--hr-lh-card);
  color: var(--hr-ink);
  text-wrap: pretty;
  overflow-wrap: break-word;
  transition: color var(--hr-dur-title) var(--hr-ease);
}

body.page-home main .kal-rec__meta {
  margin: 0 0 var(--hr-space-4);
  font-size: var(--hr-meta);
  line-height: var(--hr-lh-title);
  color: var(--hr-graphite);
}

.kal-rec__arrow {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  color: var(--hr-ink);
  transition: color var(--hr-dur-title) var(--hr-ease);
}

.kal-rec:hover .kal-rec__title,
.kal-rec:hover .kal-rec__arrow,
.kal-rec:focus-visible .kal-rec__title,
.kal-rec:focus-visible .kal-rec__arrow {
  color: var(--hr-green-brand);
}

/* Pages of past webinars: as .ut-pagination (Utbildning). */
.kal-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--hr-space-2);
  margin-top: var(--hr-space-10);
}

.kal-pagination__item {
  padding: 10px var(--hr-space-4);
  font-size: var(--hr-dek-sm);
  font-weight: var(--hr-w-semibold);
  color: var(--hr-graphite);
  text-decoration: none;
  transition: color var(--hr-dur-color) var(--hr-ease);
}

a.kal-pagination__item:hover {
  color: var(--hr-green-deep);
}

.kal-pagination__item--off {
  opacity: 0.45;
}

/* Phones: Föregående · Sida x av y · Nästa on one line. */
@media (max-width: 480px) {
  .kal-pagination {
    gap: var(--hr-space-1);
  }

  .kal-pagination__item {
    padding: 10px var(--hr-space-2);
  }

  .kal-pagination__item--end {
    display: none;
  }
}

.kal-pagination__current {
  padding: 10px var(--hr-space-6);
  border-radius: var(--hr-radius-pill);
  background: var(--hr-mint);
  color: var(--hr-green-deep);
  font-size: var(--hr-dek-sm);
  font-weight: var(--hr-w-bold);
}

/* Past events without an article: plain rows, no links (the signup pages
   are closed). Date and type in 14 px graphite, the title in ink. */
.kal-past-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kal-grid--two + .kal-past-list,
.kal-pagination + .kal-past-list {
  margin-top: var(--hr-space-12);
}

.kal-past-list__row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--hr-space-4);
  padding: 14px 0;
  border-top: var(--hr-section-rule);
}

.kal-past-list__row:last-child {
  border-bottom: var(--hr-section-rule);
}

.kal-past-list__date,
.kal-past-list__type {
  font-size: var(--hr-meta);
  color: var(--hr-graphite);
}

.kal-past-list__title {
  font-size: 16px;
  line-height: var(--hr-lh-title);
  color: var(--hr-ink);
}

@media (max-width: 600px) {
  .kal-grid--two {
    grid-template-columns: minmax(0, 1fr);
  }

  .kal-past-list__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .kal-past-list__type {
    display: none;
  }
}

@media (max-width: 768px) {
  .kal-hero__inner {
    padding: 0 var(--hr-space-4);
  }

  .kal-section {
    margin-top: var(--hr-space-10);
  }

  body.page-home main h2.kal-section__title {
    font-size: 26px;
  }
}
