/* The template gallery. The pages are the design; everything here gets out of
   their way. */

.tpl-head { max-width: 760px; margin: 0 auto; padding: 56px 24px 8px; text-align: center; }
.tpl-head h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.15; letter-spacing: -0.8px; }
.tpl-head p { color: var(--ink-dim); font-size: 15px; line-height: 1.65; margin: 0 auto; max-width: 62ch; }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center;
  margin-top: 22px; font-size: 12.5px; color: var(--ink-faint);
}

.grade {
  font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; border: 1px solid;
}
.grade.safe    { color: var(--good); border-color: rgba(94,234,212,.35); }
.grade.caution { color: var(--warn); border-color: rgba(255,176,87,.35); }
.grade.risky   { color: var(--bad);  border-color: rgba(255,122,122,.35); }

.tpl-gallery {
  max-width: 1560px; margin: 0 auto; padding: 40px 24px 20px;
  /* 340px, not 230. At thumbnail size every resume is grey lines on white and
     twenty layouts look like one — the differences are real but too small to
     see, which is exactly what was reported. */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px;
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* minmax(0, 1fr) above and this overflow are what keep a 794px page inside a
   230px card: a grid track sized to its content would be the page's width. */
.sheet-frame { overflow: hidden; background: #fff; }
.sheet-scale { display: block; transform-origin: top left; }
.sheet-scale .paper { box-shadow: none; }

.card-foot { padding: 14px 15px 16px; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.card-top h2 { margin: 0; font-size: 15px; letter-spacing: -.2px; flex: 1; }
.card-foot p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }

.tpl-foot { max-width: 620px; margin: 0 auto; padding: 20px 24px 80px; text-align: center; }
.tpl-foot p { color: var(--ink-dim); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }

@media (max-width: 760px) {
  .tpl-head h1 { font-size: 26px; }
  .tpl-gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
}

/* ---------------------------------------------------- one template, full size */
/* A card is for browsing; this is for deciding. Nobody commits to a layout
   from a 340px picture of it. */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,6,10,0.88); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 26px 20px 60px;
}
.viewer[hidden] { display: none; }
.viewer-bar {
  position: sticky; top: 0; z-index: 2;
  width: 100%; max-width: 900px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px;
  background: rgba(14,17,24,0.96); border: 1px solid var(--line); border-radius: 12px;
}
.viewer-bar h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.viewer-bar p { margin: 0; font-size: 13px; color: var(--ink-faint); flex-basis: 100%; }
.viewer-bar .spacer { flex: 1; }
.viewer-sheet { box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.viewer-sheet .paper { box-shadow: none; }
.viewer-nav { display: flex; gap: 6px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 900px; margin: 30px auto 0; padding: 0 24px;
}
.filter {
  font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-dim);
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px;
}
.filter:hover { color: var(--ink); border-color: var(--accent); }
.filter span { color: var(--ink-faint); font-size: 11.5px; margin-left: 3px; }
.filter[aria-pressed="true"] {
  color: #08090d; border-color: transparent; font-weight: 600;
  background: linear-gradient(135deg, #cfe2ff, #8fb9ff 55%, #c4b5fd);
}
.filter[aria-pressed="true"] span { color: rgba(8,9,13,.6); }

.card .cta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.card .sheet-frame { cursor: zoom-in; }
