/**
 * LD Schools — Public Stylesheet
 * Styles for search, results, comparison, and school detail pages.
 * Matches the live site's Explore Schools design.
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    /* The homepage is the design anchor. These map onto the theme's V2
       tokens so the plugin's screens (Explore Schools, compare, school
       detail) inherit the same coral/ink palette, soft shadows and rounded
       corners instead of the legacy v1 navy. Fallbacks keep the plugin
       presentable if it is ever rendered without the theme. */
    --lds-primary: var(--ldst-primary, #FF4760);
    --lds-primary-dark: var(--ldst-primary-dark, #D2001C);
    --lds-primary-light: var(--ldst-primary-light, #FFF0F1);
    --lds-accent: var(--ldst-accent, #FF6430);
    --lds-accent-light: var(--ldst-accent-light, #FFF3ED);
    --lds-success: var(--ldst-success, #198754);
    --lds-warning: var(--ldst-warning, #FFC107);
    --lds-danger: var(--ldst-danger, #BC2D3B);
    --lds-ink: var(--ldst-ink, #1B293E);
    --lds-text: var(--ldst-text, #334155);
    --lds-text-light: var(--ldst-text-light, #64748B);
    --lds-border: var(--ldst-border, #E7ECF2);
    --lds-bg: var(--ldst-bg, #F8FAFC);
    --lds-white: #fff;
    --lds-shadow: var(--ldst-shadow, 0 6px 18px rgba(27, 41, 62, 0.06));
    --lds-shadow-lg: var(--ldst-shadow-lg, 0 12px 34px rgba(27, 41, 62, 0.09));
    --lds-radius: var(--ldst-radius, 12px);
    --lds-radius-lg: var(--ldst-radius-lg, 16px);
    --lds-transition: 0.2s ease;
}

/* ==========================================================================
   Base / Common
   ========================================================================== */
.lds-search-wrapper,
.lds-compare-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: var(--ldst-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--lds-text);
}

.lds-btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: var(--lds-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background var(--lds-transition), transform var(--lds-transition);
    line-height: 1.4;
    font-family: inherit;
}

.lds-btn:hover {
    transform: translateY(-1px);
}

.lds-btn-primary {
    background: var(--lds-primary);
    color: var(--lds-white);
}

.lds-btn-primary:hover {
    background: var(--lds-primary-dark);
    color: var(--lds-white);
}

.lds-btn-secondary {
    background: var(--lds-white);
    color: var(--lds-ink);
    border: 1px solid var(--lds-border);
}

.lds-btn-secondary:hover {
    background: var(--lds-white);
    border-color: var(--lds-primary);
    color: var(--lds-primary);
}

/* ==========================================================================
   Search Banner — matches the live site blue banner
   ========================================================================== */
.lds-search-banner {
    background:
        linear-gradient(90deg, rgba(20, 28, 38, 0.78) 0%, rgba(20, 28, 38, 0.50) 45%, rgba(20, 28, 38, 0.05) 80%),
        url('../images/expschools-hero-v1.webp') center top / cover no-repeat;
    color: var(--lds-white);
    /* Slim header band (best practice for a search page) — keeps the search
       form near the top. Image anchored to the top (faces), not centered. */
    display: flex;
    align-items: center;
    min-height: clamp(200px, 26vw, 320px);
    /* Soft bottom shadow for a modern, lifted feel */
    box-shadow: 0 12px 28px rgba(20, 28, 38, 0.18);
    position: relative;
    z-index: 1;
}

.lds-banner-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
}

.lds-banner-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    color: var(--lds-white);
    margin: 0 0 12px;
    text-align: left;
}

.lds-banner-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.92);
    max-width: 600px;
    margin: 0;
    line-height: 1.55;
    text-align: left;
}

/* ==========================================================================
   Search Form Section — pencil background + form
   ========================================================================== */
/* Two separate cards side by side — the ad panel and the form each carry
   their own border, radius and shadow, with a gap between them. The wrapper
   is now only a layout row. */
.lds-search-form-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-top: 30px;
}

.lds-form-bg-col {
    flex: 0 0 220px;
    background: var(--lds-bg);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius-lg);
    box-shadow: var(--lds-shadow-lg);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0; /* ad fills the 220px column edge-to-edge */
    overflow: hidden; /* clips the slide to the rounded corners */
}

.lds-form-bg-img {
    max-width: 100%;
    height: auto;
    opacity: 0.85;
}

/* Rotating ad banner (crossfade). Slide artwork is 220x503; the slot is
   shorter than that so it does not out-run the form beside it and leave dead
   space below — object-fit:cover on the img centre-crops the difference. */
.lds-form-bg-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 220 / 400;
}
.lds-form-bg-slider .lds-ad-slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
.lds-form-bg-slider .lds-ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill the slot, no letterboxing */
    display: block;
}
.lds-form-bg-slider .lds-ad-slide.is-active {
    opacity: 1; /* full strength — these are ads, not a faded backdrop */
    z-index: 1;
}

.lds-form-content-col {
    flex: 1;
    min-width: 0;
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius-lg);
    box-shadow: var(--lds-shadow-lg);
    padding: 25px 30px 30px;
}

.lds-form-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--lds-ink);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--lds-border);
}

/* ==========================================================================
   Search Form
   ========================================================================== */
.lds-search-form {
    /* No border/shadow — form is inside the section card */
}

.lds-search-row {
    margin-bottom: 18px;
}

.lds-search-row:last-child {
    margin-bottom: 0;
}

/* Name search */
.lds-name-search .lds-field-full {
    width: 100%;
}

.lds-name-search .lds-field-full > label {
    display: none; /* label shown via placeholder & subtitle instead */
}

.lds-search-input-wrap {
    display: flex;
    gap: 0;
}

.lds-search-input-wrap input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--lds-border);
    border-right: none;
    border-radius: var(--lds-radius) 0 0 var(--lds-radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--lds-ink);
    outline: none;
    transition: border-color var(--lds-transition), box-shadow var(--lds-transition);
}

.lds-search-input-wrap input[type="text"]:focus {
    border-color: var(--lds-primary);
    box-shadow: 0 0 0 3px var(--lds-primary-light);
}

.lds-search-btn {
    padding: 12px 18px;
    background: var(--lds-primary);
    color: var(--lds-white);
    border: 1px solid var(--lds-primary);
    border-radius: 0 var(--lds-radius) var(--lds-radius) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--lds-transition);
}

.lds-search-btn:hover {
    background: var(--lds-primary-dark);
    border-color: var(--lds-primary-dark);
}

/* Filter dropdowns */
.lds-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.lds-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 5px;
    color: var(--lds-ink);
}

/* Hide native multi-select — replaced by custom dropdown */
.lds-multi-select {
    display: none !important;
}

/* ==========================================================================
   Custom Searchable Multi-Select Dropdown
   Mimics the Bootstrap Multiselect look from the live site.
   ========================================================================== */
.lds-ms-wrapper {
    position: relative;
    width: 100%;
}

.lds-ms-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--lds-text-light);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--lds-transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 38px;
}

.lds-ms-toggle:hover {
    border-color: var(--lds-primary);
}

/* Same coral focus ring the homepage search fields use. */
.lds-ms-toggle:focus {
    border-color: var(--lds-primary);
    box-shadow: 0 0 0 3px var(--lds-primary-light);
    outline: none;
}

.lds-ms-toggle.has-selection {
    color: var(--lds-text);
    font-weight: 500;
}

.lds-ms-caret {
    flex-shrink: 0;
    margin-left: 6px;
    font-size: 10px;
    color: var(--lds-text-light);
}

.lds-ms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-top: none;
    border-radius: 0 0 var(--lds-radius) var(--lds-radius);
    box-shadow: var(--lds-shadow-lg);
    z-index: 999;
    max-height: 280px;
    overflow: hidden;
    display: none;
}

.lds-ms-dropdown.open {
    display: block;
}

.lds-ms-search-wrap {
    padding: 6px 8px;
    border-bottom: 1px solid var(--lds-border);
}

.lds-ms-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--lds-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.lds-ms-search:focus {
    border-color: var(--lds-primary);
}

.lds-ms-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.lds-ms-option {
    display: flex;
    align-items: flex-start;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.1s;
}

.lds-ms-option:hover {
    background: var(--lds-primary-light);
}

.lds-ms-option input[type="checkbox"] {
    accent-color: var(--lds-primary);
    width: 15px;
    height: 15px;
    flex: 0 0 15px; /* never shrink — keeps long labels from crashing the box */
    /* explicit right margin (not flex gap) so the label never touches the box */
    margin: 1px 10px 0 0;
    cursor: pointer;
}

.lds-ms-option span {
    flex: 1;
    min-width: 0; /* allow the label to wrap instead of overflowing */
    color: var(--lds-text);
}

.lds-ms-option.hidden {
    display: none;
}

/* Charter radio group */
.lds-radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lds-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

.lds-radio input[type="radio"] {
    accent-color: var(--lds-primary);
    width: 16px;
    height: 16px;
    margin: 0;
}

/* More Filters button */
.lds-btn-more-filters {
    background: var(--lds-white);
    color: var(--lds-ink);
    padding: 8px 20px;
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--lds-transition);
    font-family: inherit;
}

.lds-btn-more-filters:hover {
    background: var(--lds-white);
    border-color: var(--lds-primary);
    color: var(--lds-primary);
}

.lds-more-arrow {
    font-size: 10px;
    transition: transform var(--lds-transition);
}

.lds-more-filters-row.open .lds-more-arrow {
    transform: rotate(180deg);
}

/* STAAR filter toggles — radio pair layout matching live site */
.lds-fieldset {
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    padding: 18px 20px;
    margin: 0;
}

.lds-fieldset legend {
    font-size: 13px;
    font-weight: 700;
    padding: 0 8px;
    color: var(--lds-ink);
}

.lds-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
}

.lds-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lds-filter-option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--lds-text);
}

.lds-radio-pair {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* Actions */
.lds-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding-top: 5px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.lds-loading {
    text-align: center;
    padding: 40px 20px;
}

.lds-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--lds-border);
    border-top: 4px solid var(--lds-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: lds-spin 0.8s linear infinite;
}

@keyframes lds-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Results
   ========================================================================== */
.lds-results-section {
    margin: 30px auto;
    padding: 0 20px;
    max-width: 1200px;
}

.lds-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.lds-results-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--lds-primary);
}

.lds-results-count {
    font-size: 14px;
    color: var(--lds-text-light);
}

/* Results meta row: count + sort control */
.lds-results-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.lds-sort-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lds-sort-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lds-text);
    margin: 0;
    white-space: nowrap;
}

.lds-sort-select {
    font-size: 13px;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    background-color: #fff;
    color: var(--lds-text);
    cursor: pointer;
}

@media (max-width: 600px) {
    .lds-results-meta {
        width: 100%;
        justify-content: space-between;
    }
}

/* Individual school result card */
.lds-school-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    margin-bottom: 8px;
    transition: box-shadow var(--lds-transition);
}

.lds-school-result:hover {
    box-shadow: var(--lds-shadow);
}

.lds-school-result-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lds-school-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    min-width: 200px;
}

.lds-school-title a {
    color: var(--lds-primary);
    text-decoration: none;
}

.lds-school-title a:hover {
    text-decoration: underline;
    color: var(--lds-primary-dark);
}

.lds-school-score {
    font-size: 14px;
    color: var(--lds-text-light);
    white-space: nowrap;
}

.lds-compare-btn {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    /* Brand coral, not the legacy orange accent. Text uses primary-dark:
       coral on the tinted background is only 3.0:1, primary-dark is 5.05:1. */
    background: var(--lds-primary-light);
    color: var(--lds-primary-dark);
    border: 1px solid var(--lds-primary);
    border-radius: var(--lds-radius);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--lds-transition), color var(--lds-transition);
    font-family: inherit;
}

.lds-compare-btn:hover {
    background: var(--lds-primary);
    color: var(--lds-white);
}

.lds-compare-btn.added {
    background: var(--lds-success);
    color: var(--lds-white);
    border-color: var(--lds-success);
}

.lds-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--lds-text-light);
    font-size: 16px;
    background: var(--lds-bg);
    border-radius: var(--lds-radius);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.lds-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.lds-page-btn {
    padding: 8px 14px;
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    background: var(--lds-white);
    color: var(--lds-text);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background var(--lds-transition);
}

.lds-page-btn:hover {
    background: var(--lds-bg);
}

.lds-page-btn.active {
    background: var(--lds-primary);
    color: var(--lds-white);
    border-color: var(--lds-primary);
}

.lds-page-ellipsis {
    padding: 8px 5px;
    color: var(--lds-text-light);
}

/* ==========================================================================
   Compare Bar (Sticky)
   ========================================================================== */
.lds-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--lds-white);
    border-top: 2px solid var(--lds-primary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    padding: 12px 20px;
}

.lds-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lds-compare-label {
    font-weight: 700;
    color: var(--lds-primary);
    font-size: 14px;
    white-space: nowrap;
}

.lds-compare-slots {
    flex: 1;
    display: flex;
    gap: 10px;
}

.lds-compare-slot {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--lds-primary-light);
    border-radius: var(--lds-radius);
    font-size: 13px;
}

.lds-compare-slot.active {
    display: flex;
}

/* School names in the compare bar link through to the school's page.
   Styled to read as a link inside the coral-tinted chip without fighting it. */
.lds-slot-name a {
    color: var(--lds-ink);
    text-decoration: none;
    border-bottom: 1px solid rgba(27, 41, 62, 0.28);
}

.lds-slot-name a:hover,
.lds-slot-name a:focus {
    color: var(--lds-primary-dark);
    border-bottom-color: var(--lds-primary-dark);
}

.lds-slot-remove {
    background: none;
    border: none;
    color: var(--lds-danger);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 0 4px;
}

.lds-btn-compare {
    background: var(--lds-primary);
    color: var(--lds-white);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--lds-radius);
    text-decoration: none;
}

.lds-btn-compare:hover {
    background: var(--lds-primary-dark);
    color: var(--lds-white);
}

/* ==========================================================================
   Glossary
   ========================================================================== */
.lds-glossary-section {
    margin: 50px auto 0;
    padding: 30px 20px 0;
    border-top: 2px solid var(--lds-border);
    max-width: 1200px;
}

.lds-glossary-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 24px;
    color: var(--lds-primary);
    margin-bottom: 20px;
    text-align: center;
}

.lds-glossary-item {
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    margin-bottom: 5px;
    overflow: hidden;
}

.lds-glossary-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--lds-bg);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--lds-text);
    text-align: left;
    font-family: inherit;
    transition: background var(--lds-transition);
}

.lds-glossary-toggle:hover {
    background: var(--lds-primary-light);
}

.lds-glossary-state-badge {
    margin-right: auto;
    margin-left: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    background: var(--lds-primary, #0a4a8f);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.lds-glossary-arrow {
    transition: transform var(--lds-transition);
    font-size: 12px;
    color: var(--lds-text-light);
}

.lds-glossary-item.open .lds-glossary-arrow {
    transform: rotate(180deg);
}

.lds-glossary-content {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--lds-text-light);
    border-top: 1px solid var(--lds-border);
}

/* ==========================================================================
   Comparison Page
   ========================================================================== */
.lds-compare-header {
    text-align: center;
    padding: 20px 0 30px;
}

.lds-compare-title {
    font-size: 28px;
    color: var(--lds-primary);
    margin: 0 0 10px;
}

.lds-compare-desc {
    color: var(--lds-text-light);
}

.lds-compare-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--lds-bg);
    border-radius: var(--lds-radius);
}

.lds-compare-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--lds-border);
    margin-bottom: 15px;
}

.lds-compare-loading {
    text-align: center;
    padding: 60px 20px;
}

/* Comparison table layout */
.lds-compare-schools-header {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 2px;
    margin-bottom: 25px;
    /* Freeze-pane: school names stay visible while scrolling the metrics
       (Siva format correction 2026-07). Sits below the site header AND the sticky year picker above it. */
    position: sticky;
    top: calc(var(--lds-adminbar-h) + var(--lds-siteheader-h) + var(--lds-yearbar-h));
    z-index: 50;
    background: #fff;
    padding: 10px 0 12px;
    border-bottom: 1px solid #E7ECF2;
    box-shadow: 0 6px 12px rgba(27, 41, 62, 0.05);
}

.lds-compare-col {
    padding: 15px;
    text-align: center;
}

.lds-compare-label-col {
    /* Empty label column */
}

.lds-compare-school-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--lds-ink);
    margin: 0 0 5px;
}

.lds-compare-school-name a {
    color: inherit;
    text-decoration: none;
}

.lds-compare-school-name a:hover,
.lds-compare-school-name a:focus {
    color: var(--lds-primary-dark);
    text-decoration: underline;
}

.lds-compare-school-district {
    font-size: 13px;
    color: var(--lds-text-light);
    margin: 0;
}

/* Comparison sections */
.lds-compare-section {
    margin-bottom: 25px;
}

.lds-compare-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lds-primary);
    padding: 10px 15px;
    background: var(--lds-primary-light);
    border-radius: var(--lds-radius) var(--lds-radius) 0 0;
    margin: 0;
}

.lds-compare-table {
    border: 1px solid var(--lds-border);
    border-top: none;
    border-radius: 0 0 var(--lds-radius) var(--lds-radius);
    overflow: hidden;
}

.lds-compare-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    border-bottom: 1px solid var(--lds-border);
}

.lds-compare-row:last-child {
    border-bottom: none;
}

.lds-compare-row:nth-child(even) {
    background: var(--lds-bg);
}

.lds-compare-cell {
    padding: 10px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.lds-compare-cell-label {
    font-weight: 600;
    color: var(--lds-text);
}

.lds-compare-cell-value {
    justify-content: center;
    text-align: center;
}

.lds-compare-cell-value.higher {
    color: var(--lds-success);
    font-weight: 600;
}

.lds-compare-cell-value.lower {
    color: var(--lds-danger);
}

/* Year selector */
/* Sticky stack on the compare page: site header -> year picker -> school
   names. The offsets are derived from these two values rather than hand-
   tuned, so the freeze-pane always lands exactly under the year band.
   Change the band height in one place and everything below follows. */
:root {
    --lds-siteheader-h: 80px;   /* .ldst-header-inner height */
    --lds-yearbar-h: 60px;      /* fixed so the offset maths is exact */
    --lds-adminbar-h: 0px;      /* raised when the WP admin bar is present */
}

body.admin-bar { --lds-adminbar-h: 32px; }

@media screen and (max-width: 782px) {
    body.admin-bar { --lds-adminbar-h: 46px; }
}

.lds-compare-year-select {
    position: sticky;
    top: calc(var(--lds-adminbar-h) + var(--lds-siteheader-h));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    height: var(--lds-yearbar-h);
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 600;
    color: var(--lds-ink);
    background: var(--lds-white);
}

.lds-compare-year-select select {
    padding: 6px 12px;
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
}

/* Compare actions */
.lds-compare-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--lds-border);
}

/* Subscription gate */
.lds-subscription-gate {
    text-align: center;
    padding: 40px 20px;
    background: var(--lds-primary-light);
    border: 2px solid var(--lds-primary);
    border-radius: var(--lds-radius);
}

.lds-subscription-gate h3 {
    /* Ink, not coral — headings follow the homepage anchor. */
    color: var(--lds-ink);
    font-size: 22px;
    margin: 0 0 10px;
}

.lds-subscription-gate p {
    color: var(--lds-text);
    margin: 0 0 20px;
}

.lds-subscribe-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--lds-primary);
    color: var(--lds-white);
    text-decoration: none;
    border-radius: var(--lds-radius);
    font-weight: 600;
}

.lds-subscribe-btn:hover {
    background: #d16820;
    color: var(--lds-white);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .lds-form-bg-col {
        display: none;
    }

    .lds-search-form-section {
        display: block;
    }
}

@media (max-width: 768px) {
    .lds-filters {
        grid-template-columns: 1fr 1fr;
    }

    .lds-toggle-group {
        grid-template-columns: 1fr;
    }

    .lds-school-result {
        flex-wrap: wrap;
    }

    .lds-school-result-main {
        width: 100%;
    }

    .lds-school-title {
        min-width: unset;
        width: 100%;
    }

    .lds-compare-schools-header,
    .lds-compare-row {
        grid-template-columns: 1fr;
    }

    .lds-compare-label-col {
        display: none;
    }

    .lds-compare-cell-label {
        background: var(--lds-primary-light);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .lds-compare-bar-inner {
        flex-wrap: wrap;
    }

    .lds-compare-slots {
        width: 100%;
    }

    .lds-pagination {
        flex-wrap: wrap;
    }

    .lds-banner-title {
        font-size: 26px;
    }

    .lds-banner-desc {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lds-filters {
        grid-template-columns: 1fr;
    }

    .lds-form-content-col {
        padding: 15px;
    }

    .lds-actions {
        flex-direction: column;
    }

    .lds-actions .lds-btn {
        width: 100%;
    }

    .lds-radio-group {
        gap: 12px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
/* The repeated school-name header exists in the DOM at all times but is
   print-only — see CompareView.injectPrintHeads(). */
.lds-print-head { display: none; }

@media print {
    .lds-compare-bar,
    .lds-compare-actions,
    .lds-compare-year-select,
    .lds-compare-manage,
    .lds-compare-suggest,
    .lds-search-form-section,
    .lds-search-banner,
    .lds-more-filters-row {
        display: none !important;
    }

    .lds-compare-wrapper,
    .lds-search-wrapper {
        max-width: 100%;
        padding: 0;
    }

    /* The on-screen header is position:sticky, which does not paginate — it
       printed a blank page. Every section carries its own .lds-print-head
       copy of the school names, so the original is redundant on paper and is
       hidden outright rather than left to strand a page of its own. */
    .lds-compare-schools-header {
        display: none !important;
    }

    /* Each section carries the school names and starts a fresh page, so every
       sheet is readable on its own. Uses the adjacent-sibling selector rather
       than :first-of-type — the first div in the content is the header, not a
       section, so :first-of-type matched nothing and the first section broke
       a page too. This matches every section EXCEPT the first. */
    .lds-compare-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .lds-compare-section + .lds-compare-section {
        page-break-before: always;
        break-before: page;
    }

    .lds-print-head {
        display: grid;
        padding: 0 0 8px;
        margin-bottom: 6px;
        border-bottom: 1px solid #E7ECF2;
        page-break-after: avoid;
        break-after: avoid;
    }

    .lds-compare-section-title {
        page-break-after: avoid;
        break-after: avoid;
    }

    .lds-compare-row {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Keep the score/rating colours and section bands on paper. */
    .lds-compare-wrapper,
    .lds-compare-wrapper * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Glossary — state scope note + nudge */
.lds-glossary-state-note {
    margin: 0 0 10px;
    color: var(--lds-text-light, #6A6868);
    font-size: 14px;
}
.lds-glossary-nudge {
    background: var(--lds-primary-light, #FFF0F1);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--lds-text, #292929);
}
.lds-glossary-nudge a { font-weight: 600; color: var(--lds-primary-dark, #D2001C); }

/* ==========================================================================
   Button color guard — red button always reads white
   ==========================================================================
   Theme container link rules (`.ldst-entry-content a`, `.ldst-footer a`, …)
   are more specific than the `.lds-btn-*` classes, so a plugin button
   rendered inside page content picked up the container's link color instead
   of its own — a coral button with coral text. Restating the colors with
   element+class specificity keeps the button's own color winning wherever
   the shortcode is placed. Keep this block LAST in the file.
   -------------------------------------------------------------------------- */
a.lds-btn.lds-btn-primary,
a.lds-btn.lds-btn-primary:link,
a.lds-btn.lds-btn-primary:visited,
a.lds-btn.lds-btn-primary:hover,
a.lds-btn.lds-btn-primary:focus,
a.lds-btn.lds-btn-primary:active {
    color: var(--lds-white);
}

a.lds-btn.lds-btn-compare,
a.lds-btn.lds-btn-compare:link,
a.lds-btn.lds-btn-compare:visited,
a.lds-btn.lds-btn-compare:hover,
a.lds-btn.lds-btn-compare:focus,
a.lds-btn.lds-btn-compare:active {
    color: var(--lds-white);
}

a.lds-btn.lds-btn-secondary,
a.lds-btn.lds-btn-secondary:link,
a.lds-btn.lds-btn-secondary:visited,
a.lds-btn.lds-btn-secondary:hover,
a.lds-btn.lds-btn-secondary:focus,
a.lds-btn.lds-btn-secondary:active {
    color: var(--lds-text);
}

/* ==========================================================================
   Compare page — manage the comparison in place
   ==========================================================================
   Add / search / remove without going back to Explore Schools.
   -------------------------------------------------------------------------- */
.lds-compare-manage {
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius-lg);
    box-shadow: var(--lds-shadow);
    padding: 16px 18px;
    margin: 0 0 22px;
}

.lds-compare-manage-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
}

.lds-compare-picked {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.lds-compare-picked:empty::before {
    content: 'No schools selected yet.';
    color: var(--lds-text-light);
    font-size: 13px;
}

.lds-compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: var(--lds-primary-light);
    border-radius: var(--lds-radius);
    font-size: 13px;
    max-width: 100%;
}

.lds-compare-chip a,
.lds-compare-chip span {
    color: var(--lds-ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lds-compare-chip a {
    border-bottom: 1px solid rgba(27, 41, 62, 0.28);
}

.lds-compare-chip a:hover {
    color: var(--lds-primary-dark);
    border-bottom-color: var(--lds-primary-dark);
}

.lds-compare-chip-remove {
    background: none;
    border: none;
    padding: 0 2px;
    line-height: 1;
    font-size: 16px;
    color: var(--lds-primary-dark);
    cursor: pointer;
}

.lds-compare-chip-remove:hover {
    color: var(--lds-ink);
}

.lds-compare-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--lds-text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.lds-compare-add {
    position: relative;
    margin-top: 12px;
}

.lds-compare-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--lds-ink);
    outline: none;
    transition: border-color var(--lds-transition), box-shadow var(--lds-transition);
}

.lds-compare-search:focus {
    border-color: var(--lds-primary);
    box-shadow: 0 0 0 3px var(--lds-primary-light);
}

.lds-compare-search:disabled {
    background: var(--lds-bg);
    color: var(--lds-text-light);
    cursor: not-allowed;
}

.lds-compare-suggest {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 320px;
    overflow-y: auto;
    background: var(--lds-white);
    border: 1px solid var(--lds-border);
    border-radius: var(--lds-radius);
    box-shadow: var(--lds-shadow-lg);
}

.lds-compare-suggest-item,
.lds-compare-suggest .is-selected,
.lds-compare-suggest-empty {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--lds-border);
}

.lds-compare-suggest-item:last-child,
.lds-compare-suggest .is-selected:last-child {
    border-bottom: none;
}

.lds-compare-suggest-item {
    cursor: pointer;
}

.lds-compare-suggest-item:hover {
    background: var(--lds-primary-light);
}

.lds-compare-suggest-item strong,
.lds-compare-suggest .is-selected strong {
    display: block;
    color: var(--lds-ink);
    font-weight: 700;
}

.lds-compare-suggest-item span,
.lds-compare-suggest .is-selected span {
    color: var(--lds-text-light);
}

.lds-compare-suggest .is-selected {
    opacity: 0.6;
    cursor: default;
}

.lds-compare-suggest .is-selected em {
    display: block;
    margin-top: 2px;
    color: var(--lds-primary-dark);
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
}

.lds-compare-suggest-empty {
    color: var(--lds-text-light);
}
