/* ---------------------------------
   Thoughts

   Poster cards, the archive grid and the review / post detail
   pages. The hub, archive search, tabs, carousel and link rows
   use the shared components in core/css/site.css.
--------------------------------- */

.thoughts-search {
    margin-bottom: 64px;
}


/* ---------------------------------
   Poster Card
--------------------------------- */

.thought-card {
    min-width: 0;
}

.thought-link {
    display: flex;
    flex-direction: column;

    gap: 12px;

    height: 100%;

    color: inherit;

    text-decoration: none;
}

.thought-link:hover {
    color: inherit;
}

.thought-poster {
    position: relative;

    aspect-ratio: 2 / 3;

    overflow: hidden;

    background-color: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    transition:
        transform 0.3s var(--ease),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.thought-poster img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.5s var(--ease);
}

.thought-link:hover .thought-poster,
.thought-link:focus-visible .thought-poster {
    transform: translateY(-4px);

    border-color: var(--accent-line);

    box-shadow:
        var(--shadow),
        0 0 0 1px var(--accent-line);
}

.thought-link:hover .thought-poster img {
    transform: scale(1.04);
}


/* Placeholder poster for thoughts without a thumbnail. */

.thought-poster-placeholder {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    justify-content: space-between;

    padding: 16px 14px;

    background-color: var(--surface);
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -1px -1px;
}

.thought-poster-placeholder .icon {
    font-size: 1.6rem;

    color: var(--accent);
}

.thought-poster-title {
    display: -webkit-box;

    overflow: hidden;

    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;

    color: var(--text);

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
}


/* Rating badge in the poster's corner. */

.thought-rating {
    position: absolute;
    top: 8px;
    right: 8px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 3px 8px;

    font-size: 0.75rem;
    font-weight: 700;

    color: var(--text);

    background-color: rgba(11, 12, 15, 0.82);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);

    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.thought-rating .icon {
    font-size: 0.7rem;

    color: var(--accent);
}


/* Text under the poster. */

.thought-card-info {
    display: flex;
    flex-direction: column;

    gap: 4px;

    min-width: 0;
}

.thought-card-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 0 8px;

    font-size: 0.72rem;

    color: var(--text-muted);
}

.thought-kind {
    font-weight: 600;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    color: var(--accent);
}

.thought-title {
    display: -webkit-box;

    overflow: hidden;

    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;

    transition: color 0.2s ease;
}

.thought-link:hover .thought-title {
    color: var(--accent);
}


/* ---------------------------------
   Carousel and Grid Sizing
--------------------------------- */

.thought-carousel > .thought-card {
    width: clamp(150px, 16vw, 196px);
}

.thought-grid {
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));

    gap: 40px 22px;
}

.archive-count {
    margin-bottom: 24px;
}


/* ---------------------------------
   Detail Page
--------------------------------- */

.thought-detail {
    position: relative;

    isolation: isolate;
}

/* Blurred poster behind the header, fading into the page. */

.thought-backdrop {
    position: absolute;
    inset: 0 0 auto;
    z-index: -1;

    height: 560px;

    overflow: hidden;
}

.thought-backdrop img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 0.32;

    filter: blur(60px) saturate(1.4);

    transform: scale(1.3);
}

.thought-backdrop::after {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(
        to bottom,
        rgba(11, 12, 15, 0.2),
        var(--bg)
    );
}


/* Poster + header. */

.thought-hero {
    display: grid;

    grid-template-columns: 220px minmax(0, 1fr);
    align-items: end;

    gap: 40px;
}

.thought-hero-text {
    grid-template-columns: minmax(0, 1fr);
}

.thought-hero-poster {
    display: block;

    width: 100%;

    aspect-ratio: 2 / 3;

    object-fit: cover;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);
}

.thought-detail-header h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
}

.thought-meta {
    display: flex;

    flex-wrap: wrap;
    align-items: center;

    gap: 16px 32px;

    margin-top: 24px;

    font-size: 0.85rem;

    color: var(--text-muted);
}

.thought-date {
    display: inline-flex;
    align-items: center;

    gap: 8px;
}


/* Rating: score plus a ten-segment bar filled to the score. */

.rating {
    display: flex;
    align-items: center;

    gap: 14px;
}

.rating-score {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;

    color: var(--accent);
}

.rating-scale {
    margin-left: 2px;

    font-size: 0.85rem;
    font-weight: 400;

    color: var(--text-faint);
}

.rating-bar {
    --segment: 14px;

    position: relative;

    width: calc(var(--segment) * 10);
    height: 8px;

    background: repeating-linear-gradient(
        90deg,
        var(--border-strong) 0 calc(var(--segment) - 3px),
        transparent calc(var(--segment) - 3px) var(--segment)
    );
}

.rating-bar::after {
    content: "";

    position: absolute;
    inset: 0 auto 0 0;

    width: calc(var(--rating) * var(--segment));

    background: repeating-linear-gradient(
        90deg,
        var(--accent) 0 calc(var(--segment) - 3px),
        transparent calc(var(--segment) - 3px) var(--segment)
    );
}


/* Body. */

.thought-body {
    margin-top: 56px;
    padding-top: 40px;

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


/* ---------------------------------
   Responsive
--------------------------------- */

@media (max-width: 700px) {

    .thoughts-search {
        margin-bottom: 48px;
    }

    .thought-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));

        gap: 32px 16px;
    }

    .thought-carousel > .thought-card {
        width: 148px;
    }

    .thought-hero {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;

        gap: 28px;
    }

    .thought-hero-poster {
        width: 170px;
    }

    .thought-body {
        margin-top: 40px;
        padding-top: 32px;
    }

}
