/* Kaffekroken – fiktiv kafé i Gjøvik (porteføljeeksempel) */

:root {
  --cream: #f6efe4;
  --paper: #fbf6ee;
  --latte: #eadccb;
  --foam: #fff9f2;
  --ink: #2a1c14;
  --ink-soft: #5c4638;
  --espresso: #3d2a20;
  --espresso-deep: #241610;
  --coffee: #6b3e2a;
  --caramel: #8a4518;
  --caramel-hover: #6f3612;
  --line: #dccbb8;
  --open: #1b4f34;
  --open-bg: #e1efe6;
  --closed: #7a3222;
  --closed-bg: #f3e2da;
  --focus: #6b3e2a;
  --header-h: 4.25rem;
  --wrap: 70rem;
  --radius: 1rem;
  --shadow: 0 0.75rem 2rem rgba(42, 28, 20, 0.08);
  --font-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-sans: "Karla", "Segoe UI", Tahoma, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--coffee);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--caramel);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--espresso);
  color: var(--foam);
  text-decoration: none;
  border-radius: 0.4rem;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--foam);
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(100% - 2rem, 42rem);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 239, 228, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--espresso);
  text-decoration: none;
  min-width: 0;
}

.logo:hover {
  color: var(--caramel);
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.logo-word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.header-status {
  display: none;
}

.nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  color: var(--espresso);
  border-radius: 0.4rem;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  margin: 0 auto;
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--espresso);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--caramel);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
}

@media (max-width: 47.99rem) {
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1.25rem;
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav li + li {
    border-top: 1px solid var(--line);
  }

  .site-nav a {
    display: block;
    padding: 0.9rem 0.25rem;
  }
}

@media (min-width: 48rem) {
  .nav-toggle {
    display: none;
  }

  .header-status {
    display: inline-flex;
    margin-left: auto;
    margin-right: 1.25rem;
  }

  .site-nav ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }

  .site-nav a {
    padding: 0.25rem 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn-accent {
  background: var(--caramel);
  color: #fffaf4;
  border-color: var(--caramel);
}

.btn-accent:hover {
  background: var(--caramel-hover);
  border-color: var(--caramel-hover);
  color: #fffaf4;
}

.btn-ghost {
  background: rgba(20, 12, 8, 0.45);
  color: #fffaf4;
  border-color: rgba(255, 249, 242, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.btn-ghost:hover {
  background: rgba(20, 12, 8, 0.7);
  color: #fffaf4;
}

.btn-dark {
  background: var(--espresso);
  color: var(--foam);
  border-color: var(--espresso);
}

.btn-dark:hover {
  background: var(--espresso-deep);
  color: var(--foam);
}

/* Open / closed badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.status-badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.is-open {
  background: var(--open-bg);
  color: var(--open);
}

.status-badge.is-closed {
  background: var(--closed-bg);
  color: var(--closed);
}

.status-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1rem;
}

.status-detail {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 28rem;
  color: var(--foam);
  isolation: isolate;
  display: flex;
  align-items: flex-end;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 12, 8, 0.72) 0%, rgba(20, 12, 8, 0.42) 48%, rgba(20, 12, 8, 0.18) 100%),
    linear-gradient(180deg, rgba(20, 12, 8, 0.35) 0%, rgba(20, 12, 8, 0.28) 30%, rgba(20, 12, 8, 0.88) 100%);
}

.hero-copy {
  width: min(100% - 2rem, var(--wrap));
  margin: 0 auto;
  padding: 4.5rem 0 2.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe8c8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 3px 12px rgba(0, 0, 0, 0.4);
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fffaf4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 4px 18px rgba(0, 0, 0, 0.45);
}

.hero-lead {
  margin: 0 0 1.4rem;
  max-width: 34rem;
  font-size: 1.15rem;
  color: #fff6ea;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 3px 14px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (min-width: 48rem) {
  .hero {
    min-height: 36rem;
  }

  .hero-copy {
    padding: 7rem 0 3.5rem;
  }
}

/* Sections */
.section {
  padding: 3.25rem 0;
}

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

.section-dark {
  background: var(--espresso-deep);
  color: var(--foam);
}

.section-label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coffee);
}

.section-dark .section-label {
  color: #e0c3a4;
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.5vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede,
.prose p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.prose p:last-child {
  margin-bottom: 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

/* Disken i dag */
.cake-card {
  display: grid;
  gap: 1.5rem;
  background: var(--foam);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.cake-card img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
}

.cake-body {
  padding: 0 1.5rem 1.5rem;
}

.cake-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.cake-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.cake-price {
  font-weight: 700;
  color: var(--caramel);
}

@media (min-width: 48rem) {
  .cake-card {
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch;
  }

  .cake-card img {
    height: 100%;
    min-height: 18rem;
  }

  .cake-body {
    padding: 2rem 2rem 2rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* About / media */
.split {
  display: grid;
  gap: 1.5rem;
}

.split img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 48rem) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
  }

  .split img {
    height: 22rem;
  }

  .split.reverse img {
    order: -1;
  }
}

.photo-grid {
  display: grid;
  gap: 0.75rem;
}

.photo-grid img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 40rem) {
  .photo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

figcaption,
.credit {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Hours teaser / table */
.hours-preview {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .hours-preview {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--foam);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}

.hours-table th {
  font-weight: 600;
}

.hours-table tr:last-child th,
.hours-table tr:last-child td {
  border-bottom: 0;
}

.hours-table tr.is-today {
  background: #f3e6d4;
}

.hours-table tr.is-today th {
  font-weight: 700;
}

/* Menu */
.menu-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
}

.menu-nav a {
  display: inline-flex;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--foam);
  border: 1px solid var(--line);
  color: var(--espresso);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.menu-nav a:hover,
.menu-nav a:focus-visible {
  background: var(--espresso);
  color: var(--foam);
  border-color: var(--espresso);
}

.menu-block {
  margin-bottom: 2.75rem;
}

.menu-block-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.menu-block-head img {
  width: 100%;
  height: 11rem;
  object-fit: cover;
  border-radius: var(--radius);
}

.menu-block h2 {
  margin: 0 0 0.35rem;
}

@media (min-width: 48rem) {
  .menu-block-head {
    grid-template-columns: 12rem 1fr;
    align-items: center;
    gap: 1.5rem;
  }

  .menu-block-head img {
    height: 8.5rem;
  }
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.menu-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.menu-list li:last-child {
  border-bottom: 0;
}

.menu-item {
  font-weight: 600;
  color: var(--ink);
}

.menu-desc {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.menu-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--coffee);
  white-space: nowrap;
}

.menu-note {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* Map */
.map-card {
  margin: 0;
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-card img {
  width: 100%;
  height: 16rem;
  object-fit: cover;
  object-position: center;
}

.map-card figcaption {
  padding: 0.85rem 1.1rem 1.1rem;
}

@media (min-width: 48rem) {
  .map-card img {
    height: 22rem;
  }
}

.address-block {
  margin: 0 0 1.5rem;
}

.address-block p {
  margin: 0.15rem 0;
}

/* Forms */
.form {
  display: grid;
  gap: 1rem;
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .form-row.two {
    grid-template-columns: 1fr 1fr;
  }
}

.field label,
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field input:user-invalid,
.field textarea:user-invalid,
.field select:user-invalid,
.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: var(--closed);
}

.field-error {
  display: none;
  margin: 0.35rem 0 0;
  color: var(--closed);
  font-size: 0.95rem;
}

.field.is-invalid .field-error {
  display: block;
}

.form-status[data-visible="true"] {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--closed-bg);
  color: var(--closed);
}

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

/* Simple pages (thanks / 404) */
.simple-page {
  min-height: calc(100vh - 14rem);
  display: flex;
  align-items: center;
  padding: 3rem 0;
}

.simple-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

/* Footer */
.site-footer {
  background: var(--espresso-deep);
  color: #f0e2d3;
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

.site-footer h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--foam);
}

.site-footer a {
  color: #f0e2d3;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer p {
  margin: 0.2rem 0;
}

.footer-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(240, 226, 211, 0.18);
  font-size: 0.85rem;
  color: #cbb6a2;
}

.footer-note p {
  margin: 0.25rem 0;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

/* Small helpers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.section-cta { margin-top: 1.5rem; }

.page-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  margin: 0 0 0.85rem;
}

.hero-status .status-detail {
  color: #fff6ea;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 3px 12px rgba(0, 0, 0, 0.4);
}

@media (min-width: 48rem) {
  .hero-status {
    display: none;
  }
}
