/* —— Base —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /*
   * Farge-mal — endre bare verdiene her for å oppdatere hele siden.
   * Under: original varm beige/kamel-palett.
   */
  --bg: #f9f4ee;
  --bg-elevated: #fffdf9;
  --accent: #b78463;
  --accent-soft: rgba(183, 132, 99, 0.14);
  --border: rgba(122, 92, 69, 0.2);
  --shadow: 0 14px 30px rgba(87, 61, 43, 0.08);
  --shadow-accent: 0 12px 28px rgba(122, 92, 69, 0.2);
  --font-sans: "Syne", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --space: clamp(1rem, 4vw, 2rem);
  --max: 72rem;

  /* Tekst (hierarki) */
  --text-primary: #3d2f26;
  --text-secondary: #7b6556;
  --text-tertiary: #9a8474;
  --text-on-accent: #fffef9;

  /* Tekstfelt / bokser */
  --field-bg: #fffdf7;
  --field-bg-muted: #faf6ef;
  --field-border: rgba(122, 92, 69, 0.28);
  --field-border-hover: rgba(183, 132, 99, 0.45);
  --field-text: var(--text-primary);
  --field-label: var(--text-secondary);
  --field-placeholder: rgba(61, 47, 38, 0.42);
  --field-focus-ring: rgba(183, 132, 99, 0.22);
  --field-radius: 10px;
  --surface-card: #ffffff;

  /* Bakoverkompatibilitet */
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: var(--space) clamp(1.25rem, 5vw, 3rem);
  background: linear-gradient(
    to bottom,
    var(--bg) 68%,
    color-mix(in srgb, var(--bg) 52%, transparent)
  );
  backdrop-filter: blur(8px);
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.admin-toggle {
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.admin-toggle:hover {
  color: var(--text-primary);
}

.admin-auth-panel {
  width: min(24rem, 100%);
  margin-left: auto;
  margin-top: 0.4rem;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.85rem;
}

.admin-auth-panel[hidden] {
  display: none;
}

@media (max-width: 1024px) {
  .admin-auth-panel {
    width: 100%;
    margin-left: 0;
  }
}

.admin-auth-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* —— Hero —— */
.hero {
  padding: clamp(3rem, 12vw, 8rem) clamp(1.25rem, 5vw, 3rem) clamp(4rem, 10vw, 7rem);
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.hero-kicker {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 9vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  font-style: italic;
  color: var(--text-muted);
}

.hero-lead {
  margin: 0 0 2.25rem;
  max-width: 32rem;
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-media img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  object-fit: cover;
  min-height: 280px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-accent);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

/* —— Sections —— */
.section {
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 5vw, 3rem);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.about,
.services,
.gallery {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  gap: 2rem;
}

.about-side {
  display: grid;
  gap: 1rem;
}

.about-side img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  .about-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

.about-text,
.services-intro,
.gallery-intro,
.contact-intro {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.about-tags {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-tags li {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.services-grid,
.gallery-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 760px) {
  .services-grid,
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.gallery-item,
.contact-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.service-card {
  padding: 1.25rem;
  background: var(--service-card-bg, var(--surface-card));
  border: 1px solid var(--service-card-border, var(--border));
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--service-card-title, var(--text-primary));
}

.service-card p {
  margin: 0;
  color: var(--service-card-text, var(--text-muted));
}

.gallery-item {
  margin: 0;
  padding: 0.75rem;
}

.gallery-item img {
  width: 100%;
  border-radius: 10px;
  min-height: 180px;
  object-fit: cover;
}

.droppable-image.drop-ready {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.gallery-item figcaption {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.gallery-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--field-bg-muted);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* —— Contact —— */
.contact-inner {
  text-align: center;
}

.contact-intro {
  margin: 0 auto 2.25rem;
  max-width: 32rem;
}

.contact-cards {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  margin: 0 auto;
}

@media (min-width: 560px) {
  .contact-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-card:hover {
  border-color: var(--field-border-hover);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-value {
  font-size: 0.9375rem;
  font-weight: 500;
  word-break: break-word;
  text-align: center;
}

/* —— Footer —— */
.site-footer {
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.btn-secondary {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  background: var(--surface-card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.editor-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 999;
  display: grid;
  gap: 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.editor-panel[hidden] {
  display: none;
}

@media (max-width: 1024px) {
  .editor-panel {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
  }
}

.editor-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.editor-active .is-editable {
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
  padding: 0.1rem;
}

.editor-active .sortable-item {
  cursor: move;
}

.sortable-item.dragging {
  opacity: 0.6;
}

.auth-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.auth-field > span {
  color: var(--field-label);
  font-size: 0.85rem;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--field-text);
  background: var(--field-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
  color: var(--field-placeholder);
}

.auth-field input:hover {
  border-color: var(--field-border-hover);
}

.auth-field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--field-focus-ring);
}

.auth-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.auth-error {
  color: #9b2f2f !important;
  min-height: 1.1rem;
}
