/* Font fallback — ensures Clash Display works even if Tailwind's font-clash utility is missing */
.font-clash {
    font-family: "Clash Display", sans-serif;
}

/* Article prose styles — dark theme, WakeTogether design system */
.prose {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.0625rem;
    line-height: 1.8;
    max-width: 100%;
}

.prose h2 {
    font-family: "Clash Display", sans-serif;
    font-weight: 700;
    font-size: 1.625rem;
    color: #fff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prose h3 {
    font-family: "Clash Display", sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose a {
    color: #a855f7;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.prose a:hover {
    color: #c084fc;
}

.prose strong {
    color: #fff;
    font-weight: 600;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose li::marker {
    color: rgba(255, 255, 255, 0.3);
}

.prose blockquote {
    border-left: 3px solid #9513ec;
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.prose img {
    border-radius: 1rem;
    margin: 2rem 0;
    max-width: 100%;
    height: auto;
}

.prose code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    color: #c084fc;
}

.prose pre {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.prose pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.8);
}

.prose hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 2rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}

.prose th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
}

.prose td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prose tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* TL;DR box */
.tldr {
    background: rgba(149, 19, 236, 0.08);
    border: 1px solid rgba(149, 19, 236, 0.2);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.tldr h4 {
    font-family: "Clash Display", sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a855f7;
    margin-bottom: 0.5rem;
}

.tldr ul {
    margin: 0;
    padding-left: 1.25rem;
}

.tldr li {
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

/* Table of Contents */
.toc {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}

.toc h4 {
    font-family: "Clash Display", sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.75rem;
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: decimal;
}

.toc li {
    margin-bottom: 0.375rem;
}

.toc a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.toc a:hover {
    color: #a855f7;
}

/* Related articles */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.related-articles h3 {
    font-family: "Clash Display", sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.related-card {
    display: block;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.related-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(149, 19, 236, 0.3);
}

.related-card h4 {
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.related-card p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .prose h2 {
        font-size: 1.375rem;
    }
    .prose h3 {
        font-size: 1.125rem;
    }
    .prose {
        font-size: 1rem;
    }
}

/* ===== Listing Page: Hero Section ===== */
.listing-hero {
    position: relative;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    margin-top: 80px;
}

.listing-hero__bg {
    position: absolute;
    inset: 0;
}

.listing-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0.3;
    filter: saturate(0.7) brightness(0.6);
}

.listing-hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #050505 0%, rgba(5, 5, 5, 0.7) 40%, transparent 100%);
}

.listing-hero__content {
    position: relative;
    z-index: 2;
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1rem 2.5rem;
    width: 100%;
}

.listing-hero__title {
    font-family: "Clash Display", sans-serif;
    font-weight: 700;
    font-size: 2.75rem;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.listing-hero__desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.125rem;
    max-width: 32rem;
}

/* Type-specific accent glow */
.listing-hero--blog::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, #06b6d4 50%, transparent 90%);
    z-index: 3;
    opacity: 0.6;
}

.listing-hero--help::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, #9513ec 50%, transparent 90%);
    z-index: 3;
    opacity: 0.6;
}

/* ===== Listing Page: Search / Filter ===== */
.listing-search {
    margin-bottom: 2rem;
}

.listing-search__field {
    position: relative;
    display: flex;
    align-items: center;
}

.listing-search__icon {
    position: absolute;
    left: 1rem;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: color var(--transition-normal);
    flex-shrink: 0;
}

.listing-search__input {
    width: 100%;
    height: 3rem;
    padding: 0 3.25rem 0 3rem;
    font-family: "Satoshi", sans-serif;
    font-size: 0.9375rem;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    outline: none;
    transition:
        background var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
    -webkit-appearance: none;
    appearance: none;
}

.listing-search__input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.listing-search__input:hover {
    background: var(--liquid-glass-bg-hover);
    border-color: var(--border-hover);
}

.listing-search__input:focus {
    background: var(--liquid-glass-bg-hover);
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow:
        0 0 0 3px rgba(var(--primary-rgb), 0.12),
        var(--shadow-md);
}

.listing-search__field:focus-within .listing-search__icon {
    color: var(--primary-light);
}

/* Hide webkit search cancel button — we have our own clear button */
.listing-search__input::-webkit-search-cancel-button,
.listing-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.listing-search__clear {
    position: absolute;
    right: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.listing-search__clear:hover {
    color: var(--text-main);
    background: var(--liquid-glass-bg-hover);
}

/* Card hide/show — needs higher specificity than .listing-card { display: flex } */
.listing-card.listing-card--hidden {
    display: none;
}

/* No results state */
.listing-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 1rem;
    text-align: center;
}

.listing-no-results p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9375rem;
}

/* ===== Listing Page: Grid Layout ===== */
.listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Single article spans full width */
.listing-grid .listing-card:only-child {
    grid-column: 1 / -1;
}

/* ===== Listing Page: Article Cards ===== */
.listing-card {
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    isolation: isolate;
    text-decoration: none;
    transition:
        border-color 200ms var(--ease-out),
        background 200ms var(--ease-out),
        transform 200ms var(--ease-out),
        box-shadow 200ms var(--ease-out);
    transform: translateZ(0);
}

@media (hover: hover) and (pointer: fine) {
    .listing-card:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.12);
        transform: translateY(-3px) translateZ(0);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    }

    .listing-card:hover .listing-card__image img {
        transform: scale(1.04) translateZ(0);
    }
}

.listing-card:active {
    transform: scale(0.98) translateZ(0);
    transition: transform 100ms var(--ease-out);
}

.listing-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}

.listing-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms var(--ease-out);
    transform: scale(1) translateZ(0);
    transform-origin: center center;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.listing-card__image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(5, 5, 5, 0.5), transparent);
    pointer-events: none;
}

.listing-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.listing-card__title {
    font-family: "Clash Display", sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
    line-height: 1.3;
}

.listing-card__desc {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card__meta {
    color: rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
}

/* Type-specific hover accents */
.listing-card--blog:hover .listing-card__title {
    color: #67e8f9;
}
.listing-card--blog:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.listing-card--help:hover .listing-card__title {
    color: #c084fc;
}
.listing-card--help:hover {
    border-color: rgba(149, 19, 236, 0.3);
}

/* Placeholder for articles without thumbnails */
.listing-card__placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-card__placeholder--blog {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(5, 5, 5, 0.95));
}

.listing-card__placeholder--help {
    background: linear-gradient(135deg, rgba(149, 19, 236, 0.12), rgba(5, 5, 5, 0.95));
}

/* ===== Listing Page: Responsive ===== */
@media (max-width: 639px) {
    .listing-hero {
        height: 220px;
    }
    .listing-hero__title {
        font-size: 1.875rem;
    }
    .listing-hero__desc {
        font-size: 0.9375rem;
    }
    .listing-grid {
        gap: 1rem;
    }
    .listing-card__body {
        padding: 1rem 1.25rem 1.25rem;
    }
    .listing-card__title {
        font-size: 1rem;
    }
}
