/* Listing flyers: a printable page, 670px wide like the original. */

:root {
  --page: 670px;
  --serif: 'Cinzel', Georgia, serif;
  --sans: 'Lato', system-ui, sans-serif;
  --ink: #000;
  --rule: #e8e6e7;
  --panel: hsl(60 16% 96%);
  --red: hsl(1 61% 37%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  text-align: center;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.masthead,
main {
  width: min(var(--page), 100%);
  margin-inline: auto;
}

/* Header: logo left, phone and website right */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.masthead__logo {
  width: 50%;
  margin: 21px 0 14px;
}

.masthead__logo img {
  width: 100%;
  height: auto;
}

.masthead__contact {
  margin-top: 1em;
  font: 400 12px/16px var(--serif);
  font-style: normal;
  text-align: right;
}

/* Search page */

.home h2 {
  margin: 1.25em 0 0.75em;
  font: 400 24px var(--serif);
}

.search {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.search input,
.search button {
  height: 34px;
  border-radius: 4px;
  font: 14px var(--sans);
}

.search input {
  width: min(16rem, 100%);
  padding: 6px 10px;
  border: 1px solid #bbb;
}

.search button {
  padding: 6px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.search button:hover {
  background: #333;
}

.home footer p {
  margin-top: 2em;
  font-size: 12px;
  text-align: left;
}

/* Flyer */

.flyer__title {
  margin: 13px 0;
  font: 400 20px/24px var(--serif);
}

.flyer__sep {
  margin-inline: 0.6em;
}

.photos {
  display: grid;
  grid-template-columns: 445fr 215fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  aspect-ratio: 670 / 320;
}

.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #555;
}

.photos__main {
  grid-row: span 2;
}

.photos--1 {
  display: block;
  aspect-ratio: auto;
}

.photos--1 .photos__main {
  width: auto;
  height: auto;
  max-height: 320px;
  margin-inline: auto;
  background: none;
}

.facts {
  display: flex;
  margin: 1em 0 0;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-size: 12px;
}

.facts__item {
  display: flex;
  flex: 1;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  padding: 1em;
  border-right: 1px solid var(--rule);
}

.facts__item:last-child {
  border-right: 0;
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  margin: 0;
  font-weight: 300;
}

.description {
  margin: 2em 0 0.5em;
  font: 400 12px/16px var(--sans);
  text-align: left;
}

.flyer__footer {
  padding-top: 1em;
  margin-bottom: 1em;
}

.agent {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  min-height: 120px;
}

.agent__info {
  margin: 0;
  font: 11px/16px var(--serif);
  text-align: right;
  text-transform: uppercase;
}

.agent__info strong {
  font-size: 12px;
}

.agent__photo {
  align-self: flex-start;
  width: auto;
  height: 117px;
}

.smallprint {
  margin: 1em 0 0;
  font: 9px/16px var(--serif);
}

.more-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 92%;
  margin: 1em auto 2em;
  break-before: page;
}

.more-photos img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Phones: stack the photos and facts instead of shrinking them to nothing */

@media (max-width: 560px) {
  .photos {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    aspect-ratio: auto;
  }

  .photos__main {
    grid-row: auto;
    grid-column: 1 / -1;
    aspect-ratio: 445 / 320;
  }

  .photos__thumb {
    aspect-ratio: 215 / 155;
  }

  .facts {
    flex-wrap: wrap;
  }

  .facts__item {
    flex-basis: 50%;
  }

  .more-photos {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.4in;
  }

  html {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body {
    padding: 0;
  }

  .photos,
  .facts,
  .agent,
  .more-photos img {
    break-inside: avoid;
  }
}
