/* ================================================================
   pick.breefly.jp — style.css
   Design: Content-first, SmartNews × Apple News hybrid
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f5f5f7;
  --surface:      #ffffff;
  --surface2:     #f0f0f5;
  --text:         #0a0a0f;
  --text2:        #5e5e7a;
  --text3:        #9898b0;
  --accent:       #e63946;
  --accent-hover: #c1121f;
  --navy:         #1a1a2e;
  --border:       #e4e4ef;
  --border2:      #d0d0e0;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.14);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-pill:  100px;
  --font:         'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  --max:          1200px;
  --topbar-h:     48px;
}

html { background: var(--bg); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================================================
   Top Bar
   ================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--navy);
  line-height: 1;
}
.topbar-logo span { color: var(--accent); }

.topbar-cats {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topbar-cats::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.cat-tab:hover { background: var(--surface2); color: var(--text); }
.cat-tab.is-active { background: var(--navy); color: #fff; }

/* Search (underline style) */
.topbar-search {
  flex-shrink: 0;
  position: relative;
}
.topbar-search-input {
  width: 140px;
  padding: 2px 0 4px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border2);
  border-radius: 0;
  outline: none;
  font-size: 0.78rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s, width 0.25s;
  -webkit-appearance: none;
}
.topbar-search-input::placeholder { color: var(--text3); }
.topbar-search-input:focus {
  border-bottom-color: var(--navy);
  width: 200px;
}
.topbar-search-input::-webkit-search-cancel-button { display: none; }

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 99;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-dropdown.is-open { display: block; }
.search-dropdown-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px 16px;
}
.search-dropdown-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { color: var(--accent); }
.search-result-thumb {
  width: 52px;
  height: 36px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-meta {
  font-size: 0.68rem;
  color: var(--text3);
  margin-top: 2px;
}
.search-no-results {
  padding: 20px 0;
  font-size: 0.85rem;
  color: var(--text3);
  text-align: center;
}

/* ================================================================
   Main content
   ================================================================ */
.main-content { padding: 24px 0 64px; }

/* ================================================================
   Page meta
   ================================================================ */
.page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.update-info {
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
.article-count { font-size: 0.75rem; color: var(--text3); }

/* ================================================================
   Hero slider
   ================================================================ */
.hero-section { margin-bottom: 28px; }

.hero-slider {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--navy);
}

.hero-slides { position: relative; }

.hero-slide {
  display: none;
  position: relative;
  text-decoration: none;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  animation: hero-fade 0.4s ease;
}
.hero-slide.is-active { display: block; }

@keyframes hero-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 画像 */
.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 6s ease;
}
.hero-slide.is-active .hero-slide-img { transform: scale(1.04); }

/* カテゴリ色ごとのグラデーション背景（画像なし時） */
.hero-slide-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.hero-slide-fallback[data-category="国内"]    { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.hero-slide-fallback[data-category="国際"]    { background: linear-gradient(135deg, #064e3b, #10b981); }
.hero-slide-fallback[data-category="テック"]  { background: linear-gradient(135deg, #4c1d95, #a78bfa); }
.hero-slide-fallback[data-category="経済"]    { background: linear-gradient(135deg, #0c4a6e, #38bdf8); }
.hero-slide-fallback[data-category="エンタメ"]{ background: linear-gradient(135deg, #831843, #f472b6); }
.hero-slide-fallback[data-category="スポーツ"]{ background: linear-gradient(135deg, #7c2d12, #fb923c); }
.hero-slide-fallback[data-category="総合"]    { background: linear-gradient(135deg, #1e293b, #64748b); }

/* グラデーションオーバーレイ */
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.28) 55%,
    transparent 100%
  );
}

/* テキスト */
.hero-slide-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-slide-title {
  font-size: clamp(1.1rem, 2.8vw, 1.55rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.hero-slide:hover .hero-slide-title { text-decoration: underline; text-decoration-color: rgba(255,255,255,0.5); }

/* インジケーター */
.hero-indicators {
  position: absolute;
  bottom: 16px;
  left: 24px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.hero-dot {
  height: 3px;
  width: 20px;
  border-radius: 2px;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, width 0.25s;
}
.hero-dot.is-active { background: #fff; width: 32px; }

@media (max-width: 600px) {
  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-slide-title { font-size: 1.05rem; }
}

/* ================================================================
   Article Card
   ================================================================ */
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Image */
.card-image,
.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
  position: relative;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.article-card:hover .card-image img { transform: scale(1.03); }

.card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb[data-category="国内"]    { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.card-thumb[data-category="国際"]    { background: linear-gradient(135deg, #064e3b, #10b981); }
.card-thumb[data-category="テック"]  { background: linear-gradient(135deg, #4c1d95, #a78bfa); }
.card-thumb[data-category="経済"]    { background: linear-gradient(135deg, #0c4a6e, #38bdf8); }
.card-thumb[data-category="エンタメ"]{ background: linear-gradient(135deg, #831843, #f472b6); }
.card-thumb[data-category="スポーツ"]{ background: linear-gradient(135deg, #7c2d12, #fb923c); }
.card-thumb[data-category="総合"]    { background: linear-gradient(135deg, #1e293b, #64748b); }
.card-thumb-icon { font-size: 2rem; opacity: 0.9; }

/* Card body */
.card-body {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.source-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-date {
  font-size: 0.68rem;
  color: var(--text3);
  white-space: nowrap;
  flex-shrink: 0;
}

.category-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: fit-content;
}
.category-chip[data-cat="国内"]    { background: #dbeafe; color: #1d4ed8; }
.category-chip[data-cat="国際"]    { background: #d1fae5; color: #059669; }
.category-chip[data-cat="テック"]  { background: #ede9fe; color: #7c3aed; }
.category-chip[data-cat="経済"]    { background: #cffafe; color: #0891b2; }
.category-chip[data-cat="エンタメ"]{ background: #fce7f3; color: #db2777; }
.category-chip[data-cat="スポーツ"]{ background: #ffedd5; color: #ea580c; }
.category-chip[data-cat="総合"]    { background: #f1f5f9; color: #64748b; }

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-curator {
  font-size: 0.74rem;
  color: #78350f;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 5px 8px;
  background: #fef9f0;
  border-radius: 6px;
  border-left: 2px solid #f59e0b;
}

.card-footer-row {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.read-more {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}
.card-external-wrap { padding: 0 14px 10px; }
.card-external { font-size: 0.68rem; color: var(--text3); }
.card-external:hover { color: var(--accent); }

/* Featured (hero main) */
.article-card[data-featured="true"] .card-title {
  font-size: 1.1rem;
  -webkit-line-clamp: 4;
  font-weight: 800;
}
.article-card[data-featured="true"] .card-body { padding: 14px 16px 12px; gap: 7px; }
.article-card[data-featured="true"] .card-curator { -webkit-line-clamp: 3; }

/* ================================================================
   Card Grid
   ================================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ================================================================
   Pagination
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 0.78rem; color: var(--text3); }
.pagination-links { display: flex; gap: 8px; }
.pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pagination-btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination-btn.is-disabled { opacity: 0.35; pointer-events: none; }

/* ================================================================
   Article detail
   ================================================================ */
.article-container { max-width: 760px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--border2); }

.article-hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16 / 9;
}
.article-hero-image img { width: 100%; height: 100%; object-fit: cover; }

.article-header { margin-bottom: 24px; }

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.article-meta-top .source-badge { font-size: 0.78rem; color: var(--text2); }

.article-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.article-date { font-size: 0.8rem; color: var(--text3); }

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-primary-large:hover { background: var(--accent-hover); }
.btn-icon { font-size: 0.9rem; }

.article-curator {
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.curator-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
  margin-bottom: 8px;
}
.curator-body { font-size: 0.9rem; color: #78350f; line-height: 1.8; }

.summary-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 14px;
}

.article-body.prose { font-size: 0.95rem; line-height: 1.9; color: var(--text); }
.article-body.prose p    { margin-bottom: 1.2em; }
.article-body.prose h2   { font-size: 1.15rem; font-weight: 800; margin: 1.6em 0 0.6em; letter-spacing: -0.02em; }
.article-body.prose h3   { font-size: 1.05rem; font-weight: 700; margin: 1.4em 0 0.5em; }
.article-body.prose ul,
.article-body.prose ol   { padding-left: 1.4em; margin-bottom: 1.2em; }
.article-body.prose li   { margin-bottom: 0.4em; }
.article-body.prose blockquote {
  border-left: 3px solid var(--border2);
  padding: 4px 0 4px 16px;
  color: var(--text2);
  margin: 1.2em 0;
}
.article-body.prose code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
}
.article-body.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(230,57,70,0.3); }
.article-body.prose a:hover { text-decoration-color: var(--accent); }

.related-articles { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 14px;
}
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.article-nav-link:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.article-nav-link.next { text-align: right; }
.nav-dir { font-size: 0.7rem; font-weight: 700; color: var(--text3); letter-spacing: 0.04em; }
.nav-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================================================================
   Category page
   ================================================================ */
.category-heading { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; }

/* ================================================================
   Search page
   ================================================================ */
.search-page { padding: 32px 0 64px; }
.search-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.search-form { display: flex; gap: 8px; max-width: 560px; }
.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--navy); }
.search-submit {
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
}
.search-submit:hover { background: #2d2d4e; }
.search-title { font-size: 0.85rem; color: var(--text2); margin-top: 10px; }
#search-results { min-height: 200px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); font-size: 0.9rem; }

/* ================================================================
   Footer
   ================================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-text { font-size: 0.78rem; color: var(--text3); }
.footer-text a { color: var(--text2); }
.footer-text a:hover { color: var(--text); }
.footer-copy { font-size: 0.75rem; color: var(--text3); }

/* ================================================================
   Scroll to top
   ================================================================ */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.scroll-top.is-visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-sub-stack { flex-direction: row; gap: 10px; }
  .hero-sub-stack .article-card { flex: 1; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .related-grid { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: left; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .hero-sub-stack { flex-direction: column; }
  .article-title { font-size: 1.35rem; }
  .pagination { flex-direction: column; align-items: flex-start; gap: 12px; }
}
