/* Roberta's 2026 — responsive theme. Ingen build, inga beroenden. */

@font-face {
  font-family: 'Open Sans Condensed';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/OpenSansCondensed-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Open Sans Condensed';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/OpenSansCondensed-Light-Italic.ttf') format('truetype');
}
@font-face {
  font-family: 'Open Sans Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/OpenSansCondensed-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredericka the Great';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/FrederickaTheGreat-Regular.ttf') format('truetype');
}

:root {
  --nav-bg: rgba(152, 94, 92, 0.9);
  --ink: #333;
  --link: #337ab7;
  --link-hover: #23527c;
  --font-body: 'Open Sans Condensed', 'Arial Narrow', sans-serif;
  --font-brand: 'Fredericka the Great', cursive;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: #5b3b2e url('../images/freebie3.jpg') no-repeat top left fixed;
  background-size: cover;
}

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

a { color: var(--link); }
a:hover, a:focus { color: var(--link-hover); }

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: #fff;
  color: #000;
}
.skip-link:focus { top: 8px; }

/* ---------- Layout (mobil först) ---------- */

.site {
  max-width: 1400px;
  margin: 0 auto;
  container-type: inline-size;
}

.hero { position: relative; }

.hero__media {
  position: relative;
  aspect-ratio: 940 / 658;
  overflow: hidden;
  background: #2b2b2b;
  box-shadow: 1px 2px 19px 0 rgba(0, 0, 0, 1);
}
.hero__photo,
.hero__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  bottom: auto;
  height: auto;
  object-fit: fill;
  pointer-events: none;
}

/* ---------- Meny ---------- */

.nav {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  box-shadow: 0 -2px 18px -1px rgba(0, 0, 0, 0.21);
}

.nav__brand {
  padding: 4px 16px;
  font-family: var(--font-brand);
  font-size: 44px;
  line-height: 1.1;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.nav__brand:hover, .nav__brand:focus { color: #fff; }

.nav__toggle {
  margin-right: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  cursor: pointer;
}
.nav__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
}

.nav__menu {
  display: none;
  flex-basis: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.nav__menu.is-open { display: block; }

.nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__item a {
  display: block;
  padding: 12px 18px;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
}
.nav__item a:hover,
.nav__item a:focus,
.nav__item.current a,
.nav__item.section a {
  color: #fff;
  background: rgba(0, 0, 0, 0.15);
}

/* ---------- Pappersytan med innehåll ---------- */

.paper {
  position: relative;
  z-index: 10;
  margin: -8% 12px 0;
  padding: 16px 20px 28px;
  background: url('../images/paper.png') no-repeat center / 100% 100%;
  color: var(--ink);
  overflow-wrap: break-word;
}
.paper:focus { outline: none; }
.paper:focus-visible { outline: 2px solid var(--link); outline-offset: -4px; }

.paper h1 {
  margin: 14px 0 12px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}
.paper p { margin: 0 0 10px; }
.paper iframe { max-width: 100%; border: 0; }

/* Startsidan: bredare, lägre papper */
.is-home .paper {
  background-image: url('../images/widepaper.png');
}
.is-home .paper h1 { font-size: 22px; margin-top: 8px; }

/* ---------- Galleri ---------- */

.gallery {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}
.gallery__item a {
  display: block;
  padding: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery__item a:hover,
.gallery__item a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.gallery__item img {
  display: block;
  width: 100%;
  border-radius: 3px;
}

/* ---------- Video / ljud ---------- */

.embeds {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.embed {
  flex: 1 1 280px;
  max-width: 560px;
  aspect-ratio: 16 / 9;
}
.embed iframe {
  display: block;
  width: 100%;
  height: 100%;
}
.soundcloud {
  width: 100%;
  max-width: 300px;
  height: 300px;
}

/* ---------- Sidfot ---------- */

.footer {
  padding: 22px 16px 28px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.footer p { margin: 0; }

/* ---------- Stor skärm: samma komposition som originalet (940 px) ---------- */

@media (min-width: 880px) {
  .site {
    margin-top: 20px;
    padding-inline: 12px;
  }
  /* container-type sitter på .site; cqw = 1 % av dess bredd.
     Fotot följer sin proportion; pappret ligger i flödet och dras upp
     över fotot med negativ marginal, så att det aldrig beskärs. */
  .hero__media { aspect-ratio: 940 / 658; }

  /* Smal list; logotypen är större än listen och hänger ned över fotot */
  .nav {
    top: 20px;
    left: 0;
    right: 0;
    height: clamp(48px, 5.3cqw, 56px);
    flex-wrap: nowrap;
    padding-inline: 1.1cqw 1.6cqw;
  }
  .nav__brand {
    position: relative;
    top: 10px;
    padding: 0;
    font-size: clamp(65px, 10.6cqw, 100px);
    line-height: clamp(48px, 5.3cqw, 56px);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  }
  .nav__toggle { display: none; }
  .nav__menu {
    display: block;
    flex-basis: auto;
    border-top: 0;
  }
  .nav__list { display: flex; align-items: center; }
  .nav__item a {
    padding: 8px clamp(8px, 1.4cqw, 16px);
    font-size: 15px;
    background: transparent;
  }
  .nav__item a:hover,
  .nav__item a:focus,
  .nav__item.current a,
  .nav__item.section a {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 5px;
  }

  .paper {
    width: 74.5cqw;
    min-height: 47cqw;
    margin: -56.8cqw 1.6cqw 28px auto;
    padding: 28px 36px 32px;
    font-size: 17px;
  }
  .paper h1 { margin-top: 0; font-size: 34px; }

  /* Startsidan: pappret börjar inne i fotot och växer vid behov åt sidan nedåt */
  .is-home .paper {
    position: absolute;
    right: 2.6cqw;
    bottom: 3.4cqw;
    width: 72.7cqw;
    min-height: 0;
    margin: 0;
    padding: 18px 28px 20px;
    font-size: 16px;
  }
  .is-home .paper h1 { margin: 0 0 6px; font-size: 20px; font-weight: 400; }
  .is-home .paper p { margin-bottom: 8px; }
}

/* Mellanbredd: lite luftigare text, allt skalar redan med cqw */
@media (max-width: 879px) {
  .is-home .paper { margin-top: -10%; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__item a { transition: none; }
}

/* ---------- Lightbox för galleribilder ---------- */

.lightbox {
  width: min(96vw, 1100px);
  max-height: 96vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
.lightbox__close {
  position: absolute;
  top: -14px;
  right: -6px;
  width: 38px;
  height: 38px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: var(--nav-bg);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}
