/* Nagi Rhythm 1.7.8: compact finder, latest posts, curated selections and compact travel companions. */
.nagi-v170 .nagi-home .nagi-new-posts { margin-bottom: 36px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.nagi-v170 .nagi-home .nagi-card--hero .nagi-card-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "image" "heading" "excerpt"; align-content: start; }
.nagi-v170 .nagi-home-hero-heading { grid-area: heading; }
.nagi-v170 .nagi-home .nagi-card--hero .nagi-card-image { grid-area: image; }
.nagi-v170 .nagi-home .nagi-card--hero .nagi-card-excerpt { grid-area: excerpt; }
.nagi-v170 .nagi-home-hero-grid--single { grid-template-columns: minmax(0, 700px); }
.nagi-v170 .nagi-home-new-more { display: flex; justify-content: flex-end; margin-top: 24px; }
.nagi-v170 .nagi-home-new-more > .nagi-index-link { min-height: 48px; padding: 12px 18px; border-radius: 6px; }
.nagi-v170 .nagi-home-content { margin-top: 0; }
.nagi-v170 .nagi-home-content > .nagi-topic-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.nagi-v170 .nagi-home-find { display: block; padding-bottom: 24px; margin-bottom: 28px; }
.nagi-v170 .nagi-home-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 0 0 8px; }
.nagi-v170 .nagi-home-heading h2 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.nagi-v170 .nagi-home-heading > .nagi-index-link { min-height: 44px; gap: 8px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; font-size: 14px; }
.nagi-v170 .nagi-home-heading > .nagi-index-link .nagi-index-label { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.nagi-v170 .nagi-home-heading > .nagi-index-link .nagi-index-count { display: inline-block; padding: 2px 5px; font-size: 11px; }
.nagi-v170 .nagi-home-find-controls { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 620px; }
.nagi-v170 .nagi-home-find .nagi-search-form { min-width: 0; margin: 0; max-width: none; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); box-sizing: border-box; }
.nagi-v170 .nagi-home-find .nagi-search-form input { min-width: 0; padding: 12px 14px; font-size: 16px; line-height: 1.6; color: var(--text); }
.nagi-v170 .nagi-home-find .nagi-search-form input::placeholder { color: var(--sub-text); opacity: 1; }
.nagi-v170 .nagi-home-find .nagi-search-form button { min-height: 44px; padding: 0 18px; margin: 4px; border-radius: 4px; font-size: 14px; line-height: 1.5; background: var(--text); color: var(--bg); }
.nagi-v170 .nagi-home-find .nagi-suggestions { margin: 0; padding: 10px 10px 4px; }
.nagi-v170 .nagi-home-topics { margin-top: 12px; scroll-margin-top: 100px; }
.nagi-v170 .nagi-home-topics .nagi-topic-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.nagi-v170 .nagi-home-topics .nagi-topic-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; gap: 8px; align-items: center; min-height: 48px; height: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; text-decoration: none; box-sizing: border-box; }
.nagi-v170 .nagi-home-topics .nagi-topic-links > li > a {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.nagi-v170 .nagi-home-topics .nagi-topic-label { grid-column: 1; grid-row: 1; min-width: 0; font-weight: 500; word-break: keep-all; overflow-wrap: anywhere; }
.nagi-v170 .nagi-home-topics .nagi-count { display: block; grid-column: 2; grid-row: 1; margin: 0; font-size: 12px; line-height: 1.4; color: var(--sub-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nagi-v170 .nagi-home-topics .nagi-count .screen-reader-text { position: static; width: auto; height: auto; margin: 0; padding: 0; border: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
.nagi-v170 .nagi-home-topics .nagi-topic-arrow { grid-column: 3; grid-row: 1; align-self: center; width: 14px; height: 14px; color: var(--accent); }
.nagi-v170 .nagi-home-topics .nagi-topic-links a:is(:hover, :focus-visible) { background: var(--light-gray); border-color: var(--accent); color: var(--text); opacity: 1; }
.nagi-v170 .nagi-home-topics .nagi-topic-links a:focus-visible, .nagi-v170 .nagi-home-collection-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nagi-v170 .nagi-home-collections { padding-bottom: 28px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.nagi-v170 .nagi-home-collections > h2 { margin: 0 0 14px; font-size: 22px; font-weight: 500; line-height: 1.5; }
.nagi-v170 .nagi-home-collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nagi-v170 .nagi-home-collection { min-width: 0; }
.nagi-v170 .nagi-home-collection-link { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; height: 100%; min-height: 132px; padding: 14px; border: 1px solid var(--border); border-radius: 6px; box-sizing: border-box; background: var(--bg); color: var(--text); text-decoration: none; transition: background-color .18s ease, border-color .18s ease; }
.nagi-v170 .nagi-home-collection-link--text { grid-template-columns: minmax(0, 1fr); }
.nagi-v170 .nagi-home-collection-link:is(:hover, :focus-visible) { background: var(--light-gray); border-color: var(--accent); color: var(--text); opacity: 1; }
.nagi-v170 .nagi-home-collection-media { display: block; width: 104px; height: 104px; align-self: start; border-radius: 4px; overflow: hidden; background: var(--light-gray); }
.nagi-v170 .nagi-home-collection-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nagi-v170 .nagi-home-collection-body { display: flex; flex-direction: column; min-width: 0; }
.nagi-v170 .nagi-home-collection-body h3 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.nagi-v170 .nagi-home-collection-description { margin: 6px 0 10px; font-size: 13px; line-height: 1.7; color: var(--sub-text); overflow-wrap: anywhere; }
.nagi-v170 .nagi-home-collection-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; font-size: 12px; line-height: 1.5; color: var(--sub-text); font-variant-numeric: tabular-nums; }
/* Keep the two travel companions together instead of stretching each row beside the lead story. */
@media (min-width: 601px) {
    .nagi-v170 .nagi-home .nagi-topic-section--travel .nagi-topic-cards { grid-template-rows: max-content 1fr; align-items: start; }
    .nagi-v170 .nagi-home .nagi-topic-section--travel .nagi-card-link { height: auto; }
}
@media (max-width: 1000px) {
    .nagi-v170 .nagi-home-topics .nagi-topic-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nagi-v170 .nagi-home-collection-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .nagi-v170 .nagi-home-collection-link { min-height: 110px; }
}
@media (max-width: 600px) {
    .nagi-v170 .nagi-home .nagi-new-posts { margin-bottom: 28px; padding-bottom: 24px; }
    .nagi-v170 .nagi-home .nagi-new-posts > .nagi-section-heading { margin-bottom: 16px; }
    .nagi-v170 .nagi-home .nagi-new-posts > .nagi-section-heading h2 { font-size: 20px; letter-spacing: 0; }
    .nagi-v170 .nagi-home .nagi-card--hero .nagi-card-link { grid-template-areas: "heading" "image"; }
    .nagi-v170 .nagi-home-hero-heading { padding-top: 0; margin-bottom: 12px; }
    .nagi-v170 .nagi-home .nagi-card--hero .nagi-card-title { font-size: clamp(20px, 5.2vw, 22px); line-height: 1.55; letter-spacing: 0; line-break: strict; text-wrap: pretty; }
    .nagi-v170 .nagi-home .nagi-card--hero.nagi-card--long-title .nagi-card-title { font-size: 20px; line-height: 1.5; }
    .nagi-v170 .nagi-home .nagi-card--hero .nagi-card-image { aspect-ratio: 16 / 9; }
    .nagi-v170 .nagi-home .nagi-card--hero .nagi-card-excerpt { display: none; }
    .nagi-v170 .nagi-home-new-more { margin-top: 18px; }
    .nagi-v170 .nagi-home-new-more > .nagi-index-link { display: flex; width: 100%; padding: 12px 14px; }
    .nagi-v170 .nagi-home-find { padding-bottom: 18px; margin-bottom: 22px; }
    .nagi-v170 .nagi-home-heading { gap: 6px 8px; margin-bottom: 6px; }
    .nagi-v170 .nagi-home-heading h2, .nagi-v170 .nagi-home-collections > h2 { font-size: 20px; }
    .nagi-v170 .nagi-home-heading > .nagi-index-link { gap: 6px; font-size: 13px; }
    .nagi-v170 .nagi-home-find .nagi-search-form input { padding: 9px 12px; }
    .nagi-v170 .nagi-home-find .nagi-search-form button { padding: 0 14px; margin: 3px; }
    .nagi-v170 .nagi-home-topics { margin-top: 10px; }
    .nagi-v170 .nagi-home-topics .nagi-topic-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
    .nagi-v170 .nagi-home-topics .nagi-topic-links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .nagi-v170 .nagi-home-topics .nagi-topic-links a { grid-template-columns: minmax(0, 1fr) auto; min-height: 44px; gap: 6px; padding: 5px 8px; line-height: 1.4; }
    .nagi-v170 .nagi-home-topics .nagi-topic-label { word-break: normal; }
    .nagi-v170 .nagi-home-topics .nagi-count { font-size: 11px; }
    .nagi-v170 .nagi-home-topics .nagi-topic-arrow { display: none; }
    .nagi-v170 .nagi-home-collections { padding-bottom: 22px; margin-bottom: 28px; }
    .nagi-v170 .nagi-home-collection-link { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; min-height: 112px; padding: 12px; }
    .nagi-v170 .nagi-home-collection-link--text { grid-template-columns: minmax(0, 1fr); }
    .nagi-v170 .nagi-home-collection-media { width: 88px; height: 88px; }
    .nagi-v170 .nagi-home-collection-body h3 { font-size: 15px; }
    .nagi-v170 .nagi-home-collection-description { margin-top: 5px; margin-bottom: 8px; font-size: 12px; }
}
@media (max-width: 360px) {
    .nagi-v170 .nagi-home .nagi-card--hero .nagi-card-title { font-size: 20px; }
}
@media (max-width: 380px) {
    .nagi-v170 .nagi-home-topics .nagi-topic-links a { grid-template-columns: minmax(0, 1fr); row-gap: 2px; min-height: 50px; padding: 6px 10px; }
    .nagi-v170 .nagi-home-topics .nagi-count { grid-column: 1; grid-row: 2; }
}
.nagi-v170 .nagi-home-collection-link.nagi-collection-cover-fit img { object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
    .nagi-v170 .nagi-home-collection-link { transition: none; }
    .nagi-v170 .nagi-home-topics .nagi-topic-links a:is(:hover, :focus-visible) .nagi-topic-arrow { transform: none; }
}
