/* ============================================================
   BURDS NERDS — bn-image-guide.css
   Article-scoped styles for /blog/chatgpt-image-prompts-for-beginners
   (the ten-image ChatGPT guide). Loaded only by that post, after
   bn-blog.css and PhotoSwipe's own stylesheet. Every selector sits
   under .ig (the article) or .ig-pswp (its lightbox), so nothing
   here can reach the photography portfolio or any other page.

   CONTRAST, measured against each element's actual fill:
     Text on --bn-surf uses --bn-text in BOTH themes (15.12:1 light,
       14.53:1 dark). In light mode every other token falls short on
       that fill (the reason bn-blog.css overrides the CTA the same way).
     Captions on --bn-bg use --bn-text-muted (4.94:1 light, 5.15:1 dark).
     The copy button border uses --bn-text-muted: 4.41:1 on --bn-surf
       in light, about 4.6:1 in dark, clearing 3:1 for a control edge.
     The lightbox is always dark, so its caption colors are fixed
       custom properties that mirror the dark-theme tokens.
   MOTION: only color/border transitions; PhotoSwipe honors
   prefers-reduced-motion itself, and the adapter disables its fade.
   ============================================================ */

/* Anchored sections clear the fixed site header. */
.ig [id] {
  scroll-margin-top: 96px;
}

.ig-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Prompt formula line ─────────────────────────────────── */
.ig .ig-formula {
  padding: 16px 20px;
  border-left: 3px solid var(--bn-acc);
  background: var(--bn-surf);
  border-radius: 0 var(--bn-radius-sm) var(--bn-radius-sm) 0;
  color: var(--bn-text);
}

/* ── Ten-card gallery ────────────────────────────────────── */
.ig .ig-gallery {
  list-style: none;
  margin: 0 0 2em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
}

.ig .ig-gallery li {
  margin: 0;
}

/* Square neutral frame; object-fit: contain keeps posters, packaging,
   comics, and the infographic whole instead of cropping them. */
.ig .ig-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: var(--bn-surf);
  border: 1px solid var(--bn-bdr);
  border-radius: var(--bn-radius-sm);
  transition: border-color var(--bn-duration) var(--bn-ease);
}

.ig .ig-card__media:hover {
  opacity: 1;
  border-color: var(--bn-acc);
}

.ig .ig-card__media picture,
.ig .ig-card__media img {
  display: block;
  width: 100%;
  height: 100%;
}

.ig .ig-card__media img {
  object-fit: contain;
}

.ig .ig-card__label {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.blog-post__body .ig-card__label a {
  color: var(--bn-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ig .ig-card__num {
  font-weight: 700;
  margin-right: 4px;
}

@media (min-width: 600px) {
  .ig .ig-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 16px;
  }
}

/* ── Recipe figures ──────────────────────────────────────── */
.ig .ig-figure {
  margin: 0 auto 1.25em;
}

.ig .ig-figure--square   { max-width: 420px; }
.ig .ig-figure--portrait { max-width: 280px; }

.ig .ig-figure a {
  display: block;
  background: var(--bn-surf);
  border-radius: var(--bn-radius-sm);
  overflow: hidden;
}

.ig .ig-figure a:hover {
  opacity: 1;
}

.ig .ig-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.ig .ig-figure figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bn-text-muted);
}

/* ── Prompt blocks with a Copy button ────────────────────── */
.ig .ig-prompt {
  margin: 0 0 1.5em;
  background: var(--bn-surf);
  border: 1px solid var(--bn-bdr);
  border-radius: var(--bn-radius);
}

.ig .ig-prompt__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--bn-bdr);
}

.blog-post__body .ig-prompt__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bn-text);
}

/* Prose prompts read better in the body font than in monospace. */
.ig .ig-prompt__text {
  margin: 0;
  padding: 14px 16px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--bn-font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--bn-text);
  background: none;
  border: 0;
}

.ig .ig-prompt__text:focus-visible {
  outline-offset: -3px;
}

.ig .ig-copy {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--bn-text-muted);
  border-radius: var(--bn-radius-sm);
  background: var(--bn-bg);
  color: var(--bn-text);
  font-family: var(--bn-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--bn-duration) var(--bn-ease);
}

.ig.ig--js .ig-copy {
  display: inline-flex;
}

.ig .ig-copy svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ig .ig-copy:hover {
  border-color: var(--bn-text);
}

.ig .ig-copy[data-state="copied"] {
  border-color: var(--bn-text);
}

/* ── "Make it yours" line ────────────────────────────────── */
.ig .ig-make-yours strong {
  color: var(--bn-text);
}

/* ── Download block ──────────────────────────────────────── */
.ig .ig-download {
  margin: 2em 0;
  padding: 20px;
  background: var(--bn-surf);
  border: 1px solid var(--bn-bdr);
  border-left: 3px solid var(--bn-acc);
  border-radius: var(--bn-radius);
}

.blog-post__body .ig-download__title {
  margin: 0 0 6px;
  font-family: var(--bn-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--bn-text);
}

.blog-post__body .ig-download__text {
  margin: 0 0 16px;
  color: var(--bn-text);
}

.blog-post__body .ig-download__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0;
}

/* The body's gold link color would otherwise turn the button label
   gold on gold; the button keeps its own --bn-acc-on text (5.84:1). */
.blog-post__body .ig-download a.btn-primary {
  color: var(--bn-acc-on);
  text-decoration: none;
  white-space: normal;
  line-height: 1.4;
  text-align: left;
}

.blog-post__body .ig-download a.ig-download__alt {
  color: var(--bn-text);
  font-size: 14px;
}

/* ── Before / after pair ─────────────────────────────────── */
.ig .ig-compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0 0 1.5em;
}

.ig .ig-compare .ig-figure {
  margin: 0;
}

.blog-post__body .ig-compare__label {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--bn-text);
}

@media (min-width: 600px) {
  .ig .ig-compare {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .ig .ig-download {
    padding: 24px 28px;
  }
}

/* ── Lightbox caption bar (PhotoSwipe adds .ig-pswp) ─────── */
.ig-pswp {
  --ig-cap-bg: rgba(17, 16, 16, 0.9);   /* --bn-bg (dark) at 90% */
  --ig-cap-text: #F0EDE6;               /* --bn-text (dark) */
}

.ig-pswp .pswp__ig-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 16px;
  background: var(--ig-cap-bg);
  color: var(--ig-cap-text);
  text-align: center;
  font-family: var(--bn-font-body);
  font-size: 14px;
  line-height: 1.5;
  transition: opacity var(--bn-duration) var(--bn-ease);
}

.ig-pswp:not(.pswp--ui-visible) .pswp__ig-caption {
  opacity: 0;
  pointer-events: none;
}

.ig-pswp .ig-pswp__caption-text {
  max-width: 640px;
  margin: 0 auto;
}

.ig-pswp .ig-pswp__caption-link {
  display: inline-block;
  min-height: 44px;
  padding: 12px 8px 0;
  color: var(--ig-cap-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ig-pswp .ig-pswp__caption-link:focus-visible {
  outline: 2px solid var(--ig-cap-text);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ig .ig-card__media,
  .ig .ig-copy,
  .ig-pswp .pswp__ig-caption {
    transition: none;
  }
}
