/**
 * FoHT Heysen Trail Interactive Map — filter-panel.css
 * Pill-button filter UI and slide-in filter panel.
 */


/* Hide the old standalone fullscreen button —
   it's been replaced by the pill in the top-left bar */
.foht-map-fullscreen-btn {
    display: none !important;
}

/* -------------------------------------------------------
   Top-left pill button bar
------------------------------------------------------- */
.foht-map-controls-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none; /* let clicks through gaps */
}

@media screen and (max-width: 650px) {
	.foht-map-controls-bar {
		flex-direction: column;
	}	
}

.foht-map-pill-btn {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    background: #fff;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp--preset--color--pine-forest-green, #3f4427);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1;
}
.foht-map-pill-btn.leaflet-control-zoom {
    box-shadow: 0 1px 4px rgba(0,0,0,0.12) !important;
}

.foht-map-pill-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}

.foht-map-pill-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Fix #6: focus-visible styles for all interactive panel controls that
   previously had no focus indicator (WCAG 2.4.7). Reuses the same
   outline style as .foht-map-pill-btn for visual consistency. */
.foht-accordion__trigger:focus-visible,
.foht-filter-panel__close:focus-visible,
.foht-filter-bulk-btn:focus-visible,
.foht-filter-footer-btn:focus-visible,
.foht-legend-info-btn:focus-visible,
.foht-panel-tab:focus-visible,
.foht-filter-action-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

#basemaps.foht-map-pill-btn,
#basemaps.foht-map-pill-btn:hover {
    border-bottom: 0 !important;
    border-bottom-width: 0 !important;
}

#foht-map-controls-bar .foht-map-pill-btn {
	min-width: 178px;
	justify-content: space-between;
}

@media screen and (max-width: 450px) {
	.foht-map-controls-bar {
		flex-direction: column;
	}
	
	.foht-map-controls-bar {
		align-items: flex-start;
	}
	
	#foht-map-controls-bar #foht-filter-toggle-btn.foht-map-pill-btn {
		min-width: 114px;
	}
}

/* Hamburger icon */
.foht-pill-icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	flex-shrink: 0;
	gap: 3px;
	width: 16px;
	cursor: pointer;
}

.foht-pill-icon span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: currentColor; /* inherits text color */
	border-radius: 9999px;          /* fully rounded ends */
}

/* Expand/contract arrows icon wrapper */
.foht-pill-arrows {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: currentColor;
}

/* Label inside pill */
.foht-pill-label {
    /* inherits from .foht-map-pill-btn */
}

/* -------------------------------------------------------
   Filter panel (slide-in from left)
------------------------------------------------------- */
.foht-filter-panel {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 999;
    width: 300px;
    max-width: calc(100% - 24px);
    height: calc(100% - 24px);
	border-radius: 12px;
    background: #fff;
    box-shadow: 2px 0 16px rgba(0,0,0,0.14);
    display: flex;
    flex-direction: column;
    transform: translateX(calc(-100% - 300px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.foht-filter-panel.is-open {
    transform: translateX(0);
    pointer-events: all;
}

/* Panel header */
.foht-filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.foht-filter-panel__title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.foht-filter-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    border-radius: 50%;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.foht-filter-panel__close:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

/* Scrollable body */
.foht-filter-panel__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

/* -------------------------------------------------------
   Accordion sections
------------------------------------------------------- */
.foht-accordion {
    border-bottom: 1px solid #e8e8e8;
}

.foht-accordion__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    line-height: 1.3;
    transition: background 0.12s;
}

.foht-accordion__trigger:hover {
    background: #f8f8f8;
}

/* Minus / Plus icon */
.foht-accordion__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
    color: #666;
    margin-left: 8px;
}

.foht-accordion__icon::before,
.foht-accordion__icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

/* Horizontal bar (always visible) */
.foht-accordion__icon::before {
    width: 12px;
    height: 1.5px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Vertical bar (hidden when open = minus) */
.foht-accordion__icon::after {
    width: 1.5px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* When open, hide vertical bar to show minus */
.foht-accordion.is-open .foht-accordion__icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

.foht-accordion__content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.foht-accordion.is-open .foht-accordion__content {
    max-height: 5000px; /* large enough for any content */
}

.foht-accordion__inner {
    padding: 4px 0 12px;
}

/* -------------------------------------------------------
   Checkbox items inside accordion
------------------------------------------------------- */
.foht-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    gap: 7px;
    cursor: pointer;
    transition: background 0.1s;
}

.foht-filter-item:hover {
    background: #f5f5f5;
}

.foht-filter-item__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* Custom checkbox */
.foht-filter-item input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.foht-filter-item__label {
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
	font-weight: 600;
}

/* -------------------------------------------------------
   Panel footer with Reset All
------------------------------------------------------- */
.foht-filter-panel__footer {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid #e8e8e8;
}

.foht-filter-reset-btn {
    width: 100%;
}

/* -------------------------------------------------------
   Hide the old #mapLegendContainer content structure —
   the new filter panel renders its own checkboxes.
   We still need the container elements to exist (JS
   populates them), but we hide the old accordion tabs
   and heading from mapLegendContainerHTML.
------------------------------------------------------- */
#mapLegendContainer .leaflet-map-legend-heading,
#mapLegendContainer .leaflet-map-legend-intro,
#mapLegendContainer .leaflet-map-legend-group-main {
    display: none;
}

/* The group-secondary (Features section) inner list is
   used by the filter panel — hide its own heading since
   the accordion provides the heading */
#mapLegendContainer .leaflet-map-legend-heading-features {
    display: none;
}

/* The actual Leaflet control element that gets appended —
   hide its outer chrome, show only the list items */
#mapLegendContainer .leaflet-map-legend-custom {
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
}

/* -------------------------------------------------------
   Fullscreen state — keep controls bar on top
------------------------------------------------------- */
.foht-map-outer-wrapper {
	position: relative;
}

.foht-map-outer-wrapper.is-fullscreen .foht-map-controls-bar {
    z-index: 12001;
}

.foht-map-outer-wrapper.is-fullscreen .foht-filter-panel {
    z-index: 12002;
	position: fixed;
}


/* -------------------------------------------------------
   Leaflet zoom control styled as a pill button
------------------------------------------------------- */
.leaflet-control-zoom.foht-map-pill-btn {
    display: flex;
    flex-direction: column;
    width: 40px;
    height: auto;
    padding: 0;
    gap: 0;
    border-radius: 12px;
}

.leaflet-control-zoom.foht-map-pill-btn a {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-size: 18px;
}

.leaflet-control-zoom.foht-map-pill-btn a:first-child {
    border-radius: 12px 12px 0 0;
}

.leaflet-control-zoom.foht-map-pill-btn a:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.leaflet-control-zoom.foht-map-pill-btn a:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* -------------------------------------------------------
   Footer — two buttons side by side
------------------------------------------------------- */
.foht-filter-panel__footer {
    display: flex;
    gap: 8px;
}

.foht-filter-footer-btn {
    flex: 1;
    height: 40px;
    background: #fff;
    border: 1.5px solid #1a1a1a;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.foht-filter-footer-btn:hover {
    background: #f5f5f5;
}

/* -------------------------------------------------------
   Intro paragraph inside accordion
------------------------------------------------------- */
.foht-accordion__intro {
    padding: 0 16px 8px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
}

.foht-accordion__intro p {
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

/* "Find out more" button in legend */
.foht-legend-find-out-more {
    display: inline-block;
    padding: 6px 19px;
    background: #fff;
    border: 1.5px solid var(--wp--preset--color--pine-forest-green, #3f4427);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wp--preset--color--pine-forest-green, #3f4427);
    text-decoration: none;
    transition: background 0.15s;
}

.foht-legend-find-out-more:hover {
    background: var(--wp--preset--color--pine-forest-green, #3f4427);
    color: var(--wp--preset--color--south-coast-cream, #fffcf2);
}

/* -------------------------------------------------------
   Bulk Select all / Clear all row
------------------------------------------------------- */
.foht-filter-bulk-row {
    display: flex;
    gap: 8px;
    padding: 4px 16px 8px;
}

.foht-filter-bulk-btn {
    flex: 1;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
	
	background: 0 0;
	border: .1em solid;
	border-radius: 999px;
	padding: 8px 30px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 1%;
	line-height: 1.25;
	color: var(--wp--preset--color--pine-forest-green, #3f4427);

}

.foht-filter-bulk-btn:hover {
    background-color: var(--wp--preset--color--pine-forest-green, #3f4427);
    border-color: var(--wp--preset--color--pine-forest-green, #3f4427);
    /* Fix #11: fallback was #3f4427 (same dark green as the bg) — text was invisible.
       Correct fallback is the South Coast Cream value #fffcf2. */
    color: var(--wp--preset--color--south-coast-cream, #fffcf2) !important;
}

@media screen and (max-width: 450px) {
	.foht-filter-bulk-btn {
		padding-left: 8px;
		padding-right: 8px;
	}
}

/* -------------------------------------------------------
   Action buttons (elevation + zoom) on trail items
------------------------------------------------------- */
.foht-filter-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--wp--preset--color--pine-forest-green, #3f4427);
    border-radius: 50%;
    padding: 0;
    transition: background 0.12s, color 0.12s;
	
	border-width: 1px;
	border-style: solid;
	border-color: var(--wp--preset--color--pine-forest-green, #3f4427);
	background: #fff;
}

a.foht-filter-action-btn {
    color: color: var(--wp--preset--color--pine-forest-green, #3f4427);
    text-decoration: none;
    cursor: pointer;
}

a.foht-filter-action-btn:hover,
button.foht-filter-action-btn:hover {
    border-width: 1px;
	border-style: solid;
	border-color: var(--wp--preset--color--pine-forest-green, #3f4427);
	background: var(--wp--preset--color--pine-forest-green, #3f4427);
	color: var(--wp--preset--color--south-coast-cream, #fffcf2);
}

/* -------------------------------------------------------
   Panel tab nav (Filter | Legend)
------------------------------------------------------- */
.foht-panel-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 16px;
    gap: 0;
    flex-shrink: 0;
}

.foht-panel-tab {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
	color: var(--wp--preset--color--pine-forest-green, #3f4427);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.foht-panel-tab:hover {
    color: #1a1a1a;
}

.foht-panel-tab.is-active {
    color: var(--wp--preset--color--pine-forest-green, #3f4427);
    border-bottom-color: color: var(--wp--preset--color--pine-forest-green, #3f4427);
}

/* Push close button to right */
.foht-panel-tabs .foht-filter-panel__close {
    margin-left: auto;
}

/* -------------------------------------------------------
   Tab panels
------------------------------------------------------- */
.foht-tab-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.foht-tab-panel.is-active {
    display: flex;
}

/* -------------------------------------------------------
   Accordion trigger layout: title left, (ⓘ + icon) right
------------------------------------------------------- */
.foht-accordion__trigger {
    /* already has display:flex justify-content:space-between */
}

.foht-accordion__trigger-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ⓘ info button */
.foht-legend-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--wp--preset--color--pine-forest-green, #3f4427);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    flex-shrink: 0;
}

.foht-legend-info-btn:hover {
    background-color: var(--wp--preset--color--pine-forest-green, #3f4427);
    color: var(--wp--preset--color--south-coast-cream, #fffcf2);
    border: 1px solid var(--wp--preset--color--pine-forest-green, #3f4427);
	border-radius: 50%;
}

/* -------------------------------------------------------
   Legend tab content
------------------------------------------------------- */
.foht-legend-content {
    padding: 12px 16px 16px;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.foht-legend-content p {
    margin: 0 0 10px;
}

.foht-legend-content p:last-child {
    margin-bottom: 0;
}

.foht-legend-content a {
    color: inherit;
}

.foht-legend-subheading {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    padding: 0;
}

.foht-legend-subheading:first-child {
    margin-top: 0;
}

/* Icon + description list */
.foht-legend-icon-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foht-legend-icon-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.foht-legend-icon-wrap {
    flex-shrink: 0;
    display: inline-block;
    width: 26px;
    margin-top: 1px;
}

.foht-legend-icon-desc {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

/* Warnings section in filter */
.foht-warnings-content {
    padding: 8px 16px 12px;
    font-size: 13px;
    line-height: 1.5;
}

.foht-warnings-content p {
    margin: 0 0 8px;
}

.foht-warnings-content p:last-child {
    margin-bottom: 0;
}


.foht-legend-icon-item {
    align-items: flex-start;
}

.foht-legend-icon-item .map-theme-legend-accom-icon.map-theme-legend-towns-icon,
.foht-legend-icon-item .map-theme-legend-accom-icon.map-theme-legend-towns-icon.icon-size-medium,
.foht-legend-icon-item .map-theme-legend-accom-icon.icon-size-large,
.foht-legend-icon-item .map-theme-legend-accom-icon.map-theme-legend-towns-icon.icon-size-large,
.foht-legend-icon-item .map-theme-legend-accom-icon.map-theme-legend-towns-icon.icon-size-extralarge {
	width: 32px !important;
	height: 32px !important;
}

/* -------------------------------------------------------
   Elevation button in filter panel — mountain SVG icon.
   Suppress any background-image from map-theme-leaflet.css
   that targets .map-theme-legend-show-elevation.
------------------------------------------------------- */
.foht-filter-elevation-btn {
    background-image: none !important;
}

.foht-filter-elevation-btn svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Also suppress the old icon if the original .map-theme-legend-show-elevation
   element ever appears inside the filter panel */
#foht-filter-panel .map-theme-legend-action-icon.map-theme-legend-show-elevation {
    display: none !important;
}
