/* ═══════════════════════════════════════════════════════════════════════════
   FEED.CSS — shared feed components
   Used by home.php, single.php, archive.php via header.php
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Feed card (.fc) ──────────────────────────────────────────────────────── */
.fc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fc:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}

/* Image area */
.fc-img-wrap {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface2);
}
.fc-img-link {
  display: block;
  width: 100%;
  height: 100%;
}
.fc-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.32s ease;
}
.fc:hover .fc-img-link img { transform: scale(1.04); }

/* Category badge — top-left on image */
.fc-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--accent);
  color: #000;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.fc-cat:hover { background: #00aee0; }

/* Time badge — bottom-right on image */
.fc-time {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 2;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Body */
.fc-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Title */
.fc-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}
.fc-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.fc-title a:hover { color: var(--accent); }

/* Meta */
.fc-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Excerpt */
.fc-excerpt {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Feed grid ────────────────────────────────────────────────────────────── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
@media (max-width: 680px) {
  .feed-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 420px) {
  .feed-grid { grid-template-columns: 1fr; }
}

/* ── List layout mode (applied to archive-grid via JS) ───────────────────── */
.archive-grid.layout-list {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
.archive-grid.layout-list .card {
  display: flex !important;
  flex-direction: row !important;
  height: auto !important;
}
.archive-grid.layout-list .card .card-img {
  width: 180px !important;
  min-width: 180px !important;
  height: auto !important;
  min-height: 120px;
  flex-shrink: 0;
}
.archive-grid.layout-list .card .time-badge { display: none; }
@media (max-width: 560px) {
  .archive-grid.layout-list .card { flex-direction: column !important; }
  .archive-grid.layout-list .card .card-img { width: 100% !important; height: 160px !important; }
}

/* ── Trending section (home.php) ─────────────────────────────────────────── */
.trending-section { margin-top: 36px; }

.trending-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}
.trending-head svg { color: var(--accent); flex-shrink: 0; }

/* ── Layout toggle buttons (archive.php) ─────────────────────────────────── */
.layout-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
}
.layout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.layout-btn.active,
.layout-btn:hover {
  background: var(--surface2);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── "Read Next" strip (single.php) ─────────────────────────────────────── */
.read-next {
  margin: 32px 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  overflow: hidden;
}
.read-next-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 16px 0;
}
.read-next-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.read-next-card:hover { background: var(--surface2); }
.read-next-card img {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.read-next-body { flex: 1; min-width: 0; }
.read-next-cat {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.read-next-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.read-next-time {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 4px;
  display: block;
}
.read-next-arrow {
  font-size: 1.1rem;
  color: var(--text3);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.read-next-card:hover .read-next-arrow { transform: translateX(4px); }
@media (max-width: 480px) {
  .read-next-card img { display: none; }
}
