/*
  Animal facility pages: the directory and the profile. The profile shares
  the pet profile's card vocabulary (iagd-pet-profile.css, prefix pp-): the
  hero card, the number line and its marks, the facts, the topic cards and
  their rows. This file carries only what a facility adds to it. Every card
  is one level deep; a tile inside a card is flat.

  Colour, spacing and easing tokens come from iagd-theme.css.
  Prefix: fc-.
*/

/* ---- Owner pages -------------------------------------------------------- */

.fc-manage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.fc-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent-text);
  white-space: nowrap;
}
.fc-manage__head { margin-bottom: 20px; }
.fc-manage__no {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
}

/* One row per facility the member manages. */
.fc-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* A grid item keeps min-width: auto, so a long address would widen the
   row past the screen instead of truncating. */
.fc-list > li { min-width: 0; }
a.fc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}
.fc-row__thumb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-base-alt);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent-text);
}
.fc-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.fc-row__main { flex: 1 1 auto; min-width: 0; }
.fc-row__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-row__meta {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  color: var(--color-dim-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-row__role {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

/* Two panels side by side on a wide screen: the form and the roster. */
.fc-manage__grid {
  display: grid;
  gap: 16px;
  align-items: start;
}
@media (min-width: 1024px) {
  .fc-manage__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
}
.fc-panel { padding: 20px; }
.fc-panel__title {
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.fc-picture {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.fc-picture__img {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-card);
  object-fit: contain;
  background: var(--color-base-alt);
  padding: 8px;
}
.fc-picture__side {
  flex: 1 1 220px;
  display: grid;
  gap: 10px;
}

.fc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-dim-1);
  cursor: pointer;
}
.fc-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
}

.fc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 420px) {
  .fc-pair { grid-template-columns: 1fr; }
}

.fc-note { font-size: 13px; }

/* Roster rows inside the Pets panel: flat, divided by hairlines. */
.fc-petrows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fc-petrow,
.fc-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}
.fc-petrow:last-child,
.fc-result:last-child { border-bottom: 0; }
.fc-petrow__thumb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-layer-soft);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent-text);
}
.fc-petrow__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fc-petrow__main { flex: 1 1 auto; min-width: 0; }
.fc-petrow__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-on-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-petrow__meta {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  color: var(--color-dim-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-petrow__acts {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
@media (max-width: 480px) {
  .fc-petrow { flex-wrap: wrap; }
  .fc-petrow__acts { width: 100%; justify-content: flex-end; }
}

.fc-attach {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.fc-results { margin-top: 4px; }
button.fc-result {
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: var(--radius-card);
  transition: background-color 140ms var(--ease-fluent);
}
button.fc-result:hover { background: var(--color-layer-soft); }
button.fc-result.is-disabled,
button.fc-result:disabled { opacity: 0.5; cursor: default; }

.fc-sheet__acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* A read-only value reads as a value, not as a field waiting for input. */
#mfm-pet-sheet .iagd-input[readonly] {
  background: transparent;
  border-style: dashed;
  color: var(--color-dim-1);
}

/* ---- Directory --------------------------------------------------------- */

/* Register banner: one accent card, icon left, arrow right. */
.fc-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  color: var(--color-text-on-dark);
  font-family: var(--font-sans);
}
.fc-banner > svg { flex: 0 0 auto; color: var(--color-accent-text); }
.fc-banner > svg:last-child { color: var(--color-text-on-dark); }
.fc-banner__text { flex: 1 1 auto; min-width: 0; }
.fc-banner__eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.fc-banner__title {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* Facility card: the logo contained on a tinted ground, then the text. */
.fc-cards { gap: 12px; }
a.fc-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: inherit;
}
/* The picture is pinned to the box, so a tall logo never grows past it:
   a percentage height on a centred grid item did not hold it in. */
.fc-card__media {
  position: relative;
  display: grid;
  place-items: center;
  height: 180px;
  background:
    radial-gradient(70% 80% at 50% 40%, rgba(124, 58, 237, 0.14), transparent 70%),
    var(--color-base-alt);
}
.fc-card__media img {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
  transition: transform 300ms var(--ease-fluent);
}
a.fc-card:hover .fc-card__media img { transform: scale(1.03); }
.fc-card__blank {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-accent-text);
}
.fc-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 12px 14px 14px;
}
/* Two lines for the name, so no kennel loses its last word to an ellipsis. */
.fc-card__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.fc-card__no,
.fc-card__addr,
.fc-card__foot {
  display: block;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-card__no {
  margin-top: 3px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--color-dim-1);
}
.fc-card__addr {
  margin-top: 3px;
  font-size: 11px;
  color: var(--color-dim-2);
}
.fc-card__foot {
  margin-top: auto;
  padding-top: 8px;
  font-size: 10.5px;
  color: var(--color-dim-2);
}

/* Register sheet. */
.fc-reg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.fc-reg__pic {
  width: 160px;
  height: auto;
  border-radius: var(--radius-card);
}
.fc-reg__price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-gold);
}
.fc-reg__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-dim-2);
}
.fc-reg__note {
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-dim-1);
}
.fc-reg .iagd-btn { margin-top: 4px; }

/* ---- Hero: a logo, not a photograph ---------------------------------- */

/* Contained on a tinted ground, so a wide wordmark and a square crest both
   show whole. The box is shorter than the pet hero's, because a logo
   carries no face to keep in frame. */
.fc-hero__media {
  position: relative;
  height: clamp(200px, 46vw, 280px);
  background:
    radial-gradient(70% 80% at 50% 40%, rgba(124, 58, 237, 0.16), transparent 70%),
    var(--color-base-alt);
}
@media (min-width: 1024px) {
  .fc-hero__media { height: clamp(220px, calc(100vh - 560px), 300px); }
}
/* Pinned to the box, so a tall logo never grows past it. */
.fc-hero__img {
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: contain;
}

/* Owner and Registered share a row; Breeds and Address run the width. */
.fc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Its own line under the address, so the link never strands a word. */
.fc-facts__map {
  display: block;
  width: max-content;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Roster ---------------------------------------------------------- */

.fc-search { margin-bottom: 12px; }

.fc-pets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .fc-pets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.fc-pet { min-width: 0; }

/* A tile has no border and no fill: it sits inside the Pets card. */
.fc-pet__link {
  display: block;
  min-width: 0;
  color: inherit;
  transition: transform 180ms var(--ease-fluent);
}
a.fc-pet__link:active { transform: scale(0.96); }
.fc-pet--dim .fc-pet__link { opacity: 0.6; }

.fc-pet__photo {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-layer-soft);
}
.fc-pet__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease-fluent);
}
a.fc-pet__link:hover .fc-pet__photo img { transform: scale(1.04); }
.fc-pet__blank {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent-text);
}

.fc-pet__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-on-dark);
  overflow-wrap: anywhere;
}
.fc-pet__meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-dim-2);
  overflow-wrap: anywhere;
}
.fc-pet__sale {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.fc-sentinel {
  display: flex;
  justify-content: center;
  min-height: 24px;
  padding-top: 12px;
}
