/* =========================================
   Inspenet TV Hub - Consolidated Styles
   ========================================= */

/* --- Layout & Container --- */
.container,
.container-tv {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.tv-hero {
  padding: 24px 0;
}

.tv-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding-bottom: 40px;
  align-items: start;
}

/* --- Typography --- */
.tv-title {
  margin: 0 0 16px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

/* --- Search Bar --- */
.tv-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tv-search__input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 16px;
  transition: border-color 0.2s;
}

.tv-search__input:focus {
  outline: none;
  border-color: #032A53;
  box-shadow: 0 0 0 3px rgba(3, 42, 83, 0.1);
}

.tv-btn {
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: #032A53;
  /* Menu Blue */
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.tv-btn:hover {
  background: #021d3a;
}

/* --- Chips (Desktop) --- */
.tv-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tv-chip {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  text-decoration: none;
  color: #475569;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.tv-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.tv-chip.is-active {
  background: #032A53;
  border-color: #032A53;
  color: #fff;
}

/* --- Sidebar --- */
.tv-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom Scrollbar for sidebar */
.tv-sidebar::-webkit-scrollbar {
  width: 4px;
}

.tv-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.tv-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.tv-side__block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.tv-side__title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

.tv-side__list,
.tv-side__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tv-side__list li {
  margin-bottom: 2px;
}

.tv-side__list a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s;
}

.tv-side__list a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-side__list a.is-current {
  background: #032A53;
  color: #fff;
  font-weight: 500;
}

.tv-side__sub {
  padding-left: 12px;
  margin-top: 2px;
  border-left: 2px solid #f1f5f9;
  margin-left: 12px;
}

/* Tags in Sidebar */
.tv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tv-tag {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s;
}

.tv-tag:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* --- Video Grid --- */
.tv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Default desktop (3 cols) */
  gap: 20px;
  align-content: start;
}

.tv-empty {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  background: #f8fafc;
  border-radius: 12px;
  color: #64748b;
}

/* --- Video Card --- */
.tv-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.tv-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tv-card__media {
  position: relative;
  aspect-ratio: 16/9;
  background: #0f172a;
  overflow: hidden;
}

.tv-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tv-card:hover .tv-card__media img {
  transform: scale(1.05);
}

.tv-card__play {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(3, 42, 83, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.tv-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tv-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;

  /* Line clamp (2 lines) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tv-card__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.tv-card__chan {
  font-weight: 600;
  color: #032A53;
}

.dot {
  color: #cbd5e1;
}

/* --- Pagination --- */
.tv-pager {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.tv-pager a,
.tv-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.tv-pager a:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.tv-pager .current {
  background: #032A53;
  border-color: #032A53;
  color: #fff;
}

/* --- Mobile Elements (Hidden by default) --- */
.tv-cat-label,
.tv-cat-select {
  display: none;
}

/* =========================================
   Responsive Breakpoints
   ========================================= */

/* --- Breadcrumbs --- */
.crumbs,
.custom-breadcrumbs,
.post-category {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.crumbs a,
.custom-breadcrumbs a {
  color: #000;
  text-decoration: none;
}

.crumbs a:hover,
.custom-breadcrumbs a:hover {
  color: #032A53;
}

.crumbs .sep {
  margin: 0 6px;
  color: #cbd5e1;
}

/* Large Screens (Keep 3 columns as requested, so we remove the 4-col override) */
/* @media (min-width: 1280px) {
  .tv-grid {
    grid-template-columns: repeat(4, 1fr);
  }
} */

/* Tablet / Small Desktop (Sidebar hidden, 3 columns) */
@media (max-width: 1024px) {
  .tv-layout {
    grid-template-columns: 1fr;
    /* Stack layout */
    gap: 0;
  }

  .tv-sidebar {
    display: none;
    /* Hide sidebar */
  }

  .tv-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Show Mobile Filters */
  .tv-cat-label,
  .tv-cat-select {
    display: block;
  }

  .tv-cat-label {
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
  }

  .tv-cat-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #fff;
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 24px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
  }
}

/* Tablet Portrait (2 columns) */
@media (max-width: 768px) {
  .tv-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .tv-hero {
    padding-bottom: 0;
  }
}

/* Mobile (1 column) */
@media (max-width: 480px) {

  .container,
  .container-tv,
  .tv-wrap {
    padding: 0 16px !important;
  }

  .tv-grid {
    grid-template-columns: 1fr;
  }

  .tv-search {
    flex-direction: row;
    /* Keep side-by-side if possible, or adjust */
    flex-wrap: wrap;
  }

  .tv-search__input {
    min-width: 0;
    /* Allow shrinking */
    flex: 1 1 auto;
  }

  .tv-btn {
    /* Make button less 'grotesque' - auto width instead of full width if it was wrapping */
    width: auto;
    padding: 0 16px;
    /* Slightly smaller padding */
    flex: 0 0 auto;
  }

  .tv-title {
    font-size: 24px;
  }
}
