/* ==================================================================
   Trade page (/trade) and its thank-you page (/thanks/trade).
   Desktop values come from Paper, "DRD Website Redesign", Version 4,
   artboard "05 Trade page" and its two tab artboards (1440 wide).
   site.css supplies .wrap, .eyebrow, .btn, .text-link and .photo-chip.
   The form block (.fm-*) and the thank-you block (.ty-*) match
   pages/millwork.css; move both into site.css when the forms are wired.
   ================================================================== */

/* ------------------------------------------------------------ shared type */
.tr-h2 { font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: 56px; letter-spacing: -.015em; }
.tr-label {
  font-family: var(--font-label); font-weight: 500; font-size: 12px; line-height: 16px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--drd-taupe);
}
.tr-note { font-family: var(--font-label); font-size: 13px; line-height: 18px; color: var(--drd-taupe); }
#apply, #in-your-terms { scroll-margin-top: 0; }

/* ------------------------------------------------------------ hero */
.tr-hero { padding-block: 56px 88px; }
.tr-hero-grid { display: grid; grid-template-columns: minmax(0, 540fr) minmax(0, 700fr); gap: 72px; align-items: center; }
.tr-hero-copy { display: flex; flex-direction: column; gap: 30px; }
.tr-hero-title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -.02em;
  font-size: min(60px, calc((100vw - 200px) * .047)); line-height: 1.1;   /* one line per phrase, as in Paper */
}
.tr-hero-title span, .tr-hero-title em { display: block; }
.tr-hero-title em { color: var(--drd-bronze); line-height: 1.133; }
.tr-hero-lede { max-width: 500px; font-size: 19px; line-height: 31px; }
.tr-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; padding-top: 6px; }
.tr-hero-actions .btn { min-height: 52px; padding: 0 30px; }
.tr-hero-actions .text-link { align-self: center; }
.tr-hero-photo { position: relative; aspect-ratio: 700 / 540; overflow: hidden; background: var(--drd-stone); }
.tr-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.tr-hero-photo .photo-chip { left: 20px; bottom: 20px; padding: 8px 12px; color: var(--drd-espresso); }

/* ------------------------------------------------------------ what you get */
.tr-get { background: var(--drd-stone); padding-block: 88px; }
.tr-get-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; padding-bottom: 40px; }
.tr-get-aside { width: 420px; flex-shrink: 0; font-size: 17px; line-height: 28px; }
.tr-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; }
.tr-benefit { display: flex; flex-direction: column; gap: 12px; padding: 28px 0 32px; border-top: 1px solid var(--drd-espresso); }
/* The left item's rule runs across the gap, so each row reads as one line */
.tr-benefit:nth-child(odd) { margin-right: -64px; padding-right: 64px; }
.tr-benefit:nth-last-child(-n + 2) { padding-bottom: 0; }
.tr-benefit-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 34px; }
.tr-benefit-body { max-width: 540px; font-size: 17px; line-height: 28px; }
.tr-benefit .tr-note + .tr-note { margin-top: -8px; }

/* ------------------------------------------------------------ how it runs */
.tr-run { padding-block: 88px; }
.tr-h2-sm { font-size: 40px; line-height: 48px; letter-spacing: -.01em; padding-bottom: 40px; }
.tr-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px; }
.tr-step { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--drd-espresso); }
.tr-step-num { font-family: var(--font-display); font-size: 40px; line-height: 44px; color: var(--drd-bronze); font-feature-settings: "lnum"; }
.tr-step-title { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 28px; }
.tr-step-body { font-size: 16px; line-height: 26px; }

/* ------------------------------------------------------------ in your terms (Hunter Green) */
.tr-terms { background: var(--drd-hunter); color: var(--drd-cream); padding-block: 80px 88px; }
.tr-terms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 36px; }
.tr-h2-terms { font-size: 44px; line-height: 52px; letter-spacing: -.01em; color: var(--drd-cream); }
.tr-tabs { display: flex; gap: 8px; padding: 5px; border: 1px solid rgba(230, 224, 213, .4); border-radius: 999px; }
.tr-tab {
  min-height: 40px; padding: 11px 22px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-family: var(--font-label); font-weight: 500; font-size: 14px; line-height: 18px; color: var(--drd-stone);
  transition: background-color .2s ease, color .2s ease;
}
.tr-tab:hover { background: rgba(250, 248, 245, .12); color: var(--drd-cream); }
.tr-tab[aria-selected="true"] { background: var(--drd-cream); color: var(--drd-hunter); }
.tr-tab:focus-visible { outline: 2px solid var(--drd-cream); outline-offset: 3px; }

.tr-panel { padding-top: 32px; border-top: 1px solid rgba(230, 224, 213, .4); }
.tr-panel[hidden] { display: none; }
.tr-panel:focus-visible { outline: 2px solid var(--drd-cream); outline-offset: 8px; }
.tr-panel-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.tr-panel-list li { display: flex; flex-direction: column; gap: 12px; }
.tr-panel h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 30px; color: var(--drd-cream); }
.tr-panel-list p { font-size: 16px; line-height: 26px; color: var(--drd-stone); }
.tr-panel-label { display: none; }
/* Before the script runs, show only the first panel (no jump when it starts) */
.js [data-tabs]:not(.tabs-ready) .tr-panel + .tr-panel { display: none; }
/* Without JavaScript: no tab bar, the three panels stack under their labels */
.no-js .tr-tabs { display: none; }
.no-js .tr-panel + .tr-panel { margin-top: 48px; }
.no-js .tr-panel-label {
  display: block; padding-bottom: 20px;
  font-family: var(--font-label); font-weight: 500; font-size: 13px; line-height: 16px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--drd-stone);
}

/* ------------------------------------------------------------ apply */
.tr-apply { background: var(--drd-stone); padding-block: 88px 96px; }
.tr-apply-grid { display: grid; grid-template-columns: minmax(0, 472fr) minmax(0, 744fr); gap: 96px; align-items: start; }
.tr-apply-copy { display: flex; flex-direction: column; gap: 32px; }
.tr-apply-copy .tr-h2 { max-width: 9.5em; }
.tr-apply-block { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--drd-espresso); }
.tr-apply-text { font-size: 17px; line-height: 28px; }

/* ------------------------------------------------------------ form (same as millwork.css) */
.fm-card { background: var(--drd-cream); padding: 44px; }
.fm { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 24px; }
.fm[hidden] { display: none; }
.fm-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; grid-column: 1 / -1; }
.fm-half { grid-column: span 3; }
.fm-third { grid-column: span 2; }
.fm-label {
  font-family: var(--font-label); font-weight: 500; font-size: 12px; line-height: 16px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--drd-taupe);
}
.fm-input {
  display: block; width: 100%; height: 52px; margin: 0; padding: 0 16px;
  border: 1px solid rgba(107, 93, 82, .8); border-radius: 0; background-color: var(--drd-cream);
  font-family: var(--font-label); font-size: 15px; line-height: 20px; color: var(--drd-espresso);
  -webkit-appearance: none; appearance: none; transition: border-color .2s ease;
}
.fm-input::placeholder { color: var(--drd-taupe); opacity: 1; }
.fm-input:hover { border-color: var(--drd-espresso); }
.fm-input:focus { outline: 2px solid var(--drd-espresso); outline-offset: -1px; border-color: var(--drd-espresso); }
.fm-select {
  padding-right: 44px; cursor: pointer;
  background: var(--drd-cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231B1714' stroke-width='1.4'/%3E%3C/svg%3E") right 16px center / 12px 8px no-repeat;
}
.fm-select:invalid { color: var(--drd-taupe); }
.fm-select:has(option[value=""]:checked) { color: var(--drd-taupe); }
.fm-select option { color: var(--drd-espresso); }
.fm-textarea { height: 96px; min-height: 96px; padding-block: 15px; resize: vertical; }
.fm-input[aria-invalid="true"] { border-color: var(--drd-crimson); }
.fm-error { font-family: var(--font-label); font-size: 13px; line-height: 18px; color: var(--drd-crimson); }
.fm-submit { grid-column: 1 / -1; width: 100%; min-height: 54px; }

.fm-done { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.fm-done[hidden] { display: none; }
.fm-done:focus { outline: none; }
.fm-done-eyebrow {
  font-family: var(--font-label); font-weight: 500; font-size: 12px; line-height: 16px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--drd-taupe);
}
.fm-done-title { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 44px; letter-spacing: -.01em; }
.fm-done-body { max-width: 520px; font-size: 17px; line-height: 28px; }
.fm-done-btn { margin-top: 8px; min-height: 52px; min-width: 240px; }

/* ------------------------------------------------------------ thank-you page (same as millwork.css) */
.ty { padding-block: 72px 112px; }
.ty-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.ty-emblem { width: 280px; height: auto; margin-bottom: 12px; }
.ty-eyebrow {
  font-family: var(--font-label); font-weight: 500; font-size: 12px; line-height: 16px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--drd-taupe);
}
.ty-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, calc(1rem + 2.2vw), 48px); line-height: 1.17; letter-spacing: -.01em; }
.ty-body { max-width: 560px; font-size: 18px; line-height: 29px; color: var(--drd-taupe); }
.ty-wrap .ty-body + .ty-body { margin-top: -14px; }
.ty-btn { width: 240px; min-height: 52px; margin-top: 4px; }

/* ------------------------------------------------------------ narrower screens */
@media (max-width: 1279px) {
  #apply, #in-your-terms { scroll-margin-top: 112px; }   /* clear the sticky header */
  .tr-hero-grid { gap: 56px; }
  .tr-hero-title { font-size: calc((100vw - 136px) * .047); }
  .tr-apply-grid { gap: 56px; grid-template-columns: minmax(0, 400fr) minmax(0, 744fr); }
  .tr-tab { min-height: 44px; padding-block: 13px; }
  .fm-card { padding: 36px; }
  .fm { column-gap: 16px; }
}
@media (max-width: 1179px) {
  .tr-steps { gap: 24px; }
  .tr-step-title { font-size: 20px; line-height: 26px; }
}
@media (max-width: 1023px) {
  .tr-hero { padding-block: 48px 88px; }
  .tr-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .tr-hero-copy { gap: 26px; }
  .tr-hero-title { font-size: clamp(38px, 7vw, 60px); }
  .tr-get, .tr-run { padding-block: 72px; }
  .tr-get-head { flex-direction: column; align-items: flex-start; gap: 20px; padding-bottom: 32px; }
  .tr-get-aside { width: auto; max-width: 520px; }
  .tr-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tr-step {
    display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; row-gap: 4px;
    padding-block: 18px 20px;
  }
  .tr-step:last-child { border-bottom: 1px solid var(--drd-espresso); }
  .tr-step-num { grid-row: 1 / span 2; font-size: 32px; line-height: 36px; }
  .tr-step-title { font-size: 22px; line-height: 28px; }
  .tr-h2-sm { padding-bottom: 28px; }
  .tr-terms { padding-block: 72px; }
  .tr-terms-head { flex-direction: column; align-items: flex-start; gap: 24px; padding-bottom: 28px; }
  .tr-panel-list { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .tr-apply { padding-block: 72px 80px; }
  .tr-apply-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .tr-apply-copy .tr-h2 { max-width: none; }
}
@media (max-width: 767px) {
  #apply, #in-your-terms { scroll-margin-top: 64px; }
  .tr-hero { padding-block: 32px 64px; }
  .tr-hero .eyebrow { gap: 12px; letter-spacing: .16em; }
  .tr-hero .eyebrow::before { flex-basis: 24px; }
  .tr-hero-lede { font-size: 17px; line-height: 28px; }
  .tr-hero-actions { flex-direction: column; align-items: stretch; gap: 20px; }
  .tr-hero-actions .btn { width: 100%; }
  .tr-hero-actions .text-link { align-self: flex-start; }
  .tr-hero-photo { margin-inline: calc(-1 * var(--gutter)); aspect-ratio: 4 / 3; }
  .tr-hero-photo .photo-chip { left: var(--gutter); bottom: 16px; }
  .tr-h2 { font-size: 36px; line-height: 44px; }
  .tr-h2-sm, .tr-h2-terms { font-size: 32px; line-height: 40px; }
  .tr-get, .tr-run { padding-block: 64px; }
  .tr-get-aside { font-size: 17px; }
  .tr-benefits { grid-template-columns: minmax(0, 1fr); }
  .tr-benefit, .tr-benefit:nth-child(odd) { margin-right: 0; padding: 24px 0 28px; }
  .tr-benefit:last-child { padding-bottom: 0; }
  .tr-benefit-title { font-size: 26px; line-height: 32px; }
  .tr-terms { padding-block: 64px; }
  .tr-tabs { align-self: stretch; }
  .tr-tab { flex: 1 1 0; padding-inline: 8px; }
  .tr-apply { padding-block: 64px 72px; }
  .fm-card { margin-inline: calc(-1 * var(--gutter)); padding: 32px var(--gutter) 36px; }
  .fm-half, .fm-third { grid-column: 1 / -1; }
  .fm { gap: 18px; }
  .fm-input { font-size: 16px; }          /* 16 px stops iOS zooming into the field */
  .fm-done-title { font-size: 30px; line-height: 38px; }
  .fm-done-btn { width: 100%; }
  .ty { padding-block: 48px 72px; }
  .ty-emblem { width: 240px; }
  .ty-body { font-size: 17px; line-height: 28px; }
  .ty-btn { width: 100%; max-width: 320px; }
}
@media (max-width: 374px) {
  .tr-hero .eyebrow::before { display: none; }
  .tr-tab { font-size: 13px; padding-inline: 4px; }
}
