/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
}

/* Hero / Header */
.hero {
    background: linear-gradient(135deg, #003545 0%, #005570 100%);
    color: white;
    padding: 0 20px;
}

.hero-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo img {
    height: 80px;
    display: block;
}

.header-brand-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
}

.header-wordmark {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.header-wordmark:hover {
    color: white;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-socials {
    display: flex;
    gap: 12px;
    align-self: center;
    padding-bottom: 5px;
}

.header-social-link {
    color: white;
    opacity: 0.75;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

.header-social-link:hover {
    opacity: 1;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-btn {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.header-btn--download {
    background: white;
    color: #003545;
}

.header-btn--download:hover {
    background: #e9ecef;
}

.header-btn--github {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-btn--github:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Hero content (homepage) */
.hero__content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 0 80px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    margin-top: 24px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    padding: 8px 20px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-cta:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* Tag Filter (shared across pages) */
.tag-filter-bar {
    flex: 1 1 0;
    display: flex;
    justify-content: flex-end;
}

.tag-filter-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 14px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #003545;
    font-family: inherit;
    transition: color 0.3s ease;
}

.tag-filter-toggle:hover {
    color: #005570;
}

.tag-toggle-icon {
    font-size: 0.6rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
    display: inline-block;
}

.tag-filter-toggle.open .tag-toggle-icon {
    transform: rotate(180deg);
}

.tag-filter-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.tag-filter-wrapper.open {
    grid-template-rows: 1fr;
}

.tag-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 0;
    padding-bottom: 0;
    transition: padding 0.3s ease;
}

.tag-filter-wrapper.open .tag-filter-container {
    padding-top: 10px;
    padding-bottom: 15px;
}

.tag-filter-btn {
    background: white;
    border: 1.5px solid #dee2e6;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    font-family: inherit;
    transition: all 0.2s ease;
}

.tag-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tag-filter-btn.active {
    background: #003545;
    color: white;
    border-color: #003545;
}

.tag-filter-clear {
    background: none;
    border: 1.5px solid #dc3545;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #dc3545;
    font-family: inherit;
    transition: all 0.2s ease;
    display: none;
}

.tag-filter-clear.visible {
    display: inline-block;
}

.tag-filter-clear:hover {
    background: #dc3545;
    color: white;
}

/* Page Breadcrumb (home + category pages) */
.page-breadcrumb {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0 20px;
}

.page-breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7px 0;
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
}

.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    color: #003545;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.breadcrumb-home:hover {
    opacity: 1;
}

.breadcrumb-sep {
    margin: 0 8px;
    opacity: 0.4;
}

.breadcrumb-category-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.breadcrumb-category-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #003545;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.breadcrumb-category-btn:hover {
    color: #005570;
}

.breadcrumb-dropdown-icon {
    font-size: 0.6rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.breadcrumb-category-btn.open .breadcrumb-dropdown-icon {
    transform: rotate(180deg);
}

.breadcrumb-get-involved-link {
    margin-left: auto;
    font-size: 1rem;
    font-weight: 600;
    color: #003545;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.breadcrumb-get-involved-link:hover {
    color: #005570;
}

.page-breadcrumb .category-dropdown-list a {
    text-decoration: none;
}

/* Category Dropdown (breadcrumb) */
.category-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 53, 69, 0.12);
    z-index: 200;
    min-width: 220px;
    overflow-y: auto;
}

.category-dropdown-list {
    list-style: none;
    padding: 6px 0;
}

.category-dropdown-list a {
    display: block;
    padding: 8px 16px;
    color: #003545;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.category-dropdown-list a:hover {
    background: #f0f4f5;
}

.category-dropdown-list .dropdown-item-active {
    display: block;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 500;
    color: #adb5bd;
    white-space: nowrap;
    cursor: default;
}

/* Scroll to Top */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #003545;
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.2s ease;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: #005570;
}

/* Footer */
site-footer {
    margin-top: auto;
}

.site-footer {
    background: linear-gradient(135deg, #003545 0%, #005570 100%);
    color: white;
    padding: 30px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-contact {
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    opacity: 0.85;
}

.footer-contact a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-contact a:hover {
    opacity: 1;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

.footer-copyright a {
    color: white;
}

/* Search Bar (shared across pages) */
.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #003545;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #adb5bd;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    display: none;
}

.search-clear.visible {
    display: block;
}

.search-clear:hover {
    color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-top {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 25px 0 6px;
    }

    .header-logo img {
        height: 55px;
    }

    .header-right {
        align-items: flex-end;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .header-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .header-social-link svg {
        width: 16px;
        height: 16px;
    }

    .hero__content {
        padding: 40px 0 60px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .header-logo img {
        height: 55px;
    }

    .header-right {
        align-items: flex-end;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .header-btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .header-social-link svg {
        width: 14px;
        height: 14px;
    }

}

/* Sponsors button — shared across home and category pages */
.sponsors-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    background: linear-gradient(135deg, #b8860b 0%, #daa520 50%, #c8960c 100%);
    color: white;
    box-shadow: 0 1px 4px rgba(184, 134, 11, 0.35);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.sponsors-btn:hover {
    opacity: 0.88;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.55);
}

.sponsors-btn.active {
    background: white;
    color: #b8860b;
    box-shadow: inset 0 0 0 1.5px #daa520;
}

.sponsors-btn.active:hover {
    opacity: 1;
    background: #fffbf0;
    box-shadow: inset 0 0 0 1.5px #b8860b, 0 2px 8px rgba(184, 134, 11, 0.25);
}

@media (min-width: 381px) and (max-width: 520px) {
    .header-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .header-brand-sep {
        display: none;
    }

    .header-wordmark {
        margin-left: 18px;
    }
}

@media (max-width: 380px) {
    .hero-top {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 16px 0;
    }

    .header-right {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .header-socials {
        padding-bottom: 0;
    }
}

