/* Contact and Resume page (task 2.2, owner's pick A): an engineering drawing's title block.
   Shared header, tokens and footer live in styles.css */

/* One ruled box. Phones: one column, a rule between cells.
   Wider: two columns (2fr 1fr), and the last cell spans both */
.title-block {
  display: grid;
  max-width: 56rem;
  margin-block: 0 var(--space-8);   /* the top comes from --page-top (styles.css) */
  border: 2px solid var(--color-accent);
}

.tb-cell {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-accent);
  scroll-margin-top: var(--space-5);   /* a jump to #email or #resume stops just above the cell */
}

.tb-cell:first-child {
  border-top: 0;
}

/* ", print": the printed sheet uses the same two-column layout, even on a narrow page */
@media (min-width: 48rem), print {
  .title-block {
    grid-template-columns: 2fr 1fr;
  }

  .tb-cell:nth-child(2) {
    border-top: 0;                     /* top row: the outer border is enough */
  }

  /* Left-column cells draw the vertical rule */
  .tb-cell:nth-child(odd):not(.tb-wide) {
    border-right: 1px solid var(--color-accent);
  }

  .tb-wide {
    grid-column: 1 / -1;
  }
}

.tb-cell p {
  margin: 0;
}

/* Small mono labels, like the label boxes on a drawing's title block */
.tb-label {
  display: block;
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--color-muted);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.tb-title {
  margin: 0;
}

/* .tb-cell .tb-note (0,2,0) beats .tb-cell p (0,1,1), so the margin applies */
.tb-cell .tb-note {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--color-muted);
}

/* An empty status line takes no space until it says something */
#copy-status:empty {
  margin: 0;
}

.tb-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--step-1);
  overflow-wrap: anywhere;             /* a long address wraps instead of widening the page on phones */
}

/* Outline pill, the same look as the carousel's Pause button.
   No display rule on purpose: it would override the hidden attribute */
.copy-button {
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--color-highlight);
}

/* A link styled as a filled button (it navigates to a file, so it stays <a>).
   Same pattern as the home page's .hero-button.is-primary */
.tb-button {
  display: inline-block;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-bg);              /* page colour on the accent: 7.8 by day, 11.0 at night */
  text-decoration: none;
}

.tb-button:hover {
  border-color: var(--color-highlight);
}

/* styles.css gives focused links a colour change instead of a ring; on a filled
   button that would clash, so this one gets the ring back (same fix as home) */
.tb-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  color: var(--color-bg);
  text-shadow: none;
}

.tb-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Keyboard way to the contact-sheet PDF (dragging needs a mouse). Hidden like the
   skip link until it gets keyboard focus, so the page looks the same for everyone else */
.tb-sheet-link:focus-visible {
  position: static;
  display: inline-block;
  width: auto;
  height: auto;
  margin-top: var(--space-2);
  clip-path: none;
  white-space: normal;
  font-size: var(--step--1);
}

/* =========================================================
   PRINT / SAVE AS PDF: just the title block, one clean sheet.
   This is also how assets/docs/contact-sheet.pdf is made (see README).
   Screen styles above are untouched: everything here only applies on paper
   ========================================================= */
@media print {
  @page {
    margin: 18mm;
  }

  /* Navigation, theme picker and buttons mean nothing on paper */
  .site-header,
  .site-footer,
  .skip-link,
  .copy-button,
  #copy-status,
  .tb-sheet-link {
    display: none;
  }

  .site-main {
    padding: 0;
  }

  .title-block {
    max-width: none;
    margin: 0;
  }

  /* The resume cell is left out: its relative link would point at wherever the
     PDF was made. The email cell takes the full width instead */
  #resume {
    display: none;
  }

  #email {
    grid-column: 1 / -1;
    border-right: 0;
  }
}
