/**
 * GDA Archive Filters — matches the site's Award Category form (award-category-form.css).
 * Every rule is scoped to .gda-archive-filters so it renders the same whether or not
 * the original stylesheet is loaded on the archive page.
 */

.gda-archive-filters.award-filter-wrapper {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 40px 20px;
    background: #111111;
    border: 2px solid #B0964A;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gda-archive-filters *,
.gda-archive-filters *::before,
.gda-archive-filters *::after {
    box-sizing: border-box;
}

.gda-archive-filters .gda-af-form {
    margin: 0;
}

.gda-archive-filters .award-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.gda-archive-filters .award-field {
    flex: 1;
    min-width: 200px;
}

.gda-archive-filters .award-field label {
    display: block;
    margin: 0 0 8px;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
}

.gda-archive-filters .award-field select {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 10px 40px 10px 15px;
    border: 1px solid #B0964A;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    text-overflow: ellipsis;
}

.gda-archive-filters .award-field select:focus {
    outline: none;
    border-color: #B0964A;
    box-shadow: 0 0 0 2px rgba(176, 150, 74, 0.2);
}

.gda-archive-filters .award-field select:focus-visible {
    box-shadow: 0 0 0 3px rgba(176, 150, 74, 0.6);
}

.gda-archive-filters .award-field select:disabled {
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #999;
    opacity: 0.6;
    border-color: #666;
}

/* Actions row: status on the left, buttons on the right (button sits right like the site form). */
.gda-archive-filters .award-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 20px;
    text-align: right;
}

.gda-archive-filters .gda-af-status {
    margin: 0;
    color: #ccc;
    font-size: 14px;
    text-align: left;
}

.gda-archive-filters .gda-af-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
}

/* :where() keeps button rules at the site rule's specificity, so the Elementor kit
   button style (gold gradient) still wins exactly as it does on the existing form. */
.gda-archive-filters :where(.check-post-button) {
    display: inline-block;
    padding: 12px 30px;
    background-color: #B0964A;
    color: #fff;
    border: 2px solid #B0964A;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

.gda-archive-filters :where(.check-post-button):hover,
.gda-archive-filters :where(.check-post-button):focus {
    background-color: #d4b85f;
    border-color: #d4b85f;
    color: #fff;
    text-decoration: none;
}

.gda-archive-filters :where(.check-post-button):focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Same disabled look as the site's "View Description" button. */
.gda-archive-filters :where(.check-post-button).is-disabled,
.gda-archive-filters :where(.check-post-button):disabled {
    background-color: #666;
    border-color: #666;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* With JS the dropdowns apply instantly, so only "Clear Filters" stays visible. */
.gda-archive-filters.is-enhanced.is-auto .gda-af-submit {
    display: none;
}

.gda-af-notice {
    padding: 12px 16px;
    border: 1px dashed #B0964A;
    color: #B0964A;
    background: #111;
}

/* Medal tier headings inside the Loop Grid (inserted by the JS). Colours follow the site's
   .award-winners-heading / .medal-silver / .medal-bronze styles. */
.gda-tier-heading {
    grid-column: 1 / -1;
    flex: 0 0 100%;
    width: 100%;
    margin: 28px 0 4px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(176, 150, 74, 0.55);
    color: #B0964A;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gda-tiered > .gda-tier-heading:first-child {
    margin-top: 0;
}

.gda-tier-heading__count {
    color: #ccc;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0;
}

.gda-tier-heading--silver {
    color: #d5d5d5;
    border-bottom-color: rgba(213, 213, 213, 0.45);
}

.gda-tier-heading--bronze {
    color: #cd7f32;
    border-bottom-color: rgba(205, 127, 50, 0.5);
}

.gda-tier-heading--other {
    color: #ccc;
    border-bottom-color: #444;
}

@media (max-width: 768px) {
    .gda-tier-heading {
        margin-top: 20px;
        font-size: 18px;
    }
}

/* Results grid while a filtered page is loading in place. */
.gda-af-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gda-af-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1024px) {
    .gda-archive-filters .award-field {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .gda-archive-filters.award-filter-wrapper {
        padding: 15px;
    }

    .gda-archive-filters .award-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .gda-archive-filters .award-field {
        flex: 1 1 auto;
        min-width: 100%;
    }

    .gda-archive-filters .award-field select {
        min-height: 44px;
    }

    .gda-archive-filters .award-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gda-archive-filters .gda-af-status {
        text-align: center;
    }

    .gda-archive-filters .gda-af-buttons {
        margin-left: 0;
        flex-direction: column;
    }

    .gda-archive-filters :where(.check-post-button) {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gda-archive-filters *,
    .gda-af-loading {
        transition: none !important;
    }
}
