/* Two-column grid for shortcode output */
.special-tags {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two equal columns */
  gap: 20px; /* spacing between items */
  list-style: none; /* remove default bullets */
  padding: 0;
  margin: 0;
}

.special-tags li {
  text-align: center; /* center image + link */
}

/* Mobile: stack items in one column */
@media (max-width: 768px) {
  .special-tags {
    grid-template-columns: 1fr;
  }
}

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

/* Container that enforces 16:9 ratio */
.special-tags .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 */
.special-tags .image-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

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

/* Grid for 4 thumbnails */
.special-tags .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%;
}

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

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

/* Grid for 2 thumbnails (side by side) */
.special-tags .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%;
}

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

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

/* Grid for 3 thumbnails (stacked vertically) */
.special-tags .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%;
}

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

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


/* Replicate theme */

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

.tag-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 */
.tag-modelname 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 */
.tag-modelname a:hover,
.tag-modelname a:focus,
.tag-modelname a:active,
.tag-modelname 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) */
.tag-modelname a:visited {
    color: #7f7f7f;
    text-decoration: none !important;
}

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