@import url("colour-constants.css");

/* Skill Up list pages — shared layout for Reading, Pronunciation, Sham Talk */

:root {
  --skill-card-image-height: 220px;
  /* List thumbs: display 160×90 (16:9). Export art at 320×180 (2×) or keep 1000×560 masters. */
  --skill-card-banner-ratio: 16 / 9;
  --skill-hero-height: clamp(280px, 32vh, 360px);
  --skill-hero-height-mobile: 24vh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body.reading-lesson {
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden; /* clip leftover shadows without breaking layout calc */
}

body.reading-lesson main a { color: inherit; text-decoration: none; }
body.reading-lesson button,
body.reading-lesson select { font: inherit; }

.skill-hero {
  height: var(--skill-hero-height);
  display: flex;
  align-items: center;
  padding: 40px 7vw 44px;
  background: var(--cream);
  color: var(--green);
  position: relative;
  overflow: hidden;
  border-bottom: var(--border);
}

.skill-hero::before {
  content: "";
  position: absolute;
  right: -105px;
  top: -150px;
  width: clamp(290px, 33vw, 430px);
  height: clamp(290px, 33vw, 430px);
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.55;
}

.skill-hero::after {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -165px;
  width: clamp(260px, 30vw, 360px);
  height: clamp(260px, 30vw, 360px);
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.45;
}

.skill-hero__inner {
  position: relative;
  z-index: 2;
  width: min(100%, 1040px);
}

.skill-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: clamp(16px, 3vw, 24px);
  color: var(--green);
  font-size: 15px;
  font-weight: 850;
}

.skill-breadcrumb a { border-bottom: 2px solid currentColor; }

.skill-breadcrumb__separator {
  align-self: center;
}

.skill-breadcrumb .skill-breadcrumb__pill {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.skill-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: clamp(14px, 2vw, 20px);
}

.skill-hero__label span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
}

.skill-hero__title {
  max-width: 920px;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-weight: 950;
  color: var(--green);
  margin-bottom: clamp(14px, 2vw, 20px);
  white-space: nowrap;
}

.skill-hero__lead {
  max-width: 790px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--green);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.ticker {
  border-bottom: var(--border);
  background: var(--green);
  color: var(--white);
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  gap: 34px;
  padding: 18px 0;
  font-weight: 950;
  letter-spacing: 0.04em;
  animation: tickerMove 24s linear infinite;
}

.ticker-track span { display: inline-flex; align-items: center; gap: 34px; }

.skill-list-section,
.article-list-shell {
  padding: clamp(58px, 7vw, 92px) 7vw 104px;
}

.skill-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 34px;
  align-items: end;
  margin-bottom: 18px;
}

.skill-list-header--compact {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}

.skill-list-header--compact .skill-list-kicker {
  margin-bottom: 0;
}

.skill-list-header--compact .skill-controls {
  max-width: none;
}

.skill-list-kicker {
  margin-bottom: 14px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skill-list-copy h2 {
  font-size: clamp(42px, 5vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-weight: 950;
  margin-bottom: 18px;
}

.skill-list-copy p {
  max-width: 700px;
  color: var(--muted);
  font-weight: 800;
}

.skill-controls {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: var(--border);
  border-radius: 30px;
  background: var(--off-white-blue);
  box-shadow: var(--shadow);
}

.skill-control-block { display: grid; gap: 10px; }

.skill-control-label,
.skill-sort span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.07em;
}

.skill-filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-filter-chip {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: var(--border);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.skill-filter-chip:hover,
.skill-filter-chip.is-active {
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.skill-filter-chip:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.skill-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 2px;
}

.skill-sort select {
  min-height: 42px;
  padding: 0 36px 0 14px;
  border: var(--border);
  border-radius: 999px;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%233c3c3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-sm);
}

.skill-sort select:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.skill-result-count {
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 900;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  overflow: visible;
  /* Room for card hard-shadow + CTA shadow without horizontal page scroll */
  padding: 4px 12px 16px 4px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.article-card {
  height: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* allow grid track to shrink past content min-size */
  border: var(--border);
  border-radius: 28px;
  background: var(--off-white-blue);
  box-shadow: var(--shadow);
  overflow: hidden; /* clip thumb to radius; CTA stays inside via link padding */
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.article-card .article-card-link {
  overflow: hidden; /* match card radius; padding below keeps CTA shadow inside */
  border-radius: inherit;
  max-width: 100%;
  min-width: 0;
}

.article-card:hover {
  transform: translate(5px, 5px) rotate(-0.35deg);
  box-shadow: var(--shadow);
}

.article-card.is-hidden { display: none; }

/*
  List thumb — same size on mobile & desktop.
  Display: 160 × 220. Source art @2×: 320 × 440.
*/
.article-card-link {
  --skill-card-thumb-w: 160px;
  --skill-card-thumb-h: 220px;
  display: block;
  height: auto;
  min-height: 0;
  /* Extra right/bottom so CTA hard-shadow never hits the card edge */
  padding: 14px 20px 22px 14px;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}

.article-card-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.article-image {
  width: var(--skill-card-thumb-w);
  min-width: var(--skill-card-thumb-w);
  max-width: var(--skill-card-thumb-w);
  height: var(--skill-card-thumb-h);
  min-height: var(--skill-card-thumb-h);
  max-height: var(--skill-card-thumb-h);
  align-self: flex-start;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  flex: 0 0 var(--skill-card-thumb-w);
}

.article-image::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.24);
}

.article-image::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -24px;
  top: -24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.article-image.has-real-image::before,
.article-image.has-real-image::after {
  display: none;
}

.article-image-file {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Beat global `.article-card img { height: 220px }` from styles.css.
   contain — lettering / illustration edges stay inside the 160×220 frame */
.article-card .article-image img.article-image-file {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center center;
}

.article-card .article-image.has-real-image {
  background: var(--white, #fff);
}

.article-card .article-image.has-real-image.article-image--transparent {
  background: transparent;
}

.article-card .article-card-body {
  padding: 0;
}

.article-image.has-real-image .article-illustration {
  display: none;
}

.article-image--banner.has-real-image {
  background: #00994d;
}

.article-image--banner.has-real-image .article-image-file {
  object-fit: contain;
  object-position: center center;
}

.article-art-pink { background: var(--pink); }
.article-art-green { background: #6fad70; }
.article-art-blue { background: #5caed1; }
.article-art-purple { background: var(--purple); }
.article-art-yellow { background: var(--yellow); }
.article-art-orange { background: #ffd49a; }

.article-illustration {
  position: relative;
  z-index: 2;
  width: min(52px, 50%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
  font-size: 22px;
  font-weight: 950;
}

.article-card-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
  align-self: stretch;
}

.article-card-body {
  --card-title-size: clamp(17px, 1.35vw, 22px);
  --card-title-lh: 1.25;
  --card-desc-size: 13px;
  --card-desc-lh: 1.45;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.article-card-tags span {
  display: inline-flex;
  padding: 5px 10px;
  border: var(--border);
  border-radius: 999px;
  background: var(--lime);
  font-size: 11px;
  font-weight: 950;
}

.article-card-tags span:nth-child(2) { background: var(--yellow); }

/* Always reserve exactly 2 title lines, then 2 desc lines, then CTA */
.article-card-title-slot {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  height: calc(var(--card-title-size) * var(--card-title-lh) * 2);
  min-height: calc(var(--card-title-size) * var(--card-title-lh) * 2);
  max-height: calc(var(--card-title-size) * var(--card-title-lh) * 2);
  overflow: hidden;
}

.article-card h2 {
  font-size: var(--card-title-size);
  line-height: var(--card-title-lh);
  letter-spacing: -0.03em;
  font-weight: 950;
  color: var(--green-dark);
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.article-card-title-slot.has-english h2 {
  -webkit-line-clamp: 1;
}

.english-title {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 950;
  line-height: var(--card-title-lh);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-card-excerpt {
  color: var(--muted);
  font-size: var(--card-desc-size);
  font-weight: 760;
  line-height: var(--card-desc-lh);
  margin: 0;
  height: calc(var(--card-desc-size) * var(--card-desc-lh) * 2);
  min-height: calc(var(--card-desc-size) * var(--card-desc-lh) * 2);
  max-height: calc(var(--card-desc-size) * var(--card-desc-lh) * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.article-card-meta {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 950;
  margin: 0;
}

/* Pin yellow CTA to bottom-right of content column (matches podcast pills). */
.article-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: auto;
  width: 100%;
  padding-top: 4px;
}

.article-card .button.article-card-cta,
.article-card-cta {
  position: relative;
  z-index: 0;
  flex: 0 1 auto;
  align-self: auto;
  margin: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

/* Keep underlines for non-card nav links only */
.article-read-link {
  width: fit-content;
  margin-top: auto;
  padding-top: 8px;
  border-bottom: 2px solid currentColor;
  font-weight: 950;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: none;
  padding: 42px;
  border: var(--border);
  border-radius: 34px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 900;
  color: var(--muted);
}

.empty-state.is-visible { display: block; }

.empty-state--static {
  display: block;
}

@keyframes tickerMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 1120px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .skill-list-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .skill-controls { width: 100%; }
  .article-grid { gap: 16px; }
}

@media (max-width: 720px) {
  .skill-hero {
    height: var(--skill-hero-height-mobile);
    min-height: 0;
    padding: 20px 20px 24px;
  }

  .skill-hero::before {
    right: -120px;
    top: -120px;
    width: 220px;
    height: 220px;
  }

  .skill-hero::after {
    left: -130px;
    bottom: -140px;
    width: 220px;
    height: 220px;
  }

  .skill-breadcrumb {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .skill-hero__label {
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-width: 1.5px;
    box-shadow: var(--shadow-sm);
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .skill-hero__label span {
    width: 7px;
    height: 7px;
  }

  .skill-hero__title {
    font-size: clamp(34px, 10vw, 44px);
    margin-bottom: 8px;
  }

  .skill-hero__lead {
    font-size: 11px;
    line-height: 1.4;
    max-width: none;
  }

  .ticker-track { padding: 14px 0; font-size: 14px; }

  .skill-list-section,
  .article-list-shell { padding: 22px 20px 64px; }

  .skill-list-header {
    gap: 18px;
    margin-bottom: 12px;
  }

  .skill-list-kicker {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .skill-list-copy { margin-bottom: 0; }

  .skill-list-copy h2 {
    font-size: clamp(28px, 8vw, 38px);
    margin-bottom: 8px;
  }

  .skill-list-copy p { font-size: 14px; line-height: 1.5; }

  .skill-result-count { margin-bottom: 18px; }

  .skill-controls {
    margin-inline: -2px;
    padding: 14px;
    border-radius: 22px;
    box-shadow: var(--shadow);
    gap: 14px;
  }

  .skill-control-block { gap: 8px; }

  .skill-control-label,
  .skill-sort span {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .skill-filter-scroll {
    flex-wrap: wrap;
    overflow: visible;
    margin-inline: 0;
    padding: 2px 0 4px;
    gap: 6px;
  }

  .skill-filter-scroll::-webkit-scrollbar { display: none; }

  body.reading-lesson .skill-filter-chip {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 950;
  }

  .skill-filter-chip:hover,
  .skill-filter-chip.is-active {
    box-shadow: var(--shadow-press);
    transform: none;
  }

  .skill-sort {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .skill-sort span {
    flex: 0 0 auto;
  }

  body.reading-lesson .skill-sort select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 0 30px 0 12px;
    background-position: right 12px center;
    background-size: 10px 7px;
    font-size: 12px;
    font-weight: 900;
    font-family: inherit;
  }

  .article-grid { grid-template-columns: minmax(0, 1fr); }

  .article-card {
    border-radius: 24px;
  }

  .article-card-link {
    --skill-card-thumb-w: 120px;
    --skill-card-thumb-h: 165px;
    padding: 12px 18px 20px 12px;
  }

  .article-card-row {
    gap: 12px;
  }

  .article-card-body {
    gap: 6px;
    min-width: 0;
  }

  .article-card-main {
    min-width: 0;
  }

  .article-card h2 {
    font-size: 17px;
  }

  .article-card-body {
    --card-desc-size: 12px;
  }

  .article-card-excerpt {
    font-size: var(--card-desc-size);
  }

  .article-card-actions {
    padding-top: 2px;
  }

  .article-card .button.article-card-cta,
  .article-card-cta {
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    padding: 0 16px;
    font-size: 12px;
    box-shadow: var(--shadow-sm);
  }
}

@media (max-width: 390px) {
  .skill-hero__title { font-size: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* Legacy aliases — events list and older markup still on articles-list.css */
.page-hero {
  height: var(--skill-hero-height);
  display: flex;
  align-items: center;
  padding: 40px 7vw 44px;
  background: var(--cream);
  color: var(--green);
  position: relative;
  overflow: hidden;
  border-bottom: var(--border);
}

.page-hero::before {
  content: "";
  position: absolute;
  right: -105px;
  top: -150px;
  width: clamp(290px, 33vw, 430px);
  height: clamp(290px, 33vw, 430px);
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.55;
}

.page-hero::after {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -165px;
  width: clamp(260px, 30vw, 360px);
  height: clamp(260px, 30vw, 360px);
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.45;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 1040px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: clamp(16px, 3vw, 24px);
  color: var(--green);
  font-size: 15px;
  font-weight: 850;
}

.breadcrumb a { border-bottom: 2px solid currentColor; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: clamp(14px, 2vw, 20px);
}

.eyebrow-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
}

.page-title {
  max-width: 920px;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-weight: 950;
  color: var(--green);
  margin-bottom: clamp(14px, 2vw, 20px);
  white-space: nowrap;
}

.page-lead {
  max-width: 790px;
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.48;
  font-weight: 900;
  color: var(--green);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

@media (max-width: 720px) {
  .page-hero {
    height: var(--skill-hero-height-mobile);
    padding: 32px 22px 36px;
  }

  .page-title { font-size: clamp(48px, 16vw, 72px); }
  .page-lead { font-size: 18px; }
}

@media (max-width: 390px) {
  .page-title { font-size: 46px; }
}

/* /skillup/ hub styles live in skill-up-hub.css */
