/* Approved photo-first layout. Scoped to the plant journal and its two lists. */
.photo-first-list .plants-grid,
.photo-first-list .plants-grid.raredex-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
  align-items: start;
}
.photo-first-list .plants-grid .plant-card.rd-stone-card {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  overflow: visible;
}
.photo-first-list .plants-grid .plant-card::before,
.photo-first-list .plants-grid .plant-card::after { display: none; }
.photo-first-list .plant-card.has-card-gg .plant-card-link { padding: 0 0 4px; }
.photo-first-list .plants-grid .plant-card .plant-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}
.photo-first-list .plants-grid .plant-card-body { display: block; padding: 0; min-width: 0; }
.photo-first-list .plants-grid .plant-card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  height: 3.1em;
  min-height: 3.1em;
  margin: 10px 0 2px;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  font-size: 20px;
  line-height: 1.55;
  color: var(--rd-text);
}
.photo-first-list .plants-grid .plant-card-category {
  min-height: 44px;
  margin: 0;
  padding: 10px 64px 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 24px;
}
.photo-first-list .plant-card-gg { right: 0; bottom: 4px; max-width: 60px; }
.photo-first-list .plant-card-flags { min-height: 1.6em; margin: 0; font-size: 12px; line-height: 1.6; color: var(--rd-muted); }
.photo-first-list .plant-card-flags:empty { display: none; }
.photo-first-list .plant-card-transfer-badge { margin: 0; }

.plant-room-page .plant-photo-first {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 32px;
  padding: 0;
  border: 1px solid var(--rd-line);
  border-radius: 14px;
  background: var(--rd-paper);
  color: var(--rd-text);
  box-shadow: 0 12px 32px rgb(20 30 20 / 8%);
}
.plant-photo-first .plant-photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 6px 16px;
  gap: 12px;
}
.plant-photo-first .plant-photo-back { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.plant-photo-first .plant-title-actions { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; width: auto; }
.plant-photo-first .plant-title-actions > button,
.plant-photo-first .plant-title-actions > details > summary {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rd-line); border-radius: 50%;
  color: var(--rd-text); background: var(--rd-paper); box-shadow: none;
}
.plant-photo-first .plant-share-menu summary { font-size: 0; gap: 0; }
.plant-photo-first .remember-plant-button [data-remember-label] { display: none; }
.plant-photo-first .remember-plant-icon { width: 22px; height: 22px; }
.plant-photo-first .plant-share-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.plant-photo-first .plant-action-menu summary { font-size: 24px; }
.plant-photo-first .plant-share-options,
.plant-photo-first .plant-action-list { z-index: 1500; max-width: min(300px, calc(100vw - 64px)); }
.plant-room-page .plant-photo-first .plant-hero-gallery {
  aspect-ratio: auto; border: 0; border-radius: 0;
  display: grid; grid-template-columns: 1fr; background: var(--rd-bg-soft);
}
.plant-room-page .plant-photo-first .plant-hero-gallery .record-carousel-image {
  position: static; inset: auto; display: none; grid-area: 1 / 1;
  width: 100%; height: auto; max-width: 100%; max-height: 620px;
  aspect-ratio: auto 4 / 5;
  margin: auto; object-fit: contain; border: 0; border-radius: 0;
  opacity: 1; transition: none;
}
.plant-room-page .plant-photo-first .plant-hero-gallery .record-carousel-image.active { display: block; }
.plant-room-page .plant-photo-first .plant-hero-gallery .record-carousel-image:not(.is-loaded) {
  /* WebKit can otherwise use the unloaded image's alt-text height. */
  aspect-ratio: 4 / 5;
}
.plant-photo-first .plant-gallery-controls { grid-area: 2 / 1; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--rd-paper); min-height: 44px; }
.plant-room-page .plant-photo-first .plant-gallery-controls .record-carousel-arrow {
  display: grid; position: static; width: 44px; height: 44px; min-height: 44px;
  background: transparent; color: var(--rd-text); border: 0; box-shadow: none; transform: none;
}
.plant-gallery-counter { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--rd-muted); }
.plant-photo-placeholder { width: 100%; aspect-ratio: 4 / 5; max-height: 620px; background: var(--rd-bg-soft); }
.plant-photo-empty { display: grid; place-items: center; min-height: 180px; color: var(--rd-muted); }
.plant-photo-info { padding: 24px 32px 28px; min-width: 0; }
.plant-room-page .plant-photo-title {
  display: block; width: auto; margin: 0 0 16px; padding: 0;
  font-size: 32px; line-height: 1.6; text-align: left;
  white-space: normal; overflow: visible; overflow-wrap: anywhere; word-break: normal;
}
.plant-photo-owner-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plant-photo-owner-row .plant-owner-link-row { flex: 1; min-width: 0; margin: 0; font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.plant-photo-owner-row .plant-owner-name { white-space: normal; }
.plant-hero-gg { flex: none; display: flex; align-items: center; gap: 6px; }
.plant-hero-gg .gg-button { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.plant-hero-gg .gg-count-button { font-size: 13px; cursor: default; }
.plant-photo-info .plant-primary-action { margin: 20px 0; padding: 0; }
.plant-photo-info .plant-record-link { display: flex; justify-content: center; width: 100%; min-height: 48px; }
.plant-passport-disclosure { margin-top: 24px; border-top: 1px solid var(--rd-line); border-bottom: 1px solid var(--rd-line); }
.plant-passport-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 12px 0; cursor: pointer; list-style: none; }
.plant-passport-disclosure > summary::-webkit-details-marker { display: none; }
.plant-passport-disclosure > summary::after { content: '＋'; color: var(--rd-muted); }
.plant-passport-disclosure[open] > summary::after { content: '−'; }
.plant-room-page .plant-passport-disclosure .plant-specimen-label { margin: 0 0 20px; }
.plant-room-page .plant-passport-disclosure .plant-name-inline { white-space: normal; overflow-wrap: anywhere; word-break: normal; font-size: 24px; line-height: 1.6; }
.plant-photo-first :is(button, a, summary):focus-visible { outline: 2px solid var(--rd-text); outline-offset: 3px; }
html.text-comfort .photo-first-list .plant-card-name { font-size: 22px; }
html.text-comfort .plant-photo-title { font-size: 36px; }
@media (max-width: 640px) {
  .photo-first-list .plants-grid,
  .photo-first-list .plants-grid.raredex-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .photo-first-list .mydex-collection-section,
  .photo-first-list .search-results-section { padding-inline: 14px; }
  .photo-first-list .plants-grid .plant-card-name { font-size: 16px; }
  .photo-first-list .plants-grid .plant-card-category { font-size: 12px; }
  .plant-room-page .plant-photo-first { border-radius: 11px; }
  .plant-photo-first .plant-photo-toolbar { padding: 4px 10px; }
  .plant-photo-info { padding: 18px 16px 20px; }
  .plant-room-page .plant-photo-title { font-size: 23px; }
  .plant-photo-owner-row .plant-owner-link-row { font-size: 13px; }
  .plant-room-page .plant-photo-first .plant-hero-gallery .record-carousel-image { max-height: 520px; }
  .plant-photo-placeholder { max-height: 520px; }
  .plant-room-page .plant-passport-disclosure .plant-name-inline { font-size: 20px; }
  html.text-comfort .photo-first-list .plant-card-name { font-size: 18px; }
  html.text-comfort .plant-room-page .plant-photo-title { font-size: 26px; }
}
