/* Page sections (sections/<slug>/render.php). The design laid these out with Tailwind utilities, which the site
   does not load; these are the same rules as classes. Everything else in a section is the design system (ds-*.css).
   Breakpoints as the design: 640, 768 and 1024px. Loaded on every page, so the tour page shares them. */

.ub-sx-is-attached { padding-top: 0; }
.ub-sx-after-head { margin-top: 18px; }
.ub-sx-act { margin-top: 32px; }

/* Text beside a photo */
.ub-sx-split__line { margin-top: 24px; max-width: 58ch; font-size: 19px; line-height: 1.55; color: var(--ub-salt); }
.ub-sx-body { margin-top: 16px; max-width: 62ch; }
.ub-sx-tilt { --tilt: 2.5deg; }
.ub-sx-tilt:hover { --tilt: 0deg; }
.ub-sx-split--left > .ub-print { order: -1; --tilt: -2.5deg; }

/* Photo cards: tilted photos, three to a row, the middle one a little lower */
.ub-sx-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px 22px; margin: 0; padding: 0; list-style: none; }
.ub-sx-cards .ub-print { --tilt: -2.5deg; }
.ub-sx-cards li:nth-child(3n+2) .ub-print { --tilt: 2deg; }
.ub-sx-cards li:nth-child(3n) .ub-print { --tilt: -1.5deg; }
.ub-sx-cards .ub-print:hover { --tilt: 0deg; }
.ub-sx-cards .ub-h3 { margin-top: 40px; }
.ub-sx-cards .ub-body { margin-top: 16px; max-width: 40ch; }
@media (min-width: 768px) {
  .ub-sx-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .ub-sx-cards li:nth-child(3n+2) { margin-top: 30px; }
}

/* Nudge */
.ub-sx-nudge { position: relative; }
.ub-sx-nudge > .ub-tape { position: absolute; left: -10px; top: -20px; z-index: 1; }
.ub-sx-nudge > .ub-print { width: 88px; height: 88px; --tilt: -4deg; }
.ub-sx-nudge:not(:has(> .ub-print)) { grid-template-columns: minmax(0, 1fr) auto; }

/* Reviews without the ranking: the bubbles take the full width */
.ub-proof.ub-proof--bare { grid-template-columns: minmax(0, 1fr); }

/* Form beside a side column */
.ub-sx-form { display: grid; row-gap: 64px; align-items: start; }
.ub-sx-form__side { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.ub-sx-form__side .ub-h3 + .ub-steps { margin-top: 32px; }
.ub-sx-form__label { margin: 0 0 16px; font-family: var(--ub-display); font-weight: 400; text-transform: uppercase; font-size: 27px; line-height: 1; letter-spacing: .035em; color: var(--ub-green); }
.ub-sx-form__note { padding-top: 24px; border-top: 1px solid var(--ub-line); }
.ub-sx-form__note b { font-weight: 600; color: var(--ub-salt); }
.ub-sx-form__note a { font-weight: 600; color: var(--ub-salt); text-decoration: underline; text-decoration-color: var(--ub-green); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color var(--ub-fast); }
.ub-sx-form__note a:hover { color: var(--ub-green); }
@media (min-width: 1024px) {
  .ub-sx-form { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px; }
  .ub-sx-form__main { grid-column: span 7; }
  .ub-sx-form__side { grid-column: 9 / span 4; }
  .ub-sx-form--solo .ub-sx-form__main { grid-column: 1 / span 8; }
}

/* Signposts */
.ub-sx-signposts__item .ub-print { margin-bottom: 12px; }
.ub-sx-signposts__item .ub-link { margin-top: auto; align-self: flex-start; padding-top: 8px; }
.ub-sx-signposts__item:focus-within { outline: 3px solid var(--ub-salt); outline-offset: 4px; }
.ub-sx-signposts__item :focus-visible { outline: 0; }
.ub-sx-signposts__end { margin-top: clamp(72px, 9.5vw, 136px); }

/* Heading and text */
.ub-sx-text { max-width: 760px; }

/* Every section's own settings: space above and below, and which screens it shows on */
.ub-sx-pt-sm { padding-top: var(--ub-sec-sm); }
.ub-sx-pb-sm { padding-bottom: var(--ub-sec-sm); }
.ub-sx-pt-0 { padding-top: 0; }
.ub-sx-pb-0 { padding-bottom: 0; }
@media (max-width: 767px) { .ub-sx-only-wide { display: none !important; } }
@media (min-width: 768px) { .ub-sx-only-phone { display: none !important; } }

/* Tape on a photo (Photo cards, Text beside a photo) */
.ub-print > .ub-sx-tape { position: absolute; left: 14px; top: 14px; z-index: 1; }
.ub-sx-cards__link { margin-top: 18px; }

/* Video beside text, with the video on the right */
@media (min-width: 861px) { .ub-sx-film--right > :first-child { order: 2; } }

/* Heading and text, in the middle */
.ub-sx-text--centre { margin-inline: auto; text-align: center; }
.ub-sx-text--centre .ub-sx-body { margin-inline: auto; }

/* Only editors see these: a section that could not be drawn, an empty preview */
.ub-sx-error, .ub-sx-empty { margin: 24px auto; padding: 16px 20px; max-width: 720px; border: 1px dashed var(--ub-line); color: var(--ub-salt); font: 500 15px/1.5 var(--ub-body, sans-serif); }

/* Legal text (Privacy policy): heading and line in a column that stays in view, text on the right (4 / 7 of 12) */
.ub-sx-legal { display: grid; row-gap: 40px; align-items: start; }
.ub-sx-legal__body { min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.ub-sx-is-attached .ub-sx-legal { margin-top: clamp(24px, 4vw, 56px); }
@media (min-width: 1024px) {
  .ub-sx-legal { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px; }
  .ub-sx-legal__head { grid-column: span 4; position: sticky; top: calc(var(--ub-header-h, 80px) + 24px); }
  .ub-sx-legal__body { grid-column: 6 / span 7; }
}
.ub-sx-legal__head .ub-sub { margin-top: 16px; }
.ub-sx-legal__text li::marker { color: var(--ub-green); }
.ub-sx-legal__text li + li { margin-top: 8px; }
.ub-sx-legal__text ol { list-style: decimal; padding-left: 22px; }
.ub-sx-legal__text h3 { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--ub-line); }
.ub-sx-legal__text > h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ub-sx-num { color: var(--ub-green); }
.ub-sx-legal__text address { margin-top: 16px; font-style: normal; color: var(--ub-salt); }
.ub-sx-legal__text b, .ub-sx-legal__text strong { font-weight: 600; color: var(--ub-salt); }
.ub-sx-legal__text small { font-size: 14px; color: var(--ub-dim, var(--ub-mist)); }

/* Tables in formatted text: the site's table, stacking into one block per row on phones */
.ub-sx-tablewrap { margin-top: 24px; }
.ub-sx-table thead th { font-size: 14px; color: var(--ub-mist); border-bottom-color: var(--ub-line-strong, var(--ub-line)); }
.ub-sx-cell { display: none; }
.ub-sx-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (min-width: 640px) { .ub-sx-tablewrap { overflow-x: auto; } }
@media (max-width: 639px) {
  .ub-sx-table, .ub-sx-table tbody, .ub-sx-table tr { display: block; }
  .ub-sx-table { border-top: 1px solid var(--ub-line); }
  .ub-sx-table thead { display: none; }
  .ub-sx-table tr { padding: 16px 0; border-bottom: 1px solid var(--ub-line); }
  .ub-sx-table tbody th { display: block; padding: 0 0 8px; border: 0; }
  .ub-sx-table td { display: flex; gap: 16px; padding: 6px 0; border: 0; }
  .ub-sx-cell { display: block; flex: none; width: 96px; font-size: 13px; font-weight: 600; color: var(--ub-dim, var(--ub-mist)); }
}

/* Tick boxes in a form (the data request form) */
.ub-sx-checks { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--ub-line); min-width: 0; }
.ub-sx-checks__error { margin-bottom: 8px; }

/* Photo wall: tilted prints, two across on phones, up to three on tablets and four on wide screens
   (render.php picks the counts so the last row is never one photo where it can help it) */
.ub-sx-wall { display: grid; grid-template-columns: repeat(var(--cols-sm, 2), minmax(0, 1fr)); gap: 22px 14px; margin: 0; padding: 0; list-style: none; }
.ub-sx-wall > .ub-print { aspect-ratio: 4 / 5; --tilt: -2.5deg; }
.ub-sx-wall > .ub-print:nth-child(3n+2) { --tilt: 2deg; }
.ub-sx-wall > .ub-print:nth-child(3n) { --tilt: -1deg; }
.ub-sx-wall > .ub-print:nth-child(even) { translate: 0 12px; }
.ub-sx-wall > .ub-print:hover { --tilt: 0deg; z-index: 1; }
.ub-sx-wall .ub-sx-tape { font-size: 20px; left: 10px; top: 10px; }
.ub-sx-wall + .ub-sx-act { margin-top: 48px; }
@media (min-width: 768px) {
  .ub-sx-wall { grid-template-columns: repeat(var(--cols-mid, 3), minmax(0, 1fr)); gap: 32px 24px; }
  .ub-sx-wall .ub-sx-tape { font-size: 25px; left: 14px; top: 14px; }
}
@media (min-width: 1024px) {
  .ub-sx-wall { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
}

/* Tick list: the tour page's checklist, across the page */
.ub-sx-ticks { max-width: 1040px; }

/* Questions and answers: the heading on the left, the questions on the right (5 / 7 of 12), as the tour page's fine print */
.ub-sx-qa { display: grid; align-items: start; row-gap: 40px; }
.ub-sx-qa__head .ub-sx-body { max-width: 40ch; }
.ub-sx-qa__p + .ub-sx-qa__p { margin-top: 12px; }
@media (min-width: 1024px) {
  .ub-sx-qa { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px; }
  .ub-sx-qa__head { grid-column: span 5; position: sticky; top: calc(var(--ub-header-h, 80px) + 24px); }
  .ub-sx-qa > .ub-acc { grid-column: span 7; }
}
