/* ========================================
   News — CheyReamea (news.cheyreamea.xyz)
   Master Stylesheet
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fafafa;
  color: #1d1d1f;
  min-height: 100vh;
}
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }
a { color: #7c3aed; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Privacy Banner --- */
.pn {
  background: #faf5ff;
  border-bottom: 1px solid #e8daff;
  padding: 8px 16px;
  font-size: .78rem;
  color: #5b21b6;
  text-align: center;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.pn.hide { display: none; }
.pn span { opacity: .8; }
.pn .pc {
  background: none; border: none; color: #7c3aed;
  cursor: pointer; font-size: 1.1rem; padding: 0 4px;
  opacity: .6; font-family: inherit;
}
.pn .pc:hover { opacity: 1; }

/* --- Header / Nav --- */
header {
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid #e8e8ed;
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 900px; margin: 0 auto; padding: 0 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo {
  font-size: 1.4rem; font-weight: 700; text-decoration: none;
  color: #1d1d1f; display: flex; align-items: center; gap: 6px;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  display: inline-block; width: 8px; height: 8px;
  background: #7c3aed; border-radius: 50%; margin-right: 2px;
}
.logo span { color: #7c3aed; }

.nav {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-block; font-size: .8rem; font-weight: 500;
  color: #6e6e73; text-decoration: none; white-space: nowrap;
  padding: 5px 12px; border-radius: 14px;
  border: 1px solid transparent;
  transition: all .2s;
}
.nav-link:hover { color: #7c3aed; background: #f5f5f7; border-color: #e5e5e7; }
.nav-link.active { color: #7c3aed; background: #faf5ff; font-weight: 600; border-color: #e8daff; }

/* --- Category Pills --- */
.cat-wrap { max-width: 900px; margin: 16px auto 16px; padding: 0 16px; }
.categories { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-pill {
  padding: 4px 12px; border-radius: 14px;
  border: 1px solid #e5e5e7; background: #fff;
  color: #6e6e73; cursor: pointer; font-size: .77rem;
  transition: all .2s; font-family: inherit;
}
.cat-pill:hover { border-color: #7c3aed; color: #7c3aed; background: #faf5ff; }
.cat-pill.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }

/* --- Search --- */
.search-bar { max-width: 560px; margin: 0 auto 24px; padding: 0 16px; }
.search-wrapper {
  display: flex; background: #f5f5f7;
  border: 1px solid #e5e5e7; border-radius: 10px; padding: 4px;
  transition: all .2s;
}
.search-wrapper:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.search-wrapper input {
  flex: 1; background: none; border: none;
  padding: 10px 14px; font-size: .95rem;
  color: #1d1d1f; outline: none;
}
.search-wrapper input::placeholder { color: #8e8e93; }
.search-wrapper button {
  background: #7c3aed; border: none; border-radius: 6px;
  padding: 8px 16px; color: #fff; cursor: pointer;
  font-size: 1.1rem; line-height: 1; transition: background .2s;
}
.search-wrapper button:hover { background: #6d28d9; }

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 24px; padding: 0 16px;
}
.article-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  border: 1px solid #f0f0f0;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: #e8e0f0;
}
.article-card:active { transform: translateY(-1px); }

/* --- Article Image --- */
.article-img {
  height: 170px;
  background: linear-gradient(135deg, #f0f0f5, #f5f0ff);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.article-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.article-card:hover .article-img img { transform: scale(1.03); }
.article-img .no-img { color: #b0b0b8; font-size: 2.5rem; }

/* --- Article Body --- */
.article-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 6px; }
.article-source {
  font-size: .7rem; color: #7c3aed; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  background: #faf5ff; padding: 1px 7px; border-radius: 4px;
}
.article-category {
  font-size: .68rem; background: #f0f0f5;
  padding: 2px 8px; border-radius: 8px; color: #6e6e73;
  white-space: nowrap;
}
.article-title {
  font-size: .92rem; font-weight: 500; line-height: 1.45;
  flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  color: #1d1d1f;
  transition: color .2s;
}
.article-card:hover .article-title { color: #7c3aed; }
.article-date {
  font-size: .73rem; color: #8e8e93; margin-top: 8px;
  display: flex; align-items: center; gap: 4px;
}

/* --- Loading / Empty --- */
.loading { text-align: center; padding: 40px; color: #8e8e93; }
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid #e5e5e7;
  border-top-color: #7c3aed;
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px 20px; color: #8e8e93; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state .empty-text { font-size: .95rem; }

/* --- Footer --- */
footer {
  text-align: center; padding: 20px;
  color: #8e8e93; font-size: .78rem;
  border-top: 1px solid #e8e8ed; margin-top: 20px;
}
footer .version { opacity: .5; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a6; }

/* --- Mobile --- */
@media (max-width: 600px) {
  .article-grid { grid-template-columns: 1fr; padding: 0 12px; gap: 12px; }
  .nav-link { font-size: .75rem; padding: 4px 7px; }
  .cat-wrap { margin: 12px auto 12px; }
}
