/* Variants B — "Vakara zils": tumša galvene, kartīšu režģis ar attēlu augšā, dzintara akcenti */
* { box-sizing: border-box; margin: 0; }

:root {
  --navy: #16283c;
  --navy-2: #1f3751;
  --accent: #f2a93b;
  --bg: #eef1f5;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --line: #dce2ea;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: var(--navy);
  color: #fff;
  padding: 36px 16px 46px;
  text-align: center;
}
/* Akordeons "Par šo lapu" lapas apakšā — intro teksts un datu avoti */
.about-box {
  max-width: 720px;
  margin: 0 auto 18px;
  padding: 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.about-box summary {
  cursor: pointer;
  text-align: center;
  padding: 10px;
  color: var(--navy);
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  list-style: none;
}
.about-box summary::-webkit-details-marker { display: none; }
.about-box summary:hover { border-color: var(--navy); }
.about-box[open] summary { border-radius: 8px 8px 0 0; }
.about-body {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--card);
  padding: 4px 16px 12px;
}
.about-body p { margin: 10px 0 0; }
header h1 { font-size: 1.75rem; }
header h1::after { content: ""; display: block; width: 56px; height: 3px; background: var(--accent); margin: 10px auto 0; border-radius: 2px; }
.tagline { opacity: 0.75; font-size: 0.95rem; margin-top: 10px; }

/* Sadaļu pogas zem filtru bloka — izskats kā .btn-directions ("Kā nokļūt") */
.sections-row { max-width: 980px; margin: 14px auto 0; padding: 0 16px; text-align: center; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  max-width: 980px;
  margin: -26px auto 0;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(22, 40, 60, 0.14);
  width: calc(100% - 32px);
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.filters select, .filters input {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  color: var(--text);
  width: 100%;
}
.filters :is(select, input):focus { outline: 2px solid var(--accent); outline-offset: 0; }

main { max-width: 980px; margin: 0 auto; padding: 8px 16px 32px; }

/* --- Kalendārs un pieteikšana --- */
#cal-toggle {
  grid-column: 1 / -1;
  background: var(--accent);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.submit-row { text-align: center; margin: 6px 0 22px; }
.submit-link {
  display: inline-block;
  background: var(--accent);
  color: var(--navy);
  border-radius: 8px;
  padding: 11px 26px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.submit-link:hover { filter: brightness(1.05); }

/* Sasaiste ar māsas lapu tukumazinas.lv */
.sister-row { max-width: 980px; margin: 0 auto 24px; padding: 0 16px; }
.sister-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: filter 0.15s ease;
}
.sister-link:hover { filter: brightness(1.18); }
.sister-link b { color: var(--accent); }
.sister-icon { font-size: 1.5rem; flex: none; }
.sister-arrow { color: var(--accent); font-weight: 700; }

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: 9px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--navy); color: #fff; }

.more-row { text-align: center; margin: 14px 0 4px; }
#show-more {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
#show-more:hover { background: var(--accent); color: var(--navy); }
#cal-toggle:hover { filter: brightness(1.05); }

.calendar {
  max-width: 980px;
  margin: 12px auto 0;
  padding: 14px 16px 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(22, 40, 60, 0.08);
  width: calc(100% - 32px);
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
}
.cal-header button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  color: var(--navy);
  cursor: pointer;
}
.cal-header button:hover { background: var(--bg); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-dayname {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}
.cal-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 46px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.cal-day:hover:not(:disabled) { border-color: var(--accent); }
.cal-day:disabled { background: transparent; color: #b9c0c9; cursor: default; }
.cal-weekend:not(:disabled) { background: #f3ede2; }
.cal-today { background: var(--navy) !important; color: #fff; border-color: var(--navy); }
.cal-selected { background: var(--accent) !important; color: var(--navy); border-color: var(--accent); font-weight: 700; }
.cal-count { font-size: 0.7rem; font-weight: 700; color: var(--navy); white-space: nowrap; }
.cal-dot { color: var(--accent); }
.cal-today .cal-count { color: #fff; }
.cal-selected .cal-count { color: var(--navy); }
.cal-selected .cal-dot { color: var(--navy); }
.cal-day:disabled .cal-count { display: none; }

.date-heading {
  font-size: 1rem;
  color: var(--navy);
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-heading::first-letter { text-transform: uppercase; }
.date-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Kartītes 2 kolonnās ar vienmērīgām atstarpēm; virsraksti/baneris pāri visam platumam */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.date-heading, .banner-wrap, .more-row, .status { grid-column: 1 / -1; }
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(22, 40, 60, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(22, 40, 60, 0.16); }

/* noapaļojums uz attēla, nevis overflow:hidden uz kartītes —
   lai kalendāra izvēlne var atvērties ārpus kartītes malām */
.card-image { display: block; background: #dfe5ec; border-radius: 12px 12px 0 0; overflow: hidden; }
.card-image img { width: 100%; height: 180px; object-fit: cover; display: block; }

.card-body { padding: 13px 16px 15px; }

.card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; margin-bottom: 7px; }
.date-chip {
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.date-chip::first-letter { text-transform: uppercase; }
.time {
  background: var(--accent);
  color: var(--navy);
  font-weight: 600;
  border-radius: 6px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.place { color: var(--muted); align-self: center; }

.card h3 { font-size: 1.05rem; margin-bottom: 5px; }
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }

.desc {
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Darbību rinda kartītes apakšā: "Uzzini vairāk" + "Pievienot kalendāram" */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.btn-more {
  display: inline-block;
  background: var(--accent);
  color: var(--navy);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.btn-more:hover { filter: brightness(1.05); }

/* Poga "Kā nokļūt" — Google Maps norādes; izskats kā "Pievienot kalendāram" */
.btn-directions {
  display: inline-block;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.btn-directions:hover { border-color: var(--navy); background: var(--bg); }

/* Poga "Pievienot kalendāram" ar mazu izvēlni (Google / .ics) */
.addcal { position: relative; }
.addcal-btn {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.addcal-btn:hover { border-color: var(--navy); background: var(--bg); }
.addcal-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(22, 40, 60, 0.18);
  overflow: hidden;
  z-index: 5;
  min-width: 190px;
}
.addcal-menu a, .addcal-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.addcal-menu a:hover, .addcal-menu button:hover { background: var(--bg); color: var(--navy); }

.source { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.source a { color: var(--muted); text-decoration: underline; }
.source a:hover { color: var(--navy); }
.status { text-align: center; color: var(--muted); padding: 40px 0; }

footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.footer-legal { margin-top: 8px; color: var(--navy); }
.footer-legal + .footer-legal { margin-top: 2px; font-size: 0.75rem; color: var(--muted); }

#to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 40, 60, 0.35);
  z-index: 10;
}
#to-top:hover { background: var(--accent); color: var(--navy); }

/* Reklāmas baneru slaideris */
.banner-wrap { margin: 4px 0 18px; }
.banner-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.banner-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e6e9ee;
}
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-dots {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.banner-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
  cursor: pointer;
}
.banner-dot.active { background: #fff; }

/* Afišas pilnekrāna skats */
.lightbox[hidden] { display: none; } /* citādi display:flex pārspēj hidden atribūtu */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 16, 24, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
.card-image { cursor: zoom-in; }

@media (max-width: 700px) {
  main { grid-template-columns: 1fr; }
  .card-image img { height: 170px; }
}
