@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* =========================================================
   Variables
   ========================================================= */

:root {
    --bg: #f5f7fb;
    --white: #fff;
    --ink: #1e3042;
    --muted: #788b9c;
    --line: #dfe7ee;
    --blue: #328bc4;
    --blue-light: #e8f3fa;
}

/* =========================================================
   Base / Reset
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: Poppins, sans-serif;
    user-select: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 62px;
    padding: 0 28px;

    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.site-header .logo {
    position: absolute;
    left: 50%;

    height: 30px;

    transform: translateX(-50%);
    transition: left 0.3s ease, transform 0.3s ease;
}

.site-nav {
    position: absolute;
    right: 28px;

    display: flex;
    align-items: center;
    gap: 8px;

    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);

    transition: opacity 0.25s ease, transform 0.3s ease;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 8px 10px;

    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;

    transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.site-nav i {
    color: var(--blue);
}

.site-header.is-scrolled .logo {
    left: 28px;
    transform: translateX(0);
}

.site-header.is-scrolled .site-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

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

.directory-page,
.legal-page {
    width: 100%;
    max-width: 750px;
    min-width: 0;
    margin: 0 auto;
}

.directory-page {
    flex: 1;
}

/* =========================================================
   Homepage intro
   ========================================================= */

.directory-intro {
    position: relative;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    min-height: 260px;
    margin: 0;
    padding: 52px 0 42px;

    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.directory-intro::after {
    position: absolute;
    right: 8%;
    bottom: -100px;

    width: 250px;
    height: 250px;

    border: 1px solid rgba(50, 139, 196, 0.22);
    border-radius: 50%;

    content: '';
    pointer-events: none;
}

.directory-intro h1 {
    max-width: 520px;
    margin: 0;

    color: var(--ink);
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 400;
    letter-spacing: -2px;
    line-height: 1.02;
}

.directory-intro h1 strong {
    color: var(--blue);
    font-weight: 600;
}

.directory-intro p {
    margin: 18px 0 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =========================================================
   Sections
   ========================================================= */

.popular-section {
    padding: 42px 0 0;
}

.favorites-section {
    padding: 28px 0 0;
}

.favorites-page .favorites-section {
    padding-bottom: 70px;
}

.show-all-favorites,
.favorites-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
}

.show-all-favorites {
    margin-top: 16px;
}

.show-all-favorites:hover,
.favorites-back:hover {
    text-decoration: underline;
}

.station-section {
    padding: 64px 0 70px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 18px;

    text-align: left;
}

.section-heading h2 {
    margin: 0;

    font-size: 23px;
    font-weight: 600;
    letter-spacing: -0.7px;
}

.section-heading span {
    color: var(--muted);
    font-size: 10px;
}

.popular-section .section-heading {
    justify-content: flex-start;
}

.popular-section .section-heading h2 {
    font-size: 28px;
}

.station-heading {
    justify-content: space-between;
}

.station-heading h2 {
    font-size: 26px;
}

/* =========================================================
   Search
   ========================================================= */

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;

    height: 44px;
    margin-bottom: 16px;
    padding: 0 13px;

    border: 1px solid var(--line);
    background: var(--white);
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;

    background: transparent;
    color: var(--ink);

    font: inherit;
    font-size: 12px;
}

.search-box input::placeholder {
    color: var(--muted);
}

/* =========================================================
   Station list / cards
   ========================================================= */

.station-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;

    width: 100%;
    min-width: 0;
}

.station-list > .message {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
}

.station-row {
    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
    min-height: 82px;
    padding: 10px;

    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 2px 0 rgba(30, 48, 66, 0.02);

    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.15s,
        box-shadow 0.15s;
}

.station-row:hover {
    border-color: #a9d1e6;
    background: var(--blue-light);
}

.station-link {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
    min-width: 0;
}

.station-row img {
    flex: 0 0 auto;

    width: 54px;
    height: 54px;

    object-fit: cover;
    background: var(--blue-light);
}

.station-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.station-copy strong,
.station-copy small,
.station-copy em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-copy strong {
    font-size: 16px;
    font-weight: 600;
}

.station-copy small,
.station-copy em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.station-copy em {
    color: var(--blue);
}

.favorite-button {
    flex: 0 0 auto;

    padding: 8px;

    border: 0;
    background: transparent;
    color: var(--muted);

    cursor: pointer;
    font-size: 14px;
}

.favorite-button:hover,
.favorite-button.is-favorite {
    color: var(--blue);
}

/* =========================================================
   Messages
   ========================================================= */

.message {
    padding: 40px 10px;

    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.message i {
    margin-right: 6px;
    color: var(--blue);
}

.message.error,
.error {
    color: #b65b5b;
}

/* =========================================================
   Submit section
   ========================================================= */

.submit-section {
    margin: 0 0 36px;
    padding: 22px;

    border: 1px solid var(--line);
    background: var(--white);
}

.submit-section h2 {
    margin: 0 0 10px;

    font-size: 21px;
    font-weight: 600;
}

.submit-section p {
    margin: 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.submit-section a {
    color: var(--blue);
    font-weight: 600;
}

.submit-section pre {
    margin: 16px 0 0;
    padding: 12px;

    overflow-x: auto;

    background: var(--bg);
    color: var(--ink);

    font: 11px monospace;
}

/* =========================================================
   Legal pages
   ========================================================= */

.legal-page {
    padding: 28px 0 70px;
}

.legal-section {
    padding: 22px;

    border: 1px solid var(--line);
    background: var(--white);
}

.legal-section h1 {
    margin: 0 0 22px;

    font-size: 26px;
    font-weight: 600;
}

.legal-section h2 {
    margin: 24px 0 8px;

    font-size: 17px;
    font-weight: 600;
}

.legal-section h2:first-of-type {
    margin-top: 0;
}

.legal-section p,
.legal-section address {
    margin: 0 0 12px;

    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    line-height: 1.8;
}

.legal-section a {
    color: var(--blue);
    font-weight: 600;
}

.legal-section ul {
    margin: 0 0 12px;
    padding-left: 20px;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    padding: 24px 0 32px;

    border-top: 1px solid var(--line);

    color: var(--muted);
    font-size: 10px;
}

.site-footer a:hover {
    color: var(--blue);
}

/* =========================================================
   Popular list animation
   ========================================================= */

#popularList .station-row {
    animation: station-reveal 0.45s both;
}

#popularList .station-row:nth-child(2) {
    animation-delay: 0.04s;
}

#popularList .station-row:nth-child(3) {
    animation-delay: 0.08s;
}

#popularList .station-row:nth-child(4) {
    animation-delay: 0.12s;
}

#popularList .station-row:nth-child(5) {
    animation-delay: 0.16s;
}

#popularList .station-row:nth-child(6) {
    animation-delay: 0.2s;
}

@keyframes station-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   Responsive: <= 900px
   ========================================================= */

@media (max-width: 900px) {
    .site-header {
        padding: 0 18px;
    }

    .site-header.is-scrolled .logo {
        left: 50%;
        transform: translateX(-50%);
    }

    .site-nav {
        display: none;
    }

    .directory-intro {
        align-items: flex-start;
        flex-direction: column;

        min-height: 0;
        padding: 42px 18px 36px;
    }

    .directory-intro h1 {
        max-width: 100%;
        font-size: clamp(34px, 10vw, 48px);
    }

    .directory-intro p {
        max-width: 100%;
        font-size: 12px;
    }

    .popular-section,
    .favorites-section,
    .station-section {
        padding-right: 18px;
        padding-left: 18px;
    }

    .popular-section {
        padding-top: 36px;
    }

    .station-section {
        padding-top: 48px;
    }

    .popular-section #popularList,
    .station-list {
        grid-template-columns: 1fr;
    }

    .popular-section .station-row {
        align-items: center;
        min-height: 82px;
    }

    .section-heading,
    .popular-section .section-heading,
    .station-heading {
        justify-content: space-between;
        text-align: left;
    }

    .section-heading h2,
    .popular-section .section-heading h2,
    .station-heading h2 {
        font-size: 23px;
    }

    .submit-section {
        margin-right: 18px;
        margin-left: 18px;
    }

    .legal-page {
        padding-right: 18px;
        padding-left: 18px;
    }

    .site-footer {
        flex-direction: column;
        max-width: none;
        padding-right: 18px;
        padding-left: 18px;
        text-align: center;
    }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .station-row,
    #popularList .station-row,
    .directory-intro {
        animation: none;
        transition: none;
    }
}
