/* ==========================================================================
   Adria Kompas - Custom Field Filter
   Restyled to match the site's own design system (ak-* brand tokens)
   v3: each field is its own separated, rounded/bordered box (matching the
   reference design) instead of one continuous strip with hairlines.
   ========================================================================== */

.custom-field-filter {
    margin-bottom: 2.5rem;
    font-family: "IBM Plex Sans", sans-serif;
}

/* Card wrapper matching .ak-card look */
.ak-filter-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: rgba(12,59,102, 0.35) 0 14px 34px -18px;
    padding: 10px;
}

/* Fields laid out as separate boxes with a gap between them, wrapping on
   smaller screens - no shared outer border/strip anymore. */
.ak-filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}

/* Each field is its own rounded, bordered box */
#field-filter-form .field-group.ak-field-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 200px;
    min-width: 180px;
    padding: 12px 18px;
    margin-bottom: 0;
    border: 1px solid rgba(12,59,102, 0.14);
    border-radius: 12px;
    background: #FCFEFE;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

#field-filter-form .field-group.ak-field-box:hover,
#field-filter-form .field-group.ak-field-box:focus-within {
    border-color: #1565A8;
    background: #FFFFFF;
}

.ak-field-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: #1565A8;
}

.ak-field-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ak-field-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* Eyebrow-style label, matching .ak-t-h6 */
#field-filter-form .ak-field-box .form-label {
    display: block;
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #5C5C69;
}

/* Select now sits flush inside its segment - no border/background of its
   own, so the whole strip reads as one search bar instead of N dropdowns */
#field-filter-form .ak-field-box .form-select {
    width: 100%;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #0C3B66;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0 18px 0 0;
    height: auto;
    line-height: 1.3;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C5C69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 14px;
}

#field-filter-form .ak-field-box .form-select:focus {
    outline: none;
    box-shadow: none;
}

/* Dropdown list (the <option> panel the browser opens) - styled as far as
   browsers allow native <select> options to be styled. Chromium respects
   background-color/color/padding on <option>; it does NOT allow rounding
   the panel's own corners or a custom hover color (that needs a fully
   custom JS-built dropdown to replace <select> - happy to build one if
   you want the exact rounded/highlighted list from the reference, this
   is the closest a native select can get). */
#field-filter-form .ak-field-box .form-select option {
    padding: 10px 14px;
    background-color: #FFFFFF;
    color: #0C3B66;
    font-weight: 500;
}

#field-filter-form .ak-field-box .form-select option:checked,
#field-filter-form .ak-field-box .form-select option:hover {
    background-color: #EAF2FA;
    color: #0C3B66;
}

/* Actions (buttons) group - sits as the last segment of the same strip */
.ak-filter-actions {
    display: flex;
    gap: 0.6rem;
    flex: 0 0 auto;
    align-items: center;
    padding: 8px;
    margin-bottom: 0;
}

/* Primary CTA button, matching .ak-cta-btn, now icon + label */
#field-filter-form .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #EE6C4D;
    border: 1px solid #EE6C4D;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 15px;
    border-radius: 999px;
    padding: 12px 26px;
    height: 48px;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ak-btn-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

#field-filter-form .btn-primary:hover {
    background-color: #d85a3d;
    border-color: #d85a3d;
    transform: translateY(-1px);
}

/* Secondary / reset button - outline style */
#field-filter-form .btn-secondary {
    background-color: transparent;
    border: 1px solid rgba(12,59,102, 0.25);
    color: #0C3B66;
    font-weight: 700;
    font-size: 15px;
    border-radius: 999px;
    padding: 12px 24px;
    height: 48px;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#field-filter-form .btn-secondary:hover {
    background-color: #F2EAD9;
    border-color: rgba(12,59,102, 0.4);
}

/* Responsive: stack fields and full-width buttons on smaller screens */
@media (max-width: 900px) {
    .ak-filter-card {
        padding: 8px;
    }

    #field-filter-form .field-group.ak-field-box {
        flex: 1 1 calc(50% - 12px);
    }

    .ak-filter-actions {
        flex: 1 1 100%;
        margin-top: 0;
        padding: 4px 8px 8px;
    }

    #field-filter-form .btn-primary,
    #field-filter-form .btn-secondary {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    #field-filter-form .field-group.ak-field-box {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Results grid
   ========================================================================== */

.filtered-items.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    margin-top: 1.5rem;
}

/* Each item - card look matching .ak-card */
.filtered-items .item {
    flex: 1 1 calc(50% - 20px);
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: rgba(12,59,102, 0.25) 0 10px 28px -16px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.filtered-items .item:hover {
    box-shadow: rgba(12,59,102, 0.35) 0 14px 34px -18px;
    transform: translateY(-2px);
}

.filtered-items .item-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.filtered-items .item-image:hover img {
    transform: scale(1.05);
}

.filtered-items .item-content {
    padding: 18px 20px 20px;
}

.filtered-items .item-content h3 {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #0C3B66;
}

.filtered-items .item-content .item-date,
.filtered-items .item-content .item-category {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #5C5C69;
    margin-bottom: 8px;
}

.filtered-items .item-content .item-description {
    font-size: 1rem;
    color: #444;
    margin-bottom: 15px;
}

/* Read More button - coral pill, matching .ak-cta-btn */
.filtered-items .btn-primary {
    display: inline-block;
    background-color: #EE6C4D;
    color: #FFFFFF;
    font-weight: 700;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.filtered-items .btn-primary:hover {
    background-color: #d85a3d;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination-wrapper {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

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

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(12,59,102, 0.18);
    color: #0C3B66;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.page-link:hover {
    background-color: #F2EAD9;
    border-color: rgba(12,59,102, 0.35);
}

.page-link.active {
    background-color: #EE6C4D;
    color: #FFFFFF;
    border-color: #EE6C4D;
}

/* Responsive Design */
@media (max-width: 767px) {
    .filtered-items .item {
        flex: 1 1 100%;
    }

    .filtered-items .item-image img {
        height: 300px;
    }
}
