/* ═══════════════════════════════════════════════════════════════════════════
   ivs-journal — the "From the journal" section, one component, two looks.
   ─────────────────────────────────────────────────────────────────────────
   Markup: resources/views/partials/journal-section.blade.php (contract in its
   header). Data: Cmf::getRecentblog() — WordPress REST, cached, DB fallback.

   Variants:
     .ivs-journal--cards     the homepage look: parchment + toile band,
                             big lead + a row of three dated cards, sign-off
                             rule with a byline.
     .ivs-journal--masthead  the tour V5 look: hairline band, lead beside a
                             thin list of headlines, the way a magazine opens
                             its journal page.

   Entrances come from the shared ivs-reveal component (data-ivs-reveal in the
   partial) — no reveal rules live here. Colors ride the --v5-* tokens with
   fallbacks, so the section works on pages without homepage.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Default container (pages may pass their own via $journalContainerClass:
      the homepage keeps .container, tour V5 keeps .tv5-container). ── */
.ivs-journal-container {
    width: min(1230px, calc(100% - 3rem));
    margin-inline: auto;
}

/* ── Shared furniture ── */
.ivs-journal a {
    text-decoration: none;
    color: inherit;
}
.ivs-journal a:focus-visible {
    outline: 2px solid var(--v5-olive-700, #4a5e2f);
    outline-offset: 3px;
}

.ivs-journal-arrow {
    display: inline-block;
    transition: transform var(--ivs-anim-micro, 300ms) var(--ivs-anim-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.ivs-journal-lead-media {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--v5-parchment, #f2efe8);
}

.ivs-journal-lead-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.15s var(--ivs-anim-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.ivs-journal-flag {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background: var(--v5-ink, #201f1d);
    color: var(--v5-parchment, #f2efe8);
    font-family: var(--v5-font-label, 'Inter', sans-serif);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 8px 14px;
}

.ivs-journal-lead-title {
    margin: 0;
    font-family: var(--v5-font-display, 'Playfair Display', Georgia, serif);
    font-weight: 500;
    color: var(--v5-ink, #201f1d);
    text-wrap: balance;
    transition: color 0.3s;
}

.ivs-journal-dateline {
    display: block;
    margin-bottom: 0.55rem;
    font-family: var(--v5-font-label, 'Inter', sans-serif);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--v5-mist, #8b877c);
}

.ivs-journal-eyebrow {
    display: block;
    margin: 0 0 0.8rem;
    font-family: var(--v5-font-label, 'Inter', sans-serif);
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.ivs-journal-title {
    margin: 0;
    font-family: var(--v5-font-display, 'Playfair Display', Georgia, serif);
    color: var(--v5-ink, #201f1d);
    text-wrap: balance;
}

/* ═══════════════════════════════════════════════════════════════════════════
   VARIANT: cards — the homepage look
   ═══════════════════════════════════════════════════════════════════════════ */

/* Band chrome: parchment laid into the page, toile fading at both edges. */
.ivs-journal--cards {
    position: relative;
    overflow: hidden;
    padding-top: 74px;
    padding-bottom: 78px;
    background: var(--v5-parchment, #f2efe8);
    border-top: 1px solid var(--v5-line, #e4e0d5);
    border-bottom: 1px solid var(--v5-line, #e4e0d5);
    box-shadow: inset 0 14px 26px -14px rgba(32, 31, 29, 0.22),
                inset 0 -14px 26px -14px rgba(32, 31, 29, 0.22);
}

.ivs-journal--cards::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: url('/images/italy.png') repeat;
    background-size: 620px;
    opacity: 0.14;
    -webkit-mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 1) 60px,
        rgba(0, 0, 0, 1) calc(100% - 60px),
        rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 1) 60px,
        rgba(0, 0, 0, 1) calc(100% - 60px),
        rgba(0, 0, 0, 0) 100%);
}

.ivs-journal--cards > div {
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .ivs-journal--cards::after {
        background-size: 420px;
        opacity: 0.12;
        -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0,
            rgba(0, 0, 0, 1) 40px,
            rgba(0, 0, 0, 1) calc(100% - 40px),
            rgba(0, 0, 0, 0) 100%);
        mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0,
            rgba(0, 0, 0, 1) 40px,
            rgba(0, 0, 0, 1) calc(100% - 40px),
            rgba(0, 0, 0, 0) 100%);
    }
}

/* Head */
.ivs-journal--cards .ivs-journal-head {
    text-align: center;
    margin-bottom: 3rem;
}
.ivs-journal--cards .ivs-journal-eyebrow {
    font-size: 0.68rem;
    color: var(--v5-olive-700, #4a5e2f);
}
.ivs-journal--cards .ivs-journal-title {
    font-size: clamp(1.85rem, 3vw, 2.7rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.01em;
}
.ivs-journal-standfirst {
    max-width: 52ch;
    margin: 0.85rem auto 0;
    font-family: var(--v5-font-body, 'Lora', Georgia, serif);
    font-size: clamp(0.92rem, 1vw, 1.02rem);
    line-height: 1.75;
    color: var(--v5-stone, #5b574d);
    text-wrap: balance;
}

/* Lead: full-width band, photo beside the words */
.ivs-journal--cards .ivs-journal-lead {
    display: grid;
    grid-template-columns: 1.32fr 1fr;
    align-items: stretch;
    margin-bottom: 3.25rem;
}
.ivs-journal--cards .ivs-journal-lead-media { aspect-ratio: 16 / 10; }
.ivs-journal--cards .ivs-journal-lead-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.4rem 0 2.4rem 2.9rem;
}
.ivs-journal--cards .ivs-journal-lead-title {
    font-size: clamp(1.5rem, 2.9vw, 2.3rem);
    line-height: 1.18;
}
.ivs-journal--cards .ivs-journal-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.25rem;
    font-family: var(--v5-font-label, 'Inter', sans-serif);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--v5-olive-700, #4a5e2f);
}

/* Rule + the three cards */
.ivs-journal-rule {
    height: 1px;
    background: var(--v5-line, #e4e0d5);
    margin-bottom: 2.1rem;
}
.ivs-journal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.1rem 1.75rem;
}
.ivs-journal-card-media {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--v5-parchment, #f2efe8);
    aspect-ratio: 3 / 2;
    margin-bottom: 0.95rem;
}
.ivs-journal-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 1s var(--ivs-anim-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}
.ivs-journal-card-title {
    margin: 0;
    font-family: var(--v5-font-display, 'Playfair Display', Georgia, serif);
    font-size: 1.06rem;
    font-weight: 500;
    line-height: 1.32;
    color: var(--v5-ink, #201f1d);
    text-wrap: balance;
    transition: color 0.28s;
}

/* Sign-off */
.ivs-journal-foot {
    margin-top: 2.6rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--v5-line, #e4e0d5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.1rem;
    flex-wrap: wrap;
}
.ivs-journal--cards .ivs-journal-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--v5-font-label, 'Inter', sans-serif);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--v5-ink, #201f1d);
    border-bottom: 1.5px solid var(--v5-ink, #201f1d);
    padding-bottom: 4px;
    transition: color 0.28s, border-color 0.28s;
}
.ivs-journal-byline {
    font-family: var(--v5-font-body, 'Lora', Georgia, serif);
    font-size: 0.86rem;
    font-style: italic;
    color: var(--v5-stone, #5b574d);
}

@media (hover: hover) {
    .ivs-journal--cards .ivs-journal-lead:hover .ivs-journal-lead-img { transform: scale(1.045); }
    .ivs-journal--cards .ivs-journal-lead:hover .ivs-journal-lead-title { color: var(--v5-olive-900, #33421f); }
    .ivs-journal--cards .ivs-journal-lead:hover .ivs-journal-arrow { transform: translateX(5px); }

    .ivs-journal-card:hover .ivs-journal-card-img { transform: scale(1.05); }
    .ivs-journal-card:hover .ivs-journal-card-title { color: var(--v5-olive-900, #33421f); }

    .ivs-journal--cards .ivs-journal-all:hover {
        color: var(--v5-olive-900, #33421f);
        border-color: var(--v5-olive-900, #33421f);
    }
    .ivs-journal--cards .ivs-journal-all:hover .ivs-journal-arrow { transform: translateX(5px); }
}

@media (max-width: 860px) {
    .ivs-journal--cards .ivs-journal-lead {
        grid-template-columns: 1fr;
        margin-bottom: 2.5rem;
    }
    .ivs-journal--cards .ivs-journal-lead-media { aspect-ratio: 16 / 11; }
    .ivs-journal--cards .ivs-journal-lead-copy { padding: 1.4rem 0 0; }
    .ivs-journal-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .ivs-journal--cards {
        padding-top: 52px;
        padding-bottom: 56px;
    }
    .ivs-journal--cards .ivs-journal-head { margin-bottom: 2.1rem; }
    .ivs-journal-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VARIANT: masthead — the tour V5 look
   ═══════════════════════════════════════════════════════════════════════════ */

.ivs-journal--masthead {
    border-top: 1px solid var(--v5-line, #e4e0d5);
    padding-block: 4rem;
}
@media (min-width: 64rem) {
    .ivs-journal--masthead { padding-block: 6rem; }
}

/* Head: the tour V5 section heading (olive eyebrow, tight Playfair) */
.ivs-journal--masthead .ivs-journal-head {
    text-align: center;
    margin-bottom: 2.5rem;
}
@media (min-width: 64rem) {
    .ivs-journal--masthead .ivs-journal-head { margin-bottom: 3rem; }
}
.ivs-journal--masthead .ivs-journal-eyebrow {
    font-size: 0.72rem;
    color: var(--v5-olive-700, #4a5e2f); /* olive — the site-wide accent (4 Aug 2026) */
}
.ivs-journal--masthead .ivs-journal-title {
    font-size: 1.875rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Lead + hairline list, side by side on desktop */
.ivs-journal--masthead .ivs-journal-masthead {
    display: grid;
    gap: 2.5rem;
}
@media (min-width: 55rem) {
    .ivs-journal--masthead .ivs-journal-masthead {
        grid-template-columns: 1.35fr 1fr;
        gap: 2.75rem;
        align-items: start;
    }
}

.ivs-journal--masthead .ivs-journal-lead { display: block; }
.ivs-journal--masthead .ivs-journal-lead-img {
    aspect-ratio: 16 / 10;
    height: auto;
    transition: transform 0.9s ease;
}
.ivs-journal--masthead .ivs-journal-flag {
    font-size: 0.6rem;
    padding: 7px 12px;
}
.ivs-journal--masthead .ivs-journal-lead-copy {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 1.1rem;
}
.ivs-journal--masthead .ivs-journal-lead-title {
    font-size: 1.5rem;
    line-height: 1.28;
}
@media (min-width: 55rem) {
    .ivs-journal--masthead .ivs-journal-lead-title { font-size: 1.72rem; }
}
.ivs-journal--masthead .ivs-journal-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--v5-stone, #5b574d);
    transition: color 0.3s;
}

/* The list */
.ivs-journal-rest {
    display: flex;
    flex-direction: column;
}
.ivs-journal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--v5-line, #e4e0d5);
}
.ivs-journal-item {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 1.1rem;
    align-items: center;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--v5-line, #e4e0d5);
}
.ivs-journal-item-thumb {
    display: block;
    overflow: hidden;
    background: var(--v5-parchment, #f2efe8);
}
/* 3:2 crops least across the mixed source ratios; square cut every subject. */
.ivs-journal-item-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.ivs-journal-item-title {
    margin: 0;
    font-family: var(--v5-font-display, 'Playfair Display', Georgia, serif);
    font-size: 0.97rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--v5-ink, #201f1d);
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.ivs-journal--masthead .ivs-journal-all {
    align-self: flex-start;
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--v5-olive-700, #4a5e2f);
    transition: color 0.3s;
}

@media (hover: hover) {
    .ivs-journal--masthead .ivs-journal-lead:hover .ivs-journal-lead-img { transform: scale(1.04); }
    .ivs-journal--masthead .ivs-journal-lead:hover .ivs-journal-lead-title { color: var(--v5-olive-700, #4a5e2f); }
    .ivs-journal--masthead .ivs-journal-lead:hover .ivs-journal-cta { color: var(--v5-ink, #201f1d); }
    .ivs-journal--masthead .ivs-journal-lead:hover .ivs-journal-arrow,
    .ivs-journal--masthead .ivs-journal-all:hover .ivs-journal-arrow { transform: translateX(4px); }

    .ivs-journal-item:hover .ivs-journal-item-img { transform: scale(1.07); }
    .ivs-journal-item:hover .ivs-journal-item-title { color: var(--v5-olive-700, #4a5e2f); }
    .ivs-journal--masthead .ivs-journal-all:hover { color: var(--v5-ink, #201f1d); }
}

/* ── Quiet hands ── */
@media (prefers-reduced-motion: reduce) {
    .ivs-journal-arrow,
    .ivs-journal-lead-img,
    .ivs-journal-card-img,
    .ivs-journal-item-img,
    .ivs-journal-lead-title,
    .ivs-journal-card-title,
    .ivs-journal-item-title,
    .ivs-journal-all {
        transition: none !important;
    }
}
