/*
 * assets/css/social.css
 * ─────────────────────────────────────────────────────────────────────────────
 * Styles for: social share buttons, OG image, video embeds, "Seen on Social",
 *             Pinterest hover "Pin It" button, copy-link toast.
 *
 * No external frameworks or icon libraries — fully self-contained.
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Custom properties ────────────────────────────────────────────────────── */
:root {
  --sp-orange:    #FF6B35;
  --sp-gold:      #FFD166;
  --sp-green:     #06D6A0;
  --sp-dark:      #1A1A2E;
  --sp-mid:       #44475A;
  --sp-light:     #F8F9FA;
  --sp-radius:    999px;       /* pill shape */
  --sp-radius-md: 12px;
  --sp-shadow:    0 4px 16px rgba(0,0,0,.14);
  --sp-trans:     0.18s ease;

  /* Brand colours for share buttons */
  --clr-pinterest:  #E60023;
  --clr-facebook:   #1877F2;
  --clr-twitter:    #0F1419;
  --clr-whatsapp:   #25D366;
  --clr-copy:       #6C63FF;
  --clr-print:      #555770;
  --clr-native:     var(--sp-orange);
}

/* ════════════════════════════════════════════════════════════════════════════
   SOCIAL SHARE BAR
   ════════════════════════════════════════════════════════════════════════════ */

.social-share {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border-radius: var(--sp-radius-md);
  box-shadow: var(--sp-shadow);
}

.social-share__label {
  margin: 0 0 1rem;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sp-mid);
}

.social-share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

/* ── Base share button ─────────────────────────────────────────────────────── */

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border: none;
  border-radius: var(--sp-radius);
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--sp-trans), transform var(--sp-trans), box-shadow var(--sp-trans);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover,
.share-btn:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
  outline: none;
}

.share-btn:active {
  transform: translateY(0);
  filter: brightness(.95);
}

.share-btn__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.share-btn__icon svg {
  width: 18px;
  height: 18px;
}

/* ── Button brand colours ──────────────────────────────────────────────────── */

.share-btn--pinterest { background-color: var(--clr-pinterest); }
.share-btn--facebook  { background-color: var(--clr-facebook);  }
.share-btn--twitter   { background-color: var(--clr-twitter);   }
.share-btn--whatsapp  { background-color: var(--clr-whatsapp);  }
.share-btn--copy      { background-color: var(--clr-copy);      }
.share-btn--print     { background-color: var(--clr-print);     }
.share-btn--native    { background: linear-gradient(135deg, var(--sp-orange), var(--sp-gold)); }

/* ── "Copied!" state ──────────────────────────────────────────────────────── */

.share-btn--copy.copied {
  background-color: var(--sp-green);
}

/* ── Toast notification ───────────────────────────────────────────────────── */

.share-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: var(--sp-dark);
  color: #fff;
  padding: .7rem 1.5rem;
  border-radius: var(--sp-radius);
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
  box-shadow: var(--sp-shadow);
}

.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════════════════════════════════
   VIDEO EMBEDS — "Seen on Social" section
   ════════════════════════════════════════════════════════════════════════════ */

.video-section {
  margin: 3rem 0;
}

/* ── Section header ───────────────────────────────────────────────────────── */

.video-section__header {
  margin-bottom: 1.5rem;
}

.video-section__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sp-dark);
  margin: 0 0 .4rem;
}

.video-section__icon {
  display: flex;
  color: var(--sp-orange);
}

.video-section__emoji {
  font-style: normal;
}

.video-section__intro {
  color: var(--sp-mid);
  font-size: .95rem;
  margin: 0;
}

/* ── Video grid ───────────────────────────────────────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 1.5rem;
}

/* ── Individual embed card ────────────────────────────────────────────────── */

.video-embed {
  background: #fff;
  border-radius: var(--sp-radius-md);
  box-shadow: var(--sp-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-embed__badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  margin: .8rem .8rem 0;
  border-radius: var(--sp-radius);
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  width: fit-content;
}

.video-embed__badge--youtube   { background: #FF0000; }
.video-embed__badge--tiktok    { background: #010101; }
.video-embed__badge--instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.video-embed__views {
  font-weight: 400;
  opacity: .85;
}

.video-embed__title {
  padding: .5rem .8rem;
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--sp-dark);
  line-height: 1.4;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Responsive 16:9 wrapper (YouTube / other) ────────────────────────────── */

.video-embed__wrapper--16x9 {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;   /* 9 / 16 = 56.25% */
  height: 0;
  overflow: hidden;
}

.video-embed__wrapper--16x9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── TikTok wrapper ───────────────────────────────────────────────────────── */

.video-embed__wrapper--tiktok {
  display: flex;
  justify-content: center;
  padding: .5rem 0;
}

.video-embed__wrapper--tiktok .tiktok-embed {
  margin: 0 auto;
}

/* ── Instagram wrapper ────────────────────────────────────────────────────── */

.video-embed__wrapper--instagram {
  display: flex;
  justify-content: center;
  padding: .5rem 0;
}

/* ── External link ────────────────────────────────────────────────────────── */

.video-embed__external-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .8rem .8rem;
  font-size: .8rem;
  color: var(--sp-orange);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--sp-trans);
}

.video-embed__external-link:hover {
  color: #c04e1f;
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════════════
   PINTEREST "PIN IT" HOVER BUTTON
   ════════════════════════════════════════════════════════════════════════════ */

/*
 * The parent recipe image container should have:
 *   position: relative;  (JS adds this automatically via social.js)
 *
 * JS adds the button dynamically on hover — this is the injected element's style.
 */

.pin-it-btn {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  background: var(--clr-pinterest);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--sp-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
  font-family: inherit;
}

.pin-it-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Shown state (toggled by JS on image hover) */
.recipe-hero-img:hover .pin-it-btn,
.pin-it-btn.pin-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════════════════════════════════════════ */

@media print {
  .social-share,
  .video-section {
    display: none !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .social-share {
    padding: 1rem;
  }

  .share-btn {
    padding: .5rem .9rem;
    font-size: .82rem;
  }

  .share-btn__text {
    /* On very narrow screens, hide text labels to keep buttons compact */
    display: none;
  }

  .share-btn__icon svg {
    width: 22px;
    height: 22px;
  }

  .video-section__title {
    font-size: 1.2rem;
  }
}

@media (max-width: 360px) {
  .social-share__buttons {
    gap: .4rem;
  }
}
