/* ==========================================================
   Lisemark Bilder — Varm premium (editorial)
   Samma designsystem som lisemark.com (variant 1a).
   Ljust + mörkt läge via [data-theme] på <html>.
   ========================================================== */

:root {
  --f-head: 'Newsreader', Georgia, serif;
  --f-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
}

/* ---- Ljust läge (default) ---- */
:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f2ea;
  --surface: #fffdf7;
  --surface-soft: #efece1;
  --fg: #1b1e14;
  --muted: #6a6d5e;
  --border: rgba(27, 30, 20, .12);
  --border-strong: rgba(27, 30, 20, .26);
  --accent: #8a6d2f;
  --accent-strong: #6f5722;
  --on-accent: #fffdf7;
  --accent-soft: rgba(138, 109, 47, .10);
  --danger: #a4392f;
  --shadow-card: 0 30px 60px rgba(20, 23, 15, .12);
  --lb-bg: rgba(20, 23, 15, .94);
}

/* ---- Mörkt läge ---- */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14170f;
  --surface: #1b1f15;
  --surface-soft: #232819;
  --fg: #f0efe4;
  --muted: #a3a493;
  --border: rgba(240, 239, 228, .12);
  --border-strong: rgba(240, 239, 228, .30);
  --accent: #cba85e;
  --accent-strong: #e2c688;
  --on-accent: #14170f;
  --accent-soft: rgba(203, 168, 94, .12);
  --danger: #d97768;
  --shadow-card: 0 30px 60px rgba(0, 0, 0, .38);
  --lb-bg: rgba(10, 12, 8, .94);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--f-body);
  transition: background .25s ease, color .25s ease;
}

a { color: inherit; }
button { font: inherit; }

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

h1, h2, h3, h4, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--f-head);
  font-weight: 500;
  letter-spacing: -.012em;
}

h1 {
  margin-bottom: 30px;
  max-width: 15ch;
  font-size: clamp(2.9rem, 6.2vw, 4.5rem);
  line-height: 1.03;
  text-wrap: balance;
}

h2 { margin-bottom: 24px; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1; }
h3 { margin-bottom: 12px; font-size: 1.35rem; }

p { color: var(--muted); line-height: 1.65; }

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.lead {
  max-width: 56ch;
  margin-bottom: 40px;
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.muted { color: var(--muted); font-size: 14px; }

.notice {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--fg);
  font-size: 14.5px;
}

.page-shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--accent);
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 600;
}

.brand span:last-child {
  font-family: var(--f-head);
  font-size: 19px;
  font-weight: 500;
}
.brand em { font-style: normal; color: var(--muted); font-size: 16px; }

.nav-right { display: flex; align-items: center; gap: 22px; }

.nav-links { display: flex; flex-wrap: wrap; gap: 26px; font-size: 14.5px; }

.nav-links a { color: var(--muted); text-decoration: none; transition: color .18s ease; }
.nav-links a:hover { color: var(--fg); }

.nav-links .nav-cta {
  color: var(--fg);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
}

.theme-control { display: inline-flex; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-control button { min-width: 0; border: 0; border-right: 1px solid var(--border); padding: 7px; color: var(--muted); background: transparent; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.theme-control button:last-child { border-right: 0; }
.theme-control button[aria-pressed='true'] { color: var(--on-accent); background: var(--accent); }
.theme-control button:hover:not([aria-pressed='true']) { color: var(--fg); background: var(--surface-soft); }

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 5vw, 64px); }
.hero .lead { margin-bottom: 0; }
.hero .muted { display: block; margin-top: 14px; }

/* ---------- Knappar ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.button.primary { padding: 15px 26px; color: var(--on-accent); background: var(--accent); }
.button.primary:hover { background: var(--accent-strong); }

.button.secondary {
  padding: 15px 20px;
  color: var(--fg);
  font-weight: 500;
  background: transparent;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
}
.button.secondary:hover { border-bottom-color: var(--accent); }

.button.danger {
  padding: 8px 14px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 13.5px;
}
.button.danger:hover { background: var(--danger); color: #fff; }

/* ---------- Albumgrid ---------- */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 8px 0 clamp(52px, 6.5vw, 84px);
}

.album-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.album-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.album-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(.95);
}

.album-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-family: var(--f-head);
  font-size: 44px;
  color: var(--accent);
  background: var(--surface-soft);
}

.album-meta { padding: 20px 22px 22px; }
.album-meta strong {
  display: block;
  font-family: var(--f-head);
  font-size: 20px;
  font-weight: 500;
}
.album-meta small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.album-meta p { margin: 10px 0 0; font-size: 14.5px; }

/* ---------- Fotogrid ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 8px 0 clamp(52px, 6.5vw, 84px);
}

.photo-cell { margin: 0; position: relative; }

.photo-cell img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  filter: saturate(.95);
  transition: border-color .18s ease, transform .18s ease;
}
.photo-cell img:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.delete-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 23, 15, .72);
  color: #fffdf7;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.delete-btn:hover { background: var(--danger); }

/* ---------- Uppladdning ---------- */

.upload-box {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 24px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}
.upload-box form { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lb-bg);
  backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none; }

.lb-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.lightbox button {
  position: absolute;
  width: 46px; height: 46px;
  border: 1px solid rgba(240, 239, 228, .2);
  border-radius: 50%;
  background: rgba(27, 31, 21, .85);
  color: #f0efe4;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease;
}
.lightbox button:hover { border-color: #cba85e; }

.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Admin ---------- */

.admin-panel {
  margin: 0 0 28px;
  padding: clamp(28px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.admin-panel h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }

.admin-form { display: grid; gap: 16px; max-width: 480px; }
.admin-form label { display: grid; gap: 7px; font-size: 14px; color: var(--muted); }
.admin-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.admin-form input:focus { border-color: var(--accent); outline: none; }
.admin-form .button { justify-self: start; }

.admin-album-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.admin-album-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-soft);
  border-radius: 11px;
}
.admin-album-list strong { font-family: var(--f-head); font-size: 18px; font-weight: 500; }
.admin-album-list .muted { flex: 1; }

/* ---------- Övrigt ---------- */

.empty-state {
  padding: clamp(48px, 7vw, 72px) 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  margin: 8px 0 clamp(52px, 6.5vw, 84px);
}
.empty-state h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 10px; }
.empty-state p { margin-bottom: 0; }

.footer {
  display: flex;
  justify-content: space-between;
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--fg); }

/* ---------- Responsivt ---------- */

@media (max-width: 640px) {
  .page-shell { width: min(100% - 28px, 1160px); }
  .nav { flex-direction: column; align-items: flex-start; gap: 16px; }
  .nav-right { width: 100%; justify-content: space-between; }
  .nav-links { gap: 18px; font-size: 14px; }
  .hero { padding-top: 32px; }
  h1 { font-size: clamp(2.4rem, 11vw, 3rem); }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
}
