/*
 * The selected listing's photos, headed by its price and what the agency says.
 *
 * The declared facts sat under the reel, which on a listing with thirty photos
 * put the construction year a screen and a half below the fold — the fact that
 * decides whether the house is worth opening at all. They now share the header
 * with the price, on the opposite edge.
 *
 * When the photos have not been read, the panel says so rather than showing an
 * empty set of verdicts, which would read as "nothing found".
 */

/* A column that fills its pane: the header and the facts take what they need,
 * the reel of thumbnails scrolls in whatever is left. Sized the other way round
 * — content first — a single photo grew to twice the height of the pane and
 * pushed the facts off screen. */
/* The panel grows to its content and the frame around it scrolls.
 *
 * It used to fill the frame exactly, with the thumbnail grid taking whatever
 * height was left and scrolling inside itself. That gave the column two
 * scrollbars side by side, and on a long panel the grid's share collapsed to
 * almost nothing: twenty-four pixels of viewport for a thousand of photographs,
 * measured. One scroller, the outer one, moves everything together. */
.photo-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* A turbo-frame is an inline element by default, which collapses the column it
 * is standing in. It has to behave like the div it replaced. */
turbo-frame#selection {
  display: block;
  flex: 1;
  min-height: 0;
}

.photo-panel__reel {
  flex: none;
  display: flex;
  flex-direction: column;
}

.photo-panel__header {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--line);
}

.photo-panel__header b {
  display: block;
}

/* The declared facts hold the right edge, as prices do in the list: two things
 * of different natures, each on its own margin, rather than one paragraph the
 * eye has to divide. */
.photo-panel__declared {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  text-align: right;
}

.photo-panel__identity b {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.photo-panel__identity span {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.photo-panel__grid {
  flex: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

/* A thumbnail is a button, not a decoration: it opens the photo full size. The
 * reset leaves nothing of the browser's button chrome around the image. */
.photo-panel__thumb {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: block;
}

.photo-panel__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-panel__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

/* One line, separated by middots — the same way a listing row prints its
 * rooms and its surface, so the two read as the same kind of statement. */
.photo-panel__facts {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.photo-panel__facts span + span::before {
  content: " · ";
  color: var(--ink-faint);
}

/* Missing, not false. Kept in the line rather than dropped from it: a listing
 * that states no year and one that states 1875 are different situations, and
 * an absent item would leave them looking alike. */
.photo-panel__unknown {
  font-style: italic;
  color: var(--ink-faint);
}

.photo-panel__label {
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: var(--label-weight);
}

.photo-panel__pending {
  flex: none;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--ink-faint);
}

.photo-panel__empty {
  padding: var(--space-4);
  color: var(--ink-faint);
}

/* The way out to the original advert. It used to sit on every row in the list;
 * one listing is selected at a time, so once is enough. */
.photo-panel__source {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.photo-panel__source:hover {
  text-decoration: underline;
}

/* Sold, beside the price it no longer applies to. */
.photo-panel__sold {
  margin-left: var(--space-2);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--line-strong);
  font-family: var(--font-sans);
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  font-weight: var(--label-weight);
  color: var(--ink-muted);
  vertical-align: middle;
}

/* The advert is gone. The only place in this application that offers to delete
 * anything, so it says what it knows and how it knows it — "404", not "erreur"
 * — and puts the action next to the evidence rather than in a menu. */
.photo-panel__gone {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunken);
}

.photo-panel__gone p {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--ink-muted);
}

.photo-panel__gone b {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  letter-spacing: normal;
  color: var(--ink);
}

.photo-panel__remove {
  flex: none;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .photo-panel__remove:hover {
    border-color: var(--ink-muted);
  }
}


/* What the agency wrote, above the photographs.
 *
 * Between a thousand and two thousand three hundred characters on every listing
 * held, so it is clamped to three lines and opens on a click. The clamp is CSS
 * and the text is whole in the page: if the controller never connects, the
 * reader still gets three lines and can scroll, rather than a sentence cut off
 * with no way past it. */
.photo-panel__description {
  flex: none;
  padding: var(--space-3) var(--space-4) 0;
}

.photo-panel__text {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-panel__description--open .photo-panel__text {
  -webkit-line-clamp: unset;
  max-height: 14rem;
  overflow-y: auto;
}

.photo-panel__unfold {
  margin-top: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

/* simple_format's own paragraphs, inside the clamped box. */
.photo-panel__text p {
  margin: 0 0 0.5em;
}

.photo-panel__text p:last-child {
  margin-bottom: 0;
}


/* What the photographs gave, criterion by criterion.
 *
 * The same icons the listing rows carry, in the same hues, so a badge here and
 * a lit mark over there are visibly the same question. Three states and none of
 * them is a strike: an answer of "no" is an answer, not a fault, and "not read
 * yet" is neither. */
/* The sparkle beside the heading. Without a size an inline SVG takes its
 * viewBox, which here is the width of the panel. */
.photo-panel__mark {
  width: 0.6rem;
  height: 0.6rem;
  display: inline-block;
  vertical-align: baseline;
}

/* On the bare ground, like the rejection block above it.
 *
 * A tinted card was tried here, to tell a model's paragraph from the agency's.
 * Both paragraphs have since left the panel, and a card drawn around four pills
 * was a lot of frame for very little picture. The mark beside the label already
 * says where these come from. */
.photo-panel__deduced {
  flex: none;
  padding: var(--space-3) var(--space-4) 0;
}

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

.findings__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.findings__item svg {
  width: 0.9rem;
  height: 0.9rem;
  flex: none;
  color: var(--line-strong);
}

.findings__name {
  font-weight: 600;
}

/* Satisfied: the criterion's own hue, and the application's blue around it. */
.findings__item--on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.findings__item--on svg { color: var(--crit); }

/* Under the pills and set apart from them: they are answers, this is an
 * account.
 *
 * No measure of its own. It had one — 62 characters — from when it sat on the
 * bare panel and a wide screen would have run the line too long. Inside the
 * card that cap became a fault: the text stopped at three fifths of the width
 * and left a band of empty violet down the right, which reads as a rendering
 * bug rather than as typography. The card is the measure now. */
.photo-panel__story {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-muted);
}

/* Not read yet — a weaker claim than "no", and drawn as one. */
.findings__item--unknown {
  opacity: 0.6;
}

/* Why the criteria turned this listing down.
 *
 * Its own section, because a rejection can come from either side: "en rue
 * bâtie" is read off the photographs and appears in the findings below as
 * well, but "sous option" and "construite en 2026" are declared by the agency
 * and would show up nowhere else.
 *
 * In the application's blue rather than a warning colour. A rejection is a
 * verdict, not a fault: the listing is sound, it simply does not answer one of
 * the criteria the reader asked for. */
.photo-panel__rejection {
  flex: none;
  padding: var(--space-3) var(--space-4) 0;
}

.photo-panel__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}

.photo-panel__reasons span {
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
}
