/* ========================================
   STYLES.CSS - Home page: grid + pieces shared by every home section
   Base, header, footer and buttons live in /css (shared across pages).
   ======================================== */

:root {
    --ink: #3b342d;
    --ink-deep: #2c2620;
    --ink-muted: #6b5d4f;
    --paper-card: #FBF8F3;
    --card-line: rgba(59, 52, 45, 0.08);
    --card-rest:
        0 1px 2px rgba(59, 52, 45, 0.04),
        0 12px 32px -14px rgba(59, 52, 45, 0.18);
    --card-lift:
        0 2px 4px rgba(59, 52, 45, 0.05),
        0 22px 44px -16px rgba(59, 52, 45, 0.26);
    --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ========================================
   Bento Grid Layout
   ======================================== */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-auto-rows: minmax(200px, auto);
    grid-gap: 15px;
    padding: 0 40px;
    max-width: 1800px;
    margin: 0 auto;
}

.section-title {
    margin-bottom: 8px;
}

/* Full-width sections stack in source order below the top block at every
   breakpoint. The (0,2,0) selector beats the fixed grid-row values that
   responsive-unified.css still sets for these classes. */
.bento-grid > .home-section {
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 26px 28px 30px;
}

/* Big sections shouldn't jump when the pointer passes over them — the cards
   inside do the moving. */
.bento-grid > .home-section:hover {
    transform: none;
    box-shadow: var(--card-shadow);
}

/* The 1024px rule in responsive-unified spans get-in-touch to line 4 of a
   2-column grid, which creates a phantom third column. */
@media (max-width: 1350px) {
    .bento-grid > .get-in-touch {
        grid-column: 1 / -1;
    }
}

/* ========================================
   Section header: title left, "All x →" right
   ======================================== */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-bottom: 18px;
}

.section-head .section-title {
    margin: 0;
}

.section-link {
    font-family: "Kreon", serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
    text-decoration-color: rgba(59, 52, 45, 0.3);
    white-space: nowrap;
    transition: text-decoration-color 200ms ease;
}

.section-link span {
    display: inline-block;
    transition: transform 240ms var(--ease-out);
}

.section-link:hover {
    text-decoration-color: currentColor;
}

.section-link:hover span {
    transform: translateX(4px);
}

/* ========================================
   Cards: one surface for every home card
   ======================================== */
.recent-card,
.featured-card,
.mini-card,
.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--paper-card);
    border: 1px solid var(--card-line);
    border-radius: 16px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--card-rest);
    transition: transform 280ms var(--ease-out), box-shadow 280ms var(--ease-out);
}

.recent-card:hover,
.featured-card:hover,
.mini-card:hover,
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-lift);
}

.recent-card:focus-visible,
.featured-card:focus-visible,
.mini-card:focus-visible,
.project-card:focus-visible,
.latest-post-content:focus-visible,
.section-link:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

/* Thumbnails ease in a touch on hover; the card itself does the lifting. */
.recent-thumb img,
.featured-thumb img,
.project-cover > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--ease-out);
}

.recent-card:hover .recent-thumb img,
.featured-card:hover .featured-thumb img,
.project-card:hover .project-cover > img {
    transform: scale(1.04);
}

/* Post thumbnails are meant to be 16:9 and some use the whole frame, so
   they are fitted, never cropped. For a true 16:9 image this is identical to
   cover; an off-ratio one gets thin paper bands instead of losing its edges. */
.recent-thumb img,
.featured-thumb img {
    object-fit: contain;
}

/* Date · Category line */
.card-meta {
    font-family: "Delius", cursive;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0 0 6px;
}

.meta-part {
    white-space: nowrap;
}

.meta-dot {
    margin: 0 0.45em;
    opacity: 0.6;
}

/* Quiet text call-to-action that replaces the old per-card buttons */
.card-cta {
    margin-top: auto;
    padding-top: 14px;
    font-family: "Kreon", serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

.card-cta span {
    display: inline-block;
    transition: transform 240ms var(--ease-out);
}

.featured-card:hover .card-cta span,
.mini-card:hover .card-cta span {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .bento-grid > .home-section {
        padding: 20px 16px 22px;
    }

    .section-link {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .recent-card,
    .featured-card,
    .mini-card,
    .project-card,
    .recent-thumb img,
    .featured-thumb img,
    .project-cover > img,
    .section-link span,
    .card-cta span {
        transition: none;
    }

    .recent-card:hover,
    .featured-card:hover,
    .mini-card:hover,
    .project-card:hover,
    .recent-card:hover .recent-thumb img,
    .featured-card:hover .featured-thumb img,
    .project-card:hover .project-cover > img {
        transform: none;
    }
}
