/* =====================================================
   RAIL SYSTEM — TRUSTYBULL CANONICAL
===================================================== */
.rows{
  position:relative;
  z-index:5;
  margin-top:12px;
}

.rail{
  margin-bottom:22px;
}

/* ===============================
   RAIL HEADER
================================ */

.rail-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px;
}

.rail-head h2{
  font-size:18px;
  font-weight:100;
  color:rgba(255,255,255,.6);
  margin-bottom:5px;
}

/* Explore / See more */
.see_more{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.01em;
  color:#d1d5db;
  text-decoration:none;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;
  transition:
    background .18s ease,
    border-color .18s ease,
    transform .18s ease;
}

.see_more:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.25);
}

.see_more:active{
  transform:scale(.97);
}

/* ===============================
   RAIL FLOW (DEFAULT)
================================ */

.rail-row{
  display:flex;
  gap:18px;
  overflow-x:auto;
  scroll-behavior:smooth;

  /* Netflix-style continuation */
  padding-right:120px;
}

.rail-row::-webkit-scrollbar{
  display:none;
}

.rail-track{
  display:flex;
  gap:18px;
}

/* ===============================
   GRID MODE (OPT-IN)
   .rows.is-grid
================================ */

.rows.is-grid .rail-row{
  overflow:visible;
  padding-right:0;
}

.rows.is-grid .rail-track{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:18px;
}

/* ===============================
   TABLET
================================ */
@media (max-width: 1100px){
  .rows.is-grid .rail-track{
    grid-template-columns:repeat(3, 1fr);
  }
}

/* ===============================
   SMALL TABLET
================================ */
@media (max-width: 900px){
  .rows.is-grid .rail-track{
    grid-template-columns:repeat(2, 1fr);
    gap:14px;
  }
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 520px){
  .rows.is-grid .rail-track{
    grid-template-columns:repeat(2, 1fr);
    gap:14px;
  }

  .tb-card{
    width:100%;
  }

  .tb-card-info{
    padding:10px 12px 16px;
  }

  .tb-card-title{
    font-size:14px;
    line-height:1.4;
  }
}

/* ===============================
   CARD CORE (16:9)
================================ */

.tb-card{
  position:relative;
  width:300px;                 /* Slimmer rail density */
  background:#0b0b0b;
  cursor:pointer;
  overflow:hidden;

  transition:
    transform .28s cubic-bezier(.4,0,.2,1),
    box-shadow .28s cubic-bezier(.4,0,.2,1);
}

/* Rail keeps fixed width */
.rows:not(.is-grid) .tb-card{
  flex-shrink:0;
}

/* Grid fills column */
.rows.is-grid .tb-card{
  width:100%;
}

.tb-card:hover{
  transform:scale(1.06) translateY(-4px);
  box-shadow:0 35px 90px rgba(0,0,0,.85);
  z-index:10;
}

/* ===============================
   IMAGE (TRUE 16:9)
================================ */

.tb-card-image{
  position:relative;
  aspect-ratio:16 / 9;
  overflow:hidden;
}

.tb-card-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .6s ease;
}

.tb-card:hover .tb-card-image img{
  transform:scale(1.06);
}

/* Cinematic bottom fade */
.tb-card-image::after{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(
    to bottom,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,.85) 100%
  );
}

/* ===============================
   INFO
================================ */

.tb-card-info{
  padding:12px 14px 16px;
  background:#0b0b0b;
}
/* META — subtle, editorial */
.tb-card-meta{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(203,213,225,.55);   /* softer, cooler gray */
  margin-bottom:10px;
  font-weight:500;
}

/* TITLE — refined + 2 line clamp */
.tb-card-title{
  font-size:16px;
  line-height:1.6;
  font-weight:600;
  color:rgba(226,232,240,.88);
  max-width:92%;

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;

  /* smooth ellipsis fade look */
  text-overflow:ellipsis;
}

/* ===============================
   MOBILE
================================ */
/* ===============================
   MOBILE OPTIMIZED RAILS
================================ */

@media (max-width: 900px){

  .rail{
    margin-bottom:18px;
  }

  .rail-head{
    padding:8px 16px 4px;
  }

  .rail-head h2{
    font-size:15px;
    font-weight:600;
    color:#e5e7eb;
  }

  .see_more{
    font-size:11px;
    padding:5px 10px;
  }

  .rail-row{
    gap:12px;
    padding:0 16px 0 16px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    padding-right:16px;
  }

  .rail-track{
    gap:12px;
  }

  .tb-card{
    width:72vw;              /* 🔥 Dynamic width based on screen */
    scroll-snap-align:start;
    border-radius:10px;
  }

  .tb-card:hover{
    transform:none;          /* No hover scale on mobile */
    box-shadow:none;
  }

  .tb-card-image{
    border-radius:10px;
  }

  .tb-card-info{
    padding:10px 12px 14px;
  }

  .tb-card-title{
    font-size:14px;
    line-height:1.45;
  }

}


/* ===============================
   SMALL DEVICES (<=480px)
================================ */

@media (max-width:480px){

  .tb-card{
    width:82vw;   /* Slightly bigger card on very small screens */
  }

}
