/* ============================================================================
   Tech-o-Yaki — Post blocks (news-site structure, arcade skin)
   Markup generated by inc/post-blocks.php
   ============================================================================ */

/* ---------- Layout ---------- */
.toy-wrap {
  max-width: var(--toy-container-max);
  margin-inline: auto;
  padding-inline: var(--toy-container-pad);
}
.toy-home { padding-block: var(--toy-space-6); }
.toy-home__title {
  margin: 0 0 var(--toy-space-5);
  font-family: var(--toy-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--toy-color-muted);
}

.toy-split,
.toy-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--toy-space-6);
}
.toy-band { margin-bottom: var(--toy-space-8); }
.toy-split { margin-bottom: var(--toy-space-8); }
.toy-split__main > .toy-band:last-child { margin-bottom: 0; }

.toy-col {
  display: flex;
  flex-direction: column;
  gap: var(--toy-space-5);
  min-width: 0;
}

@media (min-width: 900px) {
  .toy-band { grid-template-columns: var(--toy-band-cols, minmax(0, 1fr)); }
  .toy-band > * { min-width: 0; }
  /* Lead story written first (first on mobile), shown in the middle column. */
  .toy-band--lead > :first-child { grid-column: 2; grid-row: 1; }
}
@media (min-width: 1100px) {
  .toy-split { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* ---------- Block ---------- */
.toy-posts { min-width: 0; }

.toy-posts__title {
  display: inline-block;
  margin: 0 0 var(--toy-space-4);
  padding: 0.3rem 0.8rem;
  font-family: var(--toy-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--toy-color-ink);
  background: var(--toy-cat-color, var(--toy-color-geek));
  border: var(--toy-border-thin) solid var(--toy-color-ink);
  box-shadow: 3px 3px 0 var(--toy-color-ink);
}
.toy-posts__title a { color: inherit; text-decoration: none; }
.toy-posts__title[data-cat="ios"],
.toy-posts__title[data-cat="gaming"] { color: var(--toy-color-paper); }

.toy-posts__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--toy-space-5);
}
@media (min-width: 600px) {
  .toy-posts__grid[data-cols="2"],
  .toy-posts__grid[data-cols="3"],
  .toy-posts__grid[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .toy-posts__grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toy-posts__grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Category colour mapping ---------- */
.toy-post[data-cat="android"], .toy-posts__title[data-cat="android"] { --toy-cat-color: var(--toy-color-android); }
.toy-post[data-cat="ios"],     .toy-posts__title[data-cat="ios"]     { --toy-cat-color: var(--toy-color-ios); }
.toy-post[data-cat="gaming"],  .toy-posts__title[data-cat="gaming"]  { --toy-cat-color: var(--toy-color-gaming); }
.toy-post[data-cat="tech"],    .toy-posts__title[data-cat="tech"]    { --toy-cat-color: var(--toy-color-tech); }
.toy-post[data-cat="geek"],    .toy-posts__title[data-cat="geek"]    { --toy-cat-color: var(--toy-color-geek); }
.toy-post[data-cat="films"],   .toy-posts__title[data-cat="films"]   { --toy-cat-color: var(--toy-color-films); }

/* ---------- Item: shared ---------- */
.toy-post .toy-card-title { margin: 0; }
.toy-post .toy-card-title a {
  color: var(--toy-color-ink);
  text-decoration: none;
  background-image: linear-gradient(var(--toy-cat-color, var(--toy-color-gaming)), var(--toy-cat-color, var(--toy-color-gaming)));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 3px;
  transition: background-size var(--toy-t-base);
}
.toy-post .toy-card-title a:hover,
.toy-post .toy-card-title a:focus-visible { background-size: 100% 3px; }
.toy-post .toy-card-excerpt { margin: 0; }
.toy-post .toy-card-meta a { color: inherit; text-decoration: none; }
.toy-post .toy-card-meta a:hover { color: var(--toy-color-ink); text-decoration: underline; }
.toy-post .toy-tag { align-self: flex-start; text-decoration: none; }
.toy-post .toy-card-img { display: block; }
.toy-post .toy-card-img img { display: block; }

/* ---------- Item: card + feature (image on top) ---------- */
.toy-post--card,
.toy-post--feature {
  display: flex;
  flex-direction: column;
  background: var(--toy-color-card);
  border: var(--toy-border-w) solid var(--toy-color-ink);
  border-radius: var(--toy-radius-lg);
  box-shadow: var(--toy-shadow-block);
  overflow: hidden;
  transition: transform var(--toy-t-base), box-shadow var(--toy-t-base);
}
.toy-post--card:hover,
.toy-post--feature:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--toy-cat-color, var(--toy-color-gaming));
}
.toy-post--card .toy-card-title { font-size: 1.1rem; }
.toy-post--feature .toy-card-img { aspect-ratio: 16 / 9; }
.toy-post--feature .toy-card-title { font-size: var(--toy-fs-2xl); line-height: 1.12; }
.toy-post--feature .toy-card-body { padding: 1.4rem 1.5rem 1.6rem; }
.toy-band--lead > :first-child .toy-post--feature .toy-card-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }

/* ---------- Item: list (no image, one bordered panel) ---------- */
.toy-posts--list .toy-posts__grid {
  gap: 0;
  background: var(--toy-color-card);
  border: var(--toy-border-w) solid var(--toy-color-ink);
  border-radius: var(--toy-radius-lg);
  box-shadow: var(--toy-shadow-block);
  overflow: hidden;
}
.toy-post--list { border-bottom: var(--toy-border-thin) solid var(--toy-color-ink); }
.toy-post--list:last-child { border-bottom: 0; }
.toy-post--list .toy-card-body {
  padding: 0.95rem 1.1rem 1rem;
  gap: 0.45rem;
  border-left: 6px solid var(--toy-cat-color, var(--toy-color-ink));
}
.toy-post--list .toy-card-title { font-size: 1rem; line-height: 1.25; }
.toy-post--list .toy-card-excerpt { font-size: 0.875rem; line-height: 1.45; }
.toy-post--list .toy-card-img { aspect-ratio: 16 / 9; border-bottom: var(--toy-border-thin) solid var(--toy-color-ink); }

@media (prefers-reduced-motion: reduce) {
  .toy-post--card, .toy-post--feature, .toy-post .toy-card-title a { transition: none; }
  .toy-post--card:hover, .toy-post--feature:hover { transform: none; }
}

/* ---------- Sections below articles and archives ---------- */
.toy-sections {
  display: flex;
  flex-direction: column;
  gap: var(--toy-space-8);
  padding-block: var(--toy-space-8);
}

/* The GenerateBlocks global class .toy-tag forces the Geek colour: restore the category colour. */
.toy-post .toy-tag { background-color: var(--toy-cat-color, var(--toy-color-geek)); }
.toy-post[data-cat="ios"] .toy-tag,
.toy-post[data-cat="gaming"] .toy-tag { color: var(--toy-color-paper); }

/* ---------- Author link in the single template ---------- */
.toy-author-link { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.toy-author-link:hover { color: var(--toy-color-gaming); }
