/*
 * Kalon Theme — blog index (/blog/) post grid styles
 *
 * Ported from hello-theme-child/home.php inline <style id="kalon-blog-grid-css">
 * on 2026-04-09 as part of the Phase 1 theme refactor. Enqueued conditionally
 * via is_home() in kalon-theme/functions.php.
 */

.kalon-blog-grid-wrap {
    background: #f0f0f0;
    padding: 60px 24px 80px;
    /* C-4 (Phase 5): make this wrapper a query container so the inner
       grid responds to its own width, not the viewport width. Lets the
       same grid drop into a sidebar/embed at narrower contexts and
       still reflow correctly. */
    container-type: inline-size;
    container-name: kalon-blog-grid-wrap;
}
.kalon-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1240px;
    margin: 0 auto;
}
.kalon-blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}
.kalon-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.kalon-blog-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.kalon-blog-card__img-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #ebe5dc;
}
.kalon-blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.kalon-blog-card:hover .kalon-blog-card__img {
    transform: scale(1.05);
}
.kalon-blog-card__body {
    padding: 22px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.kalon-blog-card__cat {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #00B3DB;
}
.kalon-blog-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    color: #1a1a1a;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}
.kalon-blog-card__excerpt {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #6a6a6a;
    margin: 0;
    flex: 1;
}
.kalon-blog-card__more {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #00B3DB;
    margin-top: 6px;
}

.kalon-blog-pagination {
    max-width: 1240px;
    margin: 48px auto 0;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}
.kalon-blog-pagination .nav-links {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.kalon-blog-pagination a,
.kalon-blog-pagination span {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    background: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.kalon-blog-pagination a:hover {
    background: #00B3DB;
    color: #fff;
}
.kalon-blog-pagination .current {
    background: #00B3DB;
    color: #fff;
}

/* C-4 (Phase 5): switched from @media (viewport) to @container (parent
   inline-size) so card grids reflow per their actual cell width, not
   the viewport. */
@container kalon-blog-grid-wrap (max-width: 1024px) {
    .kalon-blog-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@container kalon-blog-grid-wrap (max-width: 600px) {
    .kalon-blog-grid { grid-template-columns: 1fr; gap: 20px; }
}
/* The wrapper padding is still viewport-driven (it's the OUTER element). */
@media (max-width: 600px) {
    .kalon-blog-grid-wrap { padding: 40px 16px 60px; }
}

