/* ---- Design tokens: fargevalg og fonter fra Claude Design ("Organic") ---- */
@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:wght@400;600;700&display=swap');

:root {
  --green-dark: #201e1d;
  --green: #c67139;
  --green-light: #7a8a5e;
  --green-bg: #ebddc5;
  --cream: #f5ead8;
  --text: #201e1d;
  --text-muted: #57534e;
  --border: color-mix(in srgb, #201e1d 16%, transparent);
  --radius: 16px;
  --radius-lg: 32px;
  --shadow: 0 8px 24px rgba(32, 30, 29, 0.12);
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Caprasimo", var(--font);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--green); }

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--green-dark);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
}

p { margin: 0 0 1rem; color: var(--text-muted); }

.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 234, 216, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  height: 28px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  gap: 1.5rem;
}
.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.nav a:hover { color: var(--green); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--green-dark);
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
}

/* ---- Hero (uten bilde — ingen fullførte oppdrag å vise frem enda) ---- */
.hero {
  background: linear-gradient(180deg, var(--green-bg), var(--cream));
  padding: 4.5rem 0;
  text-align: center;
}
.hero-inner {
  display: flex;
  justify-content: center;
}
.hero-text { max-width: 640px; }
.hero-text h1 { text-wrap: balance; }
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--green-dark);
}
.btn-secondary:hover { background: var(--green-bg); }
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.85rem; align-self: flex-start; }

/* ---- Sections ---- */
.section { padding: 4rem 0; }
.section-alt { background: var(--green-bg); }
.section-lead { max-width: 640px; }
.section-lead-center { margin: 0 auto 1.5rem; text-align: center; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 1rem; }

/* ---- Services ---- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.service-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--green-bg);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.service-card h3 { margin-bottom: 0.4rem; }
.service-card p { margin: 0; }

/* ---- Kalender (delt mellom forside og admin) ---- */
.calendar {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal-title { font-weight: 700; color: var(--green-dark); }
.cal-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--green-dark);
}
.cal-nav:hover { background: var(--green-bg); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekdays { margin-bottom: 4px; }
.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.cal-cell { aspect-ratio: 1; }
.cal-day {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}
.cal-day.cal-free { background: #eef1e6; border-color: #cdd6b8; }
.cal-day.cal-free-eve { background: #fdf6ea; border-color: #e3d4ac; }
.cal-day.cal-free-full { background: #a9c47e; border-color: #7f9c57; color: #1f3009; font-weight: 700; }
.cal-day.cal-busy { background: #f7e2d3; border-color: #e6b78e; color: #8a4a1f; }
.cal-day.cal-past { background: #f2ede3; border-color: #e3dccb; color: #b3aa9a; cursor: default; }
.cal-day.cal-today { outline: 2px solid var(--green); outline-offset: 1px; }
.cal-day.cal-selected { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.cal-day:disabled { cursor: default; }
.cal-day:not(:disabled):hover { transform: translateY(-1px); }
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cal-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.cal-dot.cal-free { background: #cdd6b8; }
.cal-dot.cal-free-eve { background: #fdf6ea; border: 1px solid #e3d4ac; }
.cal-dot.cal-free-full { background: #a9c47e; }
.cal-dot.cal-busy { background: #e6b78e; }

/* ---- About ---- */
.about-inner { max-width: 720px; }
.about-body {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}
@media (max-width: 600px) {
  .about-body { flex-direction: column; align-items: center; }
  .about-photo { width: 120px; height: 120px; }
}

/* ---- Kontakt ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
  /* Kontaktinfoen (telefon/e-post/område) er raskere å bruke enn å fylle ut
     hele formularet på mobil, så vis den først. */
  .contact-info-card { order: -1; }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-row label { font-weight: 600; font-size: 0.9rem; }
.form-row input,
.form-row textarea,
.form-row select {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}
.form-row textarea { border-radius: var(--radius); }
.calendar-compact {
  max-width: 280px;
  margin: 0.6rem 0 0;
  padding: 0.85rem;
  box-shadow: none;
  border-radius: var(--radius);
}
.calendar-compact .cal-title { font-size: 0.85rem; }
.calendar-compact .cal-nav { width: 1.6rem; height: 1.6rem; font-size: 0.95rem; }
.calendar-compact .cal-day { font-size: 0.75rem; }
.calendar-compact .cal-weekday { font-size: 0.65rem; }
.calendar-compact .cal-legend { font-size: 0.7rem; gap: 0.75rem; margin-top: 0.5rem; }
.date-selected-label { font-weight: 700; color: var(--green-light); margin: 0.6rem 0 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.date-selected-label[hidden] { display: none; }
.date-clear-btn { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 0; line-height: 1; }
.date-clear-btn:hover { color: #b3261e; }
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: 2px solid var(--green-light);
  outline-offset: 1px;
}
.form-status { font-weight: 600; min-height: 1.4em; }
.form-status.success { color: var(--green-light); }
.form-status.error { color: #b3261e; }

.form-row input.field-invalid { border-color: #b3261e; outline-color: #b3261e; }
.field-error { color: #b3261e; font-size: 0.85rem; font-weight: 600; margin: 0; }
.field-error[hidden] { display: none; }

.contact-info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) * 1.15);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  align-self: start;
}
.contact-info-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1rem;
}
.contact-info-card dt { font-weight: 700; color: var(--green-dark); }
.contact-info-card dd { margin: 0; color: var(--text-muted); }
.contact-info-card a { text-decoration: none; font-weight: 600; }

/* ---- Footer ---- */
.site-footer {
  background: var(--green-dark);
  color: #f1e9db;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer p { color: inherit; margin: 0; }
.site-footer a { color: inherit; }
.footer-org { margin-top: .35rem !important; font-size: .8rem; opacity: .7; }

/* ---- Toast-varsling ---- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--green-dark);
  color: #f5ead8;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green);
  max-width: 320px;
  opacity: 0;
  transform: translateX(16px);
  animation: toast-in 0.22s ease forwards, toast-out 0.22s ease 2.8s forwards;
}
.toast.error { border-left-color: #b3261e; }
.toast.success { border-left-color: #4a7c59; }
@keyframes toast-in {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(16px); }
}
