/* ============================================================
   Home page — light theme layout
   The site-wide light theme lives in techgrid.css / layout.css;
   this file holds the home page's own structure (hero, topic grids,
   discover list). Home-only card tweaks stay scoped to .tg-shell--home.
   ============================================================ */

/* ============================================================
   Page shell
   ============================================================ */
.home {
    padding-bottom: 1rem;
}

.home-container {
    max-width: 84rem;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1024px) {
    .home-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.home .hx-inline-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.home .material-symbols-outlined {
    font-size: 1rem;
    vertical-align: middle;
}

/* ============================================================
   Hero
   ============================================================ */
.hx-hero {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.hx-hero__grid {
    display: grid;
    gap: 1.5rem;
}

.hx-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--tg-border);
    background-color: var(--tg-bg-elev);
    border-radius: 1rem;
}

.hx-feature__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.hx-feature__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.hx-feature__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hx-feature:hover .hx-feature__image {
    transform: scale(1.05);
}

.hx-feature__cat {
    position: absolute;
    left: 1rem;
    top: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--topic-color, var(--tg-primary));
    border-radius: 9999px;
}

.hx-feature__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.hx-feature__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--tg-text);
}

.hx-feature__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    line-height: 1.6;
    color: var(--tg-text-muted);
}

.hx-feature__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--tg-text-muted);
}

.hx-feature__author {
    font-weight: 500;
    color: var(--tg-text);
}

/* Side "Öne Çıkanlar" */
.hx-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.hx-side__heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tg-text-muted);
}

.hx-side__bar {
    width: 0.25rem;
    height: 1rem;
    border-radius: 9999px;
    background-color: var(--tg-primary);
}

.hx-side__list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.6rem;
}

.hx-story {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border: 1px solid var(--tg-border);
    background-color: var(--tg-bg-elev);
    border-radius: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.hx-story:hover {
    border-color: rgba(37, 99, 235, 0.4);
}

.hx-story__media {
    flex-shrink: 0;
    align-self: stretch;
    width: 6.5rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.hx-story__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hx-story:hover .hx-story__image {
    transform: scale(1.05);
}

.hx-story__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
}

.hx-story__cat {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--topic-color, var(--tg-primary));
}

.hx-story__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--tg-text);
}

.hx-story__meta {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--tg-text-muted);
}

/* ============================================================
   Section header (shared by topic sections)
   ============================================================ */
.hx-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.hx-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hx-section__heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hx-section__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--tg-text);
}

.hx-section__sub {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--tg-text-muted);
}

.hx-section__all {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tg-primary);
    text-decoration: none;
}

.hx-section__all:hover {
    text-decoration: underline;
}

/* ---------- Topic grid (8 cards per page) ---------- */
.hx-topic__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.hx-topic__grid[hidden] {
    display: none;
}

.hx-topic__grid--active {
    animation: hx-page-in 0.35s ease;
}

@keyframes hx-page-in {
    from {
        opacity: 0;
        transform: translateX(0.75rem);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hx-topic__grid .content-card {
    flex-direction: row;
}

.hx-topic__grid .content-card__media {
    flex: 0 0 6rem;
    aspect-ratio: auto;
    min-height: 4.5rem;
}

.hx-topic__grid .content-card__badge {
    display: none;
}

.hx-topic__grid .content-card__body {
    min-width: 0;
    gap: 0.35rem;
    padding: 0.75rem;
}

.hx-topic__grid .content-card__title {
    font-size: 0.9375rem;
    -webkit-line-clamp: 3;
}

.hx-topic__grid .content-card__meta {
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    padding-top: 0.25rem;
}

@media (min-width: 640px) {
    .hx-topic__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

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

    .hx-topic__grid .content-card {
        flex-direction: column;
    }

    .hx-topic__grid .content-card__media {
        flex: none;
        aspect-ratio: 2 / 1;
        min-height: 0;
    }

    .hx-topic__grid .content-card__badge {
        display: block;
    }

    .hx-topic__grid .content-card__title {
        font-size: 0.9375rem;
    }
}

/* ---------- Pager (‹ ● ○ ○ ›) ---------- */
.hx-topic__tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.hx-pager {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hx-pager__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--tg-text-muted);
    background-color: var(--tg-bg-elev);
    border: 1px solid var(--tg-border);
    border-radius: 9999px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.hx-pager__btn:not(:disabled):hover {
    color: #fff;
    border-color: var(--topic-color, var(--tg-primary));
    background-color: var(--topic-color, var(--tg-primary));
}

.hx-pager__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.hx-pager__dots {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hx-pager__dot {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background-color: var(--tg-border);
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.hx-pager__dot--active {
    width: 1.25rem;
    background-color: var(--topic-color, var(--tg-primary));
}

@media (prefers-reduced-motion: reduce) {
    .hx-topic__grid--active {
        animation: none;
    }
}

/* ============================================================
   Topic sections (Oyun / Teknoloji / Yazılım)
   ============================================================ */
.hx-topic__inner {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.hx-section__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--tg-primary);
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 0.75rem;
}

.hx-section__icon .material-symbols-outlined {
    font-size: 1.25rem;
}

.hx-topic--band {
    border-top: 1px solid var(--tg-border);
    border-bottom: 1px solid var(--tg-border);
    background-color: #f2f4f8;
}

.hx-topic .hx-section__head {
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--topic-soft, var(--tg-border));
}

.hx-topic .hx-topic__icon {
    color: var(--topic-color, var(--tg-primary));
    background-color: var(--topic-soft, rgba(37, 99, 235, 0.1));
}

.hx-topic .hx-topic__all {
    color: var(--topic-color, var(--tg-primary));
}

.hx-topic .content-card:hover {
    border-color: var(--topic-color, rgba(37, 99, 235, 0.4));
}

.hx-topic .content-card:hover .content-card__title {
    color: var(--topic-color, var(--tg-primary));
}

@media (max-width: 639px) {
    .hx-topic .hx-section__title {
        font-size: 1.25rem;
    }

    .hx-topic .hx-section__sub {
        display: none;
    }

    .hx-topic .hx-section__head {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .hx-topic__tools {
        justify-content: space-between;
        width: 100%;
    }
}

@media (min-width: 768px) {
    .hx-topic__inner {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }
}

/* ============================================================
   Discover (Eğlence & Keşfet)
   ============================================================ */
.hx-discover {
    border-top: 1px solid var(--tg-border);
    border-bottom: 1px solid var(--tg-border);
    background:
        radial-gradient(32rem 14rem at 100% 0%, rgba(124, 58, 237, 0.07), transparent 70%),
        radial-gradient(32rem 14rem at 0% 100%, rgba(37, 99, 235, 0.07), transparent 70%),
        var(--tg-bg-elev);
}

.hx-discover__inner {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.hx-discover__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--tg-accent);
}

.hx-discover__intro {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 38rem;
}

.hx-discover__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tg-accent-fg);
    background-color: var(--tg-accent);
    border-radius: 9999px;
}

.hx-discover__heading {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--tg-text);
}

.hx-discover__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--tg-text-muted);
}

.hx-discover__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.hx-discover__tabs {
    display: inline-flex;
    padding: 0.25rem;
    gap: 0.25rem;
    background-color: var(--tg-bg-elev-2);
    border-radius: 9999px;
}

.hx-discover__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tg-text-muted);
    background: transparent;
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.hx-discover__tab:hover {
    color: var(--tg-text);
}

.hx-discover__tab--active,
.hx-discover__tab--active:hover {
    color: var(--tg-primary);
    background-color: var(--tg-bg-elev);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.hx-discover__random {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--tg-primary);
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hx-discover__random:hover {
    background-color: var(--tg-primary-dark);
    transform: translateY(-1px);
}

.hx-discover__random:hover .material-symbols-outlined {
    animation: hx-dice 0.6s ease;
}

@keyframes hx-dice {
    to {
        transform: rotate(360deg);
    }
}

.hx-discover__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    animation: hx-page-in 0.35s ease;
}

.hx-spot {
    position: relative;
    display: flex;
    min-height: 15rem;
    overflow: hidden;
    border: 1px solid var(--tg-border);
    border-radius: 1rem;
    color: #fff;
    text-decoration: none;
}

.hx-spot__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hx-spot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 10%, rgba(15, 23, 42, 0.3) 55%, rgba(15, 23, 42, 0.05));
}

.hx-spot:hover .hx-spot__image {
    transform: scale(1.05);
}

.hx-spot__rank {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
    padding: 0.2rem 0.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--tg-primary);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 9999px;
}

.hx-spot__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    padding: 1.25rem;
}

.hx-spot__topic {
    width: fit-content;
    padding: 0.15rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--topic-color, var(--tg-primary));
    border-radius: 9999px;
}

.hx-spot__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.hx-spot__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: #e2e8f0;
}

.hx-discover__list {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hx-discover__list li {
    list-style: none;
}

.hx-rank {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    color: inherit;
    text-decoration: none;
    background-color: var(--tg-bg-elev);
    border: 1px solid var(--tg-border);
    border-radius: 0.75rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hx-rank:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background-color: #f8faff;
}

.hx-rank__num {
    flex-shrink: 0;
    width: 1.75rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    color: rgba(37, 99, 235, 0.35);
    transition: color 0.2s ease;
}

.hx-rank:hover .hx-rank__num {
    color: var(--tg-primary);
}

.hx-rank__thumb {
    flex-shrink: 0;
    width: 3.5rem;
    height: 2.5rem;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: var(--tg-bg-elev-2);
}

.hx-rank__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hx-rank__body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.15rem;
}

.hx-rank__topic {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--topic-color, var(--tg-text-muted));
}

.hx-rank__title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--tg-text);
}

.hx-rank:hover .hx-rank__title {
    color: var(--tg-primary);
}

.hx-rank__views {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--tg-text-muted);
}

@media (max-width: 479px) {
    .hx-rank__views {
        display: none;
    }

    .hx-rank__title {
        -webkit-line-clamp: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hx-discover__body,
    .hx-discover__random:hover .material-symbols-outlined {
        animation: none;
    }
}

/* ============================================================
   Skeletons + empty
   ============================================================ */
.hx-skeleton {
    background-color: var(--tg-bg-elev-2);
    border-radius: 0.75rem;
    animation: tg-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.hx-skeleton--hero {
    height: 460px;
    border-radius: 1rem;
}

.hx-skeleton--card {
    aspect-ratio: 16 / 12;
}

.hx-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--tg-text-muted);
    background-color: var(--tg-bg-elev);
    border: 1px dashed var(--tg-border);
    border-radius: 0.75rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 768px) {
    .hx-hero {
        padding-top: 3rem;
        padding-bottom: 1.5rem;
    }

    .hx-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .hx-feature__media {
        aspect-ratio: 11 / 5;
    }

    .hx-feature__title {
        font-size: 1.75rem;
    }

    .hx-discover__inner {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .hx-discover__heading {
        font-size: 1.75rem;
    }

    .hx-spot {
        min-height: 17rem;
    }
}

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

    .hx-feature {
        grid-column: span 2 / span 2;
        min-height: 40rem;
    }

    .hx-discover__body {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .hx-spot {
        grid-column: span 2 / span 2;
        min-height: 17rem;
    }

    .hx-spot__title {
        font-size: 1.375rem;
    }

    .hx-discover__list {
        grid-column: span 3 / span 3;
    }
}
