@font-face { font-family: 'Asfaltsfossilerna'; src: url('fonts/Fonts/Asfaltsfossilerna-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Cykeln Stockholm'; src: url('fonts/Fonts/Cykeln-Stockholm.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Elledningsnoter'; src: url('fonts/Fonts/Elledningsnoter-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Pinnar'; src: url('fonts/Fonts/Pinnar-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Trasig Rullstol'; src: url('fonts/Fonts/TrasigRullstol-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Mixat'; src: url('fonts/Fonts/mixat-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Prickigt'; src: url('fonts/Fonts/prickigt-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Sprickor'; src: url('fonts/Fonts/sprickor-Regular.otf') format('opentype'); font-display: swap; }

:root {
  --ui: "Times New Roman", Times, serif;
  --ink: #111;
  --page-x: 14px;
  --tester-size: 210px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: #fff;
  color: var(--ink);
}

body {
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.08;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
}

.page-shell {
  min-height: 100vh;
  padding: 0 var(--page-x) 60px;
}

.site-header {
  position: relative;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header h1 {
  margin: 4px 60px 0;
  font-size: clamp(25px, 2.2vw, 34px);
  line-height: 1;
  font-weight: 400;
  text-align: center;
}

.back-button {
  position: absolute;
  left: 0;
  top: 54px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 23px;
  line-height: 1;
}

.font-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  width: 100%;
  padding: 8px 0 9px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: clamp(21px, 1.75vw, 30px);
  line-height: 1.06;
}

.font-link,
.slash {
  white-space: nowrap;
}

.font-link {
  cursor: pointer;
  font-family: var(--ui);
}

.font-link:hover,
.font-link:focus-visible,
.font-link.is-active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.font-link:focus-visible {
  outline: none;
}

.slash {
  display: inline-block;
  margin: 0 8px;
}

.size-row {
  display: grid;
  grid-template-columns: max-content minmax(150px, 420px);
  justify-content: end;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 8px 0 3px;
  margin-top: 4px;
  font-size: 16px;
}

.size-row label {
  white-space: nowrap;
}

.size-row output {
  display: inline-block;
  min-width: 48px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 1px;
  background: var(--ink);
  border: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1px;
  height: 18px;
  margin-top: -8.5px;
  background: var(--ink);
  border: 0;
  border-radius: 0;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 1px;
  background: var(--ink);
  border: 0;
}

input[type="range"]::-moz-range-thumb {
  width: 1px;
  height: 18px;
  background: var(--ink);
  border: 0;
  border-radius: 0;
}

input[type="range"]:focus {
  outline: none;
}

.tester-wrap {
  overflow: hidden;
}

.tester {
  width: 100%;
  min-height: 0;
  padding: 18px 0 28px;
  border: 0;
  outline: 0;
  font-family: 'Asfaltsfossilerna', 'Times New Roman', Times, serif;
  font-size: var(--tester-size);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  caret-color: #111;
}

.tester:empty::before {
  content: attr(data-placeholder);
  font-family: var(--ui);
  font-size: 24px;
  line-height: 1;
  color: #999;
  pointer-events: none;
}

@media (max-width: 760px) {
  :root {
    --page-x: 18px;
    --tester-size: 118px;
  }

  .site-header {
    min-height: 246px;
    align-items: flex-start;
    padding-top: 122px;
  }

  .site-header h1 {
    margin: 0 44px;
    font-size: 32px;
    line-height: 1.03;
  }

  .back-button {
    top: 84px;
    font-size: 25px;
  }

  .font-nav {
    padding: 18px 0 16px;
    font-size: 28px;
    line-height: 1.31;
  }

  .slash {
    margin: 0 5px;
  }

  .size-row {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 3px;
    padding: 10px 0 0;
    font-size: 15px;
  }

  .size-row label {
    display: flex;
    justify-content: space-between;
  }

  .size-row output {
    min-width: 0;
  }

  .tester-wrap {
    min-height: 0;
  }

  .tester {
    min-height: 0;
    padding-top: 36px;
    padding-bottom: 34px;
    font-size: var(--tester-size);
    line-height: 1.55;
  }

  .tester:empty::before {
    font-size: 22px;
  }
}

@media (max-width: 420px) {
  .site-header h1 { font-size: 29px; }
  .font-nav { font-size: 25px; }
}

/* Centered layout */
.font-nav {
  justify-content: center;
  text-align: center;
}

.tester {
  text-align: center;
}

.size-row {
  grid-template-columns: max-content minmax(150px, 420px);
  justify-content: center;
  width: 100%;
}

@media (max-width: 760px) {
  .size-row {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
    width: 100%;
  }
}


a { color: inherit; text-decoration: none; }
.back-button { text-decoration: none; }
.home-nav { justify-content: center; }
.content-page { padding: 28px 0; font-size: clamp(21px, 1.75vw, 30px); }
.content-page p { margin: 0; max-width: 760px; line-height: 1.5; }
.about-image { display: block; width: 100%; height: auto; margin: 0 0 36px; }

/* Archive submenu */
.archive-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  padding: 22px 0 10px;
  font-family: var(--ui);
  font-size: clamp(21px, 1.75vw, 30px);
  line-height: 1.06;
  text-align: center;
}

.archive-link {
  cursor: pointer;
  font-family: var(--ui);
  font-size: inherit;
  line-height: inherit;
}

.archive-link:hover,
.archive-link:focus-visible,
.archive-link.is-active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.archive-link:focus-visible {
  outline: none;
}

.archive-content {
  padding: 46px 0 0;
}

.archive-content[hidden] {
  display: none;
}

.archive-label {
  margin: 0 0 30px;
  font-family: var(--ui);
  font-size: clamp(21px, 1.75vw, 30px);
  line-height: 1;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 36px;
}

.archive-grid img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1000px) {
  .archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .archive-nav {
    justify-content: flex-start;
    padding: 20px 0 4px;
    font-size: 28px;
    line-height: 1.31;
    text-align: left;
  }

  .archive-content {
    padding-top: 48px;
  }

  .archive-label {
    margin-bottom: 24px;
    font-size: 28px;
  }

  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 420px) {
  .archive-nav,
  .archive-label { font-size: 25px; }
}

/* Archive image library */
.archive-page {
  background: #fff;
}

.archive-menu a.active {
  color: #e95034;
}

.archive-panels {
  padding-top: 26px;
}

.archive-panel[hidden] {
  display: none;
}

.archive-group {
  padding: 0 0 34px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--ink);
}

.archive-group:last-child {
  margin-bottom: 0;
}

.archive-group h2 {
  margin: 0 0 34px;
  font-family: var(--ui);
  font-size: clamp(23px, 1.7vw, 30px);
  line-height: 1;
  font-weight: 400;
}

.archive-image-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 44px 42px;
  align-items: start;
}

.archive-image-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1200px) {
  .archive-image-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 34px 32px;
  }
}

@media (max-width: 900px) {
  .archive-image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
  }
}

@media (max-width: 760px) {
  .archive-panels { padding-top: 34px; }
  .archive-group { padding-bottom: 28px; margin-bottom: 24px; }
  .archive-group h2 { margin-bottom: 24px; font-size: 27px; }
  .archive-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}


/* Home GIF */
.home-gif {
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
}

.home-gif img {
  display: block;
  width: min(100%, 608px);
  height: auto;
}

@media (max-width: 760px) {
  .home-gif { padding-top: 22px; }
}

/* Om-sidan: smalare bild och luft fore inskickstexten */
.about-image {
  width: min(52vw, 760px);
  max-width: 100%;
  margin: 0 auto 36px;
}
.content-page .submit-letter {
  margin-top: 52px;
}
@media (max-width: 700px) {
  .about-image { width: 100%; }
  .content-page .submit-letter { margin-top: 36px; }
}

/* Om-sidan: centrera texten under bilden */
.content-page > p {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
