/* ═══════════════════════════════════════════════════════════════
   CATEGORY SECTION + CARDS — IMPROVED UI
   Patches applied on top of style.css
═══════════════════════════════════════════════════════════════ */

/* ── Section head ─────────────────────────────────────────── */
.f2n-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 5px;
  border-bottom: 2px solid var(--line, #e8edf2);
  position: relative;
}
.f2n-section-head::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 44px; height: 2px;
  background: var(--red, #c0392b); border-radius: 2px;
}
.f2n-section-head h2 {
  font-family: var(--font-ui, sans-serif);
  font-size: var(--f2n-font-sm, 13.5px); font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink, #0f1117);
  padding-bottom: 0;
  display: flex; align-items: center; gap: 8px;
}
.f2n-section-head a {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui, sans-serif); font-size: var(--f2n-font-sm, 13.5px); font-weight: 600;
  color: var(--muted, #6b7280); white-space: nowrap;
  border: 1px solid var(--line, #e8edf2); border-radius: 20px; padding: 3px 12px;
  transition: color .15s, border-color .15s, background .15s;
  padding-bottom: 3px;
}
.f2n-section-head a:hover {
  color: var(--red, #c0392b);
  border-color: rgba(192,57,43,.3);
  background: rgba(192,57,43,.05);
}

/* ── Cat section + grid ────────────────────────────────────── */
.f2n-cat-section { margin-bottom: 20px; }

.f2n-cat-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: stretch;
}
.f2n-cat-grid > * { min-width: 0; }
.f2n-cat-grid__main { display: flex; flex-direction: column; }
.f2n-cat-grid__main .f2n-card-lg { flex: 1; }

/* Main card — taller image, no contain */
.f2n-cat-grid__main .f2n-card-lg__img {
  height: 260px;
  aspect-ratio: unset;
}
.f2n-cat-grid__main .f2n-card-lg__img img {
  object-fit: contain !important;   /* override the contain in uploaded style.css */
  max-height: none !important;
}
.f2n-cat-grid__main .f2n-card-lg__title {
  font-size: calc(var(--f2n-font-card-title, 16px) + 3px);
  -webkit-line-clamp: 3;
  flex: none;
}
.f2n-cat-grid__main .f2n-card-lg__body { padding: 18px 20px 20px; gap: 10px; }
.f2n-cat-grid__main .f2n-card-lg__excerpt {
  font-family: var(--font-ui, sans-serif);
  font-size: var(--f2n-font-sm, 13px); line-height: 1.65;
  color: var(--ink-3, #3d4a5c);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* List panel — grouped card container */
.f2n-cat-grid__list {
  display: flex; flex-direction: column;
  background: var(--white, #fff);
  border: 1px solid var(--line, #e8edf2);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  gap: 0 !important;
}

/* ── Large card (global fix) ──────────────────────────────── */
.f2n-card-lg {
  background: var(--white, #fff);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line, #e8edf2);
  transition: box-shadow .22s ease, transform .22s ease;
  height: 100%; display: flex; flex-direction: column;
}
.f2n-card-lg:hover { box-shadow: 0 10px 36px rgba(0,0,0,.12); transform: translateY(-3px); }

.f2n-card-lg__img {
  aspect-ratio: 16/10; overflow: hidden;
  background: var(--bg, #f5f7fa); flex-shrink: 0;
}
.f2n-card-lg__img img {
  width: 100%; height: 100%;
  object-fit: contain !important;   /* fix: override contain everywhere */
  max-height: none !important;
  transition: transform .5s ease;
}
.f2n-card-lg:hover .f2n-card-lg__img img { transform: scale(1.05); }

.f2n-card-lg__body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.f2n-card-lg__label {
  display: inline-flex; align-items: center;
  font-family: var(--font-ui, sans-serif); font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--red, #c0392b);
  border: 1px solid rgba(192,57,43,.2); background: rgba(192,57,43,.06);
  padding: 2px 10px; border-radius: 20px; align-self: flex-start;
  margin-bottom: 0;
}
.f2n-card-lg__title {
  font-family: var(--font-head, serif);
  font-size: var(--f2n-font-card-title, 16px);
  font-weight: 700; line-height: 1.32; color: var(--ink, #0f1117);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: none; transition: color .15s;
}
.f2n-card-lg__title:hover { color: var(--red, #c0392b); }
.f2n-card-lg__meta {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ui, sans-serif); font-size: var(--f2n-font-sm, 13.5px); color: var(--muted, #6b7280);
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line, #e8edf2);
}
.f2n-card-lg__meta svg { opacity: .5; flex-shrink: 0; }

/* ── Small card (list item) ───────────────────────────────── */
.f2n-card-sm {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: transparent !important;   /* override uploaded style white bg */
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid #f0f3f7 !important;
  box-shadow: none !important;
  text-decoration: none;
  transition: background .15s ease;
  min-width: 0;
}
.f2n-card-sm:last-child { border-bottom: none !important; }
.f2n-card-sm:hover { background: #fff8f7 !important; transform: none !important; box-shadow: none !important; }

.f2n-card-sm__img {
  width: 78px; min-width: 78px; height: 60px;
  border-radius: 6px; overflow: hidden;
  background: var(--bg, #f5f7fa); flex-shrink: 0;
}
.f2n-card-sm__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.f2n-card-sm:hover .f2n-card-sm__img img { transform: scale(1.07); }

.f2n-card-sm__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.f2n-card-sm__label {
  font-family: var(--font-ui, sans-serif); font-size: 9px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--red, #c0392b);
}
.f2n-card-sm__title {
  font-family: var(--font-ui, sans-serif);
  font-size: var(--f2n-font-sm, 13px); font-weight: 600;
  line-height: 1.42; color: var(--ink-2, #1e2535);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.f2n-card-sm:hover .f2n-card-sm__title { color: var(--red, #c0392b); }
.f2n-card-sm__meta { font-family: var(--font-ui, sans-serif); font-size: var(--f2n-font-sm, 13px); color: var(--muted, #6b7280); margin-top: auto; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .f2n-cat-grid { grid-template-columns: 1fr; }
  .f2n-cat-grid__main .f2n-card-lg__img { height: 220px; }
}
@media (max-width: 640px) {
  .f2n-cat-grid__main .f2n-card-lg__img { height: 190px; }
  .f2n-cat-grid__main .f2n-card-lg__excerpt { display: none; }
}