html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ── Map page — compact stacked layout on tablet + mobile (< 992px) ──────── */

@media (max-width: 991px) {
    /* Stack map above, tools below */
    #map-outer {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        gap: 10px !important;
    }

    #map {
        width: 100% !important;
        height: min(60vh, 480px) !important;
        min-height: 240px !important;
    }

    /* Tools bar: horizontal row of compact cards */
    #map-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        overflow-y: visible !important;
        gap: 8px !important;
    }

    /* Each tool card shares the row equally */
    #map-sidebar > .card {
        flex: 1 1 160px;
        min-width: 0;
    }

    /* Tag filter and nearby results span full width */
    #tagFilterCard,
    #nearbyPanel {
        flex: 1 1 100% !important;
    }

    /* Hide the description text — title + control is enough at this size */
    .sidebar-desc {
        display: none !important;
    }

    /* Tighter card padding */
    #map-sidebar .card-body {
        padding: 8px 10px !important;
    }
}

/* Mobile: single-column stacking for very narrow screens */
@media (max-width: 480px) {
    #map {
        height: min(52vh, 360px) !important;
    }

    #map-sidebar > .card {
        flex: 1 1 100%;
    }
}

/* ── Videos page — collapsible tag drawer on mobile ───────────────────── */

/* Toggle button: mobile only */
.video-tag-toggle {
    display: none;
}

@media (max-width: 767px) {
    .video-tag-toggle {
        display: flex;
        background: white;
        border: 1px solid var(--bs-border-color);
        border-radius: 8px;
        padding: 9px 14px;
        font-size: .85rem;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        margin-bottom: 0;
    }

    .video-tag-toggle:hover {
        background: #f8f9fa;
    }

    /* Tag panel: hidden by default on mobile, shown when .panel-open */
    .video-tag-panel {
        display: none;
        background: white;
        border: 1px solid var(--bs-border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        padding: 10px 12px 12px;
        margin-bottom: 4px;
    }

    .video-tag-panel.panel-open {
        display: block;
    }
}

/* ── Admin — scrollable tab bar on small screens ───────────────────────── */
.admin-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-tabs-wrap::-webkit-scrollbar {
    display: none;
}

.admin-tabs-wrap .nav-tabs {
    flex-wrap: nowrap;
    min-width: max-content;
}

/* ── Admin — modals: full-width on mobile ──────────────────────────────── */
@media (max-width: 575px) {
    .modal-dialog {
        margin: 0.5rem;
    }
}