/* ==========================================================================
   Sidebar Widget Styles — HAMCO Sports News
   Selectors match sidebar.php
   Uses global variables from variables.css
   ========================================================================== */

/* ---------- Widget Base ---------- */
.hn-sidebar-widget {
  background: var(--hn-card-bg);
  border-radius: var(--hn-radius-md);
  box-shadow: var(--hn-shadow-card);
  overflow: hidden;
  margin-bottom: var(--hn-space-6);
}

/* ---------- Widget Title ---------- */
.hn-widget-title {
  font-family: var(--hn-font-subheading);
  font-size: var(--hn-text-lg);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--hn-black);
  padding: 14px var(--hn-space-4);
  margin: 0;
  border-left: 4px solid var(--hn-red);
  border-bottom: 1px solid var(--hn-gray-200);
  letter-spacing: 0.03em;
  line-height: 1.1;
}

/* ---------- Widget Body ---------- */
.hn-widget-body {
  padding: 14px var(--hn-space-4);
}

/* ==========================================================================
   Trending List Widget — matches sidebar.php classes
   ========================================================================== */
.hn-trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hn-trending-item {
  display: flex;
  align-items: flex-start;
  gap: var(--hn-space-3);
  padding: var(--hn-space-3) var(--hn-space-4);
  border-bottom: 1px solid var(--hn-gray-200);
  transition: background var(--hn-transition-base);
}

.hn-trending-item:last-child {
  border-bottom: none;
}

.hn-trending-item:hover {
  background: var(--hn-gray-100);
}

/* Numbered rank — sidebar.php uses .hn-trending-num */
.hn-trending-num {
  font-family: var(--hn-font-subheading);
  font-size: 28px;
  font-weight: 700;
  color: var(--hn-gray-200);
  line-height: 1;
  min-width: 28px;
  flex-shrink: 0;
}

.hn-trending-item:nth-child(1) .hn-trending-num { color: var(--hn-red); }
.hn-trending-item:nth-child(2) .hn-trending-num { color: var(--hn-red); opacity: 0.7; }
.hn-trending-item:nth-child(3) .hn-trending-num { color: var(--hn-red); opacity: 0.5; }

/* Thumbnail — sidebar.php uses .hn-trending-thumb directly on <img> */
.hn-trending-thumb {
  width: 64px;
  height: 48px;
  border-radius: var(--hn-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

/* Content — sidebar.php uses .hn-trending-info */
.hn-trending-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Category label — sidebar.php uses .hn-trending-cat */
.hn-trending-cat {
  font-family: var(--hn-font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hn-red);
}

/* Title — sidebar.php uses .hn-trending-title directly on <a> */
.hn-trending-title {
  font-family: var(--hn-font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hn-black);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--hn-transition-base);
}

.hn-trending-title:hover {
  color: var(--hn-red);
}

/* Time ago — sidebar.php uses .hn-trending-time */
.hn-trending-time {
  font-family: var(--hn-font-body);
  font-size: 11px;
  color: var(--hn-gray-400);
}

/* ==========================================================================
   Ad Widget — matches sidebar.php classes
   ========================================================================== */
.hn-sidebar-ad {
  background: transparent;
  box-shadow: none;
}

/* Ad label — sidebar.php uses .hn-ad-label */
.hn-ad-label {
  display: block;
  font-family: var(--hn-font-body);
  font-size: var(--hn-text-xs);
  font-weight: 600;
  color: var(--hn-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: var(--hn-space-2);
}

.hn-ad-placeholder {
  background: var(--hn-gray-100);
  border: 2px dashed var(--hn-gray-200);
  border-radius: var(--hn-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.hn-ad-placeholder a {
  text-decoration: none;
  color: var(--hn-black);
}

/* Ad inner content — sidebar.php uses .hn-ad-inner */
.hn-ad-inner {
  text-align: center;
  font-family: var(--hn-font-body);
  font-size: var(--hn-text-sm);
  line-height: 1.6;
  color: var(--hn-gray-600);
}

/* Sticky sidebar */
.hn-sidebar-widget.is-sticky {
  position: sticky;
  top: 80px;
}

/* ==========================================================================
   home.php Trending Items — uses BEM-style classes
   ========================================================================== */
.hn-trending-item__rank {
  font-family: var(--hn-font-subheading);
  font-size: 28px;
  font-weight: 700;
  color: var(--hn-gray-200);
  line-height: 1;
  min-width: 28px;
  flex-shrink: 0;
}

.hn-trending-item:nth-child(1) .hn-trending-item__rank { color: var(--hn-red); }
.hn-trending-item:nth-child(2) .hn-trending-item__rank { color: var(--hn-red); opacity: 0.7; }
.hn-trending-item:nth-child(3) .hn-trending-item__rank { color: var(--hn-red); opacity: 0.5; }

.hn-trending-item__thumb {
  width: 64px;
  height: 48px;
  border-radius: var(--hn-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.hn-trending-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hn-trending-item__content {
  flex: 1;
  min-width: 0;
}

.hn-trending-item__title {
  font-family: var(--hn-font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hn-black);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--hn-transition-base);
}

.hn-trending-item__title:hover {
  color: var(--hn-red);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .hn-sidebar-widget {
    margin-bottom: var(--hn-space-4);
  }
}

@media (max-width: 680px) {
  .hn-trending-thumb {
    width: 52px;
    height: 40px;
  }

  .hn-trending-num {
    font-size: 22px;
    min-width: 22px;
  }

  .hn-trending-item__rank {
    font-size: 22px;
    min-width: 22px;
  }

  .hn-widget-title {
    font-size: var(--hn-text-md);
    padding: var(--hn-space-3) 14px;
  }
}
