@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500;1,600&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #f9faf5;
  --text: #475105;
  --text-soft: #5c6a1a;
  --border: #e3e6d8;
  --font-body: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-nav: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --max-width: 1400px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  font-size: 18px;
  line-height: 1.3;
}

a { color: var(--text); }
a:hover { opacity: 0.75; }

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 40px 8px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo-link { flex: 0 0 auto; }
.logo-link img { height: 64px; width: auto; }

.main-nav {
  flex: 1 1 auto;
  font-family: var(--font-nav);
}
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.main-nav a {
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a[aria-current="page"] { text-decoration: underline; }

.header-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-icons { display: flex; gap: 14px; align-items: center; }
.header-icons a { color: var(--text); display: flex; }
.header-icons svg { width: 20px; height: 20px; }

.lang-switcher { position: relative; font-family: var(--font-nav); font-size: 14px; }
.lang-switcher button {
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-switcher svg { width: 16px; height: 16px; }
.lang-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 0;
  min-width: 110px;
  display: none;
  z-index: 20;
}
.lang-switcher.open .lang-menu { display: block; }
.lang-menu a {
  display: block;
  padding: 4px 14px;
  text-decoration: none;
}
.lang-menu a[aria-current="true"] { text-decoration: underline; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-toggle svg { width: 26px; height: 26px; color: var(--text); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 60px 20px 40px;
  font-size: 17px;
}
.site-footer a { text-decoration: underline; }

/* ---------- Hero (home) ---------- */

body.page-home { display: flex; flex-direction: column; height: 100vh; }
body.page-home .site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(249,250,245,0.55), rgba(249,250,245,0));
}
body.page-home #main { flex: 1 1 auto; min-height: 0; display: flex; }
body.page-home .site-footer { flex: 0 0 auto; }

.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.hero-bg { width: 100%; height: 100%; object-fit: cover; }
.hero-fg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  height: 88%;
  width: auto;
  max-width: 90%;
  object-fit: contain;
}


/* ---------- Simple text page ---------- */

.page-title {
  text-align: center;
  font-weight: 500;
  font-size: 34px;
  margin: 40px auto 30px;
}

.text-page-hero { max-width: 900px; margin: 0 auto 30px; padding: 0 40px; }
.text-page-hero img { width: 100%; height: auto; }

.text-page { max-width: 900px; margin: 0 auto; padding: 0 40px 60px; }
.text-page.text-left { text-align: left; }
.text-page.text-center { text-align: center; }
.text-page p { margin: 0 0 22px; font-size: 19px; }
.text-page a { text-decoration: underline; }

.back-button {
  display: inline-block;
  margin: 30px auto 0;
  padding: 10px 24px;
  border: 1px solid var(--text);
  text-decoration: none;
  font-family: var(--font-nav);
  font-size: 15px;
}

/* ---------- Om (alternating image/text rows) ---------- */

.about-rows { max-width: var(--max-width); margin: 20px auto 0; padding: 0 40px 40px; display: flex; flex-direction: column; gap: 50px; }
.about-row { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-row.reverse .about-row-text { order: 1; }
.about-row.reverse .about-row-image { order: 2; }
.about-row-text p { font-size: 19px; margin: 0 0 20px; }
.about-row-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.about-photos { max-width: var(--max-width); margin: 10px auto 0; padding: 0 40px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- Kontakt (icon rows flanking centered text) ---------- */

.contact-grid { max-width: var(--max-width); margin: 20px auto 0; padding: 0 40px 40px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; align-items: center; }
.contact-center { text-align: center; }
.contact-center h1 { font-size: 30px; font-weight: 500; margin: 0 0 14px; }
.contact-center h2 { font-size: 26px; font-weight: 500; margin: 40px 0 10px; }
.contact-center p { font-size: 19px; margin: 0 0 10px; }
.contact-decor img { border-radius: 50%; }
.contact-decor.top-left { grid-column: 1; grid-row: 1; }
.contact-decor.top-right { grid-column: 3; grid-row: 1; }
.contact-decor.bottom-left { grid-column: 1; grid-row: 2; }
.contact-decor.bottom-right { grid-column: 3; grid-row: 2; }
.contact-center-col { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- Konst & Textil hub ---------- */

.hub-grid {
  max-width: var(--max-width);
  margin: 20px auto 0;
  padding: 0 40px 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.hub-item { text-decoration: none; color: var(--text); }
.hub-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.hub-item span {
  display: block;
  text-align: center;
  padding: 14px 8px;
  background: #eef0e4;
  font-size: 19px;
  margin-top: 6px;
}

/* ---------- Gallery pages ---------- */

.gallery-page { max-width: var(--max-width); margin: 0 auto; padding: 0 40px 20px; }
.gallery-intro { max-width: 900px; margin: 0 auto 40px; text-align: center; font-size: 19px; }

.gallery-grid { display: grid; gap: 40px 30px; margin-bottom: 40px; }
.gallery-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.gallery-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.gallery-item img { width: 100%; height: auto; }
.gallery-item figcaption {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.03em;
  margin-top: 8px;
  font-family: var(--font-nav);
  text-transform: uppercase;
}

.gallery-slideshow { max-width: 620px; margin: 0 auto 20px; position: relative; text-align: center; }
.gallery-slideshow .slide { display: none; }
.gallery-slideshow .slide.active { display: block; }
.gallery-slideshow figcaption { margin-top: 14px; font-size: 14px; letter-spacing: 0.03em; text-transform: uppercase; font-family: var(--font-nav); }
.slideshow-nav {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 34px;
  color: var(--text);
  padding: 6px 14px;
}
.slideshow-nav.prev { left: -60px; }
.slideshow-nav.next { right: -60px; }

.gallery-pagenav {
  display: flex;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 40px 60px;
  font-size: 17px;
}
.gallery-pagenav a { text-decoration: none; }
.gallery-pagenav .dir { font-size: 13px; display: block; opacity: 0.7; }

/* ---------- Utställningar ---------- */

.exhibit-page { max-width: var(--max-width); margin: 0 auto; padding: 0 40px 20px; }
.exhibit-intro-row { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: start; margin-bottom: 20px; }
.exhibit-intro-row iframe { width: 100%; aspect-ratio: 16/9; border: 0; }
.exhibit-link { margin: 0 0 40px; font-size: 18px; }
.exhibit-link a { text-decoration: underline; }
.exhibit-photo-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.exhibit-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 40px; }
.exhibit-caption { text-align: center; font-size: 22px; margin: 30px 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .site-header { padding: 18px 20px 6px; flex-wrap: wrap; }
  .logo-link img { height: 46px; }
  .main-nav { order: 3; flex-basis: 100%; display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; }
  .menu-toggle { display: block; }
  .header-tools { gap: 10px; }

  .about-row { grid-template-columns: 1fr; }
  .about-row.reverse .about-row-text { order: 0; }
  .about-row.reverse .about-row-image { order: 0; }
  .about-photos { grid-template-columns: 1fr; padding: 0 20px 20px; }

  .contact-grid { grid-template-columns: 1fr; padding: 0 20px 40px; }
  .contact-center-col { grid-column: 1; grid-row: auto; order: -1; }
  .contact-decor { max-width: 220px; margin: 0 auto; }
  .contact-decor.top-left, .contact-decor.top-right, .contact-decor.bottom-left, .contact-decor.bottom-right { grid-column: 1; grid-row: auto; }

  .hub-grid { grid-template-columns: 1fr; padding: 0 20px 40px; gap: 20px; }

  .gallery-page { padding: 0 20px 20px; }
  .gallery-grid[data-cols="2"] { grid-template-columns: 1fr; }
  .gallery-grid[data-cols="4"] { grid-template-columns: 1fr 1fr; gap: 20px 14px; }
  .gallery-pagenav { padding: 20px 20px 40px; }
  .gallery-intro { padding: 0 10px; }

  .slideshow-nav.prev { left: 0; }
  .slideshow-nav.next { right: 0; }

  .exhibit-page { padding: 0 20px 20px; }
  .exhibit-intro-row { grid-template-columns: 1fr; }
  .exhibit-photo-grid-3 { grid-template-columns: 1fr 1fr; }
  .exhibit-strip { grid-template-columns: 1fr 1fr; }

  .text-page { padding: 0 20px 40px; }
  .page-title { font-size: 26px; }
}
