/*
Theme Name: Brekky B-Rex
Description: The Brekky B-Rex homepage, photo galleries, and illustrated Adventures.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: brekky-b-rex
*/
:root {
  --paper: #fff7e9;
  --ink: #28213b;
  --purple: #4a3270;
  --line: #332747;
  --lavender: #e6d8ff;
  --pink: #fecbe2;
  --orange: #f76f3d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 system-ui, sans-serif; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #6d3dcc; outline-offset: 5px; }
figure, p, h1, h2, h3 { margin: 0; }
img { display: block; width: 100%; height: auto; }
.wrap { width: min(1180px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; padding: 10px; background: white; z-index: 5; transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 2px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; }
.brand, nav a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 950; font-size: 1.16rem; letter-spacing: -.065em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; background: var(--orange); border: 1.5px solid; border-radius: 50%; margin-right: 4px; font-size: 1rem; }
nav { display: flex; gap: clamp(16px, 3vw, 40px); font-weight: 750; }
nav a:hover, .mini-photo:hover { text-decoration: underline; text-underline-offset: 5px; }
.hero { background: var(--lavender); border-bottom: 2px solid var(--line); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 54px; padding-block: 62px 76px; }
.eyebrow { font-size: .875rem; letter-spacing: .13em; font-weight: 850; color: var(--purple); }
.hero .eyebrow span { color: #702e17; margin-right: 4px; }
h1, h2, h3 { line-height: .98; letter-spacing: -.07em; font-weight: 950; }
h1 { font-size: clamp(4.8rem, 9vw, 8.75rem); margin-block: 14px 24px; }
h1 span { display: block; color: #582ab0; }
h2 { font-size: clamp(2.7rem, 5.8vw, 5rem); }
h3 { font-size: clamp(1.5rem, 2.3vw, 2.1rem); letter-spacing: -.055em; }
.intro { max-width: 420px; font-size: clamp(1.06rem, 2vw, 1.22rem); }
.action { display: inline-block; padding: 13px 23px; margin-top: 27px; border-radius: 7px; background: var(--orange); border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--line); text-decoration: none; font-weight: 850; }
.action:hover { background: #ff8f60; }
.hero-photo { background: var(--paper); padding: 15px; border: 2px solid var(--line); border-radius: 12px; box-shadow: 9px 9px 0 var(--line); transform: rotate(3deg); position: relative; }
.hero-photo img { aspect-ratio: 1.18; object-fit: cover; object-position: center 45%; border-radius: 4px; }
.hero-photo figcaption { display: flex; gap: 9px 12px; align-items: center; flex-wrap: wrap; padding: 11px 0 0; font-weight: 680; }
.portrait-label { padding: 2px 8px; background: var(--lavender); border-radius: 4px; color: #472777; font-size: .875rem; font-weight: 850; letter-spacing: .05em; white-space: nowrap; }
.spark { position: absolute; display: grid; place-items: center; right: -19px; top: -34px; width: 73px; height: 73px; border: 2px solid var(--line); border-radius: 50%; background: #ffc54c; font-size: 3.2rem; line-height: 1; transform: rotate(-10deg); }
.section { padding-block: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; margin-block: 8px 31px; }
.section-heading p { font-size: 1.05rem; }
.gallery-grid, .friends-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { border: 2px solid var(--line); border-radius: 13px; padding: 9px; background: #fffdf8; box-shadow: 4px 4px 0 var(--line); }
.gallery-photo, .photo-frame { display: block; overflow: hidden; border-radius: 6px; }
.gallery-photo img { width: 100%; aspect-ratio: 1.2; object-fit: cover; transition: transform 170ms ease; }
.gallery-photo:hover img { transform: scale(1.04); }
.gallery-photo.cowboy img { object-position: center 37%; }
.gallery-photo.cyber img { object-position: center 36%; }
.gallery-photo.lake img { object-position: center 30%; }
.card-copy { padding: 14px 10px 12px; }
.card-copy h3 { margin-block: 7px 6px; }
.real { background: var(--pink); border-block: 2px solid var(--line); }
.real-inner { display: grid; grid-template-columns: .9fr 1fr; align-items: center; gap: clamp(32px, 7vw, 100px); }
.photo-frame { padding: 10px; border: 2px solid var(--line); background: var(--paper); box-shadow: 6px 6px 0 var(--line); transform: rotate(-2deg); }
.photo-frame img { aspect-ratio: 1.25; object-fit: cover; object-position: 50% 46%; border-radius: 4px; }
.real h2 { margin-block: 9px 17px; }
.real-intro { max-width: 410px; font-size: 1.13rem; }
.mini-photo { display: inline-flex; align-items: center; gap: 13px; margin-top: 22px; font-weight: 800; text-decoration: none; }
.mini-photo img { width: 58px; height: 58px; border: 2px solid var(--line); border-radius: 50%; object-fit: cover; }
.friends .gallery-photo img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--lavender); }
.friends .gallery-photo:hover img { transform: none; }
footer { border-top: 2px solid var(--line); background: #f6deac; }
dialog { width: max-content; max-width: min(90vw, 950px); padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #241936cf; }
dialog figure img { width: auto; max-width: 100%; max-height: 74vh; margin-inline: auto; border-radius: 5px; }
dialog figcaption { padding: 8px 4px 0; font-weight: 750; }
dialog button { position: absolute; right: 20px; top: 20px; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 44px); }
  .hero-inner { gap: 27px; }
  .gallery-grid, .friends-grid { gap: 14px; }
}
@media (max-width: 650px) {
  .header-inner { flex-wrap: wrap; justify-content: center; gap: 7px 24px; padding-block: 12px; }
  .hero-inner, .real-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { gap: 38px; padding-block: 38px 42px; }
  .hero-photo, .photo-frame { transform: none; }
  .hero-photo img { aspect-ratio: 1.3; }
  .spark { right: -12px; top: -19px; width: 52px; height: 52px; font-size: 2.25rem; }
  .section { padding-block: 45px; }
  .gallery-grid, .friends-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .gallery-photo img { aspect-ratio: 1.55; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.gallery-photo.science img { object-position: 50% 33%; }
.gallery-photo.hockey img { object-position: 50% 29%; }
.gallery-photo.airport img { object-position: 41% center; }
.mini-gallery { display: flex; flex-wrap: wrap; gap: 0 22px; }
.mini-photo img { object-position: top; }
.friend-link { display: inline-block; margin-top: 8px; font-weight: 750; text-underline-offset: 3px; }

nav { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.adventure-hero { background: var(--pink); border-bottom: 2px solid var(--line); }
.adventure-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .72fr);
  align-items: center;
  gap: clamp(24px, 5vw, 65px);
  padding-block: clamp(36px, 6vw, 78px);
}
.adventure-hero h1 { font-size: clamp(2.75rem, 7.8vw, 7.25rem); }
.adventure-cover {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--line);
}
.scene-photo { display: block; border-radius: 6px; }
.scene-photo img { border-radius: inherit; }
.story-heading { display: grid; gap: 16px; margin-bottom: 28px; }
.story-heading p, .story-ending { max-width: 66ch; font-size: 1.12rem; }
.story-ending { margin-top: 24px; }
.birthday-grid, .snack-grid { display: grid; gap: 22px; align-items: start; }
.birthday-grid { grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); }
.birthday-grid .scene-photo img {
  width: 100%;
  height: clamp(270px, 32vw, 450px);
  object-fit: contain;
  background: var(--lavender);
}
.snack-section { background: var(--lavender); border-top: 2px solid var(--line); }
.snack-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.story-card .card-copy { padding: 14px 12px 18px; }
.story-card h3 { line-height: 1.08; margin-bottom: 8px; }
.friends-story {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--lavender);
}
.friends-story h3 { margin-bottom: 8px; }
.friends-story p { max-width: 61ch; }
.friends-story .action { margin-top: 0; }
@media (max-width: 950px) {
  .snack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .adventure-hero-inner, .birthday-grid, .snack-grid { grid-template-columns: minmax(0, 1fr); }
  .birthday-grid .scene-photo img { height: auto; }
}

.adventure-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 22px; margin-top: 27px; }
.adventure-links .action, .adventure-links .friend-link { margin-top: 0; }
.story-card .card-copy p + p { margin-top: 10px; }


/* Lab Coat Buzz */
.buzz-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 310px);
  gap: clamp(22px, 5vw, 60px);
  align-items: center;
  margin-bottom: 26px;
}
.buzz-intro .story-heading { margin: 0; }
.buzz-portrait { margin: 0; }
.buzz-portrait img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.buzz-portrait figcaption { margin-top: 8px; font-size: .94rem; }
.buzz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.buzz-scene img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.buzz-stakeout img { object-fit: contain; background: #28423e; }
.buzz-last-squeak { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 640px) {
  .buzz-intro, .buzz-grid, .buzz-last-squeak { grid-template-columns: minmax(0, 1fr); }
  .buzz-portrait { width: min(100%, 310px); }
}

/* Home teasers and full-story panels */
.home-stories { padding-bottom: clamp(28px, 4vw, 52px); }
.story-teasers { display: grid; gap: 14px; }
.story-teaser { margin: 0; padding: clamp(14px, 2vw, 20px); }
.story-teaser .action { padding: 9px 15px; }
.home-stories + .friends { padding-top: 14px; }
.adventure-links { padding: 0; list-style: none; }
.story-panels { display: grid; gap: clamp(26px, 5vw, 56px); padding-block: clamp(30px, 6vw, 72px); }
.story-panel {
  min-width: 0;
  padding: clamp(16px, 4vw, 46px);
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 5px 5px 0 var(--line);
  scroll-margin-top: 16px;
}
.story-panel .story-heading h2 { font-size: clamp(2.35rem, 5.3vw, 4.5rem); overflow-wrap: break-word; }
.story-panel.snack-section { background: var(--lavender); }
.story-panel#gordito { background: #fff0df; }
.story-panel#buzz { background: #e5f3ed; }
@media (max-width: 650px) {
  .story-teaser { align-items: flex-start; flex-direction: column; gap: 12px; }
  .story-panel .story-heading h2 { font-size: clamp(1.85rem, 8vw, 3.1rem); }
}

/* Birthday Splash finale */
.birthday-finale {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 3vw, 34px);
  margin-top: 24px;
  scroll-margin-top: 16px;
}
.birthday-finale .card-copy { max-width: 62ch; }
@media (max-width: 650px) {
  .birthday-finale { grid-template-columns: minmax(0, 1fr); }
}

.wp-entry { max-width: 72ch; margin-top: 1.5rem; }
.story-panels + .story-panels { padding-top: 0; }
