/* =========================================================
   dmlfoto — soft & friendly
   Warm cream, gentle accents, rounded everything.
   Mobile-first, iPhone Safari optimized.
   ========================================================= */

:root {
  /* Warm soft palette */
  --cream:        #fbf6ef;     /* main background, soft warm white */
  --cream-2:      #f5ede0;     /* card background, warmer */
  --cream-3:      #ece2d0;     /* elevated surface */
  --ink:          #2a2420;     /* warm dark brown for text, never pure black */
  --ink-soft:     #6b5d52;     /* muted brown for secondary */
  --ink-dim:      #9a8a7c;     /* faintest brown */
  --accent:       #c97757;     /* terracotta/dusty pink — primary accent */
  --accent-deep:  #a55a3d;     /* deeper terracotta on hover */
  --sage:         #8da580;     /* soft sage green — secondary */
  --rule:         #e6d9c4;     /* hairline */
  --rule-soft:    #efe4d2;
  --shadow-sm: 0 2px 6px -2px rgba(80, 50, 30, 0.10);
  --shadow-md: 0 8px 20px -8px rgba(80, 50, 30, 0.18), 0 2px 6px -2px rgba(80, 50, 30, 0.08);
  --shadow-lg: 0 20px 40px -16px rgba(80, 50, 30, 0.25), 0 4px 10px -4px rgba(80, 50, 30, 0.10);
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --maxw: 1200px;

  /* Spacing scale tuned for one-handed iPhone use */
  --pad-x: 20px;
  --tab-h: 64px;   /* sticky bottom tab bar height */
}

@media (min-width: 768px) {
  :root {
    --pad-x: 40px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:        #1c1816;
    --cream-2:      #251f1c;
    --cream-3:      #2e2722;
    --ink:          #f0e8de;
    --ink-soft:     #b5a89c;
    --ink-dim:      #6e645a;
    --accent:       #e89977;
    --accent-deep:  #f5b395;
    --sage:         #9eb692;
    --rule:         #382f29;
    --rule-soft:    #2a2420;
    --shadow-sm: 0 2px 6px -2px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 20px -8px rgba(0,0,0,0.5), 0 2px 6px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 40px -16px rgba(0,0,0,0.6), 0 4px 10px -4px rgba(0,0,0,0.3);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  /* Reserve space for the sticky bottom tab bar on mobile */
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   HEADER
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad-x);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  -webkit-tap-highlight-color: transparent;
}
.logo-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark svg { width: 100%; height: 100%; }

/* Desktop nav (hidden on mobile - tab bar handles it) */
.header-nav {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 768px) {
  .header-nav { display: flex; }
}
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.header-nav a:hover { color: var(--ink); background: var(--cream-2); }
.header-nav a.active { color: var(--ink); background: var(--cream-3); }

/* =========================================================
   INTRO
   ========================================================= */
.intro {
  padding: 28px var(--pad-x) 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}
@media (min-width: 768px) { .intro { padding: 64px var(--pad-x) 48px; } }

.intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 18px;
  background: var(--cream-2);
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.intro-eyebrow .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.7); opacity: 0.5; }
}

.intro-title {
  margin: 0 0 18px;
  font-weight: 500;
  font-size: clamp(28px, 5.5vw, 52px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 22ch;
}
@media (min-width: 768px) {
  .intro-title { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.1; max-width: 18ch; }
}
.intro-title .loc {
  color: var(--accent);
  font-weight: 600;
  position: relative;
  /* Allow Strömstad to wrap naturally with the period rather than forcing a line break */
}
.intro-title .loc::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 5px;
  background: var(--accent);
  opacity: 0.18;
  border-radius: 99px;
}

.intro-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 50ch;
}
@media (min-width: 768px) { .intro-body { font-size: 17px; } }

/* =========================================================
   FILTER BAR — horizontally scrolls on mobile
   ========================================================= */
.filter-bar {
  position: sticky;
  top: 56px; /* below header */
  z-index: 30;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  padding: 12px 0 14px;
}
.filter-bar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.filters::-webkit-scrollbar { display: none; }

.filters button {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  background: var(--cream-2);
  color: var(--ink-soft);
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: 999px;
  transition: all .18s ease;
}
.filters button:hover { color: var(--ink); border-color: var(--rule); }
.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--cream);
}

/* =========================================================
   GALLERY GRID
   ========================================================= */
.gallery {
  padding: 8px var(--pad-x) 60px;
  max-width: var(--maxw);
  margin: 0 auto;
}
@media (min-width: 768px) { .gallery { padding: 16px var(--pad-x) 80px; } }

.grid {
  columns: 1;
  column-gap: 14px;
}
@media (min-width: 560px)  { .grid { columns: 2; column-gap: 16px; } }
@media (min-width: 1000px) { .grid { columns: 3; column-gap: 20px; } }

.card {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(8px);
  animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
@media (min-width: 560px)  { .card { margin-bottom: 16px; } }
@media (min-width: 1000px) { .card { margin-bottom: 20px; } }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card img {
  width: 100%;
  height: auto;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.card:hover img { transform: scale(1.04); }

.card-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
  max-width: calc(100% - 24px);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.card:hover .card-caption,
.card:focus-visible .card-caption {
  opacity: 1;
  transform: translateY(0);
}
@media (hover: none) {
  /* On touch devices, show caption persistently but lighter */
  .card-caption { opacity: 1; transform: none; }
}
.card-caption .cap-album {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  padding-left: 8px;
  border-left: 1px solid var(--rule);
}

.empty {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  padding: 80px 20px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--cream-2);
  border-top: 1px solid var(--rule);
  padding: 36px var(--pad-x) 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: end;
  }
}
.footer-msg {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  max-width: 36ch;
}
.footer-meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-social a {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.footer-social a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}
.footer-social svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.footer-social span:not(.handle) {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.footer-social .handle {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* =========================================================
   MOBILE TAB BAR
   ========================================================= */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--rule);
  display: flex;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .tabbar { display: none; }
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, background .15s;
}
.tab:hover { background: var(--cream-2); }
.tab svg {
  width: 22px;
  height: 22px;
  transition: transform .2s;
}
.tab.active {
  color: var(--accent);
}
.tab.active svg { transform: translateY(-1px); }

/* =========================================================
   ABOUT PAGE
   ========================================================= */
.about-hero {
  padding: 28px var(--pad-x) 0;
  max-width: 760px;
  margin: 0 auto;
}
@media (min-width: 768px) { .about-hero { padding: 64px var(--pad-x) 0; } }

.about-portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--sage));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.about-h1 {
  margin: 0 0 12px;
  font-weight: 500;
  font-size: clamp(28px, 5.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.about-h1 .name {
  color: var(--accent);
  font-weight: 600;
}

.about-tagline {
  margin: 0 0 36px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 50ch;
  line-height: 1.55;
}

.about-content {
  padding: 0 var(--pad-x) 60px;
  max-width: 760px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .about-content { padding: 0 var(--pad-x) 80px; }
}

.about-section {
  margin-bottom: 32px;
}
.about-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.about-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.about-section p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 60ch;
}
.about-section p:last-child { margin-bottom: 0; }

/* About fact list — friendly bordered cards on a grid */
.fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 24px 0 0;
}
@media (min-width: 600px) {
  .fact-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
.fact {
  background: var(--cream-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.fact-icon {
  width: 36px;
  height: 36px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.fact-icon svg { width: 18px; height: 18px; }
.fact-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fact-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.fact-value {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* =========================================================
   HISTORY PAGE — vertical timeline
   ========================================================= */
.history-hero {
  padding: 28px var(--pad-x) 0;
  max-width: 760px;
  margin: 0 auto;
}
@media (min-width: 768px) { .history-hero { padding: 64px var(--pad-x) 0; } }

.history-h1 {
  margin: 0 0 12px;
  font-weight: 500;
  font-size: clamp(28px, 5.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.history-tagline {
  margin: 0 0 36px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 50ch;
}

.timeline {
  padding: 0 var(--pad-x) 60px;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
@media (min-width: 768px) { .timeline { padding-bottom: 80px; } }

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* The vertical line running through the timeline */
.timeline-list::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--rule);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 32px;
  opacity: 0;
  transform: translateY(8px);
  animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards;
}
.timeline-item:last-child { padding-bottom: 0; }

/* The dot on each item */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--cream);
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}
.timeline-item.featured::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.timeline-year {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0 0 6px;
}
.timeline-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.timeline-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 22, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fade .25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.lb-stage figcaption {
  color: var(--cream);
  font-size: 14px;
  text-align: center;
  font-weight: 400;
  max-width: 60ch;
}

.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cream);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s, transform .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.lb-close svg, .lb-nav svg { width: 20px; height: 20px; }
.lb-close:hover, .lb-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }
@media (min-width: 768px) {
  .lb-close { top: 28px; right: 28px; }
  .lb-prev { left: 28px; }
  .lb-next { right: 28px; }
}

.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   FOCUS, SELECTION, MOTION
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--ink);
}

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