/* ===== CSS Custom Properties ===== */
:root {
  --bg: #fefcf5;
  --card-bg: #fff;
  --text: #3d3226;
  --text-muted: #8c7b6e;
  --accent: #8b7355;
  --code-bg: #f5f0e8;
  --border: #e8e0d5;
  --hover: #f0ebe0;
  --max-width: 1200px;
  --content-width: 680px;
  --sidebar-width: 220px;
  --card-gap: 20px;
  --radius: 12px;
  --transition: 0.3s ease;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --card-bg: #2a2a2a;
  --text: #e0d8cc;
  --text-muted: #a09890;
  --accent: #c4a882;
  --code-bg: #2d2820;
  --border: #3a3530;
  --hover: #353028;
}

/* Dark mode: subtle shine (reduce white glow intensity) */
html[data-theme="dark"] .photo-masonry figure::after {
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.03) 45%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 55%,
    transparent 70%
  );
}
html[data-theme="dark"] .card::after {
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255,255,255,0.02) 48%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.02) 52%,
    transparent 70%
  );
}
html[data-theme="dark"] .photo-detail-grid a::after {
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.02) 47%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.02) 53%,
    transparent 65%
  );
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.4; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

code { font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace; font-size: 0.85rem; }
:not(pre) > code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }
pre { background: var(--code-bg); padding: 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.6; font-size: 0.85rem; }
pre code { background: none; padding: 0; }
blockquote { border-left: 3px solid var(--accent); padding: 8px 16px; margin: 16px 0; color: var(--text-muted); background: var(--hover); border-radius: 0 var(--radius) var(--radius) 0; }

#main-content { flex: 1; }

/* ===== Layout Containers ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.content-with-sidebar { display: flex; gap: 32px; max-width: var(--max-width); margin: 0 auto; padding: 32px 20px; }
.content-with-sidebar .content-main { flex: 1; min-width: 0; max-width: var(--content-width); }
.content-with-sidebar .content-sidebar { width: var(--sidebar-width); flex-shrink: 0; }

/* ===== Header ===== */
.site-header { background: var(--card-bg); border-bottom: 1px solid var(--border); transition: background var(--transition); }
.site-header.head-fixed { position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 56px; gap: 16px; }

.site-brand { flex-shrink: 0; }
.site-logo { font-size: 1.25rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.site-logo:hover { text-decoration: none; }
.site-logo img { height: 32px; width: auto; }

.site-nav { display: flex; align-items: center; flex: 1; gap: 4px; }
.nav-list { display: flex; list-style: none; gap: 4px; }
.nav-list a { display: block; padding: 6px 12px; border-radius: 6px; color: var(--text); font-size: 0.95rem; transition: background 0.2s, color 0.2s; }
.nav-list a:hover { background: var(--hover); text-decoration: none; }
.nav-list .current > a { color: var(--accent); font-weight: 600; }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.08); min-width: 140px; padding: 6px 0; list-style: none; z-index: 50; }
.has-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { padding: 8px 16px; white-space: nowrap; border-radius: 0; }
.has-dropdown.open .dropdown-menu { display: block; }

.nav-search { margin-left: auto; }
.nav-search input { padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); color: var(--text); font-size: 0.85rem; width: 160px; outline: none; transition: border-color 0.2s, width 0.2s; }
.nav-search input:focus { border-color: var(--accent); width: 200px; }

/* Theme Toggle */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; color: var(--text); display: flex; align-items: center; transition: background 0.2s; }
.theme-toggle:hover { background: var(--hover); }

html:not([data-theme="dark"]) .icon-moon,
html[data-theme="dark"] .icon-sun { display: block; }

html:not([data-theme="dark"]) .icon-sun,
html[data-theme="dark"] .icon-moon { display: none; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .hamburger span:nth-child(2) { opacity: 0; }
.nav-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===== Card Grid ===== */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--card-gap); padding: 32px 0; }
.card {
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease,
              border-color 0.3s ease;
  position: relative;
}
/* Shine sweep overlay */
.card::after {
  content: '';
  position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255,255,255,0.05) 48%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.05) 52%,
    transparent 70%
  );
  background-size: 200% 200%;
  background-position: 150% 150%;
  transition: background-position 0.55s ease;
  opacity: 0;
}
.card:hover::after {
  opacity: 1;
  background-position: -50% -50%;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  border-color: rgba(139,115,85,0.15);
}
.card-thumb { display: block; overflow: hidden; position: relative; }
.card-thumb img {
  width: 100%; height: 180px; object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover .card-thumb img { transform: scale(1.06); }
.card-body { padding: 16px; position: relative; z-index: 1; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.card-excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }

/* ===== Article Detail ===== */
.article-header { margin-bottom: 24px; }
.container > .article-header { padding-top: 32px; }
.article-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.article-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 12px; }
.article-meta a { color: var(--text-muted); }
.article-content { font-size: 1rem; line-height: 1.9; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: var(--radius); margin: 16px 0; }
.article-content h2 { font-size: 1.375rem; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 1.125rem; margin: 24px 0 8px; }

/* ===== Sidebar ===== */
.sidebar-widget { margin-bottom: 24px; }
.sidebar-widget h4 { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.toc-list { list-style: none; font-size: 0.85rem; }
.toc-list li { padding: 4px 0; }
.toc-list a { color: var(--text-muted); display: block; padding: 2px 8px; border-left: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.toc-list a:hover, .toc-list a.active { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.toc-list .toc-h3 { padding-left: 16px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { background: var(--hover); color: var(--text-muted); padding: 3px 10px; border-radius: 16px; font-size: 0.8rem; transition: background 0.2s, color 0.2s; }
.tag-cloud a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.related-posts { list-style: none; font-size: 0.85rem; }
.related-posts li { padding: 4px 0; }

/* Sticky Sidebar */
.content-sidebar { position: sticky; top: 72px; align-self: flex-start; max-height: calc(100vh - 88px); overflow-y: auto; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 24px 0; }
.pagination a, .pagination span { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.9rem; color: var(--text); transition: background 0.2s; }
.pagination a:hover { background: var(--hover); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Post Navigation ===== */
.post-nav { display: flex; justify-content: space-between; padding: 24px 0; border-top: 1px solid var(--border); margin-top: 32px; font-size: 0.9rem; }
.post-nav a { color: var(--text-muted); }
.post-nav a:hover { color: var(--accent); }

/* ===== Archive Timeline ===== */
.archive-year { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 32px 0 16px; }
.archive-item { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; }
.archive-item .date { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; min-width: 100px; }
.archive-item .title { flex: 1; }
.archive-item .category { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Photography Masonry ===== */
.photo-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 4px;
  padding: 32px 0;
}
.photo-masonry figure {
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.5s ease,
              z-index 0s step-end;
  transform-origin: center center;
}
.photo-masonry figure.wide { grid-column: span 2; }
.photo-masonry figure.tall { grid-row: span 2; }
.photo-masonry figure.large { grid-column: span 2; grid-row: span 2; }

/* Inner wrapper for dual-link pattern (image lightbox + title article link) */
.photo-item-inner {
  position: relative; width: 100%; height: 100%; overflow: hidden;
}

/* Shine sweep overlay */
.photo-masonry figure::after {
  content: '';
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.06) 45%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.06) 55%,
    transparent 70%
  );
  background-size: 200% 200%;
  background-position: 150% 150%;
  transition: background-position 0.6s ease;
  opacity: 0;
}
.photo-masonry figure:hover::after {
  opacity: 1;
  background-position: -50% -50%;
}

/* Hover: elevate + multi-layer shadow */
.photo-masonry figure:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.3),
    0 4px 12px rgba(0,0,0,0.15),
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 0 4px rgba(255,255,255,0.03);
  z-index: 10;
}

/* Image link — used by lightbox */
.photo-card-link {
  display: block; width: 100%; height: 100%;
}
.photo-card-link img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.photo-masonry figure:hover .photo-card-link img {
  transform: scale(1.08);
}

/* Title link — goes to article page, sits above image at bottom */
.photo-card-title-link {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 40px 16px 14px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.5) 0%,
    rgba(0,0,0,0.12) 70%,
    transparent 100%
  );
  color: #fff; font-size: 0.85rem; letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.photo-card-title-link:hover { text-decoration: none; color: #fff; }
.photo-masonry figure:hover .photo-card-title-link {
  opacity: 1; transform: translateY(0);
}

/* ===== Lightbox with Windows-style navigation ===== */
.lightbox {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 1000; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; }
.lightbox-content {
  display: flex; flex-direction: column; align-items: center;
  max-width: 90vw; max-height: 90vh;
}
.lightbox-img-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
}
.lightbox-img-wrap img {
  max-width: 85vw; max-height: 78vh; object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.18s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 40px rgba(0,0,0,0.5);
}
.lightbox-info {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 14px; color: rgba(255,255,255,0.8); font-size: 0.85rem;
}
.lightbox-counter { font-weight: 600; letter-spacing: 0.05em; }
.lightbox-caption {
  color: rgba(255,255,255,0.55); max-width: 60vw;
  text-align: center; font-size: 0.8rem;
}
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,0.08); border: none; color: #fff;
  font-size: 32px; cursor: pointer; line-height: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; padding: 14px 6px; cursor: pointer;
  border-radius: 10px; transition: background 0.2s, transform 0.2s;
  z-index: 2; display: flex; align-items: center;
}
.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next { padding: 10px 4px; }
  .lightbox-prev { left: 4px; } .lightbox-next { right: 4px; }
  .lightbox-img-wrap img { max-width: 95vw; max-height: 72vh; }
  .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 26px; }
}

/* ===== Comments ===== */
.comments-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.comments-section h3 { margin-bottom: 16px; }
.comment-list { list-style: none; }
.comment-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author { font-weight: 600; margin-bottom: 4px; }
.comment-time { font-size: 0.8rem; color: var(--text-muted); }
.comment-content { margin-top: 8px; font-size: 0.95rem; }
.comment-form { margin-top: 24px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 0.95rem; margin-bottom: 12px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit { width: auto; padding: 10px 24px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 0.95rem; transition: opacity 0.2s; }
.comment-form .submit:hover { opacity: 0.9; }
.comments-closed { color: var(--text-muted); }

/* ===== Photo Detail Layout (left-right split for group articles) ===== */
.photo-detail-layout { display: flex; gap: 24px; align-items: flex-start; }
.photo-detail-grid { flex: 0 0 75%; column-count: 2; column-gap: 12px; }
.photo-detail-grid a {
  display: block; overflow: hidden; border-radius: 0; margin-bottom: 12px;
  position: relative; break-inside: avoid;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.45s ease;
}
/* Shine sweep on detail images */
.photo-detail-grid a::after {
  content: '';
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.05) 47%,
    rgba(255,255,255,0.16) 50%,
    rgba(255,255,255,0.05) 53%,
    transparent 65%
  );
  background-size: 200% 200%;
  background-position: 150% 150%;
  transition: background-position 0.5s ease;
  opacity: 0;
}
.photo-detail-grid a:hover::after {
  opacity: 1;
  background-position: -50% -50%;
}
.photo-detail-grid a:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.08);
  z-index: 2;
}
.photo-detail-grid img {
  width: 100%; border-radius: 0; display: block;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.photo-detail-grid a:hover img {
  transform: scale(1.06);
}
.photo-detail-divider { width: 1px; align-self: stretch; background: linear-gradient(to bottom, transparent, var(--border) 10%, var(--border) 90%, transparent); flex-shrink: 0; }
.photo-detail-text { flex: 1; min-width: 0; }
.photo-detail-text .article-content { font-size: 0.95rem; line-height: 1.9; }
.photo-detail-text .article-content h2 { font-size: 1.15rem; margin-top: 24px; }

/* ===== Empty States ===== */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; }

/* ===== Breadcrumbs ===== */
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* ===== Search Page ===== */
.search-header { text-align: center; padding: 32px 0 16px; font-size: 1.1rem; color: var(--text-muted); }
.search-header strong { color: var(--accent); }
.search-form-large { text-align: center; padding-bottom: 16px; }
.search-form-large input { padding: 10px 20px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg); color: var(--text); font-size: 1rem; width: 320px; max-width: 100%; outline: none; }
.search-form-large input:focus { border-color: var(--accent); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 48px; background: var(--card-bg); transition: background var(--transition); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.footer-links { margin-top: 4px; }
.footer-links .sep { margin: 0 6px; }

/* ===== Responsive ===== */
/* Tablet: 768-1024px */
@media (max-width: 1024px) {
  .content-with-sidebar { flex-direction: column; }
  .content-with-sidebar .content-sidebar { width: 100%; position: static; max-height: none; }
  .photo-masonry { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; }
  .photo-detail-layout { flex-direction: column; gap: 24px; }
  .photo-detail-grid { flex: none; column-count: 2; }
  .photo-detail-divider { width: 100%; height: 1px; background: linear-gradient(to right, transparent, var(--border) 10%, var(--border) 90%, transparent); }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
  .photo-masonry { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .photo-masonry figure.wide,
  .photo-masonry figure.large { grid-column: span 2; }
  .photo-detail-grid { column-count: 1; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 20px; }
  .hamburger { display: flex; }
  .site-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--card-bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px 20px; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 99; }
  .nav-open .site-nav { display: flex; }
  .nav-list { flex-direction: column; width: 100%; }
  .nav-list a { padding: 10px 12px; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 16px; display: none; }
  .has-dropdown.open .dropdown-menu { display: block; }
  .nav-search { margin: 8px 0 0; width: 100%; }
  .nav-search input { width: 100%; }
  .article-meta { flex-direction: column; gap: 4px; }
  .post-nav { flex-direction: column; gap: 8px; }
}

/* ===== RSS News Cards ===== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0; }
.news-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.news-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.news-source-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; color: #fff; white-space: nowrap; }
.news-time { font-size: 0.72rem; color: var(--text-muted); }
.news-card-title { font-size: 0.93rem; font-weight: 600; line-height: 1.5; margin-bottom: 8px; flex: 1; }
.news-card-title a { color: var(--text); }
.news-card-title a:hover { color: var(--accent); text-decoration: none; }
.news-card-summary { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-footer { font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 8px; }
.news-views { opacity: 0.7; }

@media (max-width: 1024px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .news-grid { grid-template-columns: 1fr; } }

/* Infinite Scroll */
.infscr-sentinel { text-align: center; padding: 24px 0; color: var(--text-muted); font-size: 14px; }
.infscr-loader { display: none; }
.infscr-end { display: none; }
.infscr-spinner {
  display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px;
  border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: infscr-spin 0.6s linear infinite;
}
@keyframes infscr-spin { to { transform: rotate(360deg); } }
