/* CSS-DOC: Page components | loaded immediately after overrides.css
 * Page-specific historical GIF frames, Channels artwork, recipe typography,
 * released-article invitations and Goodies archive buttons. These are not
 * global defaults. Preserve historical media, captions, responsive sizing,
 * active theme colours and keyboard focus. Rule order is unchanged from
 * the original trailing overrides.css sections, except that the shared
 * McRetro wordmark sizing remains in overrides.css.
 * See .github/CSS-ARCHITECTURE.md for the cascade and maintenance workflow.
 */
/* CSS-DOC: Page-specific historical artwork: preserve original GIFs and media dimensions; these rules are not global image defaults. */
/* Shared retro-GIF framing for Goodies, About and Channels.
   Warm stone in Light mode, cool silver in Dark mode. */
:root {
  --retro-gif-frame-bg: #E6E2D9;
  --retro-gif-frame-border: #626B70;
}
:root[data-theme="dark"] {
  --retro-gif-frame-bg: #CBD0D5;
  --retro-gif-frame-border: #71818C;
}

/* Goodies: match the compact framed animations on About and Channels.
   Keep the original file-copy GIF in the repository. */
.goodies-floppy-art {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 1.25rem auto 1.5rem;
}
.goodies-floppy-frame {
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--retro-gif-frame-border);
  border-radius: 0;
  background: var(--retro-gif-frame-bg);
}
.goodies-floppy-frame img {
  display: block;
  /* 2x its native 50 x 40 pixels: crisp detail without oversized framing. */
  width: 100px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* About: enlarge the running cat slightly while preserving its original GIF. */
.about-running-cat {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--retro-gif-frame-border);
  border-radius: 0;
  background: var(--retro-gif-frame-bg);
  margin: 1.25rem auto 1.5rem;
}
.about-running-cat img {
  display: block;
  width: 128px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* About > My Internet History: match the 600px, 16:9 framing of the
   About McRetro image. The original JPEG and shared .media-caption spacing
   remain unchanged; only its displayed dimensions are adjusted. */
.about-panel > .center img[src$="/assets/images/about/zap_it_here.jpg"] {
  width: 600px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: center;
}

/* Channels: preserve the original TV GIF at 1.5x scale in a compact frame. */
.channels-tv-art {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--retro-gif-frame-border);
  border-radius: 0;
  background: var(--retro-gif-frame-bg);
  margin: 1.25rem auto 1.5rem;
}
.channels-tv-art img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Align the three framed header GIFs with their introductory text,
   maintaining a 24px gap on desktop. On narrow screens they stay centred. */
@media screen and (min-width: 651px) {
  .about-running-cat,
  .channels-tv-art,
  .goodies-floppy-art {
    float: right;
    margin: 1.25rem 0 1rem 1.5rem;
  }

  /* Keep expandable sections below each complete introduction. */
  .about-running-cat ~ details.about-panel:first-of-type,
  .channels-tv-art ~ details.about-panel:first-of-type,
  .goodies-floppy-art ~ details.about-panel:first-of-type {
    clear: right;
  }
}

/* CSS-DOC: Channels artwork: existing JXL banners get scoped presentation changes; subsequent sections handle recipes, Nest links and Goodies collections. */
/* Channels-only illustrated banners: reuse the existing dark JXL artwork in
   Light, Dark, and Bird modes. The modest card framing is intentionally local to
   these four channel illustrations and does not change the site's theme palettes. */
.channels-art {
  display: block;
  box-sizing: border-box;
  background-color: #242B38;
  background-repeat: no-repeat;
  /* A gentle 18% focal zoom lifts the artwork without changing the JXL files. */
  background-size: 118% auto;
  background-position: center;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
:root[data-theme="dark"] .channels-art {
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}
.about-panel > .channels-art--section {
  width: calc(100% - 2rem);
  aspect-ratio: 7 / 1;
  margin: 0.75rem 1rem 0.9rem;
}
.channels-art--nix {
  background-image: url('/assets/images/channels/mcretro_nix_dark_cropped_7x1.jxl');
}
.channels-art--gaming {
  background-image: url('/assets/images/channels/mcretro_gaming_dark_cropped_7x1.jxl');
}
.channels-art--supernature {
  background-image: url('/assets/images/channels/mcretro_supernature_dark_cropped_7x1.jxl');
}
.channels-art--chirp {
  background-image: url('/assets/images/channels/mcretro_chirp_dark_cropped_7x1.jxl');
}
@media (max-width: 600px) {
  /* Mobile channel art favours the first recognizable objects over an even
     centre crop. Keep the existing JXL banners and desktop layout unchanged. */
  .channels-art--section {
    background-size: auto 108%;
  }
  .about-panel > .channels-art--section {
    aspect-ratio: auto;
    height: clamp(70px, 24vw, 95px);
    width: calc(100% - 1.5rem);
    margin: 0.75rem 0.75rem 0.85rem;
  }
  .channels-art--nix {
    background-position: 24% center;
  }
  .channels-art--gaming {
    background-position: 22% center;
  }
  .channels-art--supernature {
    background-position: 20% center;
  }
  .channels-art--chirp {
    background-position: 18% center;
  }
}

/* Recipe page typography and media captions.
   Recipes use the default layout, not .post-full .post-content.
   Keep these rules scoped to /recipes/ so blog posts and site themes stay intact. */
body[data-recipe-page="true"] .content-area > h2:first-child {
  font-size: 1.75rem;
  line-height: 1.35;
  margin: 0 0 0.35em;
}
body[data-recipe-page="true"] .content-area > h2:not(:first-child) {
  font-size: 1.375rem;
  line-height: 1.35;
  margin: 1em 0 0.25em;
}
body[data-recipe-page="true"] .content-area > h3 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 1.35em 0 0.25em;
}
body[data-recipe-page="true"] .content-area > :is(h4, h5, h6) {
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 1.2em 0 0.25em;
}
body[data-recipe-page="true"] .content-area > :is(h2, h3, h4, h5, h6) + :is(p, ul, ol),
body[data-recipe-page="true"] .content-area > :is(ul, ol) {
  margin-top: 0;
}
body[data-recipe-page="true"] .content-area > p:not(.media-caption) {
  margin-bottom: 1.15em;
}

/* Keep each caption close to its photo, while centring both as on blog posts. */
body[data-recipe-page="true"] .content-area > p:has(> img:only-child):has(+ p.media-caption),
body[data-recipe-page="true"] .content-area > p:has(> a:only-child > img:only-child):has(+ p.media-caption) {
  margin-bottom: 0.25rem;
}
body[data-recipe-page="true"] .content-area > p:has(> img:only-child) > img,
body[data-recipe-page="true"] .content-area > p:has(> a:only-child > img:only-child) > a > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
body[data-recipe-page="true"] .content-area > p:has(> a:only-child > img:only-child) > a {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
body[data-recipe-page="true"] .content-area > p.media-caption {
  max-width: 100%;
  margin: 0 auto 1.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}
body[data-recipe-page="true"] .content-area > p.media-caption:has(+ p:not(.media-caption):not(:has(img))) {
  margin-bottom: 1.15rem;
}
@media screen and (max-width: 600px) {
  body[data-recipe-page="true"] .content-area > p.media-caption {
    margin-bottom: 1.35rem;
  }
}

/* An optional entrance to the Nest on released parrot articles only.
   Light and Dark show the invitation; Bird already provides that experience. */
.post-full .chirp-view-invitation {
  margin: 0.1rem 0 1.25rem;
}
.post-full .chirp-view-invitation a {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-left: 3px solid #29A518;
  background: var(--panel);
  color: var(--link);
  font: 700 0.8125rem/1.5 Montserrat, "Helvetica Neue", sans-serif;
  text-decoration: none;
}
.post-full .chirp-view-invitation a:hover {
  background: var(--interactive-hover);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.post-full .chirp-view-invitation a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
:root[data-theme="bird"] .chirp-view-invitation {
  display: none;
}


/* Goodies' independent File Server and Photo Gallery collections.
   Use the same accessible Archive-blue palette in Light and Dark modes. */
.goodies-archive-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.9rem;
}
.goodies-archive-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--archive-accent);
  border-left: 3px solid var(--archive-accent);
  border-radius: 4px;
  background: var(--archive-filled);
  color: var(--archive-filled-text);
  font: 700 0.85rem/1.45 Montserrat, "Helvetica Neue", sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.goodies-archive-button:hover {
  background: var(--archive-filled-hover);
  color: var(--archive-filled-text);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
a.goodies-archive-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

