/*
 * Kids card photography and depth, November 2026.
 * Load after kids-redesign.css. The family hero, shared starter, parent guide,
 * article figures and game mechanics keep their existing styles and behavior.
 */

.kids-site {
  --kids-card-edge-purple: #5428b9;
  --kids-card-edge-yellow: #bb9418;
  --kids-card-edge-coral: #c94737;
  --kids-card-shadow: 0 16px 28px rgb(23 26 36 / 15%),
                      0 3px 8px rgb(23 26 36 / 8%);
}

.kids-site .story-grid {
  row-gap: 38px;
}

.kids-site .story-card,
.kids-site .game-card,
.kids-site .kids-topic-strip > a:nth-child(n) {
  --kids-card-edge: var(--kids-card-edge-purple);
  border: 1px solid #d9d6e2;
  border-radius: 22px;
  background: #fff;
  color: var(--kids-ink);
  box-shadow: 0 6px 0 var(--kids-card-edge), var(--kids-card-shadow);
  isolation: isolate;
  overflow: hidden;
}

.kids-site .story-card.theme-amber,
.kids-site .story-card.theme-lime {
  --kids-card-edge: var(--kids-card-edge-yellow);
}

.kids-site .story-card.theme-coral {
  --kids-card-edge: var(--kids-card-edge-coral);
}

.kids-site .story-card .story-cover {
  aspect-ratio: 3 / 2;
  border: 0;
  border-radius: 0;
  background: #f7f5f1;
}

.kids-site .story-cover img.cover-editorial {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  background: #f7f5f1;
  transform: none;
}

.kids-site .story-card:hover .story-cover img.cover-editorial {
  transform: none;
}

.kids-site .story-card .story-copy {
  background: #fff;
}

/* One complete photograph and a readable label, with no legacy emoji styling. */
.kids-site .kids-topic-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 16px;
  overflow: visible;
}

.kids-site .kids-topic-strip > a:nth-child(n) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  padding: 0;
  gap: 0;
  border-radius: 18px;
  text-decoration: none;
}

.kids-site .kids-topic-strip > a:nth-child(3n + 2) {
  --kids-card-edge: var(--kids-card-edge-yellow);
}

.kids-site .kids-topic-strip > a:nth-child(3n) {
  --kids-card-edge: var(--kids-card-edge-coral);
}

.kids-site .kids-topic-strip .kids-topic-art {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  background: #f7f5f1;
  font-size: 0;
  line-height: 0;
}

.kids-site .kids-topic-art img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
  transform: none;
}

.kids-site .kids-topic-strip .kids-topic-label {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 64px;
  padding: 12px 10px;
  color: var(--kids-ink);
  background: #fff;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
}

/* The original four game links retain their complete copy and footer alignment. */
.kids-site .game-card-grid {
  gap: 36px 22px;
}

.kids-site .game-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.kids-site .game-card[href$="/fruit-memory"] {
  --kids-card-edge: var(--kids-card-edge-yellow);
}

.kids-site .game-card[href$="/pattern-puzzle"] {
  --kids-card-edge: var(--kids-card-edge-coral);
}

.kids-site .game-card-art,
.kids-site .games-index .game-card-art {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 3 / 2;
  border-radius: 0;
  background: #f7f5f1;
  overflow: hidden;
}

.kids-site .game-card-art .game-cover-photo {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
  transform: none;
}

.kids-site .game-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 20px 24px;
  background: #fff;
  color: var(--kids-ink);
}

.kids-site .game-card-copy > .eyebrow {
  color: #5428b9;
}

.kids-site .game-card .game-start {
  min-height: 44px;
  margin-top: auto;
  color: var(--kids-ink);
  border-top-color: #d9d6e2;
}

/* Depth is present on touchscreens; only hover-capable pointers add movement. */
.kids-site .story-card:hover,
.kids-site .game-card:hover,
.kids-site .kids-topic-strip > a:hover {
  transform: none;
  box-shadow: 0 6px 0 var(--kids-card-edge), var(--kids-card-shadow);
}

.kids-site .story-card:focus-within,
.kids-site .game-card:focus-visible,
.kids-site .kids-topic-strip > a:focus-visible {
  outline: 3px solid var(--kids-cobalt);
  outline-offset: 5px;
}

@media (hover: hover) and (pointer: fine) {
  .kids-site .story-card,
  .kids-site .game-card,
  .kids-site .kids-topic-strip > a {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .kids-site .story-card:hover,
  .kids-site .game-card:hover,
  .kids-site .kids-topic-strip > a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 var(--kids-card-edge),
                0 20px 32px rgb(23 26 36 / 17%),
                0 4px 10px rgb(23 26 36 / 9%);
  }
}

@media (min-width: 768px) {
  .kids-site .kids-topic-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 20px;
  }

  .kids-site .kids-topic-strip .kids-topic-label {
    min-height: 66px;
    font-size: 20px;
  }

  .kids-site .game-card-copy { padding: 24px; }
}

@media (min-width: 1024px) {
  .kids-site .kids-topic-strip,
  .kids-site .kids-topic-strip:has(> a:nth-child(6):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 30px 16px;
  }

  .kids-site .kids-topic-strip .kids-topic-label {
    min-height: 72px;
    padding-inline: 8px;
    font-size: 18px;
  }
}

@media (min-width: 1440px) {
  .kids-site .kids-topic-strip { column-gap: 20px; }
  .kids-site .kids-topic-strip .kids-topic-label { font-size: 20px; }
  .kids-site .game-card-copy { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .kids-site .story-card,
  .kids-site .story-card:hover,
  .kids-site .story-card:focus-within,
  .kids-site .game-card,
  .kids-site .game-card:hover,
  .kids-site .kids-topic-strip > a,
  .kids-site .kids-topic-strip > a:hover {
    transition: none !important;
    transform: none !important;
  }
}

.kids-site[data-motion="false"] .story-card,
.kids-site[data-motion="false"] .story-card:hover,
.kids-site[data-motion="false"] .story-card:focus-within,
.kids-site[data-motion="false"] .game-card,
.kids-site[data-motion="false"] .game-card:hover,
.kids-site[data-motion="false"] .kids-topic-strip > a,
.kids-site[data-motion="false"] .kids-topic-strip > a:hover {
  transition: none !important;
  transform: none !important;
}

@media print {
  .kids-site .story-card,
  .kids-site .game-card,
  .kids-site .kids-topic-strip > a:nth-child(n) {
    border: 1px solid #bbb;
    box-shadow: none;
    transform: none;
    break-inside: avoid;
  }
}
