/*
Theme Name: Småfolk
Author: Kjetil Moen Nettservice AS
Description: Nettside for Foreningen Småfolk
Version: 1.0.0
*/

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #C94F2C;
  --light:     #FBF7F3;
  --dark:      #1A1A1A;
  --mid:       #6B6A68;
  --accent:    #E8B84B;
  --radius:    6px;
  --gap:       clamp(2rem, 5vw, 5rem);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

img, video { display: block; max-width: 100%; }
.container img { height: auto; }

a { color: inherit; text-decoration: none; }

/* ── Accessibility helpers ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: .6rem 1.2rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius);
  z-index: 9999;
  transition: top .2s;
}
.skip-to-content:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
a:focus-visible, button:focus-visible { border-radius: 2px; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.15;
  margin-bottom: 0.5em;
}
h1:not(:first-child),
h2:not(:first-child),
h3:not(:first-child),
h4:not(:first-child) { margin-top: 1.5em; }

h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); }
h4 { font-size: clamp(1rem, 2vw, 1.3rem); }

p { font-size: clamp(1rem, 1.5vw, 1.15rem); max-width: 65ch; margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; margin-bottom: 1.25em; }
ul:last-child, ol:last-child { margin-bottom: 0; }
li { margin-bottom: 0.4em; }
li:last-child { margin-bottom: 0; }
.nav-links li, .footer-nav-links li { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--primary);
  margin: 1.5em 0;
  padding: 0.5em 1.25em;
  color: var(--mid);
  font-style: italic;
}


/* ── Layout helpers ── */
.container { width: min(1200px, 92%); margin-inline: auto; }
.section { padding-block: var(--gap); }

/* ── Navigation ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem clamp(1.5rem, 5vw, 4rem);
  background: var(--light);
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
  transition: background .35s, box-shadow .35s;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--dark);
  transition: color .35s;
}

.nav-links {
  display: flex; align-items: center; gap: 2.5rem;
  list-style: none;
  margin: 0; padding: 0;
}

.nav-links a {
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dark);
  transition: color .35s;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--secondary, var(--accent));
}

/* ── Hero ── */
.hero {
  position: relative;
  height: 100svh; min-height: 600px;
  display: grid; place-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute; inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-media img,
.hero-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: slowzoom 18s ease-in-out infinite alternate;
}

.hero-media .carousel {
  position: absolute; inset: 0;
  border-radius: 0;
  height: 100%;
}
.hero-media .carousel-track {
  position: relative;
  height: 100%;
}
.hero-media .carousel-slide {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.hero-media .carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}
.hero-media .carousel-slide img {
  width: 100%;
  height: 100%;
  transform-origin: center center;
}
.hero-media .carousel-slide.is-active img {
  animation: kb-zoom-in 6s ease-in-out forwards;
}
.hero-media .carousel-slide:nth-child(3n+2).is-active img {
  animation: kb-pan-right 6s ease-in-out forwards;
}
.hero-media .carousel-slide:nth-child(3n).is-active img {
  animation: kb-pan-left 6s ease-in-out forwards;
}

@keyframes kb-zoom-in {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}
@keyframes kb-pan-right {
  from { transform: scale(1.08) translateX(-1.5%); }
  to   { transform: scale(1.08) translateX(1.5%); }
}
@keyframes kb-pan-left {
  from { transform: scale(1.08) translateX(1.5%); }
  to   { transform: scale(1.08) translateX(-1.5%); }
}

@keyframes slowzoom {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.08) 0%,
    rgba(0,0,0,.45) 60%,
    rgba(0,0,0,.65) 100%
  );
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  color: #fff;
  padding-inline: 1.5rem;
}

.hero-content h1 {
  max-width: 14ch;
  margin-inline: auto;
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}

.hero-content p {
  margin-inline: auto;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  opacity: .9;
  max-width: 45ch;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: .85rem 2.2rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  transition: transform .2s, opacity .2s;
}

.btn:hover { transform: translateY(-2px); opacity: .88; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-outline  { border: 2px solid #fff; color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; margin-top: 1.2rem; }

/* ── Section: intro ── */
.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.intro-image {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
}

.intro-image img { width: 100%; height: 100%; object-fit: cover; }

.intro-text h2 { margin-bottom: 1.2rem; }
.intro-text p  { color: var(--mid); margin-bottom: 1rem; }

/* ── Section: three pillars ── */
.pillars {
  background: var(--dark);
  color: var(--light);
  text-align: center;
}

.pillars h2 { margin-bottom: 3rem; }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.pillar { padding: 2.5rem 2rem; }

.pillar-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: grid; place-items: center;
  margin: 0 auto 1.2rem;
  font-size: 1.5rem;
}

.pillar h3 { margin-bottom: .6rem; color: var(--accent); }
.pillar p  { color: rgba(255,255,255,.7); margin-inline: auto; }

/* ── Section: workshops preview ── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  transition: transform .25s, box-shadow .25s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}

.card-image { aspect-ratio: 4/3; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 1.5rem; }
.card-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .6rem;
}
.card-body h3 { margin-top: .4rem; margin-bottom: .5rem; }
.card-body p  { color: var(--mid); font-size: .95rem; }

/* ── Full-bleed image band ── */
.band {
  height: clamp(280px, 45vw, 600px);
  overflow: hidden;
}

.band img {
  width: 100%; height: 100%; object-fit: cover;
  animation: slowzoom 20s ease-in-out infinite alternate;
}

/* ── Fjaera illustration ── */
.fjaera-img { display: block; }

/* Placement: fixed bottom-right corner */
.fjaera-fixed {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  pointer-events: none;
}
.fjaera-fixed .fjaera-img {
  width: 60px;
  opacity: .4;
}

/* ── Om oss page ── */

/* ── Section: team ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.team-card { text-align: center; }

.team-avatar {
  width: 140px; height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.team-avatar img { width: 100%; height: 100%; object-fit: cover; }

.team-card h3 { margin-bottom: .25rem; font-size: 1.1rem; }
.team-card p  { color: var(--mid); font-size: .9rem; max-width: 24ch; margin-inline: auto; }

/* ── Carousel ── */
.carousel-section .container {
  position: relative;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  outline: none;
}

.carousel:focus-visible {
  box-shadow: 0 0 0 3px var(--primary, #666);
}

.carousel-track {
  display: flex;
  transition: transform .4s ease;
}

.carousel-slide {
  min-width: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  transition: background .22s, border-color .22s, transform .22s;
}

.carousel-btn:hover {
  background: var(--primary, rgba(255,255,255,.35));
  border-color: var(--primary, rgba(255,255,255,.7));
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

.carousel-dots {
  z-index: 2;
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
  transition: background .2s;
}

.carousel-dot.active { background: #fff; }

/* ── Single post ── */
.post-body { max-width: 72ch; margin-inline: auto; }
.post-body p, .post-body li { line-height: 1.8; }
.post-body-image { width: 100%; border-radius: var(--radius); display: block; margin-bottom: 1.5rem; }
.post-body-date { font-size: .85rem; color: var(--mid); display: block; margin-bottom: .4rem; }
.post-body h1 { margin-top: 0; margin-bottom: 1.2rem; }
.post-body-excerpt { font-weight: 700; margin-bottom: 1.5rem; }
.post-body-back { display: inline-block; margin-top: 3rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.post-body-back:hover { text-decoration: underline; }

/* ── Footer ── */
footer {
  background: var(--tertiary, var(--dark));
  color: var(--hoved, rgba(255,255,255,.8));
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  font-size: .9rem;
}

/* ── Page hero (inner pages) ── */
.page-hero {
  height: 55svh; min-height: 380px;
  position: relative;
  display: grid; place-items: end start;
}

.page-hero .hero-media { position: absolute; inset: 0; overflow: hidden; }
.page-hero .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero .hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.65) 0%, rgba(0,0,0,.2) 100%); }

.page-hero-content {
  position: relative; z-index: 1;
  color: #fff;
  padding: 3rem clamp(1.5rem, 5vw, 4rem);
}

.page-hero-content .label {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--secondary, var(--accent));
  margin-bottom: .8rem;
}

.page-hero-content h1 { max-width: 16ch; }

/* ── About page ── */
.about-body {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 4rem;
  align-items: start;
}

.about-body p + p { margin-top: 1rem; }
.about-body p { color: var(--mid); }

.goals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.goals-list li {
  display: flex; align-items: flex-start; gap: .8rem;
  font-size: .97rem; color: var(--mid);
}

.goals-list li::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05em;
}

/* ── Workshops page ── */
.workshop-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-block: 3rem;
  border-top: 1px solid rgba(0,0,0,.08);
}

.workshop-block:nth-child(even) { direction: rtl; }
.workshop-block:nth-child(even) > * { direction: ltr; }

.workshop-block--reverse { flex-direction: row-reverse; }

.workshop-block-image {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
}

.workshop-block-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }

a.workshop-block--link { color: inherit; text-decoration: none; }
a.workshop-block--link:hover .workshop-block-image img { transform: scale(1.03); }
a.workshop-block--link:focus-visible { outline-offset: 4px; }

.workshop-block-text .label {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary); margin-bottom: .6rem;
  display: block;
}

.workshop-block-text h2 { margin-bottom: .8rem; font-size: clamp(1.4rem, 3vw, 2rem); }
.workshop-block-text p  { color: var(--mid); }

.workshop-meta {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1.2rem;
}

.meta-item {
  font-size: .85rem; font-weight: 600;
  color: var(--dark);
  display: flex; align-items: center; gap: .4rem;
}

.meta-item span { color: var(--mid); font-weight: 400; }

/* ── Contact page ── */
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-split-text h3 { margin-bottom: .8rem; }
.contact-split-text > p { color: var(--mid); margin-bottom: 2rem; }

.contact-detail {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .2rem;
}

.contact-detail a { color: var(--dark); }
.contact-detail a:hover { color: var(--primary); }

.contact-split-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-split-image img { width: 100%; max-height: 150px; object-fit: scale-down; }

.nav-mobile-logo-item { display: none; }

/* ── Hamburger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 36px; height: 36px;
  color: var(--dark);
  transition: color .35s;
  z-index: 200;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .intro, .about-body, .workshop-block,
  .workshop-block:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }

  .workshop-block { padding-block: 1.75rem; gap: 1.5rem; }

  .pillars-grid, .cards, .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .contact-split { grid-template-columns: 1fr; gap: 2rem; }
  .workshop-block--reverse { flex-direction: column; }
}

@media (max-width: 560px) {
  .pillars-grid, .cards, .team-grid { grid-template-columns: 1fr; }
  .fjaera-fixed .fjaera-img { width: 38px; }
  .contact-split-image { aspect-ratio: unset; }
  .post-body { padding-top: 5rem; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2.5rem;
    padding: 6rem 1.5rem 3rem;
    background: var(--light);
    z-index: 150;
    list-style: none;
  }

  .nav-links.open { display: flex; overflow-y: auto; }

  .nav-links a {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--dark) !important;
    letter-spacing: .01em;
  }

  .nav-toggle.open { color: var(--dark); }

  .nav-mobile-logo-item {
    display: block;
    text-align: center;
  }

  .carousel-slide img {
    height: 270px;
  }
}

.footer-logo img {
  height: 58px;
  width: auto;
  max-width: 200px;
  display: block;
  margin: 0 auto 1.5rem;
}

.footer-nav-links {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.footer-nav-links li { margin: .4rem 0; }

.footer-nav-links a {
  color: var(--hoved, inherit);
  text-decoration: none;
  font-size: .95rem;
}

.footer-nav-links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--secondary, currentColor);
}

.footer-email {
  margin: 0 auto 1.5rem;
  font-size: .95rem;
  max-width: none;
}

.footer-email a {
  color: var(--hoved, inherit);
  text-decoration: none;
}

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

.footer-credit-bar {
  background: #fff;
  text-align: center;
  padding: 1.25rem 1.5rem;
}

.footer-credit {
  font-size: .85rem;
  color: var(--mid);
  margin: 0 auto;
  max-width: none;
}

.footer-credit a { color: var(--mid); text-decoration: underline; text-underline-offset: 3px; }

/* ── Gallery / Masonry ── */
.masonry { columns: 3 240px; column-gap: 1rem; }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; }

.masonry-btn {
  display: block; width: 100%; padding: 0; border: none; background: none;
  cursor: pointer; border-radius: var(--radius); overflow: hidden;
}
.masonry-btn img {
  display: block; width: 100%; height: auto;
  transition: transform .35s ease, opacity .2s ease;
}
.masonry-btn:hover img,
.masonry-btn:focus-visible img { transform: scale(1.04); opacity: .88; }

/* ── Lightbox ── */
#lightbox {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
#lightbox[hidden] { display: none; }

.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.92);
}
.lb-img-wrap {
  position: relative; z-index: 1;
  max-width: calc(100vw - 8rem);
  max-height: calc(100vh - 4rem);
  display: flex; align-items: center; justify-content: center;
}
#lb-img {
  max-width: 100%; max-height: calc(100vh - 4rem);
  object-fit: contain; border-radius: 4px; display: block;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  backdrop-filter: blur(6px);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-prev:disabled, .lb-next:disabled { opacity: .25; pointer-events: none; }

@media (max-width: 600px) {
  .lb-img-wrap { max-width: 100vw; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

