/* ──────────────────────────────────────────────────────────────────
   Share & Promote — modal + trigger button
   Append this block to /css/styles.css (the existing site stylesheet).
   ────────────────────────────────────────────────────────────────── */

/* ── Trigger button (placed in .action-row alongside other CTAs) ── */

/* The Share trigger uses the existing outline/.btn-preview height
   system so it sits flush with neighboring buttons. */
.button.btn-share {
  background: transparent;
  color: var(--black);
  border: 1px solid var(--black);
  padding: 10px 20px;
  margin: 0;
  float: none;
  display: inline-block;
  cursor: pointer;
  font-family: trackim_font, Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 1px;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.button.btn-share:hover {
  background: var(--grey-lt);
  color: var(--black);
  border-color: var(--black);
}

/* ── Modal scaffolding ─────────────────────────────────────────── */

.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}
.share-modal[hidden] {
  display: none;
}
.share-modal.active {
  opacity: 1;
}

.share-modal-content {
  background: var(--white);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 28px 26px 24px;
  font-family: trackim_font, Arial, sans-serif;
  color: var(--black);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
}

.share-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--grey-dk, #555);
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
}
.share-modal-close:hover {
  background: var(--grey-lt, #eee);
  color: var(--black);
}

.share-modal-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--black);
}
.share-modal-subtitle {
  margin: 0 0 18px 0;
  font-size: 14px;
  color: var(--grey-dk, #555);
  line-height: 1.4;
}

/* ── Item preview strip ────────────────────────────────────────── */

.share-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--grey-lt, #f5f5f5);
  border-radius: 8px;
  margin-bottom: 20px;
}
.share-modal-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--white);
  flex-shrink: 0;
}
.share-modal-item-text {
  flex: 1;
  min-width: 0;
}
.share-modal-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.share-modal-item-byline {
  font-size: 12px;
  color: var(--grey-dk, #666);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ── Section structure ─────────────────────────────────────────── */

.share-modal-section {
  margin-bottom: 18px;
}
.share-modal-section:last-child {
  margin-bottom: 0;
}
.share-modal-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--grey-dk, #666);
  margin-bottom: 10px;
  font-weight: 600;
}

/* ── Social grid ───────────────────────────────────────────────── */

.share-modal-socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.share-social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 6px;
  text-decoration: none;
  color: var(--black);
  font-size: 12px;
  letter-spacing: 0.3px;
  font-family: trackim_font, Arial, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 60px;
  text-align: center;
}
.share-social-btn:hover {
  background: var(--grey-lt, #f0f0f0);
  color: var(--black);
}
.share-social-btn:active {
  transform: translateY(1px);
}
.share-social-btn span {
  line-height: 1;
}

/* ── Email form ────────────────────────────────────────────────── */

.share-email-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-email-input,
.share-email-message {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--grey-md, #ccc);
  border-radius: 6px;
  font-family: trackim_font, Arial, sans-serif;
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  resize: vertical;
}
.share-email-input:focus,
.share-email-message:focus {
  outline: none;
  border-color: var(--black);
}
.share-email-message {
  min-height: 60px;
  font-family: inherit;
  line-height: 1.4;
}
.share-email-submit {
  width: auto;
  align-self: flex-start;
  margin: 4px 0 0 0;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
}
.share-email-note {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--grey-dk, #666);
  line-height: 1.4;
  font-style: italic;
}

/* ── Copy-link row ─────────────────────────────────────────────── */

.share-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.share-copy-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--grey-md, #ccc);
  border-radius: 6px;
  font-family: monospace, monospace;
  font-size: 13px;
  color: var(--grey-dk, #444);
  background: var(--grey-lt, #f8f8f8);
  box-sizing: border-box;
}
.share-copy-input:focus {
  outline: none;
  border-color: var(--black);
}
.share-copy-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  margin: 0;
  font-size: 13px;
  cursor: pointer;
  min-width: 90px;
}
.share-copy-btn--copied {
  background: #2e7d32 !important;
  color: var(--white) !important;
  border-color: #2e7d32 !important;
}

/* ── Artwork detail page: share row below preview buttons ──────── */

/* The artwork details column already stacks two preview buttons in
   a flex row. The share row sits just below that, full-width, so
   the visual hierarchy is: image preview / how-made → share → CTA. */
.artwork-share-row {
  margin-top: 0px;
}
.artwork-share-row .btn-share.artwork-share-btn {
  width: 100%;
}

/* ── Mobile tweaks ─────────────────────────────────────────────── */

@media (max-width: 600px) {
  .share-modal {
    padding: 12px;
    align-items: flex-end;
  }
  .share-modal-content {
    padding: 24px 20px 20px;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }
  .share-modal-title {
    font-size: 20px;
  }
  .share-modal-socials {
    /* Two columns reads better than three on narrow phones — the
       labels stay un-truncated and tap targets stay generous. */
    grid-template-columns: repeat(2, 1fr);
  }
  .share-copy-row {
    flex-direction: column;
  }
  .share-copy-btn {
    width: 100%;
  }
  .share-email-submit {
    width: 100%;
  }
}
