/* ============================================================
   AITONA トップページ（ニュース構成）
   SWELL 子テーマ用。既存の jai-* とは独立した at-* 接頭辞。
   ============================================================ */

:root {
  --at-bg: #f5f4fb;          /* 既存サイトの背景色を継承 */
  --at-surface: #ffffff;
  --at-ink: #1c1b2e;
  --at-ink-2: #4a4860;
  --at-ink-3: #8b89a3;
  --at-line: #e2e0ee;
  --at-accent: #2e5bff;      /* リンク・カテゴリ */
  --at-flash: #e5484d;       /* 速報のみ */
  --at-max: 1160px;
  --at-font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

.at-top { font-family: var(--at-font); color: var(--at-ink); background: var(--at-bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
.at-top a { color: inherit; text-decoration: none; }
.at-top a:hover .at-title, .at-top a:hover.at-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.at-top a:focus-visible { outline: 2px solid var(--at-accent); outline-offset: 3px; border-radius: 2px; }
.at-top img { display: block; max-width: 100%; height: auto; }
.at-top ul { list-style: none; margin: 0; padding: 0; }
.at-wrap { max-width: var(--at-max); margin: 0 auto; padding: 0 20px; }

/* ---- 日付バー ---- */
.at-daybar { background: var(--at-surface); border-bottom: 1px solid var(--at-line); font-size: 13px; color: var(--at-ink-2); }
.at-daybar .at-wrap { display: flex; justify-content: space-between; align-items: center; height: 36px; gap: 16px; }
.at-daybar time { font-feature-settings: "tnum"; }
.at-daybar .at-updated { color: var(--at-ink-3); }
.at-daybar .at-updated b { color: var(--at-ink); font-weight: 700; }

/* ---- ヘッダー ---- */
.at-header { background: var(--at-surface); border-bottom: 1px solid var(--at-line); position: sticky; top: 0; z-index: 30; }
.at-header .at-wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.at-logo { font-size: 26px; font-weight: 700; letter-spacing: .08em; line-height: 1; }
.at-logo small { display: block; font-size: 11px; letter-spacing: .04em; font-weight: 500; color: var(--at-ink-3); margin-top: 6px; }
.at-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.at-nav::-webkit-scrollbar { display: none; }
.at-nav a { padding: 8px 12px; font-size: 14px; font-weight: 500; white-space: nowrap; border-radius: 6px; color: var(--at-ink-2); }
.at-nav a:hover, .at-nav a[aria-current] { color: var(--at-ink); background: var(--at-bg); }
.at-nav a.at-nav-news { color: var(--at-flash); font-weight: 700; }
.at-search { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--at-line); border-radius: 8px; color: var(--at-ink-2); background: none; cursor: pointer; }
.at-search:hover { border-color: var(--at-ink-3); }

/* ---- 共通パーツ ---- */
.at-kicker { font-size: 12px; font-weight: 700; color: var(--at-accent); letter-spacing: .02em; }
.at-kicker.is-flash { color: var(--at-flash); }
.at-meta { font-size: 12px; color: var(--at-ink-3); font-feature-settings: "tnum"; }
.at-title { font-weight: 700; line-height: 1.45; letter-spacing: .01em; }
.at-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--at-ink); }
.at-section-head h2 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.at-section-head a { font-size: 13px; color: var(--at-accent); font-weight: 500; }
.at-thumb { aspect-ratio: 16 / 9; background: #dcdae8; overflow: hidden; }
.at-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- ヒーロー：主役1本 ＋ 最新ニュースの時刻付きリスト ---- */
.at-hero { padding: 28px 0 40px; }
.at-hero .at-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; }
.at-lead { display: block; }
.at-lead .at-thumb { border-radius: 8px; }
.at-lead .at-kicker { margin: 16px 0 8px; display: block; }
.at-lead .at-title { font-size: 28px; margin: 0 0 10px; }
.at-lead .at-dek { font-size: 15px; color: var(--at-ink-2); margin: 0 0 10px; line-height: 1.8; }
.at-sub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; margin-top: 28px; }
.at-sub a { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.at-sub .at-thumb { border-radius: 4px; }
.at-sub .at-title { font-size: 15px; margin: 2px 0 6px; }

/* 時刻付きリスト（このページの主役） */
.at-wire { background: var(--at-surface); border: 1px solid var(--at-line); border-radius: 8px; padding: 18px 20px 8px; align-self: start; }
.at-wire-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.at-wire-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.at-wire-head .at-live { width: 8px; height: 8px; border-radius: 50%; background: var(--at-flash); }
@media (prefers-reduced-motion: no-preference) {
  .at-wire-head .at-live { animation: at-pulse 2s ease-in-out infinite; }
}
@keyframes at-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.at-wire-head span { margin-left: auto; font-size: 12px; color: var(--at-ink-3); }
.at-wire li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--at-line); position: relative; }
.at-wire li:first-of-type { border-top: 0; }
.at-wire time { font-size: 13px; font-weight: 700; color: var(--at-ink-2); font-feature-settings: "tnum"; padding-top: 2px; }
.at-wire time::after { content: ""; position: absolute; left: 40px; top: 18px; width: 5px; height: 5px; border-radius: 50%; background: var(--at-ink-3); }
.at-wire li.is-new time { color: var(--at-flash); }
.at-wire li.is-new time::after { background: var(--at-flash); }
.at-wire .at-title { font-size: 14px; margin: 0 0 4px; }
.at-wire .at-more { display: block; text-align: center; padding: 12px 0 6px; font-size: 13px; color: var(--at-accent); border-top: 1px solid var(--at-line); font-weight: 500; }

/* ---- トピック（いま追われているテーマ） ---- */
.at-topics { border-top: 1px solid var(--at-line); border-bottom: 1px solid var(--at-line); background: var(--at-surface); }
.at-topics .at-wrap { display: flex; align-items: center; gap: 10px; height: 52px; overflow-x: auto; scrollbar-width: none; }
.at-topics .at-wrap::-webkit-scrollbar { display: none; }
.at-topics strong { font-size: 13px; white-space: nowrap; margin-right: 6px; }
.at-topics a { font-size: 13px; padding: 5px 12px; border: 1px solid var(--at-line); border-radius: 999px; white-space: nowrap; color: var(--at-ink-2); }
.at-topics a:hover { border-color: var(--at-ink); color: var(--at-ink); }

/* ---- 本文グリッド：メイン ＋ サイドバー ---- */
.at-body { padding: 40px 0 56px; }
.at-body .at-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
.at-main > section + section { margin-top: 48px; }

/* カテゴリ・セクション：先頭1本を大きく、残りはリスト */
.at-cat { }
.at-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.at-cat-first .at-thumb { border-radius: 6px; }
.at-cat-first .at-title { font-size: 19px; margin: 12px 0 8px; }
.at-cat-first .at-dek { font-size: 14px; color: var(--at-ink-2); margin: 0 0 8px; }
.at-cat-list li { padding: 12px 0; border-top: 1px solid var(--at-line); }
.at-cat-list li:first-child { padding-top: 0; border-top: 0; }
.at-cat-list a { display: grid; grid-template-columns: 1fr 96px; gap: 14px; align-items: start; }
.at-cat-list .at-title { font-size: 15px; margin: 0 0 6px; }
.at-cat-list .at-thumb { border-radius: 4px; }

/* 解説・ハウツー（既存記事の器） */
.at-guides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.at-guides .at-thumb { border-radius: 6px; }
.at-guides .at-title { font-size: 15px; margin: 10px 0 6px; }

/* ---- サイドバー ---- */
.at-side > * + * { margin-top: 36px; }
.at-side h3 { font-size: 15px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--at-ink); }
.at-rank li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--at-line); }
.at-rank li:first-child { border-top: 0; padding-top: 0; }
.at-rank i { font-style: normal; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--at-ink-3); font-feature-settings: "tnum"; }
.at-rank li:nth-child(-n+3) i { color: var(--at-ink); }
.at-rank .at-title { font-size: 14px; margin: 0 0 4px; }

.at-cta { background: var(--at-ink); color: #fff; border-radius: 8px; padding: 22px 22px 20px; }
.at-cta h3 { border: 0; padding: 0; color: #fff; font-size: 17px; margin: 0 0 8px; }
.at-cta p { font-size: 13px; color: #c9c7db; margin: 0 0 16px; line-height: 1.7; }
.at-btn { display: inline-block; background: #fff; color: var(--at-ink); font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 6px; }
.at-btn:hover { background: #ecebf5; }
.at-cta .at-btn { width: 100%; text-align: center; }

.at-newsletter { border: 1px solid var(--at-line); background: var(--at-surface); border-radius: 8px; padding: 20px; }
.at-newsletter h3 { border: 0; padding: 0; margin: 0 0 6px; }
.at-newsletter p { font-size: 13px; color: var(--at-ink-2); margin: 0 0 12px; }
.at-newsletter form { display: flex; gap: 8px; }
.at-newsletter input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--at-line); border-radius: 6px; }
.at-newsletter button { font: inherit; font-size: 14px; font-weight: 700; padding: 9px 14px; border: 0; border-radius: 6px; background: var(--at-accent); color: #fff; cursor: pointer; }

.at-tags a { display: inline-block; font-size: 13px; color: var(--at-ink-2); margin: 0 10px 8px 0; }
.at-tags a::before { content: "#"; color: var(--at-ink-3); margin-right: 1px; }

/* ---- フッター ---- */
.at-footer { background: var(--at-surface); border-top: 1px solid var(--at-line); padding: 40px 0 28px; font-size: 13px; color: var(--at-ink-2); }
.at-footer .at-wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.at-footer h4 { font-size: 13px; margin: 0 0 10px; color: var(--at-ink); }
.at-footer li { margin: 0 0 8px; }
.at-footer .at-logo { font-size: 20px; }
.at-footer .at-policy { font-size: 12px; color: var(--at-ink-3); margin-top: 12px; line-height: 1.7; }
.at-copy { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--at-line); font-size: 12px; color: var(--at-ink-3); }

/* ---- レスポンシブ ---- */
@media (max-width: 1024px) {
  .at-hero .at-wrap { grid-template-columns: 1fr; gap: 32px; }
  .at-body .at-wrap { grid-template-columns: 1fr; gap: 40px; }
  .at-guides { grid-template-columns: repeat(2, 1fr); }
  .at-footer .at-wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .at-daybar .at-updated { display: none; }
  .at-header .at-wrap { gap: 16px; height: 56px; }
  .at-logo { font-size: 22px; }
  .at-logo small { display: none; }
  .at-hero { padding: 16px 0 28px; }
  .at-lead .at-title { font-size: 22px; }
  .at-sub { grid-template-columns: 1fr; }
  .at-cat-grid { grid-template-columns: 1fr; }
  .at-guides { grid-template-columns: 1fr; }
  .at-footer .at-wrap { grid-template-columns: 1fr; }
}

/* ---- SWELL 側の余白・幅制限を解除（トップのみ）---- */
body.home .l-content { max-width: none; padding: 0; margin: 0; }
body.home .l-content::before, body.home .l-content::after { display: none; }
body.home .at-top { margin-top: 0; }
