/*
 * UMBC Guide — Archive / Filter View
 * Scoped to .guide-* classes. No global element selectors.
 * Dark mode: both @media and [data-theme] blocks kept in sync.
 */

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
    --guide-text-primary:      #2a2b2c;
    --guide-text-secondary:    #636466;
    --guide-text-tertiary:     #8a8b8d;
    --guide-text-teal:         #007176;
    --guide-teal-light:        #c6e1e2;
    --guide-bg-page:           #fff;
    --guide-bg-light:          #f0f0f0;
    --guide-bg-lighter:        #fcfcfc;
    --guide-bg-header:         #f5f5f5;
    --guide-bg-hover:          #e7e7e7;
    --guide-border:            #757575;
    --guide-border-light:      #f0f0f0;
    --guide-border-url:        #999;
    --guide-accent:            #fdb515;
    --guide-accent-light:      rgba(253, 181, 21, 0.10);
    --guide-focus:             rgba(253, 181, 21, 0.40);
    --guide-link-title:        #252525;
    --guide-radius:            6px;
    --guide-radius-sm:         4px;
    --guide-speed:             0.2s;
    --guide-ease:              cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --guide-shadow-sm:         0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --guide-shadow-md:         0 4px 6px -1px rgba(0,0,0,0.10), 0 2px 4px -1px rgba(0,0,0,0.06);
    --guide-touch:             36px;
    --guide-social-filter:     grayscale(100%) brightness(0.6);
    --guide-social-filter-hover: grayscale(0%) brightness(0.9);
    --guide-myumbc-filter:     brightness(0.05);
    --guide-icon-filter:       none;
}

@media (prefers-color-scheme: dark) {
    :root {
        --guide-text-primary:      #e8e9ea;
        --guide-text-secondary:    #a8aaac;
        --guide-text-tertiary:     #787a7c;
        --guide-text-teal:         #4db8bc;
        --guide-teal-light:        rgba(77, 184, 188, 0.15);
        --guide-bg-page:           #1e1f20;
        --guide-bg-light:          #2a2b2c;
        --guide-bg-lighter:        #1e1f20;
        --guide-bg-header:         #2a2b2c;
        --guide-bg-hover:          #333435;
        --guide-border:            #555759;
        --guide-border-light:      #3a3b3c;
        --guide-border-url:        #555759;
        --guide-accent-light:      rgba(253, 181, 21, 0.12);
        --guide-link-title:        #d0d1d2;
        --guide-shadow-sm:         0 1px 3px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
        --guide-shadow-md:         0 4px 6px -1px rgba(0,0,0,0.40), 0 2px 4px -1px rgba(0,0,0,0.30);
        --guide-social-filter:     grayscale(100%) brightness(1.8);
        --guide-social-filter-hover: grayscale(0%) brightness(1.1);
        --guide-myumbc-filter:     brightness(5);
        --guide-icon-filter:       invert(1);
    }
}

[data-theme="light"] {
    --guide-text-primary:      #2a2b2c;
    --guide-text-secondary:    #636466;
    --guide-text-tertiary:     #8a8b8d;
    --guide-text-teal:         #007176;
    --guide-teal-light:        #c6e1e2;
    --guide-bg-page:           #fff;
    --guide-bg-light:          #f0f0f0;
    --guide-bg-lighter:        #fcfcfc;
    --guide-bg-header:         #f5f5f5;
    --guide-bg-hover:          #e7e7e7;
    --guide-border:            #757575;
    --guide-border-light:      #f0f0f0;
    --guide-border-url:        #999;
    --guide-accent-light:      rgba(253, 181, 21, 0.10);
    --guide-link-title:        #252525;
    --guide-shadow-sm:         0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --guide-shadow-md:         0 4px 6px -1px rgba(0,0,0,0.10), 0 2px 4px -1px rgba(0,0,0,0.06);
    --guide-social-filter:     grayscale(100%) brightness(0.6);
    --guide-social-filter-hover: grayscale(0%) brightness(0.9);
    --guide-myumbc-filter:     brightness(0.05);
    --guide-icon-filter:       none;
}

[data-theme="dark"] {
    --guide-text-primary:      #e8e9ea;
    --guide-text-secondary:    #a8aaac;
    --guide-text-tertiary:     #787a7c;
    --guide-text-teal:         #4db8bc;
    --guide-teal-light:        rgba(77, 184, 188, 0.15);
    --guide-bg-page:           #1e1f20;
    --guide-bg-light:          #2a2b2c;
    --guide-bg-lighter:        #1e1f20;
    --guide-bg-header:         #2a2b2c;
    --guide-bg-hover:          #333435;
    --guide-border:            #555759;
    --guide-border-light:      #3a3b3c;
    --guide-border-url:        #555759;
    --guide-accent-light:      rgba(253, 181, 21, 0.12);
    --guide-link-title:        #d0d1d2;
    --guide-shadow-sm:         0 1px 3px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
    --guide-shadow-md:         0 4px 6px -1px rgba(0,0,0,0.40), 0 2px 4px -1px rgba(0,0,0,0.30);
    --guide-social-filter:     grayscale(100%) brightness(1.8);
    --guide-social-filter-hover: grayscale(0%) brightness(1.1);
    --guide-myumbc-filter:     brightness(5);
    --guide-icon-filter:       invert(1);
}

/* ==========================================================================
   Page header
   ========================================================================== */

.page-header {
    padding: 0;
    margin-bottom: 2rem;
}

.page-header .guide-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--guide-text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.page-header .archive-description p {
    font-size: 1.1rem;
    color: var(--guide-text-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .page-header .guide-title { font-size: 2rem; }
    .page-header .archive-description p { font-size: 1rem; }
}

/* ==========================================================================
   View tabs
   ========================================================================== */

.guide-view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--guide-border);
    background-color: var(--guide-bg-lighter);
    border-radius: var(--guide-radius) var(--guide-radius) 0 0;
    overflow: hidden;
}

.guide-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--guide-text-secondary);
    font-weight: 500;
    font-size: 1rem;
    background-color: var(--guide-bg-light);
    border: none;
    border-bottom: 3px solid transparent;
    transition: all var(--guide-speed) var(--guide-ease);
    cursor: pointer;
}

.guide-tab:hover {
    background-color: var(--guide-bg-page);
    color: var(--guide-text-primary);
    border-bottom: 1px solid var(--guide-text-primary);
}

.guide-tab.active {
    color: var(--guide-text-primary);
    font-weight: 600;
    border: 2px solid var(--guide-accent);
}

.guide-tab:focus {
    outline: 2px solid var(--guide-focus);
    outline-offset: -2px;
    z-index: 1;
}

@media (max-width: 600px) {
    .guide-tab {
        border-bottom: 1px solid var(--guide-border);
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    .guide-tab.active { border: 1px solid var(--guide-accent); }
}

/* ==========================================================================
   Main layout
   ========================================================================== */

.guide-archive-content,
.guide-az-content,
.guide-content-wrapper {
    max-width: 1400px;
    margin: 2rem auto;
}

.guide-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem 0;
    contain: layout style;
    min-height: 600px;
}

.guide-filter {
    flex: 1 1 200px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    contain: layout style;
}

.guide-filter-results {
    flex: 3 1 500px;
    min-width: 0;
    contain: layout style;
}

@media (max-width: 1024px) {
    .guide-filter {
        position: static;
        background-color: transparent;
        padding: 0;
    }
}

@media (max-width: 800px) {
    .guide-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    .guide-filter {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ==========================================================================
   Filter panel
   ========================================================================== */

.guide-entry-search-label {
    display: block;
    margin-bottom: 1rem;
    min-width: 0;
}

.guide-entry-search-div {
    position: relative;
    min-width: 0;
}

#guide-entry-search-bar {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 40px 12px 15px;
    border: 2px solid var(--guide-border);
    border-radius: var(--guide-radius);
    font-size: 1rem;
    background-color: var(--guide-bg-page);
    color: var(--guide-text-primary);
    min-height: var(--guide-touch);
    transition: border-color var(--guide-speed) var(--guide-ease),
                box-shadow var(--guide-speed) var(--guide-ease);
}

#guide-entry-search-bar::placeholder { color: var(--guide-text-tertiary); }

#guide-entry-search-bar:focus {
    outline: none;
    border-color: var(--guide-accent);
    box-shadow: 0 0 0 3px var(--guide-focus);
    background-color: var(--guide-accent-light);
}

.guide-entry-search-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    pointer-events: none;
    filter: var(--guide-icon-filter);
}

.fieldset-guide-categories,
.topics-filter {
    padding: 0;
    margin: 0;
    background-color: transparent;
    color: var(--guide-text-primary);
    border: none;
}

.fieldset-guide-categories legend,
.topics-filter legend {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding: 0 0 0.4rem 0;
    width: 100%;
    background-color: transparent;
    color: var(--guide-text-primary);
    border-bottom: 2px solid var(--guide-accent);
}

.topics-filter {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--guide-border) transparent;
}

.topics-filter::-webkit-scrollbar { width: 6px; }
.topics-filter::-webkit-scrollbar-track { background: transparent; }
.topics-filter::-webkit-scrollbar-thumb { background-color: var(--guide-border); border-radius: 3px; }
.topics-filter::-webkit-scrollbar-thumb:hover { background-color: var(--guide-text-secondary); }

.fieldset-guide-categories .guide-categories-filter,
.topics-filter .guide-topics-filter { padding: 0 !important; }

.checkbox-container {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    border-radius: var(--guide-radius-sm);
    transition: background-color var(--guide-speed) var(--guide-ease);
    min-height: var(--guide-touch);
    position: relative;
}

.checkbox-container:hover,
.checkbox-container:focus-within {
    background-color: var(--guide-accent-light);
}

.checkbox-container label {
    padding-left: 10px;
    font-size: 14px;
    color: var(--guide-text-secondary);
    transition: color var(--guide-speed) var(--guide-ease);
    cursor: pointer;
    flex: 1;
    line-height: 18px;
}

.checkbox-container:hover label,
.checkbox-container:focus-within label {
    color: var(--guide-text-primary);
    font-weight: 500;
}

.guide-category-checkbox,
.guide-topic-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-container label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--guide-border);
    border-radius: var(--guide-radius-sm);
    background-color: var(--guide-bg-page);
    vertical-align: middle;
    margin-right: 0.5rem;
    transition: all var(--guide-speed) var(--guide-ease);
    flex-shrink: 0;
}

.guide-category-checkbox:checked + label::before,
.guide-topic-checkbox:checked + label::before {
    background-color: var(--guide-accent);
    border-color: var(--guide-accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    transform: scale(1.05);
}

.guide-category-checkbox:checked + label { color: var(--guide-text-primary); font-weight: 600; }

.guide-category-checkbox:focus + label::before,
.guide-topic-checkbox:focus + label::before {
    box-shadow: 0 0 0 3px var(--guide-focus);
    border-color: var(--guide-accent);
}

.filter-reset {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--guide-text-secondary);
    background-color: var(--guide-bg-light);
    border: 2px solid var(--guide-border);
    border-radius: var(--guide-radius);
    cursor: pointer;
    transition: all var(--guide-speed) var(--guide-ease);
    min-height: var(--guide-touch);
    position: relative;
    overflow: hidden;
}

.filter-reset:hover {
    background-color: var(--guide-bg-hover);
    color: var(--guide-text-primary);
    border-color: var(--guide-text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--guide-shadow-sm);
}

.filter-reset:focus {
    outline: none;
    border-color: var(--guide-accent);
    box-shadow: 0 0 0 3px var(--guide-focus), var(--guide-shadow-sm);
}

.filter-reset:active { transform: translateY(0); box-shadow: none; }

/* ==========================================================================
   Results panel
   ========================================================================== */

.show-entry-text-and-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--guide-radius);
    background-color: var(--guide-bg-light);
    box-shadow: var(--guide-shadow-sm);
    border-bottom: 2px solid var(--guide-border-light);
}

.show-entry-text-and-button h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--guide-text-secondary);
}

.show-entry-text-no-filter {
    gap: 4em;
}

.show-entry-text-and-button .show-entry-text-no-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.filter-count {
    display: inline-block;
    background-color: var(--guide-accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
    animation: guide-pulse-count 0.3s ease-out;
}

@keyframes guide-pulse-count {
    0%   { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#sortOptions {
    padding: 8px 12px;
    border: 2px solid var(--guide-border);
    border-radius: var(--guide-radius);
    background-color: var(--guide-bg-page);
    color: var(--guide-text-primary);
    font-size: 0.9rem;
    min-height: var(--guide-touch);
    cursor: pointer;
    transition: all var(--guide-speed) var(--guide-ease);
}

#sortOptions:focus {
    outline: none;
    border-color: var(--guide-accent);
    box-shadow: 0 0 0 3px var(--guide-focus);
}

#sortOptions:hover {
    border-color: var(--guide-text-secondary);
    background-color: var(--guide-bg-light);
}

.guide-filter-result-entries-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    contain: layout style;
}

.guide-filter-result-entries {
    background-color: var(--guide-bg-page);
    border-bottom: 1px solid var(--guide-border-light);
    transition: all var(--guide-speed) var(--guide-ease);
    content-visibility: auto;
    contain-intrinsic-size: 120px;
    contain: layout style paint;
    position: relative;
}

.guide-filter-result-entries:first-child {
    border-top: 1px solid var(--guide-border-light);
}

.guide-filter-result-entries:hover {
    background-color: var(--guide-bg-lighter);
    transform: translateX(2px);
    box-shadow: -4px 0 0 var(--guide-accent), 0 0.5px 4px rgba(0,0,0,0.1);
    border-left: 2px solid var(--guide-accent);
    z-index: 1;
}

.guide-filter-result-entries:focus-within {
    background-color: var(--guide-accent-light);
    z-index: 2;
}

/* ==========================================================================
   Entry blocks
   ========================================================================== */

.guide-entry-block {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem;
}

.guide-entry-block h2 {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.guide-entry-block h2 a { color: var(--guide-link-title); }

.guide-entry-content {
    flex: 2 1 300px;
    min-width: 0;
}

.guide-entry-contact {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: var(--guide-bg-light);
    padding: 1rem;
    border-radius: var(--guide-radius);
    border: 1px solid var(--guide-border-light);
    align-self: flex-start;
    font-size: 0.9rem;
}

.guide-entry-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.guide-entry-title a {
    text-decoration: none;
    color: var(--guide-text-primary);
    transition: color var(--guide-speed) var(--guide-ease);
    position: relative;
    display: inline-block;
}

.guide-entry-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--guide-text-teal);
    transition: width var(--guide-speed) var(--guide-ease);
}

.guide-entry-title a:hover { color: var(--guide-text-teal); }
.guide-entry-title a:hover::after { width: 100%; }

.guide-entry-title a:focus {
    outline: 2px solid var(--guide-focus);
    outline-offset: 2px;
    border-radius: var(--guide-radius-sm);
}

.guide-entry-url {
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    padding: 0.25rem 0.5rem;
    border-radius: var(--guide-radius-sm);
    border: 1px dashed var(--guide-border-url);
    display: inline-block;
}

.guide-entry-url a {
    color: var(--guide-text-secondary);
    text-decoration: none;
    word-break: break-all;
    min-width: 24px;
    min-height: 24px;
    display: inline-block;
    transition: color var(--guide-speed) var(--guide-ease);
}

.guide-entry-url a:hover { color: var(--guide-text-teal); }

.guide-entry-url a:focus {
    outline: 2px solid var(--guide-focus);
    outline-offset: 2px;
    border-radius: var(--guide-radius-sm);
}

.guide-entry-description {
    margin: 0.5rem 0 1rem 0;
    font-size: 0.95rem;
    color: var(--guide-text-secondary);
    line-height: 1.5;
    max-width: 65ch;
}

.guide-entry-description p { margin: 0; }

/* Legacy contact info class */
.guide-entry-information {
    flex: 0 1 260px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: var(--guide-bg-light);
    padding: 1rem;
    border-radius: var(--guide-radius);
    border: 1px solid var(--guide-border-light);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .guide-entry-information { flex: 1 1 auto; width: 100%; }
}

.information-img {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-radius: 0;
}

.information-img svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.information-img small {
    font-size: inherit;
    color: var(--guide-text-secondary);
    line-height: 1.4;
}

.information-img a {
    color: var(--guide-text-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding: 4px 2px;
    margin: -1px -2px;
    min-width: 24px;
    min-height: 24px;
    transition: all var(--guide-speed) var(--guide-ease);
}

.information-img a:hover {
    color: var(--guide-text-teal);
    background-color: var(--guide-teal-light);
    border-bottom: 1px solid var(--guide-text-teal);
}

.information-img a:focus {
    outline: 2px solid var(--guide-focus);
    outline-offset: 2px;
    background-color: var(--guide-accent-light);
}

/* Phone / email / location meta */
.guide-entry-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: var(--guide-bg-light);
    border-radius: var(--guide-radius);
    border: 1px solid var(--guide-border-light);
}

.guide-entry-phone,
.guide-entry-email,
.guide-entry-location {
    font-size: 0.9rem;
    color: var(--guide-text-secondary);
    line-height: 1.4;
}

.guide-entry-phone strong,
.guide-entry-email strong,
.guide-entry-location strong {
    color: var(--guide-text-primary);
    font-weight: 600;
    margin-right: 0.25rem;
}

.guide-entry-phone a,
.guide-entry-email a {
    color: var(--guide-text-teal);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--guide-speed) var(--guide-ease);
    padding: 1px 2px;
    margin: -1px -2px;
    border-radius: var(--guide-radius-sm);
}

.guide-entry-phone a:hover,
.guide-entry-email a:hover {
    background-color: var(--guide-teal-light);
    border-bottom: 1px solid var(--guide-text-teal);
}

.guide-entry-phone a:focus,
.guide-entry-email a:focus {
    outline: 2px solid var(--guide-focus);
    outline-offset: 2px;
    background-color: var(--guide-accent-light);
}

/* ==========================================================================
   Social media icons
   ========================================================================== */

.guide-entry-social-media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    align-items: center;
    list-style: none;
    margin: 0;
}

.guide-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all var(--guide-speed) var(--guide-ease);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.guide-social-link:hover {
    border-color: var(--guide-text-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.guide-social-link:focus {
    outline: 3px solid var(--guide-focus);
    outline-offset: 3px;
    border-color: var(--guide-accent);
}

.guide-social-icon {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
    filter: var(--guide-social-filter);
    transition: filter var(--guide-speed) var(--guide-ease);
}

.guide-social-link:hover .guide-social-icon,
.guide-social-link:focus .guide-social-icon {
    filter: var(--guide-social-filter-hover);
}

.guide-social-link[aria-label*="myUMBC"] {
    width: auto;
    min-width: 40px;
    padding: 0 0.5rem;
    background-color: transparent;
    border: none;
    border-radius: var(--guide-radius-sm);
}

.guide-social-link[aria-label*="myUMBC"] .guide-social-icon {
    width: auto;
    height: 24px;
    max-height: 28px;
    filter: var(--guide-myumbc-filter);
}

.guide-social-link[aria-label*="myUMBC"]:hover,
.guide-social-link[aria-label*="myUMBC"]:focus {
    border: none;
    transform: translateY(-2px);
}

.guide-social-link[aria-label*="myUMBC"]:hover .guide-social-icon,
.guide-social-link[aria-label*="myUMBC"]:focus .guide-social-icon {
    filter: none;
    opacity: 0.9;
}

/* ==========================================================================
   Loading / empty states
   ========================================================================== */

.preloader,
.no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--guide-text-secondary);
    background-color: var(--guide-bg-lighter);
    border-radius: var(--guide-radius);
    border: 2px dashed var(--guide-border);
}

.no-results h3 {
    margin: 0 0 1rem 0;
    color: var(--guide-text-primary);
    font-size: 1.2rem;
}

.no-results p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.lines {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    margin-bottom: 1rem;
    justify-content: center;
}

.line {
    width: 4px;
    height: 100%;
    background: var(--guide-border);
    animation: guide-pulse 1.2s infinite ease-in-out;
    border-radius: 2px;
}

.line:nth-child(2) { animation-delay: 0.3s; }
.line:nth-child(3) { animation-delay: 0.6s; }

#loader-msg {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--guide-text-tertiary);
}

@keyframes guide-pulse {
    0%, 80%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    40%           { transform: scaleY(1); opacity: 1; background-color: var(--guide-accent); }
}

/* Skeleton loading shimmer */
.guide-filter-result-entries-wrapper.loading .guide-filter-result-entries {
    background: linear-gradient(90deg,
        var(--guide-bg-light) 25%,
        var(--guide-border-light) 50%,
        var(--guide-bg-light) 75%);
    background-size: 200% 100%;
    animation: guide-loading 1.5s infinite;
}

@keyframes guide-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Mobile filter drawer
   ========================================================================== */

@media (max-width: 768px) {
    .fieldset-guide-categories .guide-categories-filter,
    .topics-filter .guide-topics-filter { display: none; }

    .guide-filter select.mobile-filter-dropdown {
        display: block !important;
        width: 100%;
        padding: 12px 40px 12px 15px;
        border: 2px solid var(--guide-border);
        border-radius: var(--guide-radius);
        font-size: 1rem;
        background-color: var(--guide-bg-page);
        color: var(--guide-text-primary);
        min-height: var(--guide-touch);
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23636466' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        transition: all var(--guide-speed) var(--guide-ease);
    }

    .guide-filter select.mobile-filter-dropdown:focus {
        outline: none;
        border-color: var(--guide-accent);
        box-shadow: 0 0 0 3px var(--guide-focus);
    }

    .fieldset-guide-categories legend,
    .topics-filter legend { font-size: 1rem; padding: 0.5rem; }

    .topics-filter { max-height: none; overflow-y: visible; }
}

@media (max-width: 600px) {
    .show-entry-text-no-filter { gap: 0; }

    .show-entry-text-and-button {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    .show-entry-text-and-button h2 {
        font-size: 1rem;
        text-align: center;
    }

    .show-entry-text-and-button .show-entry-text-no-filter {
        flex-direction: column;
    }

    .guide-entry-block,
    .archive .guide-entry-block,
    .page-header {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        flex-direction: column;
    }

    .archive .guide-entry-block { padding: 6px 16px !important; }

    .guide-filter-result-entries { padding: 0 1rem; }

    .guide-entry-content { flex: 1 1 auto; }

    .guide-entry-contact {
        flex: 1 1 auto;
        width: 100%;
        padding: 0.5rem;
    }

    .archive .guide-entry-social-media { display: none; }

    .guide-entry-block h2 {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 0.25rem;
    }

    .guide-entry-url { font-size: 0.8rem; padding: 2px 0.25rem; }

    .information-img { gap: 0.25rem; }
    .information-img svg { width: 14px; }
    .information-img small { font-size: 0.85rem; }

    .guide-entry-description { font-size: 0.875rem; line-height: 1.4; }

    #guide-entry-search-bar { padding: 10px 35px 10px 12px; font-size: 0.95rem; }
    .guide-entry-search-icon { right: 12px; }
    .guide-entry-search-icon svg { width: 18px; height: 18px; }

    .filter-reset { padding: 10px 16px; font-size: 0.95rem; }

    .guide-social-link { width: 40px; height: 40px; }
    .guide-social-icon { width: 22px; height: 22px; }
    .guide-social-link[aria-label*="myUMBC"] { min-width: 55px; }
    .guide-social-link[aria-label*="myUMBC"] .guide-social-icon { height: 24px; max-height: 24px; }

    .guide-entry-social-media { gap: 0.25rem; }
}

/* ==========================================================================
   Screen reader utility
   ========================================================================== */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Accessibility & print
   ========================================================================== */

@media (prefers-contrast: high) {
    .guide-filter-result-entries:hover {
        background-color: #f0f0f0;
        border-left-color: #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guide-entry-title a::after,
    .guide-filter-result-entries { transition: none; }
    .guide-filter-result-entries:hover { transform: none; }
    .line { animation: none; }
    .filter-reset::before { display: none; }
}

@media print {
    .guide-filter { display: none; }
    .guide-container { flex-direction: column; }
    .guide-filter-result-entries {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    .guide-entry-title::after { display: none; }
    .information-img a[href^="tel"]::after,
    .information-img a[href^="mailto"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
