/* =========================
   Design tokens
   ========================= */
:root {
  --color-page: #ffffff;
  --color-surface: #f8f1e7;
  --color-surface-soft: #f5ede3;
  --color-brand: #d2b48c;
  --color-brand-dark: #8b5e3b;
  --color-text: #4a2c2a;
  --color-text-muted: #625a54;
  --color-border: rgba(74, 44, 42, 0.2);
  --shadow-sm: 0 2px 8px rgba(74, 44, 42, 0.07);
  --shadow-md: 0 10px 24px rgba(74, 44, 42, 0.12);
  --radius-sm: 0.75rem;
  --radius-md: 1.125rem;
  --radius-lg: 1.5rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --container: 75rem;
  --text-measure: 60rem;
}

/* Base / reset */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--color-page);
  color: var(--color-text);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: clamp(1rem, 1vw, 1.0625rem);
  line-height: 1.65;
}

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

a {
  color: var(--color-brand-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover, a:focus-visible { color: var(--color-text); }

button, a { -webkit-tap-highlight-color: transparent; }

/* Accessibility */
.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: #fffdf9;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus { transform: translateY(0); color: #fffdf9; }

/* Typography */
h1, h2, h3 {
  margin: 0;
  color: var(--color-text);
  font-family: inherit;
  line-height: 1.15;
}

p, ul, ol { margin-top: 0; }

/* Global layout */
main {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 3vw, 1.5rem);
}

/* Shared cards and sections */
.main-section, .page-intro {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.main-section { padding: clamp(1.5rem, 4vw, 3.25rem); }

.main-section > p, .page-intro > p {
  width: 100%;
  max-width: none;
  margin-right: auto;
  color: var(--color-text-muted);
}

.main-section > p { margin-bottom: 1.25rem; }
.main-section > p:last-of-type, .page-intro > p { margin-bottom: 0; }

.main-section h1, .page-title, .kontakt-title {
  margin-bottom: var(--space-3);
  font-size: clamp(1.7rem, 2.5vw, 2.1rem);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.2;
  text-align: center;
}

.main-section h1::after, .page-title::after, .kontakt-title::after {
  display: block;
  width: 3.75rem;
  height: 0.1875rem;
  margin: 1rem auto 0;
  border-radius: 999px;
  background: var(--color-brand);
  content: "";
}

.section-title, .kennel-title {
  margin-bottom: var(--space-3);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 600;
}

.home-page .main-section > p,
.vår-historia > p,
.person-description p,
.planerade-kullar-text {
  hyphens: auto;
  text-align: justify;
  text-align-last: left;
}

.page-intro {
  padding: 0 0 var(--space-5);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive adjustments */
@media (min-width: 48rem) {
  main {
    padding-right: clamp(1.5rem, 4vw, 2.5rem);
    padding-left: clamp(1.5rem, 4vw, 2.5rem);
  }
}

@media (max-width: 30rem) {
  .main-section, .page-intro { border-radius: var(--radius-md); }
  .main-section { padding: 1.25rem; }
  .main-section h1, .page-title, .kontakt-title {
    font-size: clamp(1.55rem, 7vw, 1.8rem);
    font-weight: 600;
    line-height: 1.2;
  }

  .main-section h1::after, .page-title::after, .kontakt-title::after {
    width: 3rem;
    margin-top: 0.75rem;
  }

  .section-title, .kennel-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
  }
}

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