/* Jonas Wilén – stilmall */

@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #1c1a18;
  --muted: #6b655d;
  --line: #e4ded4;
  --accent: #9a4a2c;       /* bränd sienna */
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;
  --header-h: 76px;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 46ch; }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500; letter-spacing: .02em; text-decoration: none;
  transition: background .25s, color .25s, transform .25s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { transition: transform .25s; }
.btn:hover svg { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Sidhuvud ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
/* oskarp bakgrund på pseudo-element, så att mobilmenyn (position: fixed) täcker hela skärmen */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand img { height: 46px; width: auto; }
.site-nav ul { list-style: none; display: flex; gap: clamp(16px, 2.4vw, 34px); margin: 0; padding: 0; }
.site-nav a {
  position: relative; text-decoration: none; font-size: 14.5px; font-weight: 450; letter-spacing: .01em;
  padding: 6px 0; color: var(--muted); transition: color .2s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle { display: none; }

@media (max-width: 880px) {
  :root { --header-h: 64px; }
  .brand img { height: 38px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; position: relative; z-index: 60;
    background: none; border: 0; padding: 8px 0; font: 500 13px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); cursor: pointer;
  }
  .burger { width: 22px; height: 12px; position: relative; display: inline-block; }
  .burger::before, .burger::after, .burger span {
    content: ""; position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; transition: transform .3s, opacity .2s, top .3s;
  }
  .burger::before { top: 0; } .burger span { top: 5px; } .burger::after { top: 10px; }
  .menu-open .burger::before { top: 5px; transform: rotate(45deg); }
  .menu-open .burger::after { top: 5px; transform: rotate(-45deg); }
  .menu-open .burger span { opacity: 0; }

  .site-nav {
    position: fixed; inset: 0; z-index: 55; background: var(--bg);
    display: flex; align-items: center; padding: var(--header-h) var(--gutter) 40px;
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 6px; }
  .site-nav a { font-family: var(--serif); font-size: clamp(34px, 9vw, 48px); color: var(--ink); padding: 4px 0; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--accent); }
  .site-nav li { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; }
  .menu-open .site-nav li { opacity: 1; transform: none; }
  .menu-open .site-nav li:nth-child(2) { transition-delay: .04s; }
  .menu-open .site-nav li:nth-child(3) { transition-delay: .08s; }
  .menu-open .site-nav li:nth-child(4) { transition-delay: .12s; }
  .menu-open .site-nav li:nth-child(5) { transition-delay: .16s; }
  .menu-open .site-nav li:nth-child(6) { transition-delay: .20s; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 5vw, 72px) 0 clamp(40px, 6vw, 88px); }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 6vw, 96px); align-items: center; }
.hero h1 { font-size: clamp(54px, 8.5vw, 124px); font-weight: 500; margin-bottom: 22px; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; max-height: calc(100vh - var(--header-h) - 80px); object-fit: cover; object-position: center 30%; border-radius: var(--radius); box-shadow: 0 30px 60px -30px rgba(40, 30, 20, .45); }
.hero-art figcaption { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--muted); margin-top: 12px; }
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { max-height: 62vh; }
}

/* ---------- Block ---------- */
.block { padding-block: clamp(36px, 6vw, 80px); }
.block-tight { padding-bottom: clamp(36px, 5vw, 64px); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(20px, 3vw, 36px); border-top: 1px solid var(--line); padding-top: 22px; }
.block-head h2 { font-size: clamp(32px, 4vw, 48px); }
.more { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.more:hover { color: var(--accent); }

.page-head { padding-top: clamp(32px, 6vw, 80px); padding-bottom: clamp(24px, 4vw, 48px); }
.page-head h1 { font-size: clamp(48px, 7vw, 96px); margin-bottom: 16px; }
.page-head .lead { margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* ---------- Sektionskort ---------- */
.section-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 32px); }
.section-card { text-decoration: none; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s; }
.section-card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -24px rgba(40, 30, 20, .35); }
.section-card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.section-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.section-card:hover .section-card-img img { transform: scale(1.04); }
.section-card-text { padding: 22px 24px 24px; }
.section-card h3 { font-size: 30px; margin-bottom: 8px; }
.section-card p { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 880px) { .section-cards { grid-template-columns: 1fr; } .section-card { flex-direction: row; } .section-card-img { width: 38%; aspect-ratio: auto; min-height: 140px; } .section-card-text { flex: 1; padding: 18px; } .section-card h3 { font-size: 26px; } }
@media (max-width: 480px) { .section-card p { display: none; } }

/* ---------- Galleri (rättjusterade rader, behåller ordningen) ---------- */
.gallery { --row: 260px; display: flex; flex-wrap: wrap; gap: clamp(14px, 2vw, 28px); }
.gallery::after { content: ""; flex-grow: 999999; }
.work { margin: 0; flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row)); min-width: 0; }
.work a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--line); cursor: zoom-in; }
.work img { width: 100%; aspect-ratio: var(--ar); object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1), opacity .5s; }
.work a:hover img { transform: scale(1.03); }
.work figcaption { padding-top: 10px; line-height: 1.35; }
.work .title { display: block; font-family: var(--serif); font-size: 19px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work .meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 1100px) { .gallery { --row: 220px; } }
@media (max-width: 640px) { .gallery { --row: 150px; gap: 14px; } .work .title { font-size: 17px; } }
@media (max-width: 420px) { .work { flex-basis: 100%; } }

/* fade-in när bilder laddas */
.js .work img { opacity: 0; }
.js .work img.loaded { opacity: 1; }

/* ---------- Om-teaser ---------- */
.about-teaser { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.about-teaser img { border-radius: var(--radius); }
.about-teaser h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 18px; }
.about-teaser p { color: var(--muted); max-width: 56ch; }
.about-teaser .btn { margin-top: 10px; }
@media (max-width: 720px) { .about-teaser { grid-template-columns: 1fr; } .about-teaser img { max-width: 280px; } }

/* ---------- Nästa-länk ---------- */
.next-link { padding-bottom: clamp(48px, 7vw, 96px); }
.next-link a { display: block; text-decoration: none; border-top: 1px solid var(--line); padding-top: 24px; }
.next-title { display: inline-flex; align-items: center; gap: 14px; font-family: var(--serif); font-size: clamp(36px, 5vw, 64px); transition: color .25s, gap .25s; }
.next-link a:hover .next-title { color: var(--accent); gap: 22px; }

/* ---------- CV ---------- */
.cv { display: grid; grid-template-columns: minmax(240px, 420px) 1fr; gap: clamp(28px, 6vw, 96px); align-items: start; padding-bottom: clamp(48px, 7vw, 96px); }
.cv-portrait { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.cv-portrait img { border-radius: var(--radius); }
.cv-group { border-top: 1px solid var(--line); padding: 22px 0 18px; display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.cv-group h2 { font-size: 24px; }
.cv-group ul { list-style: none; margin: 0; padding: 0; }
.cv-group li { padding: 6px 0; color: #3a3631; }
.cv-group li + li { border-top: 1px dashed var(--line); }
@media (max-width: 1000px) { .cv-group { grid-template-columns: 1fr; gap: 8px; } }
@media (max-width: 760px) { .cv { grid-template-columns: 1fr; } .cv-portrait { position: static; max-width: 380px; } }

/* ---------- Kontakt ---------- */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; padding-bottom: clamp(48px, 7vw, 96px); }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; }
.contact-card-wide { grid-column: 1 / -1; }
.contact-card h2 { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.contact-card p { font-size: 17px; margin: 0 0 8px; }
.contact-card a { text-decoration-color: var(--line); text-underline-offset: 4px; overflow-wrap: anywhere; }
.contact-card a:hover { color: var(--accent); }
.contact-card .btn { margin-top: 6px; text-decoration: none; }
.social { display: flex; flex-direction: column; gap: 6px; }
.social a { display: inline-flex; align-items: center; gap: 10px; }
.contact-img { margin: 0; }
.contact-img img { border-radius: var(--radius); }
.contact-img figcaption { font-family: var(--serif); font-style: italic; color: var(--muted); margin-top: 10px; }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .contact-cards { grid-template-columns: 1fr; } }

/* ---------- Sidfot ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 28px; font-size: 14px; color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; }
.footer-name { font-family: var(--serif); font-size: 24px; color: var(--ink); margin: 0 0 2px; }
.site-footer p { margin: 0; }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a { text-decoration: none; display: inline-flex; }
.footer-links a:hover { color: var(--accent); }
.footer-links svg { width: 20px; height: 20px; }
.copy { grid-column: 1 / -1; font-size: 12.5px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px !important; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Ljuslåda ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #141210; color: #f2eee8;
  display: grid; grid-template-rows: auto 1fr auto; opacity: 0; transition: opacity .25s;
}
.lightbox:not([open]) { display: none; }
.lightbox.show { opacity: 1; }
.lightbox::backdrop { background: transparent; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 13px; letter-spacing: .08em; color: #b9b2a8; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 clamp(8px, 7vw, 96px); touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: opacity .25s, transform .25s; user-select: none; -webkit-user-drag: none; }
.lb-stage img.loading { opacity: 0; transform: scale(.985); }
.lb-caption { text-align: center; padding: 16px 20px 22px; }
.lb-caption .t { font-family: var(--serif); font-size: 24px; display: block; }
.lb-caption .m { font-size: 13px; color: #b9b2a8; }
.lb-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 10px; border-radius: 999px; display: inline-flex; transition: background .2s; }
.lb-btn:hover { background: rgba(255,255,255,.1); }
.lb-btn:focus:not(:focus-visible) { outline: none; }
.lb-btn svg { width: 26px; height: 26px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: clamp(4px, 2vw, 28px); }
.lb-next { right: clamp(4px, 2vw, 28px); }
.lb-single .lb-prev, .lb-single .lb-next, .lb-single .lb-count { visibility: hidden; }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: -56px; transform: none; } .lb-caption { padding-inline: 64px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
