/* Cloudlog-inspired: light surfaces, purple→blue gradient, soft cards */

:root {
    --white: #ffffff;
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 45%, #2563eb 100%);
    --gradient-text: linear-gradient(135deg, #6d28d9 0%, #2563eb 100%);
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --ok: #15803d;
    --ok-bg: #f0fdf4;
    --err: #dc2626;
    --err-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-bg: #fff1f2;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Links styled as buttons must not inherit default link hover (colour / underline). */
a.btn:hover,
a.btn:focus {
    text-decoration: none;
}

code {
    background: var(--bg-alt);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    font-size: 0.88em;
    border: 1px solid var(--border);
    color: #4338ca;
}

/* ——— Header ——— */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.site-header .wrap.flex {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    color: #5b21b6;
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wrap {
    width: 100%;
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.wrap.narrow {
    max-width: 38rem;
}

/* ——— Typography ——— */
.page-title,
h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--text);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}

h2:first-of-type {
    margin-top: 0;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    color: var(--text-muted);
    font-size: 1.0625rem;
    margin: 0 0 1rem;
    max-width: 42em;
}

.meta {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

.muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.875rem;
}

/* ——— Hero ——— */
.hero {
    padding-bottom: 0.5rem;
}

.hero__title {
    margin-bottom: 0.35rem;
}

/* Stations directory: full heading uppercase + gradient */
.stations-page-title.gradient-text {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: clamp(1.4rem, 3.2vw, 1.95rem);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 0.25rem;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem 0.5rem 0.65rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.stat-pill__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    flex-shrink: 0;
}

.stat-pill__text {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.stat-pill__value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1;
}

.stat-pill__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    border: none;
    border-radius: 999px;
    background: var(--gradient);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.hero-cta:hover {
    color: var(--white);
    text-decoration: none;
    filter: brightness(1.06);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

.hero-cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--white), 0 0 0 6px rgba(99, 102, 241, 0.55);
}

.hero-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.hero-secondary:hover {
    color: #5b21b6;
    text-decoration: none;
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.hero-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* ——— Pagination ——— */
.pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem 0.5rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.pagination__status {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.pagination > :nth-child(1) {
    grid-column: 1;
    justify-self: start;
}

.pagination > :nth-child(2) {
    grid-column: 2;
}

.pagination > :nth-child(3) {
    grid-column: 3;
    justify-self: end;
}

.pagination__btn {
    min-width: 0;
    text-align: center;
    text-decoration: none;
}

.pagination__btn:hover {
    text-decoration: none;
}

.pagination__btn--spacer {
    visibility: hidden;
    pointer-events: none;
}

/* ——— Station index ——— */
.station-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.station-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
}

.station-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.station-card__cs {
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.station-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.station-card__actions .btn {
    text-decoration: none;
}

.station-card__actions .btn:hover {
    text-decoration: none;
}

/* ——— Sections ——— */
.section-feed {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

/* ——— Cards ——— */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.card--pad {
    padding: 1.5rem 1.5rem 1.75rem;
}

.card--table {
    padding: 0;
    overflow-x: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* ——— Entries list ——— */
.entries {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entry {
    padding: 1.35rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.entry:hover {
    box-shadow: var(--shadow-lg);
    border-color: #c7d2fe;
}

.entry h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.entry h2 a {
    color: var(--text);
    text-decoration: none;
}

.entry h2 a:hover {
    color: #5b21b6;
    text-decoration: none;
}

.entry .body {
    margin-top: 0.65rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.entry .body .entry__p {
    margin: 0 0 0.85em;
}

.entry .body .entry__p:last-child {
    margin-bottom: 0;
}

.entry .body .entry__fig {
    margin: 0.9em 0;
}

.entry .body .entry__fig:first-child {
    margin-top: 0;
}

.entry .body .entry__img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.empty {
    color: var(--text-muted);
    margin-top: 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ——— Forms ——— */
.stack label {
    display: block;
    margin-bottom: 1.1rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.stack input[type="url"],
.stack input[type="text"],
.stack input[type="password"] {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.stack input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.callsign-input {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Honeypot: off-screen, unfocusable for humans; bots often still fill it. */
.hp-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ——— Buttons ——— */
button,
.btn {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

button:hover,
.btn:hover {
    background: var(--bg-alt);
    text-decoration: none;
}

button:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

button.primary,
.btn--primary,
a.btn--primary {
    border: none;
    color: var(--white);
    background: var(--gradient);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

button.primary:hover,
.btn--primary:hover,
a.btn--primary:hover,
a.btn--primary:focus-visible {
    filter: brightness(1.05);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    background: var(--gradient);
    color: var(--white);
    text-decoration: none;
}

button.danger,
.btn--danger {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: #b91c1c;
}

button.danger:hover,
.btn--danger:hover {
    background: #ffe4e6;
}

.btn--ghost {
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.4rem 0.95rem;
    color: var(--text-muted);
    border-color: transparent;
    background: transparent;
}

.btn--ghost:hover,
a.btn--ghost:hover,
a.btn--ghost:focus-visible {
    color: #5b21b6;
    background: #f5f3ff;
    text-decoration: none;
}

/* ——— Alerts ——— */
.ok {
    color: var(--ok);
    background: var(--ok-bg);
    border: 1px solid #bbf7d0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0 0 1rem;
}

.err {
    color: var(--err);
    background: var(--err-bg);
    border: 1px solid #fecaca;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0 0 1rem;
}

.bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.bar a {
    font-weight: 500;
}

/* ——— Tables ——— */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tbl th,
.tbl td {
    text-align: left;
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.tbl thead th {
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.tbl tbody tr:last-child td {
    border-bottom: none;
}

.tbl tbody tr:hover td {
    background: #fafafa;
}

.tbl .url {
    word-break: break-all;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.actions form.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.actions form.inline button {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
}

.list {
    padding-left: 1.25rem;
}

/* ——— Footer ——— */
.site-footer {
    margin-top: auto;
    padding: 2.25rem 0;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: none;
}

.site-footer a {
    color: #cbd5e1;
}

.site-footer a:hover {
    color: var(--white);
}

/* Legacy class used in footer include */
.foot {
    margin-top: auto;
    padding: 0;
    background: transparent;
    border: none;
}

.foot .wrap {
    padding-top: 0;
    padding-bottom: 0;
    color: inherit;
}

.site-footer strong {
    color: #e2e8f0;
}

.footer-legal {
    max-width: 44rem;
}

.footer-copy {
    margin: 0;
    line-height: 1.55;
    color: var(--footer-text);
}

/* ——— Utilities ——— */
.mt-tight {
    margin-top: 0.5rem;
}

.page-foot-links {
    margin-top: 1.5rem;
    font-size: 0.9375rem;
}
