/* ==========================================================================
   Ana səhifə — "Ən çox baxılanlar" (Reseptlər · Forum · Məhsullar)
   includes/home-top.php
   ========================================================================== */
.ht-section { padding: 26px 0 10px; }

.ht-panel {
  position: relative; overflow: hidden;
  padding: 24px; border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, #fffaf7 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 50px -40px rgba(36, 20, 23, .55);
}
.ht-panel::before { /* açıq dekorativ fon */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(40% 60% at 100% 0%, rgba(110, 231, 183, .16), transparent 60%),
    radial-gradient(45% 70% at 0% 0%, rgba(244, 63, 94, .12), transparent 60%);
}

/* ---------- Başlıq ---------- */
.ht-head { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.ht-head-icon {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--color-primary);
  background: radial-gradient(circle at 35% 30%, #fff, var(--color-primary-tint));
  box-shadow: 0 10px 22px -14px rgba(216, 31, 61, .8), 0 0 0 1px rgba(244, 63, 94, .12);
}
.ht-head-icon svg { width: 34px; height: 34px; }
.ht-head-text h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.15; letter-spacing: -.02em; }
.ht-head-text p { margin: 4px 0 0; font-size: 14.5px; color: var(--color-ink-faint); }

/* ---------- Sütunlar ---------- */
.ht-cols {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  align-items: start;   /* sütunlarda sətir sayı fərqli olanda boş yer qalmasın */
}
.ht-cols[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ht-cols[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1080px) { .ht-cols, .ht-cols[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .ht-cols, .ht-cols[data-cols="2"], .ht-cols[data-cols="3"] { grid-template-columns: minmax(0, 1fr); } }

.ht-col {
  --ht-1: #f43f5e; --ht-2: #be123c; --ht-soft: rgba(244, 63, 94, .1);
  min-width: 0; padding: 14px; border-radius: 22px;
  background: #fff; border: 1px solid var(--ht-soft);
  box-shadow: 0 1px 2px rgba(36, 20, 23, .04);
}
.ht-col-forum  { --ht-1: #3b82f6; --ht-2: #1d4ed8; --ht-soft: rgba(59, 130, 246, .12); }
.ht-col-mehsul { --ht-1: #22c55e; --ht-2: #15803d; --ht-soft: rgba(34, 197, 94, .14); }

.ht-col-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--ht-soft); }
.ht-col-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--ht-1), var(--ht-2));
  box-shadow: 0 10px 18px -12px var(--ht-2);
}
.ht-col-icon svg { width: 22px; height: 22px; }
.ht-col-head h3 {
  flex: 1 1 auto; min-width: 0; margin: 0; font-size: 19px; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;   /* düymənin altına girməsin */
}
.ht-col-more {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 700; text-decoration: none;
  color: var(--ht-2); background: #fff; border: 1px solid var(--ht-soft);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ht-col-more .ht-go { width: 13px; height: 13px; }
.ht-col-more:hover { background: linear-gradient(135deg, var(--ht-1), var(--ht-2)); border-color: transparent; color: #fff; }

/* ---------- Sətirlər ---------- */
.ht-list { list-style: none; margin: 0; padding: 0; }
.ht-list li + li { border-top: 1px solid var(--color-border); }
.ht-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px; text-decoration: none; color: inherit;
  border-radius: 14px; transition: background .15s ease, transform .15s ease;
}
.ht-item:hover { background: var(--ht-soft); transform: translateX(2px); }
.ht-thumb {
  position: relative; flex: 0 0 86px; width: 86px; height: 70px; border-radius: 14px; overflow: hidden;
  background: var(--color-surface-alt); display: grid; place-items: center;
}
.ht-thumb-wide { flex-basis: 104px; width: 104px; }
.ht-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ht-thumb-ph { font-size: 26px; }
.ht-tag {
  position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--ht-1), var(--ht-2));
}

.ht-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ht-title {
  font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--color-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ht-item:hover .ht-title { color: var(--ht-2); }
/* Məhsul adları uzun olur — bir sətirdə kəsilir, sətirlər bərabər qalır */
.ht-col-mehsul .ht-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ht-author { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--color-ink-faint); }
.ht-author img, .ht-av-fallback {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--color-primary-tint); color: var(--color-primary-dark);
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
}
.ht-author b { font-weight: 600; color: var(--color-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-author time { flex-shrink: 0; margin-left: auto; }

.ht-stats { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 700; color: var(--color-ink-faint); }
.ht-stats span { display: inline-flex; align-items: center; gap: 4px; }
.ht-stats svg { width: 15px; height: 15px; }
.ht-stats .is-like { color: var(--color-primary); }

.ht-price {
  align-self: flex-start; padding: 3px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: var(--color-primary-dark); background: var(--color-primary-tint);
}

.ht-go { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-ink-faint); transition: transform .15s ease, color .15s ease; }
.ht-item:hover > .ht-go { color: var(--ht-2); transform: translateX(3px); }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  .ht-section { padding: 18px 0 6px; }
  .ht-panel { padding: 16px 14px; border-radius: 22px; }
  .ht-head { gap: 12px; margin-bottom: 14px; }
  .ht-head-icon { width: 48px; height: 48px; }
  .ht-head-icon svg { width: 26px; height: 26px; }
  .ht-head-text p { font-size: 13px; }
  .ht-cols { gap: 12px; }
  .ht-col { padding: 12px; border-radius: 18px; }
  .ht-col-head h3 { font-size: 17px; }
  .ht-col-icon { width: 36px; height: 36px; border-radius: 12px; }
  .ht-col-icon svg { width: 19px; height: 19px; }
  .ht-col-more { padding: 6px 10px; font-size: 11.5px; }
  .ht-thumb, .ht-thumb-wide { flex-basis: 74px; width: 74px; height: 62px; }
  .ht-title { font-size: 14px; }
  .ht-item { padding: 10px 4px; gap: 10px; }
}
@media (max-width: 560px) {
  /* Telefonda düymədə yalnız ox qalır — başlıq tam görünsün, kəsilməsin */
  .ht-col-more span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ht-col-more { padding: 8px; border-radius: 50%; }
  .ht-col-more .ht-go { width: 15px; height: 15px; }
  .ht-author time { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ht-item, .ht-go { transition: none; } .ht-item:hover { transform: none; } }
