/* MiDia-News style.css
 * Mobile-first Bootstrap-Overrides.
 * Convention: minimieren — primär Bootstrap-Utilities nutzen.
 */

/* ---------- Touch targets ---------- */
@media (max-width: 575.98px) {
  .btn,
  .form-control,
  .form-select {
    min-height: 44px;
  }
  body {
    /* Bottom-Nav-Höhe + Safe-Area */
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }
  /* Wenn auch sticky-action-bar drauf ist: nicht doppelt; sticky-action-bar managed das selbst */
}

/* ---------- Bottom Nav (Mobile) ---------- */
#mobile-bottom-nav {
  z-index: 1020;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  font-size: 0.75rem;
  text-align: center;
  padding: 0.25rem 0.5rem;
  min-width: 56px;
  line-height: 1.1;
}
.bottom-nav-item .bi {
  font-size: 1.25rem;
  display: block;
  line-height: 1;
}

/* ---------- Floating Camera/Add FAB ---------- */
.fab-camera {
  position: fixed;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0));
  width: 56px;
  height: 56px;
  font-size: 1.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1025;
}

/* ---------- Sticky Action Bar (Wizard Bottom-Buttons) ---------- */
.sticky-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  padding: 0.75rem;
  margin-top: 1.5rem;
  margin-left: calc(-1 * var(--bs-gutter-x, 0.75rem));
  margin-right: calc(-1 * var(--bs-gutter-x, 0.75rem));
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  z-index: 1030;
}
@media (max-width: 991.98px) {
  .sticky-action-bar {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom, 0));
    margin: 0;
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Buffer im Form, damit Inhalt nicht von Action-Bar verdeckt wird */
  form:has(.sticky-action-bar) {
    padding-bottom: 6rem;
  }
}

/* ---------- Wizard Steps ---------- */
.wizard-steps {
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  scrollbar-width: thin;
}
.wizard-step {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-size: 0.78rem;
}
.wizard-step.active {
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}
.wizard-step.done {
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

/* ---------- Variant-Card highlight ---------- */
.variant-card {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  border-width: 2px;
  border-color: var(--bs-border-color);
}
.variant-card:hover {
  border-color: var(--bs-primary-border-subtle);
}
.variant-card:has(input:checked),
.variant-card.selected {
  border-color: var(--bs-primary);
  background: #fff7d6;
}
[data-bs-theme="dark"] .variant-card:has(input:checked),
[data-bs-theme="dark"] .variant-card.selected {
  background: #3b3a1f;
}
.variant-card:active {
  transform: scale(0.99);
}

/* ---------- Toast positioning ---------- */
.toast-container {
  z-index: 1080;
}
@media (max-width: 767.98px) {
  .toast-container {
    bottom: calc(80px + env(safe-area-inset-bottom, 0));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
  }
  .toast-container .toast {
    width: 100%;
  }
}
@media (min-width: 768px) {
  .toast-container {
    top: 0;
    right: 0;
  }
}

/* ---------- HTMX indicator ---------- */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ---------- /archiv styling ---------- */
.archiv-body {
  background: var(--bs-body-bg);
}
.archiv-container {
  max-width: 720px;
  line-height: 1.65;
}
.archiv-container h1, .archiv-container h2 {
  letter-spacing: -0.01em;
}
.archiv-content p {
  margin-bottom: 1rem;
}
.archiv-entry h2 a {
  color: var(--bs-body-color);
}
.archiv-entry h2 a:hover {
  color: var(--bs-primary);
}

/* ---------- Image preview ---------- */
.image-preview-wrap img {
  background: var(--bs-secondary-bg);
}

/* ---------- Misc ---------- */
details > summary {
  cursor: pointer;
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "▾";
  float: right;
  transition: transform 0.2s;
}
details[open] > summary::after {
  transform: rotate(180deg);
}

/* Print: handled by print.css */
