/* ==========================================================================
   HP District Publications Frontend — Professional Design
   Covers: District selector · Year filter · PDF cards
   ========================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
    --hp-dist-primary: #0d3b6e;
    --hp-dist-primary-dark: #092c52;
    --hp-dist-primary-light: #e8f0fa;
    --hp-dist-accent: #c8973a;
    --hp-dist-accent-light: #fdf3e3;
    --hp-dist-surface: #ffffff;
    --hp-dist-surface-2: #f7f9fc;
    --hp-dist-border: #dde3ec;
    --hp-dist-text: #1a2636;
    --hp-dist-text-muted: #6b7a8d;
    --hp-dist-radius: 10px;
    --hp-dist-shadow: 0 2px 12px rgba(13, 59, 110, .07);
    --hp-dist-shadow-hover: 0 8px 28px rgba(13, 59, 110, .14);
    --hp-dist-transition: all .22s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   MAIN WRAPPER
   ========================================================================== */

.hp-district-pub-wrap {
    margin-bottom: 28px;
}

/* ── Header ────────────────────────────────────────────────────────── */
.hp-district-pub-header {
    margin-bottom: 24px;
}

.hp-district-pub-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--hp-dist-primary);
    margin: 0 0 8px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--hp-dist-accent);
    display: inline-block;
}

/* ==========================================================================
   FILTERS SECTION
   ========================================================================== */

.hp-district-pub-filters {
    background: var(--hp-dist-surface);
    border: 1px solid var(--hp-dist-border);
    border-radius: var(--hp-dist-radius);
    padding: 12px 16px;
    margin-bottom: 24px;
    box-shadow: var(--hp-dist-shadow);
    display: flex;
    justify-content: flex-end !important;
}

.hp-district-filter-row {
    display: flex;
    flex-wrap: nowrap;           /* keep on one line */
    gap: 16px;
    align-items: flex-end;
}

.hp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hp-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--hp-dist-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hp-district-select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--hp-dist-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--hp-dist-text);
    background: var(--hp-dist-surface-2);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    min-width: 160px;
    cursor: pointer;
    font-weight: 500;
}

.hp-district-select:hover {
    border-color: #aab0bb;
    background: var(--hp-dist-surface);
}

.hp-district-select:focus {
    border-color: var(--hp-dist-primary);
    box-shadow: 0 0 0 3px rgba(13, 59, 110, .1);
    background: var(--hp-dist-surface);
}

/* ==========================================================================
   DISTRICT NAVIGATION (BUTTONS)
   ========================================================================== */

.hp-district-nav {
    margin-bottom: 24px;
    background: var(--hp-dist-surface);
    border: 1px solid var(--hp-dist-border);
    border-radius: var(--hp-dist-radius);
    padding: 16px 20px;
    box-shadow: var(--hp-dist-shadow);
}

.hp-district-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hp-district-btn {
    flex: 0 1 auto;
    padding: 10px 16px;
    background: var(--hp-dist-surface-2);
    border: 1.5px solid var(--hp-dist-border);
    border-radius: 8px;
    color: var(--hp-dist-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hp-dist-transition);
    white-space: nowrap;
    text-align: center;
}

.hp-district-btn:hover {
    border-color: var(--hp-dist-primary);
    background: var(--hp-dist-primary-light);
    color: var(--hp-dist-primary);
}

.hp-district-btn.active {
    background: var(--hp-dist-primary);
    color: #fff;
    border-color: var(--hp-dist-primary);
    box-shadow: 0 4px 12px rgba(13, 59, 110, .25);
}

/* ==========================================================================
   CONTENT AREA
   ========================================================================== */

.hp-district-content {
    min-height: 200px;
}

/* ── Section Header ────────────────────────────────────────────────– */
.hp-district-section {
    margin-bottom: 28px;
}

.hp-district-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hp-dist-border);
}

.hp-district-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--hp-dist-primary);
    margin: 0;
}

.hp-district-section-year {
    font-size: 14px;
    color: var(--hp-dist-text-muted);
    font-weight: 500;
}

/* ── PDF Cards Grid ────────────────────────────────────────────────– */
.hp-district-pdfs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

/* ── Individual PDF Card ────────────────────────────────────────────– */
.hp-district-pdf-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--hp-dist-surface);
    border: 1px solid var(--hp-dist-border);
    border-left: 4px solid var(--hp-dist-primary);
    border-radius: 8px;
    padding: 16px;
    transition: var(--hp-dist-transition);
}

.hp-district-pdf-card:hover {
    box-shadow: var(--hp-dist-shadow-hover);
    border-left-color: var(--hp-dist-accent);
    transform: translateX(3px);
    background: var(--hp-dist-surface-2);
}

/* PDF Icon */
.hp-district-pdf-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--hp-dist-accent-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hp-dist-accent);
}

.hp-district-pdf-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* PDF Info */
.hp-district-pdf-info {
    flex: 1;
    min-width: 0;
}

.hp-district-pdf-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-dist-text);
    margin: 0;
    line-height: 1.4;
}

/* Download Button */
.hp-district-pdf-download {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    background: var(--hp-dist-primary);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: var(--hp-dist-transition);
    cursor: pointer;
    border: none;
}

.hp-district-pdf-download:hover {
    background: var(--hp-dist-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 151, 58, .35);
    color: #fff;
    text-decoration: none;
}

.hp-district-pdf-download .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* ==========================================================================
   EMPTY & LOADING STATES
   ========================================================================== */

#hp-district-empty {
    text-align: center;
    color: var(--hp-dist-text-muted);
    padding: 48px 20px;
    background: var(--hp-dist-surface-2);
    border: 2px dashed var(--hp-dist-border);
    border-radius: var(--hp-dist-radius);
    font-size: 15px;
}

#hp-district-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--hp-dist-text-muted);
}

#hp-district-loading p {
    margin: 0;
    font-size: 14px;
}

/* District dropdown hidden on desktop, shown only on mobile */
@media (min-width: 769px) {
    .hp-district-mobile-filter {
        display: none !important;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    /* On mobile: filters take full width, justify left, allow wrap */
    .hp-district-pub-filters {
        justify-content: flex-start;
    }

    .hp-district-filter-row {
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    /* Each filter group takes equal space side by side */
    .hp-filter-group {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }

    .hp-district-select {
        width: 100%;
        min-width: unset;
    }

    /* Hide desktop district buttons on mobile — use dropdown instead */
    .hp-district-nav {
        display: none !important;
    }

    .hp-district-pdfs {
        grid-template-columns: 1fr;
    }

    .hp-district-section-title {
        font-size: 18px;
    }

    .hp-district-pub-header h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .hp-district-pdf-card {
        flex-wrap: wrap;
        gap: 12px;
    }

    .hp-district-pdf-info {
        flex: 1 1 100%;
    }

    .hp-district-pdf-download {
        flex: 1 1 auto;
    }

    .hp-district-section-title {
        font-size: 18px;
    }
}