/**
 * Homepage "recent comments" section.
 *
 * Social proof, presented as a list of quotations rather than a grid of cards.
 * The homepage already runs two card grids above this block — the category
 * carousels and the packages band — so a third reads as more of the same. A
 * hairline-separated list is a change of texture, and it matches how a comment
 * thread is set on the single templates, so a comment looks like a comment
 * everywhere on the site.
 *
 * @see docs/comments-system.md Full documentation of the comments system
 */

/* A neutral well with an accent edge, not a tinted slab. --accent-soft is sized
   for small elements — filter rows, badges — where it reads as a warm
   highlight; across a section this large it reads as a muddy wash instead,
   because a low-chroma accent at low alpha over the page ground lands on a dull
   mid-tone. A percentage fade does not rescue it either: the section is taller
   than the viewport, so its top 60% is most of what anyone sees. The accent
   belongs in the heading and the hairline, which is where it goes. */
.recent-comments-section {
    background-color: var(--surface-translucent);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
}

/* The heading itself is .category-title, shared with the carousels and the
   packages band — sized in home/carousel.css, glinted in main.css. Only the
   spacing below it belongs to this block. */
.recent-comments-section .category-title {
    margin-bottom: 1.5rem;
}

/* No inner scroll. A scroll container inside a page that already scrolls traps
   the wheel on a desktop and steals the page's own gesture on a phone, and it
   hides exactly the content the block exists to show. The number of rows is the
   height control instead — render_recent_comments($limit), called from
   page_home.php. */
.recent-comments-list {
    display: flex;
    flex-direction: column;
}

/* A row in a list, not a card. The section is already a bordered well on the
   page; giving each item a border, a fill and a shadow as well nests three
   levels of box for one short quotation. */
.recent-comment-item + .recent-comment-item {
    border-top: 1px solid var(--border-subtle);
}

/* The whole row is the link, and the hover wash is what says so. It is inset
   from the hairline by the row's own padding, so the highlight reads as a
   focused row rather than as a full-bleed band. */
.recent-comment-link {
    display: block;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.recent-comment-link:hover,
.recent-comment-link:focus-visible {
    background-color: var(--surface-translucent);
    text-decoration: none;
    color: inherit;
}

.recent-comment-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* ---------------------------------------------------------------- thumbnail */

/* Portrait, not square, and the same 3:4 the card grid crops to: these are
   photographs of people, and a square crop takes the head or the feet. Fixed at
   every width — the row is the same shape on a phone as on a desktop, so there
   is no ratio for a breakpoint to change. */
.recent-comment-thumbnail-wrapper {
    flex: none;
    width: 54px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--bg-dark);
}

.recent-comment-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recent-comment-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--clr-engagement);
    background-color: var(--bg-dark);
}

/* ---------------------------------------------------------------- content */

.recent-comment-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* The ad the comment is about: context and link target, set as an accent kicker
   above the quote. These are keyword-built ad titles rather than names, so five
   of them at heading size are a wall of pink and the block stops reading as
   quotations at all. One line — the rest of the title is on the page it links
   to. */
.recent-comment-post-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--clr-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-comment-link:hover .recent-comment-post-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The quotation, and the reason the block exists — so it takes the page
   foreground and the largest size in the row. Two lines: the text is already
   trimmed to 20 words in PHP, and a third line makes the row a paragraph. */
.recent-comment-text {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--clr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Attribution, under the words it attributes. */
.recent-comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--clr-engagement);
}

.recent-comment-author,
.recent-comment-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.recent-comment-author i,
.recent-comment-date i {
    font-size: 0.9em;
    opacity: 0.8;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 767px) {
    .recent-comments-section {
        padding: 1.5rem 1rem;
    }

    .recent-comments-section .category-title {
        margin-bottom: 1rem;
    }

    .recent-comment-link {
        padding: 12px 6px;
    }

    .recent-comment-row {
        gap: 11px;
    }

    .recent-comment-thumbnail-wrapper {
        width: 46px;
    }

    .recent-comment-text {
        font-size: 14px;
    }

    /* The two meta items stack rather than sharing a line: at this width the
       author's name plus a relative date wraps mid-item and reads as three
       fragments instead of two. */
    .recent-comment-meta {
        gap: 2px 12px;
    }
}
