/* ==========================================================================
   FrameX — Art & Artists
   The artist directory (art.html), an artist's profile (artist.html), an
   artwork (artwork.html), a custom painting request (painting.html,
   paintings.html) and the parts of the artist dashboard that are its own.
   Colours, type and spacing come from tokens.css; cards use the shared card
   shell (white, hairline border, card radius).
   ========================================================================== */

/* Stars --------------------------------------------------------------------- */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.stars .icon {
  width: 15px;
  height: 15px;
  color: var(--star);
  fill: currentColor;
}

.stars strong {
  color: var(--ink);
}

/* Toolbar: search, the Artists / Artworks switch, filters -------------------- */
.art-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.art-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.art-search {
  position: relative;
  flex: 1 1 260px;
}

.art-search .icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.art-search .input {
  width: 100%;
  padding-left: 44px;
  border-radius: var(--radius-pill);
}

.art-count {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Artist cards ------------------------------------------------------------- */
.artist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--grid-gap);
}

@media (min-width: 640px) {
  .artist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .artist-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .artist-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.artist-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink);
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

@media (hover: hover) {
  .artist-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--shadow-lift);
  }
}

.artist-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.artist-photo {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  overflow: hidden;
}

.artist-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-photo--lg {
  width: clamp(96px, 14vw, 140px);
  height: clamp(96px, 14vw, 140px);
  font-size: 2.2rem;
  border: 4px solid var(--white);
  box-shadow: var(--shadow-card);
}

.artist-card__name {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 700;
  line-height: 1.25;
}

.artist-card__user,
.artist-card__place {
  color: var(--muted);
  font-size: var(--text-sm);
}

.artist-card__place {
  display: flex;
  align-items: center;
  gap: 6px;
}

.artist-card__place .icon {
  width: 15px;
  height: 15px;
}

.art-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.art-tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--accent-deep);
  font-size: var(--text-xs);
  font-weight: 600;
}

.artist-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.artist-card__foot strong {
  font-family: var(--font-display);
}

/* Artwork cards ------------------------------------------------------------ */
.artwork-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

@media (hover: hover) {
  .artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }
}

.artwork-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--stone-soft);
}

.artwork-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artwork-card__flag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(5, 8, 22, 0.78);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: 700;
}

.artwork-card__body {
  display: grid;
  gap: 4px;
  padding: var(--card-pad);
}

.artwork-card__label {
  color: var(--gold-muted);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.artwork-card__title {
  font-size: var(--text-card);
  font-weight: 700;
  line-height: 1.3;
}

.artwork-card__meta {
  color: var(--muted);
  font-size: var(--text-xs);
}

.artwork-card__price {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: var(--text-price);
  font-weight: 700;
}

/* Join as an artist --------------------------------------------------------- */
.art-join {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
}

@media (min-width: 900px) {
  .art-join {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

/* Artist profile ------------------------------------------------------------ */
.artist-head {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-soft), var(--white) 70%);
}

@media (min-width: 760px) {
  .artist-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }
}

.artist-head__name {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  line-height: 1.15;
}

.artist-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.artist-head__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.artist-head__meta .icon {
  width: 15px;
  height: 15px;
}

.artist-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.artist-about {
  display: grid;
  gap: var(--grid-gap);
  margin-top: var(--grid-gap);
}

@media (min-width: 900px) {
  .artist-about {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.art-panel {
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.art-panel > h2,
.art-panel > h3 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
}

.art-panel p + p {
  margin-top: 10px;
}

.art-facts {
  display: grid;
  gap: 0;
}

.art-facts > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.art-facts > div:first-child {
  border-top: 0;
}

.art-facts dt {
  color: var(--muted);
}

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

.art-section {
  margin-top: clamp(28px, 4vw, 48px);
}

.art-section > .section-head {
  margin-bottom: 16px;
}

/* Custom painting: the price list and the request form ---------------------- */
.svc-list {
  display: grid;
  gap: 10px;
}

.svc {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.svc:hover {
  border-color: var(--ink);
}

.svc:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.svc input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.svc__title {
  font-weight: 700;
}

.svc__meta {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
}

.svc__price {
  font-family: var(--font-display);
  font-size: var(--text-price);
  font-weight: 700;
  white-space: nowrap;
}

.cp-form {
  display: grid;
  gap: 18px;
}

/* A text box of several lines is a rounded box, not a pill */
textarea.input {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  resize: vertical;
}

.cp-step {
  display: grid;
  gap: 10px;
}

.cp-step > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-h4);
  font-weight: 700;
}

.cp-step > h3 > span:first-child {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: var(--text-xs);
}

/* How the price is split: paid on acceptance, paid when finished */
.cp-split {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
}

.cp-split > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

.cp-split > div:first-child {
  border-top: 0;
}

.cp-split strong {
  font-family: var(--font-display);
  white-space: nowrap;
}

.cp-split .is-total {
  background: var(--surface-soft);
  font-weight: 700;
}

.cp-split .is-done span::after {
  content: " ✓";
  color: var(--success);
  font-weight: 700;
}

.cp-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--umber);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.cp-note .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent);
}

/* Reference photos */
.ref-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ref-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed var(--slate);
  border-radius: var(--radius-md);
  background: var(--stone-soft);
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  overflow: hidden;
}

.ref-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-tile--add {
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.ref-tile--add:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.ref-tile--add .icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 6px;
}

.ref-tile__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(5, 8, 22, 0.78);
  color: var(--white);
}

.ref-tile__remove .icon {
  width: 14px;
  height: 14px;
}

.ref-tile__facts {
  position: absolute;
  inset: auto 0 0;
  padding: 4px 6px;
  background: rgba(5, 8, 22, 0.72);
  color: var(--white);
  font-size: 11px;
}

.ref-tile__bar {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--amber);
  transform-origin: left;
}

.cp-addresses {
  display: grid;
  gap: 8px;
}

/* A request: where it stands, and its history -------------------------------- */
.cp-status {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--white);
}

.cp-status--pay {
  border-left-color: var(--amber);
  background: #fff8ee;
}

.cp-status--done {
  border-left-color: var(--success);
}

.cp-status--closed {
  border-left-color: var(--slate);
  background: var(--stone-soft);
}

.cp-status strong {
  font-family: var(--font-display);
  font-size: var(--text-h4);
}

.cp-status__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.cp-layout {
  display: grid;
  gap: var(--grid-gap);
}

@media (min-width: 960px) {
  .cp-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: start;
  }
}

.cp-track {
  display: grid;
  gap: 0;
}

.cp-track li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 16px 28px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.cp-track li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--slate);
  border-radius: 50%;
  background: var(--white);
}

.cp-track li::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 9px;
  width: 2px;
  background: var(--line);
}

.cp-track li:last-child::after {
  display: none;
}

.cp-track li.is-done {
  color: var(--ink);
}

.cp-track li.is-done::before {
  border-color: var(--success);
  background: var(--success);
}

.cp-track li.is-now::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.16);
}

.cp-track li.is-now {
  color: var(--ink);
  font-weight: 700;
}

.cp-history {
  display: grid;
  gap: 8px;
  font-size: var(--text-sm);
}

.cp-history li {
  display: grid;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.cp-history li:first-child {
  padding-top: 0;
  border-top: 0;
}

.cp-history small {
  color: var(--muted);
}

.cp-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink);
}

.cp-row + .cp-row {
  margin-top: 10px;
}

.cp-row__meta {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Home page review card without a photo: the customer's initial */
.review-card__avatar--initials {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-weight: 700;
}

/* Reviews ------------------------------------------------------------------- */
.rev-list {
  display: grid;
  gap: 12px;
}

.rev {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: var(--text-sm);
}

.rev__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rev__by {
  color: var(--muted);
  font-size: var(--text-xs);
}

.rev-form {
  display: grid;
  gap: 10px;
}

.rev-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}

.rev-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rev-stars label {
  padding: 4px;
  color: var(--stone);
  cursor: pointer;
}

.rev-stars label .icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.rev-stars input:checked ~ label,
.rev-stars label:hover,
.rev-stars label:hover ~ label {
  color: var(--star);
}

.rev-stars input:focus-visible + label {
  outline: 2px solid var(--accent);
  border-radius: 6px;
}

/* Artwork page -------------------------------------------------------------- */
.aw {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
}

@media (min-width: 900px) {
  .aw {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
}

.aw-gallery {
  display: grid;
  gap: 10px;
}

@media (min-width: 900px) {
  .aw-gallery {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

.aw-gallery__main {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--stone-soft);
  overflow: hidden;
}

.aw-gallery__main img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.aw-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.aw-thumbs button {
  flex: none;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--stone-soft);
  overflow: hidden;
}

.aw-thumbs button[aria-pressed="true"] {
  border-color: var(--ink);
}

.aw-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aw-info {
  display: grid;
  gap: 16px;
}

.aw-price {
  font-family: var(--font-display);
  font-size: var(--text-price-lg);
  font-weight: 700;
  line-height: 1.1;
}

.aw-by {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink);
}

.aw-by .artist-photo {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.aw-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aw-buy .btn {
  flex: 1 1 200px;
}

/* Account: notifications ----------------------------------------------------- */
.acc-news {
  display: grid;
  gap: 0;
  margin-bottom: 12px;
}

.acc-news__item > a,
.acc-news__item > div {
  display: grid;
  gap: 2px;
  padding: 10px 0 10px 14px;
  border-top: 1px solid var(--line);
  border-left: 3px solid transparent;
  color: var(--ink);
  font-size: var(--text-sm);
}

.acc-news__item:first-child > a,
.acc-news__item:first-child > div {
  border-top: 0;
}

.acc-news__item.is-unread > a,
.acc-news__item.is-unread > div {
  border-left-color: var(--accent);
}

.acc-news__item span,
.acc-news__item small,
.acc-news__empty {
  color: var(--muted);
}

.acc-news__count {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  vertical-align: middle;
}

/* Artist dashboard and admin: what is its own ---------------------------------- */
.ad-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--stone-soft);
  object-fit: cover;
}

.ad-reason {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #fdecec;
  color: #8a1c1c;
  font-size: var(--text-sm);
}

.ad-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.ad-form__row {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .ad-form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ad-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
}

.ad-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ad-pics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ad-pics .ref-tile {
  width: 110px;
}

.set-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.set-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

@media (min-width: 640px) {
  .set-row {
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
  }
}

.set-row small {
  display: block;
  color: var(--muted);
}

.set-row .input,
.set-row .select {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .artist-card,
  .artwork-card {
    transition: none;
  }
}
