/* ==========================================================
   Cover Letters Hub — centered, symmetrical two-tree layout
   Class prefix: clh-  (cover-letter-hub)
   Adapted from /css/resume-metrics/resume-metrics-hub.css (.rmh-*),
   which itself is a copy of the resume-guides hub family tree.
   The hero/section/header rules follow the centered treatment used
   on /resume-metrics. Loaded only by /cover-letters.
   ========================================================== */


/* ---------- Centered hero (mirror /resume-metrics) ---------- */

.clh-hero__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.clh-hl {
  color: #7ee2a8;
}


/* ---------- Section + centered header (mirror /resume-metrics) ---------- */

.clh-section {
  padding: 56px 24px;
}

.clh-section--white {
  background: #fff;
}

.clh-section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 30px;
}

.clh-section__eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a73e8;
  margin: 0 0 8px;
}

.clh-section__head h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.clh-lead {
  font-size: 15px;
  color: #4d5562;
  line-height: 1.55;
  margin: 0;
}

.clh-section__inner {
  max-width: 1180px;
  margin: 0 auto;
}


/* ---------- Family tree (.clh-fams) ---------- */

/* Centered flex-wrap (not a fixed grid) so an incomplete last row sits
   centered instead of left-aligned with a gap. Tree 1 has 14 families and
   Tree 2 has 7, neither a multiple of 5, so a plain repeat(5,1fr) grid would
   leave a ragged right edge. flex-basis keeps 5 per row on desktop; the
   -0.6px epsilon guards against sub-pixel wrap. See Cover Letter Page.md §3. */
.clh-fams {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: 16px;
}

.clh-fam {
  display: flex;
  flex-direction: column;
  flex: 0 1 calc((100% - 4 * 28px) / 5 - 0.6px);
  border: 0;
  background: transparent;
  padding: 0;
}

/* Data-color palette. Every color used across both trees is mapped here.
   blue/green/yellow/purple/orange/red/teal/stone/emerald/indigo/amber/rose/pink
   are carried over from the resume-guides + resume-metrics hub CSS. The
   cyan/sky/lime hexes are pulled from resume-template.css so each color used
   in Tree 1 (cyan, sky) and Tree 2 (cyan, indigo, sky, rose, purple, lime,
   amber) resolves. */
.clh-fam[data-color="blue"]    { --rf: #2563EB; --rf-card: rgba(37,99,235,0.05);  --rf-link: rgba(37,99,235,0.10);  --rf-link-hover: rgba(37,99,235,0.18); }
.clh-fam[data-color="green"]   { --rf: #16A34A; --rf-card: rgba(22,163,74,0.05);  --rf-link: rgba(22,163,74,0.10);  --rf-link-hover: rgba(22,163,74,0.18); }
.clh-fam[data-color="yellow"]  { --rf: #CA8A04; --rf-card: rgba(202,138,4,0.05);  --rf-link: rgba(202,138,4,0.10);  --rf-link-hover: rgba(202,138,4,0.18); }
.clh-fam[data-color="purple"]  { --rf: #8B5CF6; --rf-card: rgba(139,92,246,0.05); --rf-link: rgba(139,92,246,0.10); --rf-link-hover: rgba(139,92,246,0.18); }
.clh-fam[data-color="orange"]  { --rf: #EA580C; --rf-card: rgba(234,88,12,0.05);  --rf-link: rgba(234,88,12,0.10);  --rf-link-hover: rgba(234,88,12,0.18); }
.clh-fam[data-color="red"]     { --rf: #DC2626; --rf-card: rgba(220,38,38,0.05);  --rf-link: rgba(220,38,38,0.10);  --rf-link-hover: rgba(220,38,38,0.18); }
.clh-fam[data-color="teal"]    { --rf: #0D9488; --rf-card: rgba(13,148,136,0.05); --rf-link: rgba(13,148,136,0.10); --rf-link-hover: rgba(13,148,136,0.18); }
.clh-fam[data-color="slate"]   { --rf: #475569; --rf-card: rgba(71,85,105,0.05);  --rf-link: rgba(71,85,105,0.10);  --rf-link-hover: rgba(71,85,105,0.18); }
.clh-fam[data-color="stone"]   { --rf: #78716C; --rf-card: rgba(120,113,108,0.05);--rf-link: rgba(120,113,108,0.10);--rf-link-hover: rgba(120,113,108,0.18); }
.clh-fam[data-color="emerald"] { --rf: #059669; --rf-card: rgba(5,150,105,0.05);  --rf-link: rgba(5,150,105,0.10);  --rf-link-hover: rgba(5,150,105,0.18); }
.clh-fam[data-color="indigo"]  { --rf: #4F46E5; --rf-card: rgba(79,70,229,0.05);  --rf-link: rgba(79,70,229,0.10);  --rf-link-hover: rgba(79,70,229,0.18); }
.clh-fam[data-color="amber"]   { --rf: #D97706; --rf-card: rgba(217,119,6,0.05);  --rf-link: rgba(217,119,6,0.10);  --rf-link-hover: rgba(217,119,6,0.18); }
.clh-fam[data-color="rose"]    { --rf: #E11D48; --rf-card: rgba(225,29,72,0.05);  --rf-link: rgba(225,29,72,0.10);  --rf-link-hover: rgba(225,29,72,0.18); }
.clh-fam[data-color="pink"]    { --rf: #DB2777; --rf-card: rgba(219,39,119,0.05); --rf-link: rgba(219,39,119,0.10); --rf-link-hover: rgba(219,39,119,0.18); }
.clh-fam[data-color="cyan"]    { --rf: #0891B2; --rf-card: rgba(8,145,178,0.05);  --rf-link: rgba(8,145,178,0.10);  --rf-link-hover: rgba(8,145,178,0.18); }
.clh-fam[data-color="sky"]     { --rf: #0284C7; --rf-card: rgba(2,132,199,0.05);  --rf-link: rgba(2,132,199,0.10);  --rf-link-hover: rgba(2,132,199,0.18); }
.clh-fam[data-color="lime"]    { --rf: #65A30D; --rf-card: rgba(101,163,13,0.05);--rf-link: rgba(101,163,13,0.10);--rf-link-hover: rgba(101,163,13,0.18); }

.clh-fam__head {
  list-style: none;
  cursor: default;
  padding: 0;
  display: block;
  user-select: none;
}
.clh-fam__head::-webkit-details-marker { display: none; }

.clh-fam__name {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--rf, #1a73e8);
}

.clh-fam__name::after {
  content: '';
  display: block;
  width: 28px;
  height: 2.5px;
  background: var(--rf, #1a73e8);
  border-radius: 2px;
  margin-top: 6px;
}

.clh-fam__count {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.01em;
}

.clh-fam__chev {
  width: 12px;
  height: 12px;
  color: var(--rf, #6b7280);
  display: none;
  transition: transform 0.18s ease;
}

.clh-fam[open] .clh-fam__chev { transform: rotate(180deg); }

.clh-fam__body {
  padding: 0;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.clh-fam-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: var(--rf-link, rgba(37,99,235,0.10));
  color: #1c2330;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.clh-fam-card:hover {
  background: var(--rf-link-hover, rgba(37,99,235,0.18));
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.clh-fam-card__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--rf, #1a73e8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clh-fam-card__icon svg { width: 15px; height: 15px; }

.clh-fam-card__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coming-soon: lighter tint, muted text, faded icon, italic "Soon" badge. */
.clh-fam-card.is-soon {
  background: var(--rf-card, rgba(37,99,235,0.05));
  color: #6b7280;
  cursor: default;
  pointer-events: none;
}

.clh-fam-card.is-soon .clh-fam-card__icon {
  color: var(--rf, #9ca3af);
  opacity: 0.55;
}

.clh-fam-card__soon {
  margin-left: auto;
  padding-left: 6px;
  font-size: 10px;
  font-weight: 500;
  font-style: italic;
  color: #9ca3af;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Current-page (full-tone, reserved for individual cover-letter pages). */
.clh-fam-card.is-current {
  background: var(--rf, #1a73e8);
  color: #fff;
  cursor: default;
  pointer-events: none;
}

.clh-fam-card.is-current .clh-fam-card__icon { color: #fff; }

.clh-fam-card.is-current::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-left: auto;
  flex-shrink: 0;
}

/* Tablet: 3 per row, last row still centers */
@media (max-width: 1023px) {
  .clh-fams { gap: 24px; }
  .clh-fam { flex-basis: calc((100% - 2 * 24px) / 3 - 0.6px); }
}

/* Mobile: 1 per row, summary becomes clickable */
@media (max-width: 720px) {
  .clh-fams { gap: 18px; }
  .clh-fam { flex-basis: 100%; }
  .clh-fam__head {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .clh-fam__name { flex: 1; }
  .clh-fam__name::after { display: none; }
  .clh-fam__count { margin-top: 0; }
  .clh-fam__chev { display: inline-block; flex-shrink: 0; }
  .clh-fam__body { margin-top: 10px; }
}

/* Desktop force-open: <details> body always shown regardless of state */
@media (min-width: 721px) {
  .clh-fam .clh-fam__body { display: flex !important; }
}
