/* ============================================================
   Redesign — papildu stili pāri esošajam style.css
   ============================================================ */

/* ── Hero meklēšana ────────────────────────────────────────── */
.hero {
  margin: 8px 0 28px;
  text-align: left;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-blue);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.hero-title {
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.hero-title .accent { color: var(--c-blue); }
.hero-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 20px;
}

/* Liels meklēšanas lauks */
.search-box {
  position: relative;
  max-width: 640px;
}
.search-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* ≥16px — iOS Safari nezūmē fokējoties */
  color: var(--text-dim);
  background: var(--surface-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 56px 14px 46px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-appearance: none;
  outline: none;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus {
  border-color: var(--c-blue);
  background: var(--surface-hover);
  box-shadow: 0 0 0 4px rgba(78, 168, 222, 0.14), 0 8px 24px rgba(0,0,0,0.18);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}
.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 3px;
  pointer-events: none;
}
.search-kbd kbd {
  font-family: 'Inter', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}

/* Quick-tag chips zem meklēšanas */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  align-items: center;
}
.quick-tag-label {
  font-size: 11px;
  color: var(--text-faint);
  margin-right: 4px;
  letter-spacing: 0.04em;
}
.quick-tag {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.quick-tag:hover {
  color: var(--c-blue);
  background: var(--surface-hover);
  border-color: var(--c-blue);
}

/* ── Search dropdown ──────────────────────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-mid);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 460px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  padding: 6px;
}
html.light-theme .search-results {
  background: #fff;
  box-shadow: 0 16px 44px rgba(0,0,0,0.16);
  border-color: rgba(0,0,0,0.10);
}
.search-results.open { display: block; }
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:hover,
.search-result.active {
  background: var(--surface-hover);
}
.search-result-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 76px;
  text-align: center;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.search-result-desc {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result mark {
  background: rgba(78, 168, 222, 0.22);
  color: var(--c-blue);
  padding: 0 2px;
  border-radius: 3px;
}
html.light-theme .search-result mark {
  background: rgba(41, 128, 185, 0.18);
  color: var(--c-blue-2);
}
.search-result-arrow {
  color: var(--text-faint);
  flex-shrink: 0;
  display: flex;
}
.search-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.search-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 12px 6px;
}

/* ── Section header ar action pa labi ────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 14px 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-head .section-title-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.section-head .section-action {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.section-head .section-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.section-head .section-link:hover { color: var(--c-blue); background: var(--surface); }

/* Density toggle */
.density-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 0;
}
.density-toggle button {
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.density-toggle button.active {
  background: var(--surface-elev);
  color: var(--text-dim);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
html.light-theme .density-toggle button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.density-toggle button:hover { color: var(--text-dim); }

/* ── Recent strip ─────────────────────────────────────────── */
.recent-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
  max-width: 280px;
}
.recent-chip:hover {
  background: var(--surface-hover);
  border-color: var(--c-blue);
  transform: translateY(-1px);
}
.recent-chip-cat {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-chip-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-empty {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

/* ── Compact list (dense mode) ───────────────────────────── */
.list-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.list-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-hover); }
.list-row-cat {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 0;
  text-align: center;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.list-row-body { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.list-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 60%;
}
.list-row-desc {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.list-row-arrow {
  color: var(--text-vague);
  font-size: 14px;
}
.list-row:hover .list-row-arrow { color: var(--c-blue); }

@media (max-width: 600px) {
  .list-row { grid-template-columns: 70px 1fr auto; gap: 10px; padding: 9px 12px; }
  .list-row-body { flex-direction: column; align-items: flex-start; gap: 2px; }
  .list-row-title { max-width: none; }
}

/* ── Mini card grid (uzlabotā kartīšu sadaļa) ─────────────── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.tile:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}
html.light-theme .tile:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.tile-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.tile-icon svg { width: 20px; height: 20px; }
.tile.t-blue   .tile-icon { background: rgba(78, 168, 222, 0.14); color: var(--c-blue); }
.tile.t-purple .tile-icon { background: rgba(200, 160, 255, 0.14); color: var(--c-purple); }
.tile.t-coral  .tile-icon { background: rgba(232, 93, 117, 0.14); color: var(--c-coral); }
.tile.t-teal   .tile-icon { background: rgba(78, 205, 196, 0.14); color: var(--c-teal); }
.tile.t-indigo .tile-icon { background: rgba(110, 127, 232, 0.14); color: var(--c-indigo); }
.tile.t-orange .tile-icon { background: rgba(255, 140, 66, 0.14); color: var(--c-orange); }
.tile.t-amber  .tile-icon { background: rgba(212, 160, 84, 0.14); color: var(--c-amber); }
.tile.t-green  .tile-icon { background: rgba(94, 211, 162, 0.14); color: var(--c-green); }

html.light-theme .tile.t-blue   .tile-icon { background: rgba(41,128,185,0.10); }
html.light-theme .tile.t-purple .tile-icon { background: rgba(125,60,181,0.10); }
html.light-theme .tile.t-coral  .tile-icon { background: rgba(192,57,43,0.10); }
html.light-theme .tile.t-teal   .tile-icon { background: rgba(20,128,128,0.10); }
html.light-theme .tile.t-indigo .tile-icon { background: rgba(58,82,200,0.10); }
html.light-theme .tile.t-orange .tile-icon { background: rgba(224,112,32,0.10); }
html.light-theme .tile.t-amber  .tile-icon { background: rgba(192,122,32,0.10); }
html.light-theme .tile.t-green  .tile-icon { background: rgba(30,132,73,0.10); }

.tile-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tile-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: auto;
}
.tile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.tile-meta-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.tile-meta-arrow {
  margin-left: auto;
  transition: transform 0.18s;
}
.tile:hover .tile-meta-arrow { transform: translateX(3px); color: var(--c-blue); }

/* ── Coming-soon kompaktais saraksts ─────────────────────── */
.future-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.future-strip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.future-strip-items {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.future-strip-items span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.future-strip-items span::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-vague);
}

/* ── News strip (kompaktāks par esošo) ───────────────────── */
.news-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.news-mini {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.news-mini:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.news-mini-date {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  padding-top: 2px;
}
.news-mini-day {
  font-size: 19px;
  font-weight: 800;
  color: var(--c-blue);
  line-height: 1;
}
.news-mini-mon {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-top: 2px;
}
.news-mini-body { flex: 1; min-width: 0; }
.news-mini-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-blue);
  margin-bottom: 3px;
}
.news-mini-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Tweaks panel hide kontroles ─────────────────────────── */
.tweaks-hidden { display: none !important; }

/* ── Body tweaks variants ────────────────────────────────── */
body.tw-icons-emoji .tile-icon-svg { display: none; }
body.tw-icons-emoji .tile-icon-emoji { display: grid; }
body:not(.tw-icons-emoji) .tile-icon-emoji { display: none; }
.tile-icon-emoji { font-size: 20px; }

/* Hide poll/counter, kad tweaks pieprasa */
body.tw-no-poll #poll { display: none; }
body.tw-no-counter .visit-counter { display: none; }
body.tw-no-future .future-strip { display: none; }

/* Search overlay (Cmd+K) — pārklāj visu lapu */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,22,32,0.78);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  animation: overlayIn 0.18s ease-out;
}
html.light-theme .search-overlay { background: rgba(20,30,45,0.45); }
.search-overlay.open { display: flex; }
.search-overlay .search-box {
  width: min(640px, 92vw);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* Smaller hero on small screens */
@media (max-width: 640px) {
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 14px; }
  .search-input { font-size: 16px; padding: 12px 50px 12px 42px; } /* 16px — pret iOS auto-zoom */
  .search-kbd { display: none; }
}

/* ── „Vairāk” izvēlne — mobilajā nav paliek piekļuve visiem sadaļām ── */
.site-nav-inner { position: relative; }
.nav-more { display: none; }
@media (max-width: 860px) {
  .nav-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 7px 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
  }
  .nav-more:hover,
  .nav-more[aria-expanded="true"] { color: var(--text-dim); background: var(--surface-hover); }
}
.nav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  background: var(--bg-mid);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.45);
  padding: 6px;
  z-index: 60;
}
html.light-theme .nav-more-menu { background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,0.16); }
.nav-more-menu[hidden] { display: none; }
.nav-more-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.nav-more-menu a:hover { background: var(--surface-hover); color: var(--text-bright); }

/* ── Pārslēgs uz veco versiju (agrāk inline stili) ── */
.legacy-switch {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-gray-text, #4b5563);
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.legacy-switch:hover { transform: scale(1.05); }
.legacy-switch-icon { font-size: 15px; }
@media (max-width: 640px) {
  .legacy-switch {
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }
  .legacy-switch .legacy-switch-text { display: none; }
  /* lai peldéjošā poga neaizsedz kājenes saites */
  .site-foot { padding-bottom: 84px; }
}
