/*
 * Insight 一覧ページ（page-insight-list.php）専用。
 * クラス名はすべて insight- で始め、テーマ本体の style.css・UIkit とぶつからないようにしてある。
 * 色はテーマの変数（--color-*）をそのまま使う。
 */
.insight-page {
    --insight-gutter: 24px;
    --insight-primary-dark: #003a4e;
    --insight-grid-line: rgba(255, 255, 255, .8);
    --insight-ease: cubic-bezier(.4, 0, .2, 1);
}

/* UIkit・テーマの要素の既定の余白を、この一覧の中だけ打ち消す（:where で優先度を上げず、下のクラスの指定が勝つようにしてある） */
:where(.insight-page) h2,
:where(.insight-page) h3,
:where(.insight-page) p,
:where(.insight-page) figure,
:where(.insight-page) ul { margin: 0; padding: 0; }
:where(.insight-page) ul { list-style: none; }
.insight-page a,
.insight-page a:hover { text-decoration: none; }
.insight-page img { max-width: 100%; }

/* 語の途中で切らず、文節で折り返す（対応しているブラウザのみ。非対応でも読める） */
.insight-feature-title,
.insight-feature-sub,
.insight-feature-sum,
.insight-row-title,
.insight-row-sub,
.insight-intro { word-break: auto-phrase; }
.insight-w { display: inline-block; }
.insight-line { display: block; }

.insight-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--insight-gutter); }

/* ---------- 導入文（題の帯の下 36px、中央、文の下 56px） ---------- */
/* 下の 56px は margin でなく padding（UIkit の .uk-container は最後の子の margin-bottom を 0 にするため） */
.insight-intro { margin-top: 36px; padding-bottom: 56px; text-align: center; font-size: 16px; line-height: 1.8; }

/* ---------- 区切りの見出し（紺の細罫＋小さなラベル） ---------- */
.insight-sec-head {
    display: flex; align-items: baseline; gap: 16px;
    margin: 0 0 36px; padding: 18px 0 0;
    border-top: 1px solid var(--color-primary);
    font-size: 13px; line-height: 1.4; font-weight: 400;
}
.insight-sec-en { font-weight: 700; letter-spacing: .15em; color: var(--color-primary); }
.insight-sec-ja { color: var(--color-text-light); letter-spacing: .08em; }

.insight-latest,
.insight-archive,
.insight-notes { padding-bottom: 120px; }
.insight-empty { margin: 0 0 120px; padding: 48px 0; border-block: 1px solid var(--color-border); text-align: center; }

/* ---------- 額装（図版も絵も同じ枠：方眼の台紙＋細罫＋同じ比率） ---------- */
.insight-frame {
    padding: 28px;
    background-color: var(--color-bg-light);
    background-image:
        linear-gradient(var(--insight-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--insight-grid-line) 1px, transparent 1px);
    background-size: 8px 8px;
    border: 1px solid var(--color-border);
    transition: border-color .2s ease;
}
.insight-frame img {
    display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}
.insight-frame--s { padding: 12px; }

/* ---------- 記事（共通） ---------- */
.insight-entry { position: relative; }
.insight-entry-link { color: inherit; transition: color .2s ease; }
.insight-entry-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.insight-entry-link:focus-visible { outline: none; }
.insight-entry:has(.insight-entry-link:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 8px; }
.insight-entry:active { opacity: .88; }
.insight-arrow { display: block; width: 10px; height: 10px; flex: none; fill: currentColor; transition: transform .35s var(--insight-ease), color .2s ease; }
.insight-meta { line-height: 1.4; }
.insight-date { font-size: 13px; letter-spacing: .14em; color: var(--color-text-light); font-feature-settings: "tnum"; white-space: nowrap; }

/* ---------- 最新の 1 本 ---------- */
.insight-feature { align-items: stretch; }
.insight-feature .insight-frame { grid-column: 1 / 8; align-self: start; }
.insight-feature-body { grid-column: 8 / 13; display: flex; flex-direction: column; align-items: flex-start; padding-top: 2px; }
.insight-feature-title {
    margin-top: 20px;
    color: var(--color-heading);
    font-size: clamp(30px, 3.06vw, 44px);
    font-weight: 500;
    line-height: 1.36;
    letter-spacing: .04em;
    text-wrap: balance;
}
.insight-feature-sub { margin-top: 16px; font-size: 18px; font-weight: 600; line-height: 1.7; color: var(--color-heading); }
.insight-feature-sub::after { content: ""; display: block; width: 42px; height: 1px; margin-top: 24px; background: var(--color-primary); }
.insight-feature-sum { margin-top: 24px; font-size: 15px; line-height: 1.9; text-wrap: pretty; }
.insight-more {
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: auto; padding: 32px 0 6px;
    font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--color-primary);
    border-bottom: 1px solid var(--color-primary);
}

/* ---------- それより前の記事（額は最新の額と右端をそろえる。罫・押せる範囲は額の左端から右端まで） ---------- */
.insight-row { --insight-row-start: calc((100% + var(--insight-gutter)) / 12 * 4); align-items: center; padding: 32px 0; }
.insight-row:first-child { padding-top: 0; }
.insight-row:last-child { padding-bottom: 0; }
.insight-row:not(:last-child)::before { content: ""; position: absolute; left: var(--insight-row-start); right: 0; bottom: 0; height: 1px; background: var(--color-border); }
.insight-row .insight-entry-link::after { left: var(--insight-row-start); }
.insight-row.insight-entry:has(.insight-entry-link:focus-visible) { outline: none; }
.insight-row .insight-entry-link:focus-visible::after { outline: 2px solid var(--color-primary); outline-offset: 6px; }
.insight-row .insight-frame { grid-column: 5 / 8; grid-row: 1; }
.insight-row-body { grid-column: 8 / 13; grid-row: 1; padding-right: 32px; }
.insight-row-title {
    margin-top: 12px;
    color: var(--color-heading);
    font-size: clamp(20px, 1.67vw, 24px);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .04em;
    text-wrap: balance;
}
/* 矢印は題の最後の字のすぐ後ろ。幅を 0 扱いにして、矢印だけが次の行に落ちないようにする */
.insight-row-title .insight-arrow { display: inline-block; width: 11px; height: 11px; margin: 0 -27px 0 16px; vertical-align: baseline; color: var(--color-primary); }
.insight-row-sub { margin-top: 8px; font-size: 15px; line-height: 1.7; text-wrap: balance; }
@media (min-width: 960px) and (max-width: 1199px) {
    /* 幅が狭い PC では、行の額を 1 列ぶん広げる */
    .insight-row { --insight-row-start: calc((100% + var(--insight-gutter)) / 12 * 3); }
    .insight-row .insight-frame { grid-column: 4 / 8; }
}

@media (hover: hover) and (pointer: fine) {
    .insight-feature:hover .insight-entry-link,
    .insight-row:has(.insight-entry-link:hover) .insight-entry-link { color: var(--color-primary); }
    .insight-feature:hover .insight-frame,
    .insight-row:has(.insight-entry-link:hover) .insight-frame { border-color: var(--color-primary); }
    .insight-feature:hover .insight-arrow,
    .insight-row:has(.insight-entry-link:hover) .insight-arrow { transform: translate(3px, 3px); color: var(--color-primary); }
}

/* ---------- 免責とお問い合わせ ---------- */
.insight-notes-list { grid-column: 1 / 8; max-width: 548px; }
.insight-notes-list p {
    padding-left: 1em; text-indent: -1em;
    font-size: 13px; line-height: 1.9; color: var(--color-text-light);
    text-wrap: pretty;
}
.insight-notes-list p + p { margin-top: 8px; }
.insight-notes-list .insight-w { text-indent: 0; }
.insight-notes-list a { color: var(--color-primary); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; transition: color .2s ease; }
.insight-notes-list a:hover { color: var(--insight-primary-dark); text-decoration: underline; }
.insight-notes-cta { grid-column: 8 / 13; }
.insight-page .insight-notes-cta .c-button { margin: 0; }

/* ---------- 読み込み時だけの控えめな出方 ---------- */
@media (prefers-reduced-motion: no-preference) {
    .insight-reveal { animation: insight-rise .7s cubic-bezier(.23, 1, .32, 1) both; }
    @keyframes insight-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    .insight-page *, .insight-page *::before, .insight-page *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- スマホ・タブレット（テーマと同じ 959px で切り替え） ---------- */
@media (max-width: 959px) {
    .insight-grid { display: block; }
    .insight-intro { text-align: left; font-size: 14px; }
    .insight-sec-head { margin-bottom: 24px; padding-top: 14px; font-size: 12px; }
    .insight-latest,
    .insight-archive,
    .insight-notes { padding-bottom: 72px; }
    .insight-empty { margin-bottom: 72px; }
    .insight-frame { padding: 10px; }
    .insight-feature-body { margin-top: 24px; padding-top: 0; }
    .insight-date { font-size: 12px; }
    .insight-feature-title { margin-top: 12px; font-size: clamp(24px, 6.9vw, 34px); line-height: 1.42; }
    .insight-feature-sub { margin-top: 12px; font-size: 15px; }
    .insight-feature-sub::after { margin-top: 20px; }
    .insight-feature-sum { margin-top: 20px; font-size: 14px; }
    .insight-more { margin-top: 8px; padding-top: 20px; min-height: 44px; }
    .insight-row { --insight-row-start: 0px; display: flex; flex-direction: column; align-items: stretch; padding: 32px 0; }
    .insight-row-body { margin-top: 20px; padding-right: 28px; }
    .insight-row-title { margin-top: 8px; font-size: 20px; }
    .insight-row-sub { margin-top: 8px; font-size: 13px; }
    .insight-row-title .insight-arrow { position: absolute; right: 2px; bottom: 38px; width: 10px; height: 10px; margin: 0; }
    .insight-row:last-child .insight-row-title .insight-arrow { bottom: 6px; }
    .insight-notes-list p { font-size: 12px; }
    .insight-notes-cta { margin-top: 32px; }
    .insight-page .insight-notes-cta .c-button { font-size: 12px; }
}
@media (min-width: 600px) and (max-width: 959px) {
    .insight-feature .insight-frame,
    .insight-row .insight-frame { width: 100%; max-width: 640px; }
    .insight-feature-body,
    .insight-row-body { max-width: 560px; }
}
@media (max-width: 599px) {
    .insight-feature-sum .insight-pc { display: none; }
    .insight-notes-list { max-width: none; }
}
