/* Sectioned vehicle photography */
html:has(.section-gallery:target) { scroll-behavior: auto; }
.section-gallery {
  min-width: 0;
  scroll-margin-top: .25rem;
  padding: clamp(.8rem, 1.6vw, 1.45rem);
  border: 1px solid #c6cec1;
  border-radius: .65rem;
  background: #fafbf6;
}
.album-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin-bottom: .95rem;
}
.album-heading h2 {
  margin: 0;
  color: #20382d;
  font: 400 clamp(1.65rem, 2.75vw, 2.55rem)/1.05 Georgia, serif;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.album-heading > span {
  color: #56655b;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.album-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .85rem;
}
.album-switch .album-tab {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .48rem;
  padding: .35rem .7rem;
  min-height: 44px;
  min-width: 0;
  border: 1px solid #c5cec1;
  border-radius: .32rem;
  background: #f5f7ef;
  color: #33473b;
  font: 550 .89rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.album-tab small { font-size: .78rem; font-weight: 480; opacity: .88; font-variant-numeric: tabular-nums; }
.album-switch .album-tab:hover { border-color: #748a78; }
.album-switch .album-tab[aria-pressed="true"],
.album-switch .album-tab[aria-current="true"] { color: #fff8e9; border-color: #244c3b; background: #244c3b; }
.section-gallery .gallery-stage { border: 1px solid #23362d; border-radius: .35rem; background: #18211d; }
.section-gallery .gallery-count, .album-viewer .gallery-count {
  left: .6rem;
  top: .6rem;
  border: 1px solid #b4bcb04f;
  border-radius: .25rem;
  background: #16261eeb;
  padding: .45rem .6rem;
  font-size: .8rem;
  letter-spacing: .012em;
}
.section-gallery .gallery-step, .section-gallery .gallery-expand,
.album-viewer .gallery-step, .album-viewer .dialog-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #d6ded091;
  border-radius: 50%;
  color: #fbf7e9;
  background: #15251edb;
}
.section-gallery .gallery-step:hover, .section-gallery .gallery-expand:hover,
.album-viewer .gallery-step:hover, .album-viewer .dialog-close:hover { background: #243d32; }
.section-gallery .thumb { border-radius: .35rem; }
.section-gallery .thumb[aria-current="true"], .section-gallery .thumb[aria-pressed="true"] {
  border-color: #305440;
  outline: 1px solid #305440;
}
.section-gallery .media-pager a { color: #304f3a; text-decoration: underline; text-underline-offset: .22rem; }
.section-gallery .media-pager a, .section-gallery .media-pager button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.section-gallery :is(button,a):focus-visible, .album-viewer button:focus-visible {
  outline: 3px solid #ce923b;
  outline-offset: 2px;
}
#sheet.album-viewer[open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #101814;
  overflow: hidden;
}
#sheet.album-viewer .dialog-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  padding: max(.9rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
#sheet.album-viewer .album-heading { padding-right: 3.4rem; justify-content: flex-start; min-height: 2.75rem; align-items: center; margin-bottom: .6rem; }
#sheet.album-viewer .album-heading h2 { font-size: clamp(1.25rem, 2.3vw, 2rem); max-width: 100%; color: #f5f0df; }
#sheet.album-viewer .album-heading > span { color: #c4d1c6; }
#sheet.album-viewer .album-tab { color: #d8e3d8; border-color: #486252; background: #203329; }
#sheet.album-viewer .album-tab[aria-pressed="true"] { color: #25352b; background: #ede1bf; border-color: #ede1bf; }
#sheet.album-viewer .gallery-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  background: #090e0b;
  border: 1px solid #33473a;
  border-radius: .35rem;
}
#sheet.album-viewer .album-original {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .75rem;
  border: 1px solid #91a394;
  border-radius: .3rem;
  background: #17271fe8;
  color: #fff7e7;
  font-size: .88rem;
  font-weight: 550;
}
#sheet.album-viewer .album-original:hover { background: #294234; }
#sheet.album-viewer .album-original:focus-visible { outline: 3px solid #ce923b; outline-offset: 2px; }
#sheet.album-viewer .gallery-stage video { max-height: 100%; }
#sheet.album-viewer .dialog-close { right: max(.8rem, env(safe-area-inset-right)); top: max(.8rem, env(safe-area-inset-top)); }
@media (max-width: 640px) {
  .album-switch { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .album-heading { margin-bottom: .7rem; }
  .album-switch .album-tab { padding-inline: .55rem; }
  .section-gallery .gallery-step, .album-viewer .gallery-step { min-width: 44px; }
  .section-gallery .media-pager { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: .5rem; }
  .section-gallery .media-pager > :last-child { justify-self: end; text-align: right; }
  .section-gallery .media-pager button { font-size: .84rem; line-height: 1.2; }
  #sheet.album-viewer .album-heading { display: block; }
  #sheet.album-viewer .album-heading > span { display: block; margin-top: .22rem; }
}
@media (max-height: 540px) and (orientation: landscape) {
  #sheet.album-viewer .dialog-body { padding-block: max(.28rem, env(safe-area-inset-top)) max(.28rem, env(safe-area-inset-bottom)); }
  #sheet.album-viewer .album-heading { display: flex; min-height: 2.75rem; margin: 0; }
  #sheet.album-viewer .album-switch { display: flex; flex-wrap: nowrap; overflow-x: auto; margin-bottom: .3rem; padding: .2rem; }
  #sheet.album-viewer .album-tab { flex: none; }
  #sheet.album-viewer .dialog-close { top: max(.2rem, env(safe-area-inset-top)); }
}
