/* CSS for Geo Post Filter */

.gpf-wrapper {
    margin: 20px 0;
    font-family: inherit;
}

/* Category Tabs */
.gpf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 10px;
}

.gpf-tab {
    padding: 10px 20px;
    background-color: #f0f0f1;
    color: #000 !important; /* Aggressive override for Elementor */
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    border-bottom: none;
}

.gpf-tab:hover {
    background-color: #dcdcde;
    color: #000 !important;
}

.gpf-tab-active {
    background-color: #2271b1 !important;
    color: #fff !important; /* Aggressive override for Elementor */
    border-color: #2271b1 !important;
}

.gpf-tab-active:hover {
    background-color: #135e96 !important;
    color: #fff !important;
}

/* Filter Form */
.gpf-filter-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

/* Mobile Toggle Button (Matches Screenshot) */
.gpf-mobile-toggle {
    display: none;
    background-color: #f0f0f1; /* Light gray background */
    color: #1d2327; /* Dark bold text */
    border: 1px solid #ccd0d4;
    padding: 14px 15px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 15px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.gpf-mobile-toggle:hover {
    background-color: #e5e5e5;
}

/* Form Row & Field Wrappers */
.gpf-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end; /* Ensures inputs align at the bottom even if label text wraps */
}

.gpf-field-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
}

.gpf-field-wrap label {
    font-weight: 700;
    font-size: 14px;
    color: #1d2327;
    margin-bottom: 8px;
    display: block;
}

/* Aggressive overrides for Elementor Pro */
.gpf-form-row input[type="text"],
.gpf-form-row select {
    padding: 0 15px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    width: 100% !important;
    font-size: 14px !important;
    height: 42px !important;
    min-height: 42px !important;
    line-height: 40px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    background-color: #fff !important;
    color: #333 !important;
}

/* Grid Layout */
.gpf-results {
    margin-top: 30px;
}

.gpf-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(var(--cols-desktop, 3), 1fr);
}

/* Card Styling */
.gpf-post-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.gpf-post-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.gpf-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f1;
}

.gpf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gpf-post-card:hover .gpf-card-image img {
    transform: scale(1.05);
}

/* New Pill */
.gpf-new-pill {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    letter-spacing: 0.5px;
}

.gpf-pill-inline {
    position: static;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    box-shadow: none;
}

.gpf-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gpf-card-header {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.gpf-card-header h3 {
    margin: 0;
    font-size: 1.25em;
    line-height: 1.3;
    flex-grow: 1;
}

.gpf-card-header h3 a {
    text-decoration: none;
    color: #1d2327;
    transition: color 0.2s ease;
}

.gpf-card-header h3 a:hover {
    color: #2271b1;
}

/* Post Meta (Date) */
.gpf-post-meta {
    margin-bottom: 15px;
    font-size: 13px;
    color: #8c8f94;
    font-weight: 500;
}

.gpf-excerpt {
    color: #50575e;
    line-height: 1.6;
    font-size: 14px;
    flex-grow: 1;
    margin-bottom: 20px;
}

.gpf-excerpt p:last-child {
    margin-bottom: 0;
}

.gpf-card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f1;
    text-align: center;
}

.gpf-read-more {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gpf-read-more:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Pagination Styles */
.gpf-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    width: 100%;
}

.gpf-pagination a,
.gpf-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #2271b1;
    background: #fff;
    transition: all 0.2s ease;
}

.gpf-pagination span.current {
    background-color: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.gpf-pagination a:hover {
    background-color: #f0f0f1;
}

/* ----------------------------------------- */
/* Location Directory Links Shortcode Styles */
/* ----------------------------------------- */

.gpf-directory-links {
    margin: 40px 0;
    font-family: inherit;
}

.gpf-link-section {
    margin-bottom: 40px;
}

.gpf-link-section h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #1d2327;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 10px;
}

/* Alphabetical Navigation */
.gpf-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 25px;
}

.gpf-alpha-link,
.gpf-alpha-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
}

.gpf-alpha-link {
    background-color: #f0f0f1;
    color: #2271b1 !important; /* Aggressive override for Elementor */
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.gpf-alpha-link:hover {
    background-color: #dcdcde;
    color: #135e96 !important;
}

.gpf-alpha-active {
    background-color: #2271b1 !important;
    color: #fff !important; /* Aggressive override for Elementor */
    border-color: #2271b1 !important;
}

.gpf-alpha-active:hover {
    background-color: #135e96 !important;
    color: #fff !important;
}

.gpf-alpha-disabled {
    background-color: #f9f9f9;
    color: #c3c4c7;
    border: 1px solid #f0f0f1;
    cursor: default;
}

/* Accordion Wrapper */
.gpf-accordion-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Accordion Item */
.gpf-accordion {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background-color: #fff;
    overflow: hidden;
}

/* Accordion Header */
.gpf-accordion-header {
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    background-color: #fbfbfb;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    display: block; /* Hides default triangle on some browsers */
    position: relative;
}

/* Custom Triangle for Accordion */
.gpf-accordion-header::-webkit-details-marker {
    display: none; /* Hides default triangle in Safari/Chrome */
}

.gpf-accordion-header::after {
    content: "\25BC"; /* Down arrow */
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #8c8f94;
}

.gpf-accordion[open] .gpf-accordion-header::after {
    content: "\25B2"; /* Up arrow */
}

.gpf-accordion-header:hover {
    background-color: #f0f0f1;
}

.gpf-accordion[open] .gpf-accordion-header {
    border-bottom: 1px solid #e5e5e5;
    background-color: #fff;
}

/* Accordion Content */
.gpf-accordion-content {
    padding: 18px;
}

/* Post Link List inside Accordions */
.gpf-post-link-list {
    list-style: disc;
    margin: 0 0 0 20px;
    padding: 0;
}

.gpf-post-link-list li {
    margin-bottom: 8px;
}

.gpf-post-link-list li:last-child {
    margin-bottom: 0;
}

.gpf-post-link-list a {
    color: #2271b1;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.gpf-post-link-list a:hover {
    color: #135e96;
    text-decoration: underline;
}

.gpf-no-posts {
    color: #8c8f94;
    font-style: italic;
    margin: 0;
}

/* Directory specific pagination override */
.gpf-link-pagination {
    margin-top: 25px;
    justify-content: flex-start;
}

/* Tablet Responsiveness */
@media (max-width: 1024px) {
    .gpf-grid {
        grid-template-columns: repeat(var(--cols-tablet, 2), 1fr);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .gpf-mobile-toggle {
        display: block; /* Show the toggle button */
    }

    .gpf-form-row {
        display: none; /* Hide the form fields by default */
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-top: 15px;
    }

    .gpf-form-row.gpf-expanded {
        display: flex; /* Display them when the JS adds this class */
    }
    
    .gpf-field-wrap {
        width: 100%;
        flex: 1 1 100%;
    }

    .gpf-grid {
        grid-template-columns: repeat(var(--cols-mobile, 1), 1fr);
    }
    
    .gpf-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .gpf-tab {
        border-radius: 4px;
        text-align: center;
        border: 1px solid #e5e5e5;
    }

    .gpf-alpha-link,
    .gpf-alpha-disabled {
        min-width: 28px;
        height: 28px;
        font-size: 13px;
    }
}