/*
 * assets/css/artist-profiles.css
 * All front-end styles for the Artist Profiles plugin.
 * Uses CSS custom properties so you can override in your theme's Additional CSS.
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500&family=Ubuntu:wght@700&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --ap-font-display: 'Cinzel', serif;
  --ap-font-body:    system-ui, -apple-system, sans-serif;
  --ap-color-text:        #1a1a1a;
  --ap-color-muted:       #666;
  --ap-color-border:      #e8e8e8;
  --ap-color-bg:          #fff;
  --ap-color-bg-alt:      #f8f8f6;
  --ap-color-accent:      #1a1a1a;
  --ap-color-success:     #1a6640;
  --ap-color-success-bg:  #eaf3de;
  --ap-color-error:       #8b1a1a;
  --ap-color-error-bg:    #fdf0f0;
  --ap-color-info:        #1a4a6a;
  --ap-color-info-bg:     #e8f2fb;
  --ap-radius:            4px;
  --ap-radius-lg:         8px;
  --ap-max-width:         1100px;
  --ap-hero-img-size:     340px;
  --ap-gallery-gap:       20px;
}

/* ── Shared wrappers ─────────────────────────────────────────────────────── */
.ap-directory-wrap,
.ap-profile-page,
.ap-portal {
  max-width: var(--ap-max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: var(--ap-font-body);
  color: var(--ap-color-text);
}

/* ── Directory: sort bar ─────────────────────────────────────────────────── */
.ap-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ap-color-border);
}
.ap-sort-label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ap-color-muted);
  margin-right: 4px;
}
.ap-sort-btn {
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--ap-color-border);
  border-radius: 20px;
  color: var(--ap-color-text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.ap-sort-btn:hover     { background: var(--ap-color-bg-alt); border-color: #ccc; }
.ap-sort-active        { background: var(--ap-color-text) !important; color: #fff !important; border-color: var(--ap-color-text) !important; }

/* ── Directory: grid ─────────────────────────────────────────────────────── */
.ap-directory-grid {
  display: grid;
  gap: var(--ap-gallery-gap);
}
.ap-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ap-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ap-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Directory: artist card ─────────────────────────────────────────────── */
.ap-artist-card {
  display: block;
  text-decoration: none;
  color: var(--ap-color-text);
  transition: opacity .2s;
}
.ap-artist-card:hover { opacity: .8; }

.ap-artist-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ap-color-bg-alt);
  border-radius: var(--ap-radius);
  margin-bottom: 12px;
}
.ap-artist-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.ap-artist-card:hover .ap-artist-img { transform: scale(1.03); }

.ap-artist-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 6vw, 52px);
  font-family: var(--ap-font-display);
  color: var(--ap-color-muted);
  letter-spacing: .02em;
}
.ap-artist-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  text-decoration: none;
}
.ap-artist-tagline {
  font-size: 13px;
  color: var(--ap-color-muted);
  margin: 0;
  line-height: 1.4;
  text-decoration: none;
}
.ap-artist-card .ap-artist-name,
.ap-artist-card .ap-artist-tagline { text-decoration: none; }
.ap-directory-empty { color: var(--ap-color-muted); }

/* ── Profile: hero ───────────────────────────────────────────────────────── */
.ap-profile-hero {
  display: grid;
  gap: 40px;
  padding: 48px 0 40px;
  align-items: start;
}
.ap-hero-image-left  { grid-template-columns: var(--ap-hero-img-size) 1fr; }
.ap-hero-image-right { grid-template-columns: 1fr var(--ap-hero-img-size); }
.ap-hero-image-right .ap-profile-hero-img-wrap { order: 2; }
.ap-hero-image-right .ap-profile-hero-text     { order: 1; }
.ap-hero-image-top   { grid-template-columns: 1fr; text-align: center; }
.ap-hero-image-top .ap-profile-hero-img-wrap { max-width: var(--ap-hero-img-size); margin: 0 auto; }

.ap-profile-hero-img-wrap { flex-shrink: 0; }
.ap-profile-hero-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--ap-radius);
  display: block;
}

.ap-profile-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ap-color-muted);
  margin: 0 0 10px;
}
.ap-profile-name {
  font-family: var(--ap-font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 500;
  margin: 0 0 16px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ap-profile-short-bio {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ap-color-text);
  max-width: 56ch;
  margin: 0 0 20px;
}

/* Text alignment helpers */
.ap-text-center .ap-profile-short-bio { margin-left: auto; margin-right: auto; }
.ap-text-right  .ap-profile-short-bio { margin-left: auto; }
.ap-text-center { text-align: center; }
.ap-text-right  { text-align: right; }

/* Social links */
.ap-social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ap-social-link {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--ap-color-border);
  border-radius: 20px;
  color: var(--ap-color-text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.ap-social-link:hover { background: var(--ap-color-bg-alt); border-color: #ccc; }
.ap-text-center .ap-social-links { justify-content: center; }
.ap-text-right .ap-social-links  { justify-content: flex-end; }

/* Divider */
.ap-divider { border: none; border-top: 1px solid var(--ap-color-border); margin: 48px 0; }

/* Section labels */
.ap-section-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ap-color-muted);
  margin: 0 0 8px;
}
.ap-section-title {
  font-family: var(--ap-font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  margin: 0 0 32px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Gallery grid ─────────────────────────────────────────────────────────── */
.ap-gallery-grid { display: grid; gap: var(--ap-gallery-gap); }

.ap-cols-masonry { display: block; column-count: 3; column-gap: var(--ap-gallery-gap); }
.ap-cols-masonry .ap-artwork-card { break-inside: avoid; margin-bottom: var(--ap-gallery-gap); }

/* ── Artwork card ─────────────────────────────────────────────────────────── */
.ap-artwork-card { display: flex; flex-direction: column; }
.ap-artwork-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--ap-color-bg-alt);
  border-radius: var(--ap-radius);
  margin-bottom: 12px;
}
.ap-artwork-img {
  width: 100%;
  display: block;
  transition: transform .35s ease;
}
.ap-artwork-card:hover .ap-artwork-img { transform: scale(1.03); }
.ap-artwork-img-placeholder {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ap-color-muted);
  font-size: 13px;
}
.ap-artwork-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
}
.ap-badge-sold      { background: #1a1a1a; color: #fff; }
.ap-badge-available { background: var(--ap-color-success-bg); color: var(--ap-color-success); }

.ap-artwork-info { padding: 0 2px; }
.ap-artwork-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px;
  line-height: 1.3;
}
.ap-artwork-year     { font-weight: 400; color: var(--ap-color-muted); }
.ap-artwork-material { font-size: 13px; color: var(--ap-color-text); margin: 0 0 2px; }
.ap-artwork-dims     { font-size: 12px; color: var(--ap-color-muted); margin: 0 0 4px; }
.ap-artwork-price    { font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.ap-artwork-sats     { font-size: 12px; font-weight: 400; color: var(--ap-color-muted); margin-left: 2px; }

/* ── Embed section ───────────────────────────────────────────────────────── */
.ap-embed-section { margin-bottom: 0; }
.ap-embed-wrap { max-width: 800px; }
.ap-embed-wrap iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: var(--ap-radius); }

/* ── Bio section ─────────────────────────────────────────────────────────── */
.ap-bio-section { max-width: 680px; }
.ap-text-center .ap-bio-section,
.ap-bio-section.ap-text-center { max-width: 680px; margin: 0 auto; }
.ap-bio-body { font-size: 16px; line-height: 1.75; color: var(--ap-color-text); }
.ap-bio-body p { margin: 0 0 1.2em; }

/* ── Auth / portal ───────────────────────────────────────────────────────── */
.ap-auth-wrap { max-width: 480px; }
.ap-auth-panel { padding: 0; }
.ap-hidden { display: none !important; }
.ap-active  { display: block; }
.ap-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap-color-muted);
  margin: 0 0 6px;
}
.ap-auth-title {
  font-family: 'Ubuntu', sans-serif !important;
  font-weight: 700 !important;
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: 0 !important;
  font-style: normal !important;
}
.ap-auth-sub    { font-size: 14px; color: var(--ap-color-muted); margin: 0 0 24px; line-height: 1.55; }
.ap-verify-note { font-size: 14px; margin-bottom: 20px; }
.ap-hint        { font-size: 12px; color: var(--ap-color-muted); margin-top: 8px; }

.ap-form-group  { margin-bottom: 16px; }
.ap-form-group label { display: block; font-size: 13px; color: var(--ap-color-muted); margin-bottom: 5px; }
.ap-form-group input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--ap-color-border);
  border-radius: var(--ap-radius);
  color: var(--ap-color-text);
  background: var(--ap-color-bg);
  transition: border-color .15s;
  box-sizing: border-box;
}
.ap-form-group input:focus { outline: none; border-color: var(--ap-color-text); }

.ap-otp-input {
  font-size: 28px !important;
  letter-spacing: .25em !important;
  text-align: center;
  font-family: var(--ap-font-display);
  max-width: 220px !important;
}

.ap-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap-req { color: #c00; }

.ap-form-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }

.ap-btn {
  padding: 10px 20px;
  font-size: 14px;
  border: 1px solid var(--ap-color-border);
  border-radius: var(--ap-radius);
  background: var(--ap-color-bg);
  color: var(--ap-color-text);
  cursor: pointer;
  transition: background .15s, opacity .15s;
  font-family: var(--ap-font-body);
}
.ap-btn:hover    { background: var(--ap-color-bg-alt); }
.ap-btn:disabled { opacity: .55; cursor: not-allowed; }
.ap-btn-primary  { background: var(--ap-color-text) !important; color: #fff !important; border-color: var(--ap-color-text) !important; }
.ap-btn-primary:hover { opacity: .85; }

.ap-switch-msg { font-size: 13px; color: var(--ap-color-muted); margin-top: 4px; }
.ap-switch-msg a { color: var(--ap-color-text); }

.ap-message {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--ap-radius);
  margin-top: 12px;
}
.ap-success { background: var(--ap-color-success-bg); color: var(--ap-color-success); }
.ap-error   { background: var(--ap-color-error-bg);   color: var(--ap-color-error); }
.ap-info    { background: var(--ap-color-info-bg);    color: var(--ap-color-info); }

/* ── File upload button ───────────────────────────────────────────────────── */
#ap-artwork-images-input { display: none; }
.ap-file-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 0.5px solid var(--ap-color-border);
  border-radius: var(--ap-radius);
  cursor: pointer;
  font-size: 13px;
  background: var(--ap-color-bg);
  margin-top: 6px;
}
.ap-file-btn:hover { background: var(--ap-color-bg-alt); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ap-hero-image-left,
  .ap-hero-image-right { grid-template-columns: 1fr; }
  .ap-hero-image-right .ap-profile-hero-img-wrap,
  .ap-hero-image-right .ap-profile-hero-text { order: unset; }
  .ap-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .ap-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .ap-cols-masonry { column-count: 2; }
}
@media (max-width: 480px) {
  .ap-cols-4,
  .ap-cols-3,
  .ap-cols-2 { grid-template-columns: 1fr; }
  .ap-cols-masonry { column-count: 1; }
  .ap-field-row { grid-template-columns: 1fr; }
}

/* ── Portal dashboard chrome ──────────────────────────────────────────────── */
.ap-portal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ap-color-border);
}
.ap-portal-name {
  font-family: 'Ubuntu', sans-serif !important;
  font-size: 28px;
  font-weight: 700 !important;
  margin: 4px 0 0;
  letter-spacing: 0 !important;
}

.ap-portal h1,
.ap-portal h2,
.ap-portal h3 {
  font-family: 'Ubuntu', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  font-style: normal !important;
}

.ap-status-bar { font-size: 13px; margin-bottom: 20px; color: var(--ap-color-muted); }
.ap-status-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; }
.ap-status-draft   { background: #f1efe8; color: #5f5e5a; }
.ap-status-pending { background: #fff3cd; color: #856404; }
.ap-status-live    { background: #d1e7dd; color: #0a5f38; }
.ap-reject-note-inline { display: block; margin-top: 6px; padding: 6px 10px; background: #fdf0f0; color: #8b1a1a; border-radius: 4px; font-size: 12px; }

.ap-portal-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ap-color-border); margin-bottom: 28px; }
.ap-portal-tab { padding: 9px 18px; font-size: 13px; text-decoration: none; color: var(--ap-color-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ap-portal-tab:hover { color: var(--ap-color-text); }
.ap-tab-active  { color: var(--ap-color-text) !important; border-bottom-color: var(--ap-color-text) !important; }

.ap-form-section-title {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ap-color-muted);
  margin: 28px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--ap-color-border);
}
.ap-form-section-title:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.ap-form-group { margin-bottom: 16px; }
.ap-form-group label { display: block; font-size: 13px; color: var(--ap-color-muted); margin-bottom: 5px; }
.ap-form-group input,
.ap-form-group textarea,
.ap-form-group select {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--ap-color-border);
  border-radius: var(--ap-radius);
  background: var(--ap-color-bg);
  color: var(--ap-color-text);
  font-family: var(--ap-font-body);
  box-sizing: border-box;
  transition: border-color .15s;
}
.ap-form-group input:focus,
.ap-form-group textarea:focus,
.ap-form-group select:focus { outline: none; border-color: var(--ap-color-text); }
.ap-form-group textarea { resize: vertical; line-height: 1.6; }

.ap-img-preview { width: 80px; height: 80px; object-fit: cover; border-radius: var(--ap-radius); display: block; margin-bottom: 8px; border: 1px solid var(--ap-color-border); }
.ap-artwork-thumb-preview { width: 60px; height: 60px; object-fit: cover; border-radius: var(--ap-radius); border: 1px solid var(--ap-color-border); }

/* ── White background on profile and portal pages ────────────────────────── */
.ap-profile-page { background: #fff; }
.ap-portal { background: #fff; }