/* Card Google photos (framework v0, 2026-10-16; Jeff's ruling: listing grids and city
   pages only, loaded on scroll). Loaded with assets/ctv-gphoto.js, and only on pages
   that can show one. Nothing here applies until the script has swapped a placeholder
   for a photo that has already loaded, so a failed lookup leaves the placeholder as it
   was rendered.

   Attribution follows the entity-page rules (ctv-global.css §23b): a 1px border sets
   Google content apart, the official outlined logo sits inside the photo with its
   clear space (gic-attribution.css), the author credit sits on the same dark chip
   (white on rgba(20,14,16,0.72): 7.8:1 worst case). Listing cards carry it inside the
   media box, above the card's stretched link (z-index 1). City cards and tiles are a
   single <a>, so the script wraps them and places the attribution BESIDE the link,
   never inside it: an <a> inside an <a> is invalid and the inner one is not reliably
   clickable. */

.ctv-entity-card__media.ctv-gphoto,
.ctv-gphoto-wrap--card .ctv-cityx-card__photo,
.ctv-gphoto-wrap--tile .ctv-cityx-dtile { box-shadow: inset 0 0 0 1px rgba(31, 31, 31, 0.22); }

.ctv-gphoto-wrap { position: relative; display: flex; flex-direction: column; }
.ctv-gphoto-wrap > a { flex: 1 1 auto; }

.ctv-gphoto .gic-attr,
.ctv-gphoto-wrap > .gic-attr {
  position: absolute; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; gap: 8px;
  margin: 0; pointer-events: none;
  --gic-fallback-sans: var(--font-ui);
}
.ctv-gphoto .gic-attr { bottom: 0; align-items: flex-end; }
/* City card: the box spans the photo only (height set by the script), content at its foot. */
.ctv-gphoto-wrap--card > .gic-attr { top: 0; height: var(--ctv-gphoto-h, 0); align-items: flex-end; }
/* Tile: title and meta own the foot of the tile, so the attribution sits at the top. */
.ctv-gphoto-wrap--tile > .gic-attr { top: 0; align-items: flex-start; }

.ctv-gphoto .gic-attr__logo,
.ctv-gphoto .gic-attr__text,
.ctv-gphoto-wrap > .gic-attr .gic-attr__logo,
.ctv-gphoto-wrap > .gic-attr .gic-attr__text { pointer-events: auto; flex: 0 0 auto; }
.ctv-gphoto .gic-attr__gmaps,
.ctv-gphoto-wrap > .gic-attr .gic-attr__gmaps { color: #fff; }
.ctv-gphoto .gic-attr__authors,
.ctv-gphoto-wrap > .gic-attr .gic-attr__authors {
  pointer-events: auto;
  margin: 0 8px 8px 0; padding: 3px 8px; border-radius: 4px;
  background: rgba(20, 14, 16, 0.72); color: #fff;
  font-family: var(--font-ui); font-size: 12px; font-weight: 400; line-height: 1.3;
  max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctv-gphoto-wrap--tile > .gic-attr .gic-attr__authors { margin: 8px 8px 0 0; }
/* Listing cards are WP Grid Builder cards, and WPGB ships a reset on card spans,
   `.wp-grid-builder .wpgb-card span { color: inherit; margin: 0; padding: 0;
   font-size: 100% }` (0,2,1), which beats the rule above (0,2,0). Measured on Local
   2026-11-01 at 390px: the "Photo:" label rendered rgb(38,38,38) on the dark chip while
   the linked name stayed white, the chip sat flush on the photo's right and bottom edges,
   and it had no inner padding and larger text than the Nearby chip. This selector is
   0,3,0 and restores the chip to match the Nearby cards, which are not WPGB cards. */
.ctv-entity-card__media.ctv-gphoto .gic-attr__authors {
  color: #fff; margin: 0 8px 8px 0; padding: 3px 8px; font-size: 12px;
}
/* Below 600px the credit WRAPS instead of truncating (Jeff, 2026-11-01), the same rule as
   the entity-page chip (ctv-global.css §23b). Measured on Local 2026-11-01 at 390px with
   the longest live credit, "SingleThread Farm - Restaurant - Inn": one line and truncated
   before. No line clamp, deliberately: a very long name takes a third line rather than
   losing characters. Listing and Nearby chips sit on the photo's foot and grow upwards;
   the tile chip sits at the top and grows downwards. */
@media (max-width: 599px) {
  .ctv-gphoto .gic-attr__authors,
  .ctv-gphoto-wrap > .gic-attr .gic-attr__authors {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
  }
}
.ctv-gphoto .gic-attr__authors a,
.ctv-gphoto-wrap > .gic-attr .gic-attr__authors a { color: #fff; text-decoration: underline; }

/* Tile photo: an <img> (not a CSS background) so it carries referrerpolicy, under the scrim. */
.ctv-gphoto__tileimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
