:root {
  --bg: #0f1410;
  --bg-elevated: #181f19;
  --bg-card: #1c251e;
  --bg-card-hover: #233028;
  --border: #2d3a30;
  --border-strong: #3d5242;
  --text: #e8efe9;
  --text-muted: #9aab9e;
  --text-dim: #6d7d70;
  --accent: #7cb87a;
  --accent-strong: #9fd49c;
  --accent-soft: rgba(124, 184, 122, 0.14);
  --accent-glow: rgba(124, 184, 122, 0.28);
  --warn: #d4a574;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(124, 184, 122, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(90, 140, 120, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(60, 90, 70, 0.15), transparent 60%);
  z-index: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.invisible {
  visibility: hidden;
}

.site-header,
.main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 16, 0.72);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--accent-strong);
  background: linear-gradient(145deg, var(--accent-soft), rgba(124, 184, 122, 0.05));
  border: 1px solid rgba(124, 184, 122, 0.28);
  box-shadow: 0 0 24px var(--accent-glow);
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 184, 122, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem 0.2rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25);
  max-width: min(100%, 17.5rem);
}

.lang-globe {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  color: var(--text-dim);
  margin-inline-start: 0.15rem;
}

.lang-select {
  appearance: none;
  border: none;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239aab9e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.35rem center / 0.75rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 550;
  padding: 0.35rem 1.35rem 0.35rem 0.35rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  max-width: 14.5rem;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  outline: none;
  transition: color 0.15s, background-color 0.15s;
}

.lang-select:hover {
  color: var(--accent-strong);
}

.lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-select option {
  background: var(--bg-elevated);
  color: var(--text);
}

html[dir="rtl"] .lang-select {
  background-position: left 0.35rem center;
  padding: 0.35rem 0.35rem 0.35rem 1.35rem;
}

html[dir="rtl"] .search-icon {
  left: auto;
  right: 1rem;
}

html[dir="rtl"] #searchInput {
  padding: 0.95rem 2.85rem 0.95rem 2.6rem;
}

html[dir="rtl"] .clear-btn {
  right: auto;
  left: 0.7rem;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.filters {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 0.95rem 2.6rem 0.95rem 2.85rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#searchInput::placeholder {
  color: var(--text-dim);
}

#searchInput::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.clear-btn {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--border);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.clear-btn:hover {
  background: var(--border-strong);
}

.combo {
  position: relative;
}

.combo input[type="text"] {
  padding-right: 2.35rem;
}

html[dir="rtl"] .combo input[type="text"] {
  padding-right: 0.85rem;
  padding-left: 2.35rem;
}

html[dir="rtl"] .combo .clear-btn {
  right: auto;
  left: 0.45rem;
}

.combo .clear-btn {
  right: 0.45rem;
  width: 24px;
  height: 24px;
  font-size: 1.05rem;
  border-radius: 6px;
}


.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.field select,
.field input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select:focus,
.field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-reset {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-reset:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--accent);
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.35rem 0 0.9rem;
}

.results-bar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.results-bar strong {
  color: var(--text);
  font-weight: 650;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-wrap label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.sort-wrap select {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.card:hover {
  border-color: rgba(124, 184, 122, 0.45);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.maker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 184, 122, 0.22);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.pattern {
  margin: 0.45rem 0 0;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.size {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.spec-wide {
  grid-column: 1 / -1;
}

.spec {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.spec-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.spec-value {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(24, 31, 25, 0.5);
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0 0 0.4rem;
  max-width: 70ch;
}

.footer-meta {
  color: var(--text-dim);
  opacity: 0.8;
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding: 1rem;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .lang-switcher {
    margin-inline-start: auto;
    max-width: 100%;
  }

  .lang-select {
    max-width: min(14.5rem, calc(100vw - 5.5rem));
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .main {
    padding: 1rem 1rem 2.5rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .field-actions .invisible {
    display: none;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .results-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-wrap {
    justify-content: space-between;
  }

  .sort-wrap select {
    flex: 1;
  }
}

/* —— Tabs —— */
.tab-nav {
  position: relative;
  z-index: 15;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
  display: flex;
  gap: 0.4rem;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(24, 31, 25, 0.7);
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.tab-btn.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(124, 184, 122, 0.45);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-panel[hidden] {
  display: none !important;
}

/* —— Fördrift —— */
.fordrift-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fordrift-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.fordrift-intro {
  margin: 0;
  color: var(--text-muted);
  max-width: 65ch;
}

.fordrift-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.fordrift-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.fordrift-inputs .field:nth-child(3),
.fordrift-inputs .field:nth-child(4) {
  grid-column: 1 / -1;
}

.fordrift-inputs input[type="number"],
.fordrift-picker input[type="text"],
.fordrift-picker select:not(.tire-pick-list) {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fordrift-inputs input[type="number"]:focus,
.fordrift-picker input[type="text"]:focus,
.fordrift-picker select:not(.tire-pick-list):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.picker-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.picker-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.picker-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.picker-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.picker-list-head label {
  margin: 0;
}

.picker-match-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.tire-pick-list {
  width: 100%;
  min-height: 6.75rem;
  max-height: 7.5rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

.tire-pick-list:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tire-pick-list option {
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  min-height: 2rem;
}

.picker-status {
  margin: 0.45rem 0 0;
  min-height: 1.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.picker-target {
  margin-top: 0.55rem;
}

.picker-target-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.btn-fill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 184, 122, 0.4);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-fill-axle {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.15;
}

.btn-fill-sub {
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-muted);
  opacity: 0.95;
}

.btn-fill-front {
  border-color: rgba(110, 168, 220, 0.45);
  background: rgba(110, 168, 220, 0.12);
  color: #9ec8ea;
}

.btn-fill-rear {
  border-color: rgba(124, 184, 122, 0.45);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn-fill:hover:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(124, 184, 122, 0.18);
}

.btn-fill-front:hover:not(:disabled) {
  background: rgba(110, 168, 220, 0.2);
  border-color: rgba(110, 168, 220, 0.7);
  box-shadow: 0 0 0 2px rgba(110, 168, 220, 0.18);
}

.btn-fill-rear:hover:not(:disabled) {
  background: rgba(124, 184, 122, 0.22);
  border-color: var(--accent);
}

.btn-fill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-fill.is-filled .btn-fill-sub {
  color: inherit;
  opacity: 0.9;
}

@media (max-width: 560px) {
  .picker-filters {
    grid-template-columns: 1fr;
  }
}

.fordrift-btn-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.btn-primary {
  flex: 1;
  min-width: 8rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(180deg, #8fd08c 0%, var(--accent) 100%);
  color: #0b140e;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px rgba(124, 184, 122, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

.fordrift-actions .btn-reset {
  flex: 0 0 auto;
  min-width: 7rem;
}

.metric-value.is-ok {
  color: var(--accent-strong);
}

.metric-value.is-warn {
  color: #e6b35a;
}

.metric-value.is-bad {
  color: #e07a7a;
}

.fordrift-results {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.fordrift-results h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

.fordrift-placeholder {
  margin: 0;
  color: var(--text-muted);
}

.fordrift-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.metric {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.metric-wide {
  grid-column: 1 / -1;
}

.metric-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 550;
  color: var(--text);
}

.metric-value.mono,
.mono {
  font-family: var(--mono);
}

.fordrift-assumption {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 75ch;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .fordrift-grid {
    grid-template-columns: 1fr;
  }

  .fordrift-inputs {
    grid-template-columns: 1fr;
  }

  .fordrift-inputs .field:nth-child(3),
  .fordrift-inputs .field:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .tab-nav {
    padding: 0.65rem 1rem 0;
  }

  .fordrift-metrics {
    grid-template-columns: 1fr;
  }

  .metric-wide {
    grid-column: auto;
  }
}


/* —— Katalog product thumbnails + lightbox —— */
.card {
  flex-direction: row;
  align-items: stretch;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem 0.95rem;
}

.card-thumb {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #121812;
  overflow: hidden;
  cursor: zoom-in;
  align-self: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.card-thumb:hover,
.card-thumb:focus-visible {
  border-color: rgba(124, 184, 122, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
  transform: scale(1.02);
}

.card-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #121812;
}

.card--no-thumb {
  /* Text-only card when no tire-only catalog image is available */
}

.card-thumb[hidden] {
  display: none !important;
}

.card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 10, 8, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-figure {
  margin: 0;
  max-width: min(920px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 3rem);
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #101610;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.lightbox-caption {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: none;
}

@media (max-width: 520px) {
  .card {
    flex-direction: column;
  }
  .card-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 180px;
    align-self: center;
  }
}
