/* ==========================================================================
   Journal Grids (Travel Journal family) + Heading Style 9 "Squiggle"
   Journey Hero · Destinations Mosaic · Postcards Grid
   Loaded only when one of them (or heading style 9) is used.
   ========================================================================== */
@font-face { font-family: 'Caveat'; src: url('../../fonts/Caveat-Bold-latin.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../../fonts/PlayfairDisplay-Variable-latin.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
    --epj-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --epj-script: 'Caveat', 'Segoe Script', cursive;
    --epj-radius: 8px;
    --epj-muted: color-mix(in srgb, var(--text-main) 60%, transparent);
    --epj-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='15' viewBox='0 0 60 15'%3E%3Cpath d='M0,7.5 Q15,0 30,7.5 T60,7.5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* --- Heading Style 9: serif title + hand-drawn squiggle --- */
.ep-heading-style_9 { align-items: flex-end; padding-bottom: 18px; }
.ep-heading-style_9 .title-text { font-family: var(--epj-serif); font-weight: 700; letter-spacing: -.3px; text-transform: none; }
.ep-heading-style_9::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 120px; height: 12px;
    background: var(--accent);
    -webkit-mask: var(--epj-wave) repeat-x 0 50% / 40px 10px; mask: var(--epj-wave) repeat-x 0 50% / 40px 10px;
}
.ep-heading-style_9 .view-all { display: inline-flex; align-items: center; gap: 6px; font: 700 1.35rem/1 var(--epj-script); letter-spacing: 0; text-transform: none; color: var(--text-main); }
.ep-heading-style_9 .view-all i { color: var(--accent); font-size: 1.1rem; transition: transform .2s; }
.ep-heading-style_9 .view-all:hover i { transform: translateX(3px); }
.ep-sidebar .ep-heading-style_9 .title-text { font-size: 1.35rem; }
.ep-sidebar .ep-heading-style_9::after { width: 80px; }

/* --- Shared --- */
.epj { padding: 44px 0; }
.epj a { text-decoration: none; }
.epj .ep-row-layout > .ep-sidebar { height: auto; overflow: visible; }
.epj-kicker { display: inline-block; margin-bottom: 8px; font: 700 1.45rem/1 var(--epj-script); color: var(--accent); transform: rotate(-2deg); transform-origin: left center; }
.epj-kicker--sm { margin-bottom: 4px; font-size: 1.15rem; }
.epj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 12.5px; font-weight: 500; color: var(--epj-muted); }
.epj-dot { width: 3px; height: 3px; margin: 0 8px; border-radius: 50%; background: currentColor; opacity: .7; }
.epj-meta__by { color: var(--text-main); font-weight: 600; }
.epj-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--bg-section-alt)), var(--bg-section-alt)); }

/* --- Journey Hero --- */
.epj-hero { padding-top: 34px; }
.epj-hero__grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 40px; align-items: stretch; }
.epj-hero__grid.is-solo { grid-template-columns: minmax(0, 1fr); }
.epj-hero__grid.is-solo .epj-hero__side { display: none; }
.epj-hero__main { position: relative; display: flex; align-items: flex-end; min-height: 540px; overflow: hidden; isolation: isolate; border-radius: var(--epj-radius); background: #1f2937; }
.epj-hero__media { position: absolute; inset: 0; z-index: -2; }
.epj-hero__media img, .epj-hero__media .epj-ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.epj-hero__main:hover .epj-hero__media img { transform: scale(1.04); }
.epj-hero__main::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 28%, rgba(8, 8, 10, .85)); }
.epj-hero__body { max-width: 760px; padding: 40px; color: #fff; }
.epj-hero__body .epj-kicker { font-size: 1.8rem; }
.epj-hero__title { margin: 0 0 14px; font: 700 clamp(1.9rem, 1.2rem + 2.1vw, 3.1rem)/1.12 var(--epj-serif); letter-spacing: -.5px; }
.epj-hero__title a { color: #fff; }
.epj-hero__excerpt { max-width: 620px; margin: 0 0 22px; font-size: 1.05rem; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.epj-hero__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.epj-hero__main .epj-meta, .epj-hero__main .epj-meta__by { color: rgba(255, 255, 255, .82); }
.epj-hero__cta { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 4px; background: var(--accent); color: #111 !important; font-size: 14px; font-weight: 700; transition: transform .2s, filter .2s; }
.epj-hero__cta:hover { transform: translateY(-2px); filter: brightness(.95); }

.epj-hero__side { display: flex; flex-direction: column; min-width: 0; }
.epj-hero__label { position: relative; display: inline-block; align-self: flex-start; margin-bottom: 6px; padding-bottom: 12px; font: 700 1.9rem/1 var(--epj-script); color: var(--text-main); }
.epj-hero__label::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--accent); -webkit-mask: var(--epj-wave) repeat-x 0 50% / 30px 8px; mask: var(--epj-wave) repeat-x 0 50% / 30px 8px; }
.epj-hero__list { display: flex; flex: 1; flex-direction: column; justify-content: space-around; margin: 0; padding: 0; list-style: none; counter-reset: epj; }
.epj-hero__item { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; margin: 0; padding: 20px 0; counter-increment: epj; }
.epj-hero__item::marker { content: none; }
.epj-hero__item + .epj-hero__item { border-top: 1px dashed var(--border); }
.epj-hero__thumb { position: relative; display: block; width: 96px; height: 96px; }
.epj-hero__thumb img, .epj-hero__thumb .epj-ph { width: 96px; height: 96px; object-fit: cover; border-radius: var(--epj-radius); }
.epj-hero__thumb::after { content: counter(epj, decimal-leading-zero); position: absolute; top: -8px; left: -8px; padding: 4px 8px; border-radius: 20px; background: var(--accent); color: #111; font-size: 12px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 3px var(--bg-body); }
.epj-hero__item-title { margin: 0; font: 700 1.12rem/1.32 var(--epj-serif); }
.epj-hero__item-title a { color: var(--text-main); transition: color .2s; }
.epj-hero__item-title a:hover { color: var(--accent); }

/* --- Destinations Mosaic --- */
.epj-dest__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 230px; gap: 18px; }
.epj-tile { min-width: 0; }
.epj-tile.is-lead { grid-column: span 2; grid-row: span 2; }
.epj-dest__grid.count-1 .epj-tile.is-lead { grid-column: 1 / -1; }
.epj-dest__grid.count-2 .epj-tile { grid-column: span 2; grid-row: span 2; }
.epj-dest__grid.count-3 .epj-tile:not(.is-lead) { grid-column: span 2; }
.epj-dest__grid.count-4 .epj-tile:nth-child(2) { grid-column: span 2; }
.epj-tile__link { position: relative; display: block; height: 100%; overflow: hidden; border-radius: var(--epj-radius); color: #fff; background: #1f2937; }
.epj-tile__link img, .epj-tile__link .epj-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.epj-tile__link:hover img { transform: scale(1.06); }
.epj-tile__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .78)); }
.epj-tile__link::after { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 4px; opacity: 0; transition: opacity .3s, inset .3s; pointer-events: none; }
.epj-tile__link:hover::after { opacity: 1; inset: 12px; }
.epj-tile__body { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.epj-tile__place { display: inline-flex; align-items: center; gap: 6px; font: 700 1.6rem/1 var(--epj-script); color: #fff; }
.epj-tile__place i { font-size: .95rem; color: var(--accent); }
.epj-tile__title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 600; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.epj-tile.is-lead .epj-tile__body { padding: 28px 30px; gap: 8px; }
.epj-tile.is-lead .epj-tile__place { font-size: 2.4rem; }
.epj-tile.is-lead .epj-tile__title { font: 700 clamp(1.3rem, 1rem + 1vw, 1.8rem)/1.25 var(--epj-serif); color: #fff; -webkit-line-clamp: 3; }

/* --- Postcards --- */
.epj-cards__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 26px; }
.epj-cards__grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.epj-card { min-width: 0; }
.epj-card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--epj-radius); background: var(--bg-section-alt); }
.epj-card__img { position: absolute; inset: 0; }
.epj-card__media img, .epj-card__media .epj-ph { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.epj-card:hover .epj-card__media img { transform: scale(1.05); }
.epj-card__stamp { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 24px); padding: 7px 11px; border-radius: 30px; background: rgba(255, 255, 255, .94); color: #111 !important; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.epj-card__stamp i { color: var(--accent); font-size: 13px; }
.epj .epj-card__save { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #111; font-size: 16px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s, background .2s; }
.epj-card:hover .epj-card__save, .epj .epj-card__save:focus-visible, .epj .epj-card__save.saved { opacity: 1; transform: none; }
.epj .epj-card__save.saved { background: var(--accent); color: #111; }
.epj-card__body { padding-top: 16px; }
.epj-card__title { position: relative; margin: 0 0 10px; padding-bottom: 12px; font: 700 1.2rem/1.3 var(--epj-serif); letter-spacing: -.2px; }
.epj-card__title a { color: var(--text-main); transition: color .2s; }
.epj-card__title a:hover { color: var(--accent); }
.epj-card__title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 28px; height: 8px; background: var(--accent); -webkit-mask: var(--epj-wave) repeat-x 0 50% / 24px 7px; mask: var(--epj-wave) repeat-x 0 50% / 24px 7px; transition: width .45s ease; }
.epj-card:hover .epj-card__title::after { width: 84px; }
.epj-card__excerpt { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--epj-muted); }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .epj-cards__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .epj-hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 992px) {
    .epj-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .epj-hero__main { min-height: 460px; }
    .epj-hero__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 30px; }
    .epj-hero__item + .epj-hero__item { border-top: 0; }
    .epj-dest__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; }
    .epj-dest__grid .epj-tile:not(.is-lead) { grid-column: span 1; grid-row: span 1; }
    .epj-dest__grid.count-2 .epj-tile, .epj-dest__grid.count-3 .epj-tile:not(.is-lead) { grid-column: span 1; }
}
@media (max-width: 768px) {
    .epj { padding: 30px 0; }
    .epj-cards__grid, .epj-cards__grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
    .epj-card__title { font-size: 1.02rem; }
    .epj-card__save { opacity: 1; transform: none; }
    .epj-dest__grid { grid-auto-rows: 170px; gap: 12px; }
    .epj-tile__place { font-size: 1.3rem; }
    .epj-tile__body { padding: 14px; }
    .epj-tile.is-lead .epj-tile__place { font-size: 2rem; }
    .epj-hero__body { padding: 26px 22px; }
    .epj-hero__body .epj-kicker { font-size: 1.5rem; }
    .epj-hero__main { min-height: 420px; }
}
@media (max-width: 480px) {
    .epj-cards__grid:not(.m-2col), .epj-cards__grid.cols-3:not(.m-2col) { grid-template-columns: minmax(0, 1fr); }
    .epj-cards__grid:not(.m-2col) .epj-card__media { aspect-ratio: 4 / 3; }
    .epj-hero__item { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
    .epj-hero__thumb, .epj-hero__thumb img, .epj-hero__thumb .epj-ph { width: 78px; height: 78px; }
    .epj-hero__cta { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .epj img, .epj-card__title::after, .epj-tile__link::after { transition: none !important; }
}
@media (max-width: 768px) {
    .epj-cards__grid.m-2col .epj-meta time,
    .epj-cards__grid.m-2col .epj-meta time + .epj-dot { display: none; }
}
