/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:   #f5f0e8;
  --warm:    #ede5d8;
  --sand:    #c8b49a;
  --brown:   #7a5c44;
  --dark:    #2e2118;
  --text:    #3d2e22;
  --muted:   #7a6a5a;
  --vipps:   #ff5b24;
  --vipps-h: #e04d1a;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --max: 1100px;
  --gap: 2rem;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
}

img { display: block; max-width: 100%; }
a { color: var(--brown); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header / nav ── */
header {
  background: var(--cream);
  border-bottom: 1px solid var(--sand);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.logo {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.01em;
}

nav a {
  font-size: 0.95rem;
  color: var(--muted);
  margin-left: 1.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

nav a:hover { color: var(--brown); text-decoration: none; }

/* ── Hero ── */
.hero {
  position: relative;
  width: 100%;
  height: clamp(300px, 45vw, 700px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
}

.hero-text h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-text p {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
  .hero-text {
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 100%);
  }
  .hero-text h1 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  .hero-text p {
    font-size: 0.85rem;
  }
}

/* ── Sections ── */
section { padding: 4rem 2rem; }

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

.section-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 2.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--sand);
}

/* ── Book grid ── */
#boker { background: var(--warm); }

.book-category {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  font-style: italic;
  color: var(--brown);
  margin: 2.5rem 0 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--sand);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(60,30,10,.07);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(60,30,10,.12);
}

.book-cover {
  background: var(--sand);
  aspect-ratio: 1746 / 2126;
  overflow: hidden;
}

.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--brown);
  text-align: center;
  padding: 1rem;
}

.book-info {
  padding: 1rem 1rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.book-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

.book-author {
  font-size: 0.85rem;
  color: var(--muted);
}

.book-translator {
  font-size: 0.8rem;
  color: var(--sand);
  font-style: italic;
}

.book-price {
  font-size: 0.9rem;
  color: var(--brown);
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn-vipps {
  margin-top: 0.8rem;
  display: inline-block;
  background: var(--vipps);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s;
}

.btn-vipps:hover { background: var(--vipps-h); text-decoration: none; color: #fff; }

/* ── Om forlaget ── */
#om .om-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

#om p { max-width: 60ch; color: var(--muted); margin-bottom: 1rem; }
#om p:last-child { margin-bottom: 0; }

.om-meta {
  background: var(--warm);
  border-radius: 6px;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 2;
}

.om-meta strong { color: var(--dark); }

/* ── Bestilling ── */
#bestilling { background: var(--warm); }

.bestilling-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.bestilling-grid p { color: var(--muted); margin-bottom: 1rem; }

.vipps-box {
  background: var(--cream);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(60,30,10,.07);
  text-align: center;
}

.vipps-box h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--dark);
}

.vipps-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--vipps);
  margin: 0.5rem 0 1rem;
  letter-spacing: 0.05em;
}

.vipps-box p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0;
}

.vipps-logo {
  width: 80px;
  margin: 0 auto 1rem;
}

.btn-primary {
  display: inline-block;
  background: var(--brown);
  color: #fff;
  border-radius: 4px;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background .15s;
  margin-top: 1rem;
}

.btn-primary:hover { background: var(--dark); text-decoration: none; color: #fff; }

/* ── Kontakt ── */
#kontakt .kontakt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

.kontakt-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kontakt-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sand);
  font-weight: 600;
}

.kontakt-value {
  font-size: 1rem;
  color: var(--dark);
}

/* ── Vipps-modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(46, 33, 24, 0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--cream);
  border-radius: 10px;
  padding: 2.5rem 2.5rem 2rem;
  max-width: 380px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.modal-close:hover { color: var(--dark); }

.modal-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sand);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.modal-vipps-nr {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--vipps);
  letter-spacing: 0.06em;
  margin: 0.2rem 0 1rem;
}

.modal-book-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 1rem;
  font-style: italic;
}

.modal-instructions {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Footer ── */
footer {
  background: var(--dark);
  color: var(--sand);
  text-align: center;
  padding: 2rem;
  font-size: 0.82rem;
}

footer a { color: var(--sand); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 3rem 1.5rem; }
  .hero-img { display: none; }
  #om .om-grid { grid-template-columns: 1fr; }
  .bestilling-grid { grid-template-columns: 1fr; }
  section { padding: 3rem 1.5rem; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 1rem 1.2rem; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
