/* Högläsningsrallyt
   Nunito is self-hosted (SIL Open Font License, see fonts/OFL.txt).
   Border green is sampled from the Canva art (#82a445).
   Text green is a darker shade of the same hue so it clears WCAG AA on white. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/nunito-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-800.woff2") format("woff2");
}

:root {
  --green: #82a445;
  --green-text: #527814;
  --green-deep: #3f6410;
  --ink: #2b2b2b;
  --paper: #ffffff;
  --tint: #f4fae6;
  --radius: 1.15rem;
  --wrap: 1100px;
  --shadow-focus: 0 0 0 3px #fff, 0 0 0 6px var(--green-deep);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

p {
  margin: 0 0 0.85rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--green-text);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 20;
  transform: translateY(-160%);
  background: #fff;
  color: var(--green-deep);
  border: 2px solid var(--green);
  border-radius: 0.6rem;
  padding: 0.45rem 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

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

.wrap {
  width: min(var(--wrap), calc(100% - 1.5rem));
  margin-inline: auto;
}

/* Header */

.site-header {
  padding-top: 0.15rem;
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.6rem;
  padding: 0.35rem 0 0.1rem;
}

.logo-link {
  order: 1;
  flex: 1 0 100%;
  display: flex;
  justify-content: center;
  border-radius: 0.75rem;
  text-decoration: none;
}

.logo-link img {
  width: min(18.5rem, 82vw);
  height: auto;
}

.header-start {
  order: 2;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
}

.header-end {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.category-icons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.category-icons li {
  line-height: 0;
}

.category-icons img {
  width: clamp(3.15rem, 14.5vw, 4.15rem);
  height: auto;
  display: block;
}

.quote {
  width: max-content;
  max-width: 100%;
  margin: 0;
  border: 3px solid var(--green);
  border-radius: 0.85rem;
  padding: 0.32rem 0.62rem 0.36rem;
  text-align: center;
  color: var(--green-text);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.22;
  font-style: normal;
}

.quote p {
  margin: 0;
}

.lastips {
  width: max-content;
  max-width: min(19rem, 100%);
  margin: 0;
  border: 3px solid var(--green);
  border-radius: 0.85rem;
  padding: 0.32rem 0.55rem 0.4rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

.lastips h2 {
  margin: 0 0 0.15rem;
  text-align: center;
  color: var(--green-text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lastips ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.lastips a {
  font-weight: 700;
}

.portrait {
  margin: 0;
  justify-self: center;
}

.portrait img {
  display: block;
  width: min(11.5rem, 70vw);
  height: auto;
  border-radius: 0.35rem;
}

/* Main */

.site-main {
  padding: 1.15rem 0 1.35rem;
}

@media (max-width: 1119px) {
  .header-end {
    gap: 1rem;
  }

  .site-main {
    padding-top: 2.75rem;
  }
}

#sa-fungerar-det,
#intresseanmalan {
  scroll-margin-top: 1.25rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-title {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.page-roomy .stack {
  gap: 2.6rem;
}

.page-roomy .card {
  padding: 1.75rem 1.5rem 1.55rem;
}

.page-roomy .about-layout {
  gap: 1.45rem;
}

.page-roomy .card p {
  margin-bottom: 1.05rem;
}

.card {
  position: relative;
  background: #fff;
  border: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 1.2rem 1.15rem 1.1rem;
  color: inherit;
}

.card ul {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.card li + li {
  margin-top: 0.25rem;
}

.card-label {
  position: absolute;
  top: 0;
  left: 1.05rem;
  transform: translateY(-50%);
  margin: 0;
  background: #fff;
  color: var(--green-text);
  border: 2.5px solid var(--green);
  border-radius: 999px;
  padding: 0.34rem 0.72rem 0.36rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
  max-width: calc(100% - 1.6rem);
}

.card-label--wrap {
  line-height: 1.25;
  white-space: normal;
}

.card-label--center {
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
}

/* Keep the pill on the border, but reserve its full height so wrapped
   headings cannot sit on the first line of body text. */
.card:not(.teaser):has(> .card-label) {
  padding-top: 0;
}

.card:not(.teaser) > .card-label {
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: calc(100% - 2.15rem);
  top: auto;
  left: 1.05rem;
  transform: translateY(-50%);
  margin: 0 0 0.55rem;
  vertical-align: top;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.16s ease;
}

.card-link:hover,
.card-link:focus-visible {
  background: var(--tint);
}

.card-link:hover .card-label,
.card-link:focus-visible .card-label {
  background: var(--tint);
}

.card-link--corner {
  padding-right: 4.4rem;
}

.arrow {
  width: 3.05rem;
  height: auto;
  color: var(--green);
  display: block;
  flex: none;
  transition: transform 0.16s ease;
}

.card-link--corner .arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.card-link--corner:hover .arrow,
.card-link--corner:focus-visible .arrow {
  transform: translate(5px, -50%);
}

.teaser:hover .arrow,
.teaser:focus-visible .arrow {
  transform: translateX(5px);
}

.lead-in {
  margin-top: 0.15rem;
}

.card-title {
  margin: 0.15rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.card > .section-head:first-of-type {
  margin-top: 0.1rem;
}

.section-head {
  margin: 1.45rem 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--green-text);
}

.subhead {
  margin: 1rem 0 0.15rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--ink);
}

.emphasis {
  margin-top: 1.1rem;
  font-weight: 800;
}

/* Steps and categories */

.steps,
.cat-list {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.steps li,
.cat-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.step-badge {
  position: relative;
  width: 2.45rem;
  height: 2.45rem;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #95d64f, #5eae24 72%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.step-badge img {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  left: -0.02rem;
  top: -0.04rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.step-badge b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
  padding-left: 0.28rem;
  text-shadow: 0 1px 1px rgba(40, 70, 10, 0.35);
}

.cat-list {
  margin-top: 0.9rem;
  gap: 1rem;
}

.cat-list li {
  align-items: flex-start;
}

.cat-list img {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  margin-top: 0.12rem;
}

.cat-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.cat-sub {
  margin: 0.05rem 0 0.3rem;
  font-weight: 800;
  color: var(--green-text);
}

.cat-list p:last-child {
  margin-bottom: 0;
}

.cat-tail {
  white-space: nowrap;
}

a.cat-sample {
  font-size: calc(1em - 2pt);
  white-space: nowrap;
}

.media-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.media-source {
  margin: 0 0 0.15rem;
  color: var(--green-text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-note,
.media-quote {
  margin: 0.35rem 0 0;
}

.media-quote {
  padding: 0;
  border: 0;
  font-weight: 700;
}

.media-list .text-link {
  display: inline;
}

/* Teasers */

.teaser-grid,
.material-grid {
  display: grid;
  gap: 1.65rem;
}

.teaser-grid {
  grid-template-columns: 1fr;
}

.teaser {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
  min-height: 6.6rem;
  padding-top: 1.7rem;
  padding-right: 0.95rem;
}

.teaser p {
  margin: 0;
}

.teaser .arrow {
  width: 2.55rem;
}

.material-grid {
  grid-template-columns: 1fr;
}

.material-grid--three {
  align-items: stretch;
}

/* Link inside body copy */

.text-link {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--green);
  text-underline-offset: 0.16em;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--green-text);
}

/* Intresseanmälan */

.interest-card > p {
  margin-bottom: 0.9rem;
}

.interest-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.interest-fields {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  font-weight: 800;
  color: var(--ink);
}

.optional {
  font-weight: 700;
  color: var(--green-text);
}

.interest-form input[type="text"],
.interest-form input[type="email"],
.interest-form textarea {
  width: 100%;
  margin: 0;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2.5px solid var(--green);
  border-radius: 0.8rem;
  padding: 0.65rem 0.8rem;
}

.interest-form textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.interest-form input::placeholder,
.interest-form textarea::placeholder {
  color: #4d5c3e;
  opacity: 1;
}

.interest-form input[aria-invalid="true"],
.interest-form textarea[aria-invalid="true"] {
  border-color: #9b2c2c;
}

.field-error {
  margin: 0;
  min-height: 0;
  color: #7f1d1d;
  font-weight: 700;
  font-size: 0.95rem;
}

.field-error:empty {
  display: none;
}

.field-check {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  column-gap: 0.7rem;
  row-gap: 0.3rem;
  align-items: start;
}

.field-check input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.15rem 0 0;
  accent-color: var(--green-deep);
}

.field-check label {
  font-weight: 700;
}

.field-check .field-error {
  grid-column: 2;
}

.interest-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0;
  font-weight: 800;
}

.form-status:empty {
  display: none;
}

.form-status.is-error {
  color: #7f1d1d;
}

.form-success {
  margin: 0.4rem 0 0;
  padding: 0.95rem 1rem;
  background: var(--tint);
  border-radius: 0.85rem;
  font-weight: 800;
}

.form-success:focus {
  outline: 3px solid var(--green-deep);
  outline-offset: 3px;
}

.interest-submit {
  appearance: none;
  align-self: flex-start;
  margin-top: 0.15rem;
  border: 3px solid var(--green-deep);
  background: var(--green-deep);
  color: #fff;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  border-radius: 999px;
  padding: 0.75rem 1.3rem;
  cursor: pointer;
}

.interest-submit:hover {
  background: var(--green-text);
  border-color: var(--green-text);
}

.interest-submit:disabled {
  cursor: progress;
  opacity: 0.72;
}

.field-check a {
  font-weight: 800;
}

/* Navigation */

.site-nav {
  padding: 0;
  width: 100%;
  max-width: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.05rem 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

.site-nav a {
  color: var(--green-text);
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.15rem;
  margin: 0 0 0.65rem;
}

.footer-links a {
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.about-layout {
  display: grid;
  gap: 1rem;
}

.about-layout .portrait {
  order: -1;
}

.portrait-placeholder {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.portrait-frame {
  width: min(11.5rem, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px dashed var(--green);
  border-radius: 1.15rem;
  background: var(--tint);
  color: var(--green-text);
  font-weight: 800;
  text-align: center;
  padding: 0.75rem;
}

.portrait-placeholder figcaption {
  font-weight: 800;
}

.todo-note {
  margin: 0.2rem 0 0;
  color: var(--green-deep);
  font-weight: 800;
  font-size: 0.95rem;
}

.contact-mail {
  font-size: 1.15rem;
}

.interest-form :focus {
  outline: none;
}

.interest-form :focus-visible {
  outline: 3px solid var(--green-deep);
  outline-offset: 3px;
}

/* Footer */

.site-footer {
  padding: 0 0 1.4rem;
}

.footer-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  border: 2.5px solid var(--green);
  border-radius: 1rem;
  padding: 0.65rem 0.9rem;
  color: var(--green-text);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-align: center;
}

/* Focus */

a:focus {
  outline: none;
}

a:focus-visible,
.card-link:focus-visible {
  outline: 3px solid var(--green-deep);
  outline-offset: 3px;
}

.card-link:focus-visible {
  outline-offset: 4px;
}

::selection {
  background: #e3f3bf;
}

/* Desktop */

@media (min-width: 760px) {
  .material-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem 1.15rem;
  }

  .material-grid--three {
    grid-template-columns: 1fr 1fr;
  }

  .material-grid--three > :first-child {
    grid-column: 1 / -1;
  }

  .interest-fields {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .about-layout {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0.4rem 1.25rem;
  }

  .page-roomy .about-layout {
    gap: 1.15rem 2.1rem;
  }

  .page-roomy .card {
    padding: 1.95rem 1.8rem 1.7rem;
  }

  .about-layout .portrait {
    order: 0;
  }
}

@media (min-width: 860px) {
  .teaser-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .footer-bar {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-radius: 999px;
    padding: 0.48rem 1.2rem;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .footer-bar span:first-child {
    text-align: left;
  }

  .footer-bar span:last-child {
    text-align: right;
  }
}

@media (min-width: 1040px) {
  .teaser-grid {
    grid-template-columns: repeat(4, 1fr);
  }

}

@media (min-width: 1120px) {
  .header-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.4rem 0 0.15rem;
  }

  .header-start {
    order: 1;
    flex: 1 1 0;
    justify-content: flex-start;
    gap: 0.85rem;
    min-width: max-content;
  }

  .logo-link {
    order: 2;
    flex: 0 0 auto;
  }

  .logo-link img {
    width: 16.75rem;
  }

  .header-end {
    order: 3;
    flex: 1 1 0;
    align-items: flex-end;
    justify-content: center;
    width: auto;
    min-width: 0;
  }

  .site-nav {
    width: auto;
    max-width: 17.5rem;
  }

  .site-nav ul {
    justify-content: flex-end;
  }

  .quote {
    width: max-content;
    max-width: 16rem;
    font-size: 1.02rem;
    padding: 0.28rem 0.58rem 0.32rem;
  }

  .category-icons {
    gap: 0.55rem;
  }

  .category-icons img {
    width: 4.45rem;
  }

  .card {
    padding: 1.25rem 1.35rem 1.15rem;
  }

  .card-link--corner {
    padding-right: 5rem;
  }
}

@media (hover: hover) {
  .logo-link:hover img {
    transform: scale(1.035);
  }

  .logo-link img {
    transition: transform 0.16s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .card,
  .quote,
  .footer-bar,
  .card-label,
  .step-badge,
  .interest-submit,
  .interest-form input,
  .interest-form textarea {
    border: 2px solid ButtonText;
    forced-color-adjust: auto;
  }

  .arrow {
    color: LinkText;
  }
}

@media print {
  .skip-link {
    display: none;
  }

  .card,
  .quote,
  .footer-bar {
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
