/* ==========================================================================
   nilssons.nu — modern nordisk design
   ========================================================================== */

/* Respektera besökarens systeminställning för minimal rörelse */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  --color-bg: #faf9f6;
  --color-bg-alt: #f1efe8;
  --color-surface: #ffffff;
  --color-text: #1f1e1c;
  --color-text-muted: #6f6a62;
  --color-border: #e5e1d8;

  --color-accent: #37503f;
  --color-accent-hover: #2a3d30;
  --color-accent-soft: #e8ede8;

  --color-ink: #22261f;
  --color-ink-soft: #f4ede3;
  --color-clay: #b7674a;
  --color-clay-soft: #f3e4dc;

  --tile-moss: #4b6355;
  --tile-clay: #a9654a;
  --tile-ink: #2a3140;
  --tile-stone: #857f72;
  --tile-sand: #b7965f;

  --color-success: #2f6b45;
  --color-success-bg: #e7f1e9;
  --color-error: #a3402f;
  --color-error-bg: #f7eae7;

  --radius: 10px;
  --radius-lg: 20px;
  --radius-bento: 28px;
  --shadow-soft: 0 8px 30px rgba(31, 30, 28, 0.06);
  --shadow-bento: 0 14px 40px rgba(31, 30, 28, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Mörkt läge ---- */

[data-theme="dark"] {
  --color-bg: #1c1e1a;
  --color-bg-alt: #242621;
  --color-surface: #262822;
  --color-text: #f2f0ea;
  --color-text-muted: #a19c8f;
  --color-border: #3a3c34;

  --color-accent: #4a7358;
  --color-accent-hover: #5c8a6a;
  --color-accent-soft: #24312a;

  --color-ink: #2f4739;
  --color-ink-soft: #3a3226;
  --color-clay-soft: #3d2a22;

  --color-success: #8fd19e;
  --color-success-bg: #1f3327;
  --color-error: #e8a08c;
  --color-error-bg: #3a2420;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-bento: 0 14px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .site-header {
  background: rgba(28, 30, 26, 0.7);
}

[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(28, 30, 26, 0.92);
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

body > .site-footer {
  flex-shrink: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.18;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

h1 { font-weight: 300; }

p {
  margin: 0 0 1em;
}

.eyebrow {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* ---- Publik header / nav ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 249, 246, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.site-header.is-scrolled {
  background: rgba(250, 249, 246, 0.92);
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.logo {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text);
  display: flex;
  align-items: center;
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
}

.logo-dot {
  color: var(--color-accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.main-nav a {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-text);
}

.main-nav a.active {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.main-nav a.portal-link {
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.main-nav a.portal-link:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

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

.hero {
  padding: 96px 0 100px;
  background: var(--color-bg);
}

.hero.has-image {
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 620px;
  display: flex;
  align-items: center;
  position: relative;
}

.hero.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 22, 20, 0.68) 0%, rgba(20, 22, 20, 0.28) 100%);
}

.hero.has-image .container {
  position: relative;
  z-index: 1;
}

.hero.has-image .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.hero.has-image h1 {
  color: #fff;
}

.hero.has-image .hero-subtitle {
  color: rgba(255, 255, 255, 0.82);
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  max-width: 720px;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* ---- Hero: fullbild, centrerad ---- */

.hero-center {
  min-height: 640px;
  text-align: center;
  justify-content: center;
}

.hero-center::before {
  background: linear-gradient(180deg, rgba(20, 22, 20, 0.35) 0%, rgba(20, 22, 20, 0.62) 100%);
}

.hero-center h1 {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero-center .hero-subtitle {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-center .hero-actions {
  justify-content: center;
}

/* ---- Hero: kompakt banderoll (projekt-/blogginlägg) ---- */

.hero.has-image.hero-center.hero-compact {
  min-height: 340px;
  padding: 56px 0;
}

.hero-compact h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

/* ---- Teaser-rad (Om oss / Familjeportal) ---- */

.teaser-row {
  padding: 64px 0;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.teaser-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.teaser-card:hover {
  border-color: #d7d2c5;
  transform: translateY(-2px);
  text-decoration: none;
}

.teaser-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.25em;
}

.teaser-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.teaser-card-dark {
  background: var(--color-ink);
  color: #fff;
  border-color: transparent;
}

.teaser-card-dark .eyebrow {
  color: rgba(255, 255, 255, 0.5);
}

.teaser-card-dark h3 {
  color: #fff;
}

.teaser-card-dark p {
  color: rgba(255, 255, 255, 0.7);
}

.teaser-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.teaser-card:hover .teaser-arrow {
  opacity: 0.9;
  transform: translate(2px, -2px);
}

@media (max-width: 780px) {
  .teaser-grid {
    grid-template-columns: 1fr;
  }
}

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

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 13px 26px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-text);
}

.hero.has-image .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.hero.has-image .btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.78rem;
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}

.link-danger {
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
}

.inline-form {
  display: inline;
}

/* ---- Sektioner ---- */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.page-header {
  padding: 72px 0 12px;
}

.page-header-center {
  text-align: center;
}

.page-header-center h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: 1.02rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Projektsida ---- */

.hero.has-image .back-link {
  color: rgba(255, 255, 255, 0.72);
}

.hero.has-image .back-link:hover {
  color: #fff;
}

.project-hero-top {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: left;
}

.project-hero-top p {
  margin: 0 0 12px;
}

.project-hero-top .eyebrow {
  margin-bottom: 0;
}

@media (max-width: 780px) {
  .project-hero-top {
    top: 24px;
  }
}

.project-card {
  padding: 0;
}

.share-btn {
  justify-self: start;
}

.comments-heading {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.comment-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.comment-meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.comment-body {
  margin: 0;
}

.gallery-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 20px;
}


.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}

.section-header h2 {
  font-size: 1.7rem;
  margin-bottom: 0;
}

.section-header a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-clay);
  white-space: nowrap;
}

.empty-state {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  padding: 32px;
  text-align: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.back-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.back-link:hover {
  color: var(--color-text);
}

/* ---- Senaste-rad (startsidan) ---- */

.latest-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.latest-column .section-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 24px;
}

.latest-column .section-header h2 {
  border-left: 3px solid var(--color-clay);
  padding-left: 14px;
}

@media (max-width: 780px) {
  .latest-columns {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ---- Kortnät (Projekt/Blogg) ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: start;
  gap: 28px;
}

.card-grid-tight {
  grid-template-columns: 1fr;
  gap: 20px;
}

.card-grid-tight .card {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: stretch;
}

/* Bildwrappern har inget eget innehåll som påverkar radens höjd - bara
   textkolumnen (card-body) styr hur hög raden blir. Bilden fylls sedan ut
   wrappern med absolut positionering, oavsett bildens egna proportioner. */
.card-grid-tight .card-image-wrap,
.card-grid-tight .card-tile {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.card-grid-tight .card-image-wrap .card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-grid-tight .card-body {
  padding: 20px 24px;
}

@media (max-width: 480px) {
  .card-grid-tight .card {
    grid-template-columns: 1fr;
  }

  .card-grid-tight .card-image-wrap,
  .card-grid-tight .card-tile {
    width: 100%;
    height: 160px;
  }
}

.card {
  display: block;
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-bento);
  transform: translateY(-3px);
  text-decoration: none;
}

.card-image {
  display: block;
  width: 100%;
  height: 190px;
  background-color: var(--color-bg-alt);
  object-fit: cover;
  object-position: center;
}

.card-tile {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-tile span {
  font-size: 2.6rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
}

.tile-moss { background: var(--tile-moss); }
.tile-clay { background: var(--tile-clay); }
.tile-ink { background: var(--tile-ink); }
.tile-stone { background: var(--tile-stone); }
.tile-sand { background: var(--tile-sand); }

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.12rem;
  font-weight: 500;
  margin-bottom: 0.35em;
}

.card-body p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0.4em 0 0;
}

.card-body .card-meta {
  color: var(--color-clay);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---- Om oss / artikel-layout ---- */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
}

.about-layout-solo {
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
}

.article {
  display: grid;
  gap: 32px;
  max-width: 760px;
}

.about-image img,
.article-image img {
  border-radius: var(--radius-lg);
}

.article-image-header {
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.article-image-header img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.article-body,
.about-text {
  color: var(--color-text);
  font-size: 1.04rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
  gap: 16px;
  margin-top: 8px;
}

.project-gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.project-gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-gallery-item:hover img {
  transform: scale(1.04);
}

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

body.lightbox-open {
  overflow: hidden;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 20, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 100;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 4px 10px;
}

.lightbox-close:hover {
  opacity: 1;
}

@media (max-width: 600px) {
  .lightbox-overlay {
    padding: 20px;
  }
}

@media (max-width: 780px) {
  .article-image-header,
  .article-image-header img {
    max-height: 280px;
    height: 280px;
  }
}

@media (max-width: 780px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ---- Portal-sida ---- */

.portal-hero {
  background: var(--color-accent);
  color: #fff;
  padding: 110px 0;
  text-align: center;
}

.portal-hero .eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.portal-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 2.8rem);
  max-width: 620px;
  margin: 0 auto 0.5em;
}

.portal-hero p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  margin: 0 auto 2em;
  font-size: 1.05rem;
}

.portal-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  max-width: 720px;
  margin: 48px auto 0;
  text-align: left;
}

.portal-feature {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.portal-feature h3 {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.portal-feature p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  margin: 0;
}

.portal-hero .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.portal-hero .btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Formulär ---- */

.admin-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 14px;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="file"],
.admin-form textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.admin-form textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 500 !important;
}

.field-hint {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin: 2px 0 0;
}

.current-image img {
  max-width: 220px;
  border-radius: 6px;
  margin: 6px 0;
}

.gallery-manage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 8px 0 14px;
}

.gallery-manage-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}

.gallery-manage-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.gallery-manage-item label {
  display: block;
  font-size: 0.75rem;
  text-align: left;
  margin-bottom: 2px;
  color: var(--color-text-muted);
}

.gallery-manage-item input[type="text"] {
  width: 100%;
  font-size: 0.82rem;
  padding: 5px 8px;
  margin-bottom: 8px;
}

.gallery-delete-label {
  justify-content: center !important;
  font-size: 0.78rem !important;
  color: var(--color-error);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form {
  margin-top: 8px;
}

/* ---- Flash-meddelanden ---- */

.flash {
  padding: 13px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.flash-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.flash-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* ---- Footer (publikt) ---- */

.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 32px 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-text);
}

/* ---- Mobil ---- */

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

  #site-header {
    /* backdrop-filter skapar ett nytt "containing block" för
       position:fixed-barn, vilket gör att mobilmenyn nedan annars
       klipps till headerns egen (låga) höjd istället för hela
       skärmen. Stäng av det på mobil så menyn positioneras mot
       viewporten som den ska. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .main-nav {
    position: fixed;
    inset: 72px 0 0 0;
    z-index: 25;
    background: var(--color-bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 32px 28px;
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .main-nav a {
    width: 100%;
    padding: 14px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
  }

  .main-nav a.portal-link {
    margin-top: 12px;
    text-align: center;
    border: 1px solid var(--color-accent);
  }

  body.nav-open {
    overflow: hidden;
  }

  .header-inner {
    height: 72px;
  }

  .logo-img {
    height: 30px;
  }

  .section {
    padding: 56px 0;
  }

  .page-header {
    padding: 48px 0 8px;
  }

  .hero {
    padding: 64px 0 72px;
  }

  .hero.has-image {
    min-height: 480px;
  }

  .hero.has-image.hero-center.hero-compact {
    min-height: 260px;
  }

  .hero-logo {
    max-width: 380px;
  }
}

/* ==========================================================================
   Admin-panel
   ========================================================================== */

.login-body {
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}

.login-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-soft);
}

.login-box h1 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.2em;
}

.login-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.login-box form {
  display: flex;
  flex-direction: column;
}

.login-box label {
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 16px;
}

.login-box input {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
}

.login-box input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.back-link.standalone {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.85rem;
}

.admin-body {
  margin: 0;
  background: var(--color-bg-alt);
  font-family: var(--font);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 232px;
  background: var(--color-accent);
  color: #fff;
  padding: 28px 0;
  flex-shrink: 0;
}

.admin-logo {
  font-weight: 500;
  padding: 0 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 12px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
}

.admin-nav a {
  color: rgba(255, 255, 255, 0.75);
  padding: 11px 24px;
  font-size: 0.9rem;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.admin-nav hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 12px 24px;
}

.admin-content {
  flex: 1;
  padding: 40px 44px;
  max-width: 980px;
}

.admin-content h1 {
  font-size: 1.5rem;
  font-weight: 500;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card:hover {
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.stat-number {
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-accent);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.admin-table th {
  background: var(--color-bg-alt);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-actions {
  display: flex;
  gap: 14px;
}

/* ---- Kontaktmeddelanden ---- */

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.message-card.unread {
  border-left: 3px solid var(--color-accent);
}

.message-meta {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.badge {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 8px;
}

.message-body {
  margin: 0 0 10px;
}

.message-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 720px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
  }

  .admin-content {
    padding: 28px 20px;
  }
}
