/**
 * Keşfet (/p/kesfet) — modern grid, uzun kelime / Türkçe uyumu
 */

.discover-page {
    max-width: min(1200px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2rem);
    padding-bottom: clamp(2rem, 8vw, 4rem);
}

.discover-header {
    text-align: center;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
    padding: 0 0.5rem;
}

.discover-header h1 {
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-color, #1e1b24);
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.discover-header p {
    font-family: var(--font-ui, system-ui, sans-serif);
    color: var(--text-color-light, #5c5666);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    margin: 0;
    line-height: 1.5;
}

/* Uzun kelimeler grid'i patlatmasın */
.categories-grid {
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

@media (min-width: 520px) {
    .categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Kart */
.category-card {
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: clamp(7.5rem, 28vw, 9.5rem);
    border-radius: clamp(14px, 3vw, 20px);
    padding: clamp(0.85rem, 2.5vw, 1.15rem);
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 4px 16px rgba(30, 27, 36, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    background: var(--category-color, #6d28d9);
}

@supports (background: linear-gradient(0deg, red, blue)) {
    .category-card {
        background: linear-gradient(
            155deg,
            color-mix(in srgb, var(--category-color, #6d28d9) 82%, #ffffff) 0%,
            var(--category-color, #6d28d9) 42%,
            color-mix(in srgb, var(--category-color, #6d28d9) 78%, #000000) 100%
        );
    }
}

.category-card::before {
    content: '';
    position: absolute;
    inset: -40% -20% auto auto;
    width: 85%;
    height: 85%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.35) 0%,
        transparent 55%
    );
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
}

.category-card::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -15%;
    width: 70%;
    height: 70%;
    background: rgba(109, 40, 217, 0.2);
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    filter: blur(2px);
    z-index: 0;
    pointer-events: none;
}

.category-content {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
}

.category-card .category-card__title {
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: clamp(0.95rem, 2.8vw, 1.15rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    text-wrap: balance;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* theme-modern .quote-count rengi burada devralınıyordu — kartta açık metin şart */
.category-card .quote-count {
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    display: inline-block;
    padding: 0.25rem 0.55rem;
    margin: 0;
    color: #fff;
    color: rgba(255, 255, 255, 0.98);
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.category-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow:
        0 14px 32px rgba(30, 27, 36, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.category-card:focus-visible {
    outline: 3px solid var(--primary-color, #6d28d9);
    outline-offset: 3px;
}

html[data-theme='dark'] .discover-header h1 {
    color: var(--text-color, #ece8f4);
}

html[data-theme='dark'] .discover-header p {
    color: var(--text-color-light, #a8a0b8);
}

html[data-theme='dark'] .category-card {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
