/* ===== RESET & CUSTOM PROPERTIES ===== */
:root {
  --primary:      #0055CC;
  --primary-dk:   #003D99;
  --red:          #E53935;
  --bg:           #F3F3F5;
  --surface:      #FFFFFF;
  --text:         #111111;
  --text-mid:     #444444;
  --text-muted:   #888888;
  --border:       #E2E2E6;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.12);
  --radius:       8px;
  --radius-sm:    4px;

  --cat-tech:          #0055CC;
  --cat-economy:       #2E7D32;
  --cat-sports:        #B71C1C;
  --cat-international: #5C1F87;
  --cat-entertainment: #AD1457;
  --cat-life:          #00695C;
  --cat-domestic:      #BF360C;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== HEADER ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 50px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 7px;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #1B5E20, #388E3C);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  border-radius: 7px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.header-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-mid);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 20px; height: 20px; }

/* Category nav */
.category-nav {
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-tabs {
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 2px;
  height: 40px;
  white-space: nowrap;
  min-width: max-content;
}

.cat-tab {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  background: transparent;
  transition: all 0.18s;
  flex-shrink: 0;
}
.cat-tab:hover { background: var(--bg); color: var(--text); }
.cat-tab.active { background: var(--primary); color: #fff; }

/* ===== BREAKING BAR ===== */
.breaking-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 34px;
  overflow: hidden;
}

.breaking-label {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  letter-spacing: 0.1em;
}

.ticker-wrap { flex: 1; overflow: hidden; }
.ticker-track {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  font-size: 12px;
  color: var(--text-mid);
}
.ticker-item {
  flex-shrink: 0;
  padding-right: 48px;
}
.ticker-item::before {
  content: '◆';
  font-size: 9px;
  margin-right: 12px;
  color: var(--red);
  vertical-align: middle;
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== MAIN LAYOUT ===== */
#main-content { max-width: 900px; margin: 0 auto; }

/* ===== SECTION BLOCKS ===== */
.featured-section {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  margin-bottom: 4px;
}
.section-block {
  padding: 10px 10px 4px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.title-bar {
  display: inline-block;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  flex-shrink: 0;
}
.bar-tech          { background: var(--cat-tech); }
.bar-economy       { background: var(--cat-economy); }
.bar-sports        { background: var(--cat-sports); }
.bar-entertainment { background: var(--cat-entertainment); }
.bar-domestic      { background: var(--cat-domestic); }

.more-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}
.more-link:hover { text-decoration: underline; }

/* ===== CATEGORY BADGES ===== */
.cat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  color: #fff;
  line-height: 1.4;
}
.cat-tech          { background: var(--cat-tech); }
.cat-economy       { background: var(--cat-economy); }
.cat-sports        { background: var(--cat-sports); }
.cat-international { background: var(--cat-international); }
.cat-entertainment { background: var(--cat-entertainment); }
.cat-life          { background: var(--cat-life); }
.cat-domestic      { background: var(--cat-domestic); }

/* ===== META ROW ===== */
.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.dot { color: #ccc; }
.source { font-weight: 500; color: var(--text-mid); }

/* ===== CARD BASE ===== */
.card-link { display: block; color: inherit; }

/* ===== FEATURED CARD ===== */
.featured-card {
  background: var(--surface);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  transition: box-shadow 0.2s;
}
.featured-card:hover { box-shadow: none; }

.featured-img {
  position: relative;
  aspect-ratio: 16 / 9;
}
.img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 55%);
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
  color: #fff;
}
.badge-hot { background: var(--red); }
.badge-new { background: var(--primary); }

.featured-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 12px 14px;
}
.featured-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin: 3px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 2-COLUMN GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.section-block .grid-2 { margin-top: 8px; }

.grid-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.grid-card:hover { box-shadow: var(--shadow-md); }

.grid-img {
  aspect-ratio: 4 / 3;
}
.grid-body {
  padding: 7px 9px 10px;
}
.grid-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin: 3px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== LIST CARDS (horizontal) ===== */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.list-card:hover { box-shadow: var(--shadow-md); }
.list-card .card-link {
  display: flex;
  align-items: stretch;
}

.list-img {
  width: 100px;
  min-height: 75px;
  flex-shrink: 0;
}
.list-body {
  padding: 8px 10px;
  flex: 1;
  min-width: 0;
}
.list-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin: 3px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== WIDE CARD (mini-featured) ===== */
.wide-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  transition: box-shadow 0.2s;
}
.wide-card:hover { box-shadow: var(--shadow-md); }

.wide-img {
  position: relative;
  aspect-ratio: 16 / 7;
}
.img-overlay-light {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 60%);
}
.wide-body {
  padding: 10px 12px 12px;
}
.wide-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
  margin: 4px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== LOAD MORE ===== */
.load-more-wrap {
  padding: 16px 10px 20px;
  text-align: center;
}
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  transition: all 0.2s;
}
.load-more-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== FOOTER ===== */
.site-footer {
  background: #1a1a1f;
  color: rgba(255,255,255,0.8);
  padding: 24px 16px 32px;
  margin-top: 8px;
}
.footer-inner { max-width: 900px; margin: 0 auto; }

.footer-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
}
.footer-logo .logo-mark { background: rgba(255,255,255,0.12); }
.footer-logo .logo-text { color: #fff; }

.footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 18px;
}
.footer-cats a { font-size: 13px; color: rgba(255,255,255,0.65); }
.footer-cats a:hover { color: #fff; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}
.footer-links a { font-size: 11px; color: rgba(255,255,255,0.4); }
.footer-links a:hover { color: rgba(255,255,255,0.7); }
.copyright { font-size: 11px; color: rgba(255,255,255,0.3); }

/* ===== MOBILE DRAWER ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.45);
}
.mobile-overlay.active { display: block; }

.mobile-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 270px;
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.mobile-overlay.active .mobile-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.drawer-nav { padding: 8px 0; flex: 1; }
.drawer-link {
  display: block;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.drawer-link:hover { background: var(--bg); color: var(--primary); }

.drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer-footer a { font-size: 12px; color: var(--text-muted); }
.drawer-footer a:hover { color: var(--primary); }

/* ===== SCROLL REVEAL ===== */
.card-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.card-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== CATEGORY FILTER ===== */
.filter-hidden { display: none !important; }

/* ===== DUAL-IMAGE CARD (magazine irregular style) ===== */
.dual-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dual-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.dual-card:hover { box-shadow: var(--shadow-md); }

.dual-imgs {
  display: flex;
  gap: 8px;
  height: 128px;
}
.dual-img-main {
  flex: 3;          /* 60% */
  background-size: cover;
  background-position: center;
  min-width: 0;
}
.dual-img-sub {
  flex: 2;          /* 40% */
  background-size: cover;
  background-position: center;
  min-width: 0;
}

.dual-body {
  padding: 8px 10px 11px;
}
.dual-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin: 3px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== DESKTOP ===== */
@media (min-width: 600px) {
  .list-img { width: 120px; min-height: 90px; }
  .featured-title { font-size: 17px; }
  .grid-title, .list-title { font-size: 13px; }
  .wide-title { font-size: 14px; }
  .dual-imgs { height: 160px; }
  .dual-title { font-size: 13px; }
}

@media (min-width: 760px) {
  .section-block { padding-left: 0; padding-right: 0; }
  #main-content { padding: 0 16px; }
}

/* =============================================
   2カラムレイアウト
   ============================================= */

.layout-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.layout-wrapper > #main-content {
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* インデックスページのサイドバー */
.layout-wrapper > .article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 901px) {
  .layout-wrapper > .article-sidebar {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .layout-wrapper > .article-sidebar::-webkit-scrollbar { width: 4px; }
  .layout-wrapper > .article-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
}

/* サイドバー共通コンポーネント（index / article 共用） */
.sidebar-section {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 11px 14px 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  margin: 0;
}

.sidebar-card {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  color: inherit;
  text-decoration: none;
}
.sidebar-card:last-child { border-bottom: none; }
.sidebar-card:hover { background: var(--bg); }

.sidebar-thumb {
  width: 77px;
  height: 77px;
  flex-shrink: 0;
  align-self: flex-start;
  background-size: cover;
  background-position: center;
}

.sidebar-info {
  padding: 8px 10px 8px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.sidebar-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* 天気ウィジェット */
.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 8px;
}
.weather-icon { font-size: 34px; line-height: 1; }
.weather-temp {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.weather-temp span { font-size: 15px; font-weight: 400; color: var(--text-muted); }
.weather-desc { font-size: 13px; color: var(--text-mid); padding: 0 14px 2px; }
.weather-sub  { font-size: 12px; color: var(--text-muted); padding: 0 14px 4px; }
.weather-location {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 14px 12px;
  text-align: right;
}
.weather-loading {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 14px;
}

/* レスポンシブ：900px以下は1カラム */
@media (max-width: 900px) {
  .layout-wrapper {
    grid-template-columns: 1fr;
  }
  .layout-wrapper > .article-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  .layout-wrapper > #main-content {
    padding: 0 16px;
  }
}
