:root {
  --bg: #0b0f0d;
  --bg-soft: #111614;
  --elev: #171e1a;
  --card: #1a221e;
  --ink: #f4efe6;
  --muted: #b6aea0;
  --gold: #c4a574;
  --gold-bright: #e2c58d;
  --line: rgba(196, 165, 116, 0.22);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
a:hover { color: var(--gold-bright); }

/* topbar */
.topbar {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #141a17;
  color: var(--gold);
  font-size: 0.75rem;
  padding: 4px 10px;
  letter-spacing: 0.02em;
}
.topbar b { font-weight: 600; color: var(--ink); }

/* header */
.top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0.7rem 1.2rem;
  background: #151c18;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 6;
}
.top .logo {
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}
.top .logo:hover { color: var(--gold-bright); }
.top nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.top nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}
.top nav a:hover, .top nav a.active { color: var(--gold-bright); }
.btn {
  display: inline-block;
  background: var(--gold);
  color: #14110c;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--gold-bright); color: #14110c; }
.btn.small { padding: 0.4rem 0.9rem; font-size: 0.88rem; }

/* category chip bar */
.catnav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 16px;
  background: var(--elev);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 56px;
  z-index: 4;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.catnav a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1c2420;
}
.catnav a:hover, .catnav a.active {
  background: #24302a;
  border-color: var(--gold);
  color: var(--gold-bright);
}

.homewrap, .pagewrap {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
}

/* intro / who box — like portal "Kas mēs esam" */
.who {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem 1.4rem 1.2rem;
  margin: 1.2rem 0 1rem;
}
.who h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
  color: var(--ink);
}
.who-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem 2rem;
}
.who h3 {
  font-family: Outfit, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--gold);
}
.who p { margin: 0 0 0.7rem; color: #ebe4d8; }
.who p:last-child { margin-bottom: 0; }
.who ul { margin: 0; padding-left: 1.15rem; }
.who li { margin: 0.3rem 0; }

/* CTA banner */
.cta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  background: var(--elev);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  margin: 0 0 1.4rem;
}
.cta-banner strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gold-bright);
  line-height: 1.2;
}
.cta-banner p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* centered hero like portal */
.hero {
  text-align: center;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 18px 10px 8px;
}
.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 2.55rem);
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.15;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.pills span { white-space: nowrap; }

/* category / section card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 2.2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
  color: inherit;
}
.card .ph {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(196,165,116,0.14), transparent 60%),
    #141b18;
}
.card .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .ph img { transform: scale(1.05); }
.card .b {
  padding: 0.7rem 0.75rem 0.85rem;
  text-align: center;
}
.card h3 {
  font-family: Outfit, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--ink);
  line-height: 1.3;
}
.card .tease {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* inner pages */
.pagewrap { padding: 1.2rem 0 2.4rem; }
.page-head { margin: 0 0 1rem; }
.page-head .eyebrow {
  display: inline-block;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.page-head h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
  line-height: 1.15;
}
.page-body p { margin: 0 0 1rem; color: #ebe4d8; }
.page-body h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.55rem;
  margin: 1.8rem 0 0.7rem;
}
.page-body h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.6rem 0 0.55rem;
  color: var(--gold);
}
.back-end {
  display: inline-block;
  margin-top: 1.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.92rem;
}
.back-end:hover { background: var(--gold); color: #14110c; }

ul.bullets { margin: 0.3rem 0 1.1rem; padding-left: 1.15rem; }
ul.bullets li { margin: 0.45rem 0; }

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin: 1rem 0 0.5rem;
}
figure {
  margin: 0;
  background: #101513;
  border-radius: 12px;
  overflow: hidden;
}
figure img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ratio-3-4 { aspect-ratio: 3/4; }
.solo-photo { max-width: 420px; }
.lead-photo { margin: 1rem 0 0.5rem; }
figure figcaption {
  padding: 0.5rem 0.75rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}
figure.ratio-4-3:has(figcaption),
figure.ratio-3-4:has(figcaption),
figure.lead-photo:has(figcaption) {
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
}
figure.ratio-4-3:has(figcaption) img,
figure.lead-photo:has(figcaption) img { aspect-ratio: 4/3; height: auto; width: 100%; object-fit: cover; }
figure.ratio-3-4:has(figcaption) img { aspect-ratio: 3/4; height: auto; width: 100%; object-fit: cover; }

.callout {
  background: var(--elev);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 1.2rem 1.2rem;
  margin: 0.4rem 0 1.3rem;
}
.callout strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--gold-bright);
  margin-bottom: 0.3rem;
}
.callout p { margin: 0; color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0 1.2rem;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th { text-align: left; background: #223027; color: var(--gold); font-weight: 500; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.emphasis { background: #24332b; font-weight: 600; }
tr.emphasis td { color: var(--gold-bright); border-bottom: 0; }

.foto-nav {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin: 0 0 1.4rem;
}
.foto-nav h2 { font-size: 1.1rem; margin: 0 0 0.4rem; color: var(--gold); }
.foto-nav ol { margin: 0; padding: 0; list-style: none; }
.foto-nav li { margin: 0.22rem 0; }
.foto-nav a { text-decoration: none; }
.foto-nav a:hover { text-decoration: underline; }
.nested { padding-top: 0.5rem; margin-top: 1.3rem; border-top: 1px solid var(--line); }

footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 24px;
  padding: 28px 24px 32px;
  border-top: 1px solid var(--line);
  background: #101513;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}
footer .flogo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
footer .flogo:hover { color: var(--gold-bright); }
footer .flinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}
footer .flinks a { text-decoration: none; }
footer p { margin: 0; }

.lb {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 7, 0.94);
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lb.open { display: flex; }
.lb img { max-width: min(1200px, 100%); max-height: 92vh; object-fit: contain; cursor: zoom-out; border-radius: 8px; }
.lb-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  color: #fff;
  font-size: 2rem;
  background: none;
  border: 0;
  cursor: pointer;
}

@media (min-width: 700px) {
  .who-cols { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .media-grid { grid-template-columns: 1fr 1fr; }
  footer { grid-template-columns: 1fr 2fr; text-align: left; align-items: center; }
  footer .flinks, footer p { grid-column: 1 / -1; }
  footer .flinks { justify-content: flex-start; }
  footer p { text-align: center; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .card h3 { font-size: 0.92rem; min-height: 2.5em; }
}
@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 0.5rem 0.7rem; gap: 8px; }
  .top nav { gap: 10px; font-size: 0.85rem; flex-wrap: wrap; }
  .catnav { top: auto; position: relative; }
}
@media (max-width: 700px) {
  .topbar span { display: none; }
  .topbar { font-size: 0.68rem; padding: 3px 6px; }
  .hero h1 { font-size: 1.45rem; }
  .who { padding: 1rem 1rem; }
}
.ratio-4-3 { aspect-ratio: 4/3; }

/* homepage hero photo */
.hero-photo {
  margin: 0 auto 1rem;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #101513;
  max-width: 100%;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: default;
}

/* in-page room chips on Māja */
.room-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.2rem 0 0.2rem;
}
.room-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  background: var(--elev);
}
.room-nav a:hover, .room-nav a:focus {
  border-color: var(--gold);
  color: var(--gold-bright);
}
.nested, .room-nav + .nested, [id^="telpa-"], [id^="foto-"] {
  scroll-margin-top: 5.5rem;
}

.floor { margin-top: 1.6rem; }
.floor > h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  color: var(--gold);
  font-size: 1.45rem;
  margin: 0 0 0.2rem;
  scroll-margin-top: 5.5rem;
}
.floor > .nested:first-of-type { border-top: 0; margin-top: 0.3rem; padding-top: 0; }
.floor .nested h3 { font-size: 1.25rem; }
.room-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.room-floor {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-right: 0.15rem;
}
.foto-nav ol ol { margin: 0.2rem 0 0.35rem 1rem; padding: 0; list-style: none; }
.foto-nav ol ol li { margin: 0.15rem 0; }
