/* Typing tips page. Reuses taiPie.css's color variables and card/button
   styles (:root, .taitype-stage-card, .taitype-btn-primary, .taitype-tabs)
   so this page stays visually consistent with the typing tutor -- this
   file only adds the tip-grid-specific layout. */

/* taiPie.css's `.taitype-app.container` rule sets a 1760px width with
   `!important` (it's designed for the wide practice-tutor layout), which
   was silently beating any plain `.tips-app { max-width: 1200px }` rule
   here regardless of source order -- that's why this page was rendering
   edge-to-edge instead of the standard 1200px content width every other
   page uses. Matching its exact specificity pattern (three classes) plus
   `!important` is the only way to reliably win against it. */
.taitype-app.container.tips-app {
  width: min(1200px, calc(100vw - 36px)) !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* This page's dark mode is pure black rather than the typing tutor's navy-
   tinted dark theme -- scoped to `.tips-page` only (via higher selector
   specificity than taiPie.css's shared `body.dark` rule) so the tutor
   itself is untouched. Still driven by the same site-wide `dark` class
   toggle, so it responds correctly whichever theme the user has active. */
body.dark.tips-page {
  --taitype-bg: #000000;
  --taitype-surface: #0a0a0a;
  --taitype-surface-soft: #121212;
  --taitype-border: rgba(255, 255, 255, 0.14);
  background: #000000;
}

.tips-card {
  padding: 1.6rem 1.6rem 2rem;
  text-align: center;
}

.tips-title {
  margin: 0.5rem 0 0.4rem;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.04em;
  color: var(--taitype-primary-strong);
}

.tips-intro {
  max-width: 620px;
  margin: 0 auto 1.6rem;
  color: var(--taitype-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Ratatype-style blog-card grid: three columns on desktop, generous
   gutters, borderless cards -- the image itself is the card, with a short
   category label + bold headline sitting directly underneath it. */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.2rem 1.8rem;
  text-align: left;
}

.tip-card {
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.tip-card-body {
  padding: 1rem 0.1rem 0;
}

/* Full-bleed header image, rounded on every corner like a real illustrated
   card rather than a small boxed-in icon -- this is the dominant visual
   element of each card, matching a proper blog/article grid instead of a
   bare list of tiny thumbnails. */
.tip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: var(--taitype-surface-soft);
  border: 1px solid var(--taitype-border);
  overflow: hidden;
}

.tip-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

/* Icon-badge header used for tips without a photo/diagram -- a big
   colour-tinted circle with a Font Awesome glyph, sized to match the photo
   headers exactly so the grid stays visually consistent whichever style a
   given card uses. */
.tip-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
}

.tip-icon-badge span {
  width: 30%;
  aspect-ratio: 1 / 1;
  max-width: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
}

.tip-tag {
  display: inline-block;
  margin: 0.95rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--taitype-zahra, #0a8a77);
}

.tip-icon-badge.tone-a { background: linear-gradient(160deg, rgba(3, 78, 79, 0.06), rgba(3, 78, 79, 0.02)); }
.tip-icon-badge.tone-a span { background: rgba(3, 78, 79, 0.12); color: #034e4f; }

.tip-icon-badge.tone-b { background: linear-gradient(160deg, rgba(255, 179, 0, 0.1), rgba(255, 179, 0, 0.02)); }
.tip-icon-badge.tone-b span { background: rgba(255, 179, 0, 0.18); color: #b8790a; }

.tip-icon-badge.tone-c { background: linear-gradient(160deg, rgba(91, 107, 214, 0.1), rgba(91, 107, 214, 0.02)); }
.tip-icon-badge.tone-c span { background: rgba(91, 107, 214, 0.16); color: #4b58b8; }

.tip-icon-badge.tone-d { background: linear-gradient(160deg, rgba(201, 65, 65, 0.09), rgba(201, 65, 65, 0.02)); }
.tip-icon-badge.tone-d span { background: rgba(201, 65, 65, 0.14); color: #b83e3e; }

.tip-icon-badge.tone-e { background: linear-gradient(160deg, rgba(10, 138, 92, 0.1), rgba(10, 138, 92, 0.02)); }
.tip-icon-badge.tone-e span { background: rgba(10, 138, 92, 0.16); color: #0a8a5c; }

body.dark .tip-icon-badge.tone-a { background: linear-gradient(160deg, rgba(10, 138, 119, 0.14), transparent); }
body.dark .tip-icon-badge.tone-b { background: linear-gradient(160deg, rgba(255, 179, 0, 0.14), transparent); }
body.dark .tip-icon-badge.tone-c { background: linear-gradient(160deg, rgba(91, 107, 214, 0.16), transparent); }
body.dark .tip-icon-badge.tone-d { background: linear-gradient(160deg, rgba(201, 65, 65, 0.16), transparent); }
body.dark .tip-icon-badge.tone-e { background: linear-gradient(160deg, rgba(10, 138, 92, 0.16), transparent); }

.tips-grid-heading {
  margin: 2.2rem 0 1rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--taitype-primary-strong);
  text-align: left;
}

.tips-grid-heading:first-of-type {
  margin-top: 0;
}

.tips-credit {
  margin: 1.4rem auto 0;
  max-width: 620px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--taitype-muted);
}

.tip-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--taitype-primary-strong);
}

.tip-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--taitype-muted);
}

.tips-cta {
  margin-top: 1.8rem;
  display: flex;
  justify-content: center;
}

.tips-cta .taitype-btn {
  flex: none;
  padding: 0 1.6rem;
}

@media (max-width: 760px) {
  .tips-card {
    padding: 1.1rem 0.9rem 1.4rem;
  }

  .tips-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .tip-icon,
  .tip-icon-badge {
    aspect-ratio: 16 / 10;
  }

  .tip-icon-badge span {
    font-size: 2.1rem;
  }
}
