/* ==========================================================
   LATEX RESUME: the gallery (/latex-resume/), the named
   template pages (/latex-resume/<template>/) and the builder
   page (/latex-resume-builder/).
   Loaded as the `resume` chunk (inc/resume.php). Built on the
   tool-page styles in style.css: same column, cards, tokens
   and buttons. The editor has its own stylesheet.

   On top of the tool page: more scale (a larger H1 and section
   headings), the builder as the page's highlighted card, and a few
   different surfaces for the sections (plain text, the slate tint,
   the page colour, one near-black panel) instead of a row of
   identical white cards. Theme tokens only.

   Blue (--color-primary) is for calls to action only: the filled
   buttons and the "Use this template" links (Saurabh, 14 Nov 2026).
   Every other accent here is the brand orange or a light tint of it,
   defined once below. Orange text on white is too weak for small
   type (about 3.3:1), so the chips use an orange tint with dark text.
   The classes the page content uses are listed in inc/resume.php.
   ========================================================== */

:root {
  --tpl-orange-tint: rgba(243, 94, 22, .10);   /* chips */
  --tpl-orange-wash: rgba(243, 94, 22, .03);   /* inside a highlighted card */
  --tpl-orange-glow: 0 0 0 3px rgba(243, 94, 22, .08), 0 6px 24px rgba(243, 94, 22, .10); /* --shadow-feature, in orange */
}

/* --- Intro: a larger title, the tagline as chips --- */
.tll-resume .tool-doc__intro { margin-bottom: 40px; }
.tll-resume .tool-doc__intro h1 {
  margin-bottom: 18px;
  font-size: clamp(2.3rem, 4.6vw, 3.1rem);
  line-height: 1.12;
}
.tll-resume .tool-doc__intro .tpl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.tpl-tags li {
  margin: 0;
  padding: 4px 13px;
  border-radius: var(--radius-pill);
  background: var(--tpl-orange-tint);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}
.tll-resume .tool-doc__intro .hero-sub { font-size: 18px; line-height: 1.65; }

/* --- Section rhythm: bigger headings, more room above each --- */
.tll-resume .tool-doc__section { margin-top: 96px; }
.tll-resume .tool-doc__section > h2,
.tll-resume .tpl-gallery__title {
  margin: 0 0 26px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
}

/* Anything that belongs to one example is in the page for every example;
   only the chosen one shows (resume.js switches them). */
.tool-doc [data-tpl-for][hidden] { display: none !important; }

/* --- Create your resume: the picker at the top of the gallery ---
   The star of the page: the highlighted card (orange border, the feature
   glow in orange, a faint warm wash inside), a large heading and button, and two real
   pages peeking in at the right edge on wider screens. */
.tpl-start {
  position: relative;
  overflow: hidden;
  padding: 40px 44px 42px;
  border: 1.5px solid var(--color-orange);
  border-radius: var(--radius-md);
  background: var(--tpl-orange-wash);
  box-shadow: var(--tpl-orange-glow);
}
.tpl-start__body {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 280px);
}
.tpl-start__title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.15rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.tpl-start__form { margin: 0; }
.tpl-start__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
/* Without JavaScript there is one list: it takes the whole row. */
.tpl-start__fields:has(> [data-tpl-start-field][hidden]) { grid-template-columns: minmax(0, 1fr); }
.tpl-start__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
/* The author's display rule above would otherwise beat the hidden attribute. */
.tpl-start__field[hidden] { display: none; }
.tpl-start__field label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
.tpl-start__field select {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 44px 0 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C5B56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 16px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text);
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  transition: border-color .2s ease;
}
.tpl-start__field select:hover { border-color: var(--color-text-muted); }
.tpl-start__field select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.tpl-start__submit { margin-top: 22px; }
.tpl-start__submit .btn {
  height: 54px;
  padding: 0 34px;
  font-size: 1rem;
}
.tpl-start__submit .btn > span { transition: transform .15s ease-out; }
.tpl-start__submit .btn:hover > span { transform: translateX(3px); }
.tpl-start__note {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-muted);
}
/* On the gallery: the link to the builder page, after the note. */
.tpl-start__note a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Two real pages at the right edge, cut off by the panel. */
.tpl-start__pages {
  position: absolute;
  top: 34px;
  right: 0;
  bottom: 0;
  width: 270px;
}
.tpl-start__page {
  position: absolute;
  width: 236px;
}
.tpl-start__page img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 0 0 1px var(--color-border-subtle), 0 10px 30px rgba(20, 20, 19, .12);
}
.tpl-start__page--back { top: 0; right: -78px; transform: rotate(6deg); }
.tpl-start__page--front { z-index: 1; top: 22px; right: 4px; transform: rotate(-3deg); }

/* --- The template cards under it --- */
.tpl-gallery__templates { margin-top: 88px; }

/* --- Pills: the switch between a template's examples (as on /tools/) --- */
.tpl-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.tpl-switch__pill {
  display: inline-block;
  padding: 4px 15px;
  border: 1px solid var(--color-text);
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tpl-switch__pill:hover,
.tpl-switch__pill[aria-current="true"] {
  background: var(--color-text);
  color: #fff;
}
.tpl-switch__pill:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Two cards or four: two equal columns, not an empty third column or a lone card
   on its own row. Wider
   screens only: phones keep their single column (these selectors would otherwise
   outrank the phone rule below). */
@media (min-width: 561px) {
  .tpl-grid:has(> li:nth-child(2):last-child),
  .tpl-grid:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-grid:has(> li:nth-child(2):last-child) .tpl-card__preview,
  .tpl-grid:has(> li:nth-child(4):last-child) .tpl-card__preview { aspect-ratio: 4 / 3; padding: 28px 40px 0; }
}

/* --- The grid of template cards ---
   Tall previews, a heavy name, the blue "Use this template" link (a call
   to action). On hover the card lifts a little and takes the orange
   border. */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* A lone card on the last row sits in the middle, not at the left: 7 cards are 3+3+1
   on wide screens and 2+2+2+1 on tablets (3 cards are 2+1 there). */
@media (min-width: 901px) {
  .tpl-grid > li:last-child:nth-child(3n+1):not(:first-child) { grid-column: 2; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .tpl-grid > li:last-child:nth-child(odd):not(:first-child) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 20px) / 2);
  }
}
.tpl-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tpl-card:hover,
.tpl-card:focus-within {
  border-color: var(--color-orange);
  box-shadow: var(--tpl-orange-glow);
  transform: translateY(-3px);
}
.tpl-card__preview {
  display: block;
  aspect-ratio: 1 / 1.12;
  padding: 24px 24px 0;
  overflow: hidden;
  background: var(--color-bg-page);
}
.tpl-card__preview img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 0 0 1px var(--color-border-subtle), 0 8px 24px rgba(0, 0, 0, .08);
}
.tpl-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 24px;
  border-top: 1px solid var(--color-border-subtle);
}
.tpl-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.tpl-card__title a { color: inherit; text-decoration: none; }
.tpl-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tpl-card__title a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.tpl-card__blurb {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
}
.tpl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
  padding: 0;
  list-style: none;
}
.tpl-chip {
  margin: 0;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-page);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.tpl-chip--style { background: var(--tpl-orange-tint); color: var(--color-text); }
.tpl-card__actions { margin: auto 0 0; }
/* The card's way into the editor: underlined blue text, not a button,
   so the page's one filled button stays "Create my resume". */
.tpl-card__use {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tpl-card__use::after {
  content: "\2192";
  display: inline-block;
  transition: transform .15s ease-out;
}
.tpl-card__use:hover { color: var(--color-primary-hover); text-decoration-thickness: 2px; }
.tpl-card__use:hover::after { transform: translateX(3px); }
.tpl-card__use:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.tpl-all {
  margin: 22px 0 0;
  font-size: 15px;
}

/* --- Section surfaces --- */

/* Plain text, no box. */
.tpl-prose { max-width: 760px; }
.tpl-prose p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text);
}
.tpl-prose p:last-child { margin-bottom: 0; }

/* A panel on the slate tint or on the page colour. */
.tpl-panel {
  padding: 36px 40px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-page);
}
.tpl-panel--slate {
  border-color: var(--color-slate-tint-2);
  background: var(--color-slate-tint);
}

/* The site's tick in a circle, in orange. */
.tpl-ticks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tpl-ticks > li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 32px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
}
.tpl-ticks > li:last-child { margin-bottom: 0; }
.tpl-ticks > li::before,
.tpl-why > li::before {
  content: "";
  position: absolute;
  top: .15em;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--color-orange);
  -webkit-mask: var(--icon-check-circle) center / contain no-repeat;
          mask: var(--icon-check-circle) center / contain no-repeat;
}

/* The "why" points: three in a row, a blue tick over a bold title. */
.tpl-why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tpl-why > li {
  position: relative;
  margin: 0;
  padding-top: 38px;
}
.tpl-why > li::before { top: 0; width: 26px; height: 26px; }
.tpl-why h3,
.tpl-steps h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.tpl-why p,
.tpl-steps p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* How it works: large orange serif numerals joined by a hairline. */
.tpl-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tpl-step;
}
.tpl-steps > li {
  position: relative;
  margin: 0;
  counter-increment: tpl-step;
}
.tpl-steps > li::before {
  content: counter(tpl-step);
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-orange);
}
/* From just after this numeral to just before the next one. */
.tpl-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 52px;
  right: -22px;
  border-top: 1px solid var(--color-border);
}

/* The ATS section: the explanation, then a near-black half with the
   text an ATS reads. */
.tpl-ats {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.tpl-ats__body { padding: 34px 36px; }
.tpl-ats__body > p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--color-text);
}
.tpl-ats__body > .tpl-ticks { margin: 0 0 18px; }
.tpl-ats__body > :last-child { margin-bottom: 0; }
.tpl-ats__body .tpl-small {
  font-size: 14px;
  color: var(--color-text-muted);
}
.tpl-ats-sample {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 300px;
  margin: 0;
  padding: 28px 28px 22px;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.tpl-ats-sample__label {
  display: block;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--color-text-on-dark-muted);
}
/* The text takes no height of its own, so the dark half is exactly as
   tall as the half beside it. The last lines fade into the panel (a
   mask, not a colour), so the panel never ends on half a line. */
.tpl-ats-sample__window {
  position: relative;
  flex: 1 1 auto;
}
.tpl-ats-sample__window > .tpl-ats-sample__text {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 5.1em), transparent calc(100% - .6em));
          mask-image: linear-gradient(to bottom, #000 calc(100% - 5.1em), transparent calc(100% - .6em));
}
.tpl-ats-sample__text {
  margin: 0;
  padding: 0;
  background: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text-on-dark);
}
.tpl-ats-sample__text code { padding: 0; background: none; font: inherit; color: inherit; }
/* On a template page the whole text is there: it scrolls inside the window. */
.tpl-ats-sample__window--scroll > .tpl-ats-sample__text { overflow: auto; padding-bottom: 3.4em; }
.tpl-ats-sample__window--scroll:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* The closing panel: the slate tint, dark text (the page keeps one dark
   accent, the ATS panel). */
.tpl-closing {
  padding: 40px 44px;
  border: 1px solid var(--color-slate-tint-2);
  border-radius: var(--radius-md);
  background: var(--color-slate-tint);
}
.tpl-closing p {
  max-width: 640px;
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
}

/* --- One template --- */
.tpl-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.tpl-detail__preview {
  padding: 36px 40px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-page);
}
.tpl-detail__preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--color-border-subtle), 0 14px 40px rgba(20, 20, 19, .10);
}
.tpl-detail__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tpl-detail__side .tool-doc__card { height: auto; }
/* "Use this template": the page's main card, highlighted like the builder. */
.tpl-detail__side .tpl-use {
  padding: 30px 30px 28px;
  border: 1.5px solid var(--color-orange);
  background: var(--tpl-orange-wash);
  box-shadow: var(--tpl-orange-glow);
}
.tpl-use .tool-doc__card-title { font-size: 24px; font-weight: 600; }
.tpl-detail__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 14px;
}
.tpl-detail__actions .btn { width: 100%; height: 54px; font-size: 1rem; }
/* A button inside a card is a button, not an in-text link. */
.tool-doc__card a.btn.btn--primary,
.tool-doc__card a.btn.btn--primary:hover { color: #fff; text-decoration: none; }
.tpl-detail__small {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-text-muted);
}
.tpl-facts { margin: 6px 0 14px; }
.tpl-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 14.5px;
}
.tpl-facts > div:last-child { border-bottom: 0; }
.tpl-facts dt { color: var(--color-text-muted); }
.tpl-facts dd { margin: 0; text-align: right; font-weight: 600; }

/* --- Phones and narrow screens --- */
@media (max-width: 900px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-detail { grid-template-columns: minmax(0, 1fr); }
  .tpl-why,
  .tpl-steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .tpl-steps > li:not(:last-child)::after { display: none; }
  .tpl-steps > li::before { margin-bottom: 10px; font-size: 44px; }
  .tpl-ats { grid-template-columns: minmax(0, 1fr); }
  .tpl-ats-sample { min-height: 320px; }
}
/* No room for the pages beside the form: the form takes the panel. */
@media (max-width: 760px) {
  .tpl-start__pages { display: none; }
  .tpl-start__body { max-width: none; }
}
@media (max-width: 768px) {
  .tll-resume .tool-doc__section { margin-top: 72px; }
  .tll-resume .tool-doc__intro .hero-sub { font-size: 17px; }
  .tpl-panel { padding: 26px 22px; }
  .tpl-ats__body { padding: 26px 22px; }
  .tpl-ats-sample { padding: 22px 20px 18px; }
  .tpl-closing { padding: 30px 24px; }
  .tpl-closing p { font-size: 16px; }
}
@media (max-width: 560px) {
  .tpl-start { padding: 26px 20px 28px; }
  .tpl-start__fields { grid-template-columns: minmax(0, 1fr); }
  .tpl-start__submit .btn { width: 100%; }
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .tpl-card__preview { aspect-ratio: 1 / .9; }
  .tpl-detail__preview { padding: 16px; }
  .tpl-detail__side .tpl-use { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .tpl-card,
  .tpl-switch__pill,
  .tpl-start__field select,
  .tpl-start__submit .btn > span,
  .tpl-card__use::after { transition: none; }
  .tpl-card:hover,
  .tpl-card:focus-within { transform: none; }
  .tpl-start__submit .btn:hover > span,
  .tpl-card__use:hover::after { transform: none; }
}
