/* Shared styles for every tile list page (models, categories, tags, foot sizes,
   months). Drawn by tfuk_list_render() in list-engine.php. */
.tfuk-list {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two equal columns */
  gap: 40px; /* spacing between items */
  list-style: none; /* remove default bullets */
  padding: 0;
  margin: 0;
}

.tfuk-list li {
  text-align: center; /* center image + link */
}

/* Mobile: two tiles across, same as desktop */
@media (max-width: 768px) {

  #content-wrap,
  #fullwidth {
    width: 100%;
    padding-left: 0px !important;
    padding-right: 0px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .tfuk-list {
    grid-template-columns: 1fr 1fr; /* two across on mobile, same as desktop */
    gap: 24px 12px;
  }
  
  .tfuk-list li {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tfuk-list .image-wrapper {
    width: 100%;
    margin: 0;
  }

}

.entry-content ul.tfuk-list,
.entry-content ul.tfuk-list li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Container that enforces 16:9 ratio */
.tfuk-list .image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio (9/16 = 0.5625) */
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Zoom the whole wrapper on hover */
.tfuk-list .image-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Image fills the container */
.tfuk-list .image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop to fill */
}

/* Grid for 4 thumbnails */
.tfuk-list .grid-2x2 {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.tfuk-list .grid-2x2 .grid-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tfuk-list .grid-2x2 img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grid for 2 thumbnails (side by side) */
.tfuk-list .grid-1x2 {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.tfuk-list .grid-1x2 .grid-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tfuk-list .grid-1x2 img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grid for 3 thumbnails (stacked vertically) */
.tfuk-list .grid-1x3 {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.tfuk-list .grid-1x3 .grid-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tfuk-list .grid-1x3 img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Replicate theme */

/* Base title element (same font and rhythm as theme) */
.tfuk-list-title a {
    font-family: 'Josefin Sans', Tahoma, serif;
    font-weight: 300;
    font-size: 20px;
    line-height: 1.5em;
    margin: 10px 0 0 0;
    padding: 0;
}

.tfuk-list-caption {
    font-family: 'Josefin Sans', Tahoma, serif;
    color: #7f7f7f !important;
    line-height: 1.5em;
    margin: 10px 0 0 0;
    padding: 0;
}

/* --- TITLE LINK: reproduce tag page look & behavior --- */
/* Start grey, no underline, animate color smoothly */
.tfuk-list-title a {
    color: #000000 !important;                           /* base grey was #7f7f7f*/
    text-decoration: none !important;         /* beat global underline */
    transition: color .5s ease !important;               /* smooth color transition */
}

/* Hover/focus/active: exact blue you provided, still no underline */
.tfuk-list-title a:hover,
.tfuk-list-title a:focus,
.tfuk-list-title a:active,
.tfuk-list-title a:visited:hover {
    color: #3d53ff !important;                           /* exact tag-page blue */
    text-decoration: none !important;
}

/* Keep visited the same grey (adjust if your tag page differs) */
.tfuk-list-title a:visited {
    color: #7f7f7f;
    text-decoration: none !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tfuk-list-title a { transition: none; }
}

/* JFF Stats totals badges (video runtime + photo count) - top-right of
   each card's image. Mirrors the theme's own per-post Grid/List
   badge pill (.tf-badge-type / .tf-badge-type-runtime / .tf-badge-runtime-label
   in style.css), but positioned via a small flex wrapper instead of the
   theme's absolute positioning, since a card here can show BOTH a video
   pill and a photo pill side by side (a single post only ever shows one). */
.tfuk-list .tf-model-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tfuk-list .tf-model-badges .tf-badge {
  position: static; /* override the theme's position:absolute - the wrapper above handles placement */
}
.tfuk-list .tf-badge-type {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  border-radius: 50%;
}
.tfuk-list .tf-badge-type svg {
  width: 12px;
  height: 12px;
  display: block;
}
.tfuk-list .tf-badge-type.tf-badge-type-runtime {
  width: auto;
  min-width: 24px;
  padding: 0 8px 0 6px;
  border-radius: 12px;
  gap: 4px;
  align-items: center;
}
.tfuk-list .tf-badge-runtime-label {
  display: inline-block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 768px) {
  /* Two tiles across: pills are scaled down to match the smaller tiles. */
  .tfuk-list .tf-model-badges { top: 4px; right: 4px; gap: 3px; }
  .tfuk-list .tf-badge-type { width: 16px; height: 16px; }
  .tfuk-list .tf-badge-type svg { width: 8px; height: 8px; }
  .tfuk-list .tf-badge-type.tf-badge-type-runtime { min-width: 16px; padding: 0 5px 0 4px; gap: 3px; border-radius: 8px; }
  .tfuk-list .tf-badge-runtime-label { font-size: 8px; }
}

/* Mobile: two tiles across, so scale the text down to fit. Kept at the end of
   the file so it wins over the desktop title/caption sizes above. */
@media (max-width: 768px) {
  .tfuk-list-title a {
    font-size: 14px;
  }
  .tfuk-list-caption {
    font-size: 12px;
  }
}

/* Foot sizes have always used a slightly smaller title on desktop. */
@media (min-width: 769px) {
  .tfuk-list--footsize .tfuk-list-title a {
    font-size: 18px;
  }
}
