/* Home layout and shared card styles. */
.toeic-home {
  --home-width: var(--toeic-width);
  --home-gutter: var(--toeic-gutter);
  --home-ink: #202126;
  --home-muted: #39404b;
  --home-blue: #005dc7;
  --home-teal: #006c65;
  --home-canvas: #f5f5f7;
  --home-surface: #fff;
  --home-border: #dfe2e7;
  --home-chip: #edf4fc;
}

.toeic-home main {
  background: var(--home-canvas);
}

.home-shell {
  width: 100%;
  max-width: var(--home-width);
  margin-inline: auto;
  padding-inline: var(--home-gutter);
}

.home-intro {
  color: var(--home-ink);
  background: linear-gradient(115deg, #fcfdff, #fff4df);
  border-block-end: 1px solid #e9e3d9;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.09fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 2.25rem;
  padding-block: 1.75rem;
}

.home-hero-copy {
  align-self: center;
  padding-block: 0.75rem;
}

.home-eyebrow {
  margin: 0 0 0.625rem;
  color: #894214 !important;
  font-weight: 700;
}

.home-hero h1 {
  --mcb-size-h1: 3rem;
  margin: 0 0 1rem !important;
  color: inherit;
  line-height: 1.1 !important;
  font-weight: 730 !important;
  letter-spacing: -0.035em !important;
  overflow-wrap: anywhere;
}

.home-hero-skills,
.home-hero-reading {
  display: block;
}

.home-hero h1 em {
  font-style: normal;
  color: var(--home-blue);
}

.home-hero h1 .home-hero-reading em {
  color: var(--home-teal);
}

.home-lead {
  --mcb-size-h2: 1.0625rem;
  max-width: 58ch;
  margin: 0;
  color: var(--home-muted) !important;
  line-height: 1.6 !important;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.55em 1em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
}

.home-action-primary {
  background-color: var(--home-blue);
  color: #fff;
}

.home-action-primary:hover {
  background-color: #004fa9;
}

.home-action-secondary {
  background-color: #fff;
  border-color: #007a70;
  color: var(--home-teal);
}

.home-action-secondary:hover {
  background-color: #e2f7ef;
}

.home-hero-visual {
  position: relative;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 22rem;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 1.75rem;
  background: linear-gradient(140deg, #ffd67d, #ff944e);
}

.home-hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.home-catalog {
  padding-block: 1.75rem 3rem;
}

.toeic-home .home-section {
  margin-block-start: 2rem;
  color: var(--home-ink);
}

.toeic-home .home-section:first-child {
  margin-block-start: 0;
}

.home-section h2 {
  --mcb-size-h2: 2rem;
  margin: 0 0 0.875rem !important;
}

.home-catalog .home-section h2 { color: var(--home-ink) !important; }

.home-cards,
.home-features {
  display: grid;
  gap: 0.875rem;
}

.home-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-section-reading .home-cards,
.home-section-chuyen-de .home-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-features {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.875rem;
}

.home-card {
  --home-card-ink: var(--home-blue);
  display: flex;
  flex-direction: column;
  min-height: 44px;
  padding: 1.125rem;
  background: var(--home-surface);
  color: var(--home-ink);
  border: 1px solid var(--home-border);
  border-radius: 1.375rem;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

:is(.home-section-listening, .home-section-reading) .home-card-title {
  --mcb-size-h2: 1.25rem;
}

.home-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
  color: var(--home-card-ink);
}

.home-card-label {
  --mcb-size-h2: 0.875rem;
  padding: 0.23em 0.7em;
  border-radius: 999px;
  background-color: var(--home-chip);
  font-weight: 700;
  line-height: 1.55;
}

.home-card-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.7em;
  height: 1.7em;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--home-chip);
  color: var(--home-card-ink);
  line-height: 1;
}

.home-card-title {
  --mcb-size-h2: 1.125rem;
  font-weight: 710;
  line-height: 1.28;
}

.home-card-detail {
  --mcb-size-h2: 0.9375rem;
  margin-top: 0.375rem;
  color: var(--home-muted);
  line-height: 1.45;
}

.home-feature {
  --home-feature-size: 10.75rem;
  --home-feature-art-width: 36%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(var(--home-feature-art-width), var(--home-feature-size));
  min-block-size: var(--home-feature-size);
  padding: 0;
}

.home-feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.125rem;
}

.home-feature .home-card-title { --mcb-size-h2: 1.5rem; }

.home-feature-art {
  align-self: center;
  margin: 0.625rem;
}

.home-feature-art img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: 0.875rem;
}

@media (hover: hover) {
  .home-card:hover {
    border-color: #aabbd0;
    box-shadow: 0 3px 12px #1d263912;
  }

  .home-card:hover .home-card-arrow {
    background: var(--home-surface);
    border-color: var(--home-card-ink);
    color: var(--home-card-ink);
  }
}

.home-tips ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-tips li {
  padding: 0.875rem 1rem;
  border: 1px solid var(--home-border);
  border-radius: 1.125rem;
  background: var(--home-surface);
  color: var(--home-muted) !important;
  line-height: 1.5 !important;
}

.home-tips strong {
  display: block;
  color: var(--home-ink);
  margin-block-end: 0.25rem;
}

@media (max-width: 970px) {
  .home-hero { gap: 1.25rem; }
  .home-hero h1 { --mcb-size-h1: 2.375rem; }
  .home-hero-visual {
    align-self: center;
    min-block-size: 0;
  }
  .home-cards,
  .home-section-chuyen-de .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-section-chuyen-de .home-cards > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding-block: 1.25rem;
  }

  .home-hero-copy { padding-block: 0; }
  .home-hero h1 { --mcb-size-h1: 2rem; }
  .home-lead { --mcb-size-h2: 1rem; }
  .home-hero-actions { margin-top: 1rem; }

  .home-hero-visual {
    border-radius: 1.25rem;
  }

  .home-section h2 { --mcb-size-h2: 1.625rem; }

  .home-section-reading .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-section-reading .home-cards > :last-child {
    grid-column: 1 / -1;
  }

  .home-cards,
  .home-features {
    gap: 0.625rem;
  }

  .home-card:not(.home-feature) {
    padding: 0.75rem;
    border-radius: 1rem;
  }

  .home-cards .home-card-title { --mcb-size-h2: 1.0625rem; }

  .home-features, .home-tips ul { grid-template-columns: minmax(0, 1fr); }

  .home-feature {
    --home-feature-size: 9rem;
    --home-feature-art-width: 39%;
    border-radius: 1rem;
  }

  .home-feature-copy { padding: 0.875rem; }
  .home-feature .home-card-title { --mcb-size-h2: 1.1875rem; }
}

@media (max-width: 355px) {
  .home-cards,
  .home-section-reading .home-cards,
  .home-section-chuyen-de .home-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .home-hero { display: block; }
  .home-hero-visual, .home-hero-actions { display: none; }
  .home-card { break-inside: avoid; }
}
