/* ==========================================================================
   Books and Coffee — stils. Mobile-first.
   Gaišs: silti balts fons, tumšs teksts, misiņa zelts (pēc veikala lūguma).
   --ivory = galvenā teksta krāsa, --gold-light = zelts tekstam (tumšāks, lai labi lasās).
   ========================================================================== */

:root {
  --bg: #FBF8F2;
  --bg-2: #F3EDE2;
  --panel: #EAE2D3;
  --ivory: #2A2621;
  --muted: #6B6253;
  --gold: #8F6C2F;
  --gold-light: #75561F;
  --line: rgba(143, 108, 47, 0.35);
  --line-soft: rgba(42, 38, 33, 0.12);
  --velvet: #2E4A3B;
  --error: #B3261E;

  --display: "Gloock", Georgia, "Times New Roman", serif;
  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;

  --gutter: 1.25rem;
  --header-h: 3.75rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.08; }
h2 { font-size: clamp(2.1rem, 8vw, 3.2rem); }

.script { font-family: var(--script); font-weight: 400; color: var(--gold); }

p { margin: 0 0 1rem; }

a { color: var(--gold-light); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--ivory); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--gold); color: var(--bg);
}
.skip-link:focus { top: 0.5rem; color: var(--bg); }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

[hidden] { display: none !important; }

/* ---------- Pogas: taisnstūri ar zelta malu ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 3rem; padding: 0.75rem 1.5rem;
  border: 1px solid var(--gold); border-radius: 0;
  font: 600 0.8rem/1.2 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--bg); }
.btn-line { background: transparent; color: var(--gold-light); }
.btn-line:hover { background: var(--gold); color: var(--bg); }
.btn-small { min-height: 2.5rem; padding: 0.5rem 0.9rem; font-size: 0.72rem; background: transparent; color: var(--gold-light); }
.btn-small:hover { background: var(--gold); color: var(--bg); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Galvene ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); }

.logo {
  font: 400 1.35rem/1 var(--display);
  color: var(--ivory); text-decoration: none; white-space: nowrap;
}
.logo .script { font-size: 1.35em; margin: 0 0.05em; position: relative; top: 0.06em; }
.logo:hover { color: var(--ivory); }

.header-actions { display: flex; align-items: center; gap: 0.25rem; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; margin-right: -0.6rem;
  background: none; border: 0; color: var(--ivory); cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 1.3rem; height: 1px; background: currentColor; transition: transform 0.2s;
}
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0.75rem var(--gutter) 1.5rem; text-align: center; }
.site-nav a {
  display: block; padding: 0.7rem 0;
  font: 400 1.75rem/1.2 var(--display); color: var(--ivory); text-decoration: none;
}
.site-nav a:hover { color: var(--gold-light); }

/* ---------- Sākums ---------- */

.hero { padding: 2.5rem 0 3.5rem; text-align: center; }

.eyebrow {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 0 auto 1.5rem; max-width: 36rem;
  font: 500 0.7rem/1.4 var(--sans); letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before, .eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.eyebrow span { flex: 0 1 auto; }

.wordmark {
  display: flex; flex-direction: column; align-items: center;
  font-size: clamp(3.6rem, 19vw, 8.5rem); line-height: 0.88;
  letter-spacing: -0.01em;
}
.wm-and { font-size: 0.62em; line-height: 0.7; margin: 0.02em 0 0.08em; }

.hero-lead { max-width: 30rem; margin: 1.75rem auto 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1.75rem; }

.hero-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
  margin-top: 2.75rem;
}
.hg { margin: 0; position: relative; }
.hg img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel); }
.hg-main { grid-column: 1 / -1; }
.hg-main img { aspect-ratio: 4 / 3; }
/* plāns zelta rāmis kā gleznai */
.hg::after {
  content: ""; position: absolute; inset: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  pointer-events: none;
}
.hg img { animation: hero-in 1s ease-out both; }
.hg:nth-child(2) img { animation-delay: 0.12s; }
.hg:nth-child(3) img { animation-delay: 0.24s; }
/* Vienīgā animācija: foto parādās ielādējot */
@keyframes hero-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sadaļas ---------- */

.section { padding: 4.5rem 0; }
.section-raised { background: var(--bg-2); }

.section-head { text-align: center; max-width: 36rem; margin: 0 auto 2.25rem; }
.section-head p { color: var(--muted); margin: 0; }

.ornament {
  display: flex; align-items: center; gap: 1.4rem;
  width: 9rem; margin: 1rem auto 1.1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0l5 5-5 5-5-5z' fill='%23C9A45C'/%3E%3C/svg%3E") center / 0.55rem no-repeat;
  height: 0.6rem;
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--gold); opacity: 0.6; }

/* ---------- Katalogs ---------- */

.filters {
  display: flex; gap: 1.4rem;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 2rem;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line-soft);
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto;
  padding: 0.75rem 0 0.7rem;
  border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted);
  font: 500 0.78rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer;
}
.filter:hover { color: var(--ivory); }
.filter[aria-pressed="true"] { color: var(--gold-light); border-bottom-color: var(--gold); }

.products {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 0.9rem;
}
.product { display: flex; flex-direction: column; }

.cat-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1.5rem;
}
.cat-head:first-child { margin-top: 0; }
.cat-head h3 { font-size: clamp(1.6rem, 6vw, 2.2rem); white-space: nowrap; }
.cat-head::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 2; }
.cat-count {
  order: 3;
  font: 500 0.72rem var(--sans); letter-spacing: 0.14em; color: var(--muted);
}
.product-media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--panel);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-wide { grid-column: 1 / -1; }
.product-wide .product-media { aspect-ratio: 16 / 10; }
.product:hover .product-media img { transform: scale(1.03); }
.product-media::after {
  content: ""; position: absolute; inset: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.7); pointer-events: none;
}

.ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font: 400 1.3rem var(--display); color: rgba(143, 108, 47, 0.75);
  background: radial-gradient(circle at 50% 40%, #F4EEE3, #E6DCCB 70%);
}

.product-body { display: flex; flex-direction: column; flex: 1; padding-top: 0.85rem; text-align: center; }
.product-cat {
  margin: 0 0 0.3rem;
  font: 500 0.66rem var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.product-name { margin: 0; font: 400 1.12rem/1.25 var(--display); }
.product-note { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted); }
.product-foot {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  margin-top: auto; padding-top: 0.85rem;
}
.product-price { font: 400 1.25rem var(--display); color: var(--gold-light); }
.product-price-ask { font: 400 0.8rem var(--sans); color: var(--muted); }

.catalog-note { margin: 3rem 0 0; text-align: center; color: var(--muted); }

/* ---------- Piegāde: ēdienkartes stils ---------- */

.menu-card {
  max-width: 44rem; margin: 0 auto;
  padding: 2.25rem 1.25rem;
  border: 1px solid var(--line);
  outline: 1px solid var(--line); outline-offset: -0.5rem;
}
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { padding: 1rem 0; }
.menu-list li + li { border-top: 1px solid var(--line-soft); }
.menu-row { display: flex; align-items: baseline; gap: 0.5rem; margin: 0; }
.menu-name { font: 400 1.3rem/1.2 var(--display); }
.menu-dots { flex: 1; min-width: 1rem; border-bottom: 1px dotted rgba(42, 38, 33, 0.3); transform: translateY(-0.3em); }
.menu-price { font: 400 1.2rem var(--display); color: var(--gold-light); white-space: nowrap; }
.menu-desc { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- Pasākumi ---------- */

.events { display: grid; gap: 2.25rem; align-items: center; }
.events-photo { margin: 0; position: relative; }
.events-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel); }
.events-photo::after {
  content: ""; position: absolute; inset: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.75); pointer-events: none;
}
.events-text { text-align: center; }
.events-text h2 { margin: 0; }
.events-lead { font: 400 1.35rem/1.35 var(--display); }
.events-text p:not(.events-lead) { color: var(--muted); margin-bottom: 1.75rem; }

/* ---------- Kontakti ---------- */

.contact { display: grid; gap: 2.5rem; }
.contact h2 { margin-bottom: 0.75rem; }
.address { font: 400 1.4rem/1.3 var(--display); font-style: normal; color: var(--gold-light); margin-bottom: 1rem; }
.menu-list-compact { margin-bottom: 1.5rem; }
.menu-list-compact li { padding: 0.6rem 0; }
.menu-list-compact .menu-name, .menu-list-compact .menu-price { font: 500 0.98rem var(--sans); }
.contact-text { color: var(--muted); }
.ig-handle { margin-top: 1rem; }

.map {
  position: relative; aspect-ratio: 4 / 3; background: var(--panel);
  border: 1px solid var(--line);
}
.map iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  filter: grayscale(1) invert(0.92) contrast(0.85) sepia(0.2);
}

/* ---------- Kājene ---------- */

.site-footer { padding: 3rem 0 2.5rem; border-top: 1px solid var(--line); text-align: center; }
.site-footer p { margin: 0 0 0.4rem; font-size: 0.9rem; color: var(--muted); }
.footer-mark { font: 400 2.2rem/1 var(--display); color: var(--ivory) !important; margin-bottom: 0.75rem !important; }
.footer-mark .script { font-size: 1.3em; }
.footer-tag { font: 500 0.68rem var(--sans) !important; letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 1.25rem !important; }

/* ==========================================================================
   Lielāki ekrāni
   ========================================================================== */

@media (min-width: 40em) {
  :root { --gutter: 2rem; }
  .products { grid-template-columns: repeat(3, 1fr); gap: 2.5rem 1.5rem; }
  .product-wide { grid-column: span 2; }
  .filters { justify-content: center; overflow: visible; flex-wrap: wrap; margin: 0 0 2.5rem; padding: 0; gap: 0.5rem 1.75rem; }
  .menu-card { padding: 3rem 3rem; }
  .hero-gallery { grid-template-columns: 1fr 1.6fr 1fr; align-items: end; gap: 1rem; }
  .hg-main { grid-column: 2; grid-row: 1; }
  .hg-main img { aspect-ratio: 1; }
  .hg:nth-child(2) { grid-column: 1; grid-row: 1; }
  .hg:nth-child(3) { grid-column: 3; grid-row: 1; }
}

@media (min-width: 60em) {
  :root { --header-h: 4.5rem; }
  .menu-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; background: none; border: 0; margin-left: auto; }
  .site-nav ul { display: flex; gap: 2.25rem; padding: 0; }
  .site-nav a {
    padding: 0.25rem 0;
    font: 500 0.75rem var(--sans); letter-spacing: 0.18em; text-transform: uppercase;
    border-bottom: 1px solid transparent;
  }
  .site-nav a:hover { color: var(--gold-light); border-bottom-color: var(--gold); }
  .header-actions { margin-left: 1.25rem; }

  .hero { padding: 4rem 0 5.5rem; }
  .section { padding: 6.5rem 0; }
  .products { grid-template-columns: repeat(4, 1fr); }
  .events { grid-template-columns: 1fr 1fr; gap: 5rem; }
  .contact { grid-template-columns: 1fr 1.25fr; gap: 4.5rem; align-items: center; }
}

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