/* Life layer: bigger hero photo, thank-you carousel, social rows, polaroid gallery,
   washi-tape textures and small moving details. Loaded last. */

/* ---------- Brand: "The" in handwriting ---------- */
.brand-the { font: 700 1.15rem/1 var(--font-hand); color: var(--rose); margin-right: 1px; }

/* ---------- Hero: three big photos, the number note in its own space ---------- */
.scrapbook { min-height: 680px; }
.scrapbook .s1 { width: 58%; left: 0; top: 0; z-index: 2; }
.scrapbook .s1 img { aspect-ratio: 4 / 4.7; }
.scrapbook .s2 { width: 47%; right: -2%; top: 3%; z-index: 1; }
.scrapbook .s3 { width: 47%; right: 3%; bottom: 0; top: auto; z-index: 3; }
.scrapbook .sticky { left: 3%; right: auto; bottom: 1%; z-index: 4; width: 178px; }
.scrapbook .doodle.heart { left: 50%; top: -4%; }
.scrapbook .doodle.sparkle { left: 44%; right: auto; bottom: 6%; }
.scrapbook .doodle.star { right: -3%; top: 50%; }
.hero-note { left: -12%; top: 0; }
@media (max-width: 880px) { .scrapbook { min-height: 0; aspect-ratio: 1 / 1.12; } }
@media (max-width: 480px) { .scrapbook .sticky { width: 126px; bottom: 0; } }

/* ---------- Washi tape with real texture (stripes and dots) ---------- */
.snap::before, .stat::before, .donor::before, .thanks-card::before, .gal::before {
  background-image:
    repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 4px, transparent 4px 9px),
    linear-gradient(rgba(0,0,0,.03), rgba(0,0,0,.03));
}
.snap.tape-sky::before { background-image: radial-gradient(rgba(255,255,255,.55) 1.6px, transparent 2px) 0 0 / 8px 8px; }

/* ---------- Thank-you carousel ---------- */
.thanks-band { overflow: hidden; }
.carousel { position: relative; }
.carousel::before, .carousel::after { content: ""; position: absolute; top: 0; bottom: 0; width: clamp(20px, 6vw, 90px); z-index: 2; pointer-events: none; }
.carousel::before { left: 0; background: linear-gradient(90deg, var(--cream), transparent); }
.carousel::after { right: 0; background: linear-gradient(-90deg, var(--cream), transparent); }
.carousel-track {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 26px max(var(--gutter), calc((100vw - var(--wrap)) / 2)) 34px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
}
.carousel-track::-webkit-scrollbar { display: none; }
.thanks-card {
  flex: 0 0 clamp(250px, 28vw, 330px); scroll-snap-align: start; position: relative;
  background: var(--paper-warm); background-image: var(--tex-fibre); border-radius: 4px; padding: 30px 24px 24px;
  box-shadow: 0 1px 2px rgba(42,32,36,.1), 0 18px 30px -18px rgba(42,32,36,.5);
  rotate: var(--tilt, 0deg); transition: rotate .3s ease, transform .3s ease;
}
.thanks-card:nth-child(3n+2) { background-color: #FFF4F6; }
.thanks-card:nth-child(3n) { background-color: #F1F8FB; }
.thanks-card::before { content: ""; position: absolute; top: -11px; left: 50%; width: 84px; height: 24px; transform: translateX(-50%) rotate(-3deg); background-color: rgba(244,205,24,.7); }
.thanks-card:nth-child(3n+2)::before { background-color: rgba(217,72,111,.45); }
.thanks-card:nth-child(3n)::before { background-color: rgba(140,203,224,.75); }
.thanks-card:hover { rotate: 0deg; transform: translateY(-6px); }
.thanks-card h3 { font: 700 2rem/1.05 var(--font-hand); color: var(--leaf-deep); margin: 0 0 8px; }
.thanks-card p { margin: 0 0 10px; color: var(--ink); }
.thanks-card small { font-weight: 800; color: var(--ink-2); font-size: .82rem; letter-spacing: .03em; }
.thanks-heart { position: absolute; right: 16px; top: 14px; color: var(--rose); font-size: 1.3rem; animation: beat 1.8s ease-in-out infinite; }
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper-warm); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.round:hover { background: var(--ink); color: #fff; transform: scale(1.06); }
.car-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.car-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(42,32,36,.2); cursor: pointer; padding: 0; transition: width .25s, background .25s; }
.car-dots button[aria-current="true"] { width: 26px; border-radius: 6px; background: var(--rose); }

/* ---------- Fresh from YouTube / Instagram ---------- */
.yt-latest, .ig-wrap:not(:empty) { margin-top: clamp(36px, 5vw, 56px); }
.yt-latest-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.yt-latest-head h3 { font-size: 2rem; color: var(--rose); margin: 0; }
.yt-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .yt-row { grid-template-columns: repeat(2, 1fr); } }
.yt-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: var(--paper-warm); padding: 8px 8px 12px; border-radius: 4px; box-shadow: 0 1px 2px rgba(42,32,36,.1), 0 14px 24px -16px rgba(42,32,36,.45); transition: transform .25s; }
.yt-card:nth-child(odd) { rotate: -1deg; } .yt-card:nth-child(even) { rotate: 1deg; }
.yt-card:hover { transform: translateY(-5px) rotate(0); }
.yt-card:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 3px; }
.yt-card .thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 2px; background: var(--ink); }
.yt-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.yt-card:hover .thumb img { transform: scale(1.06); }
.yt-card .thumb .ic { position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--rose); color: #fff; }
.yt-card b { font: 700 1rem/1.25 var(--font-display); padding: 0 4px; }
.yt-card small { color: var(--ink-2); font-weight: 600; padding: 0 4px; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.ig-grid .instagram-media { margin: 0 !important; min-width: 0 !important; width: 100% !important; border-radius: 6px !important; }

/* ---------- Gallery: polaroids scattered on a kraft-paper table ---------- */
.gallery-table {
  background-color: #E9D7B5 !important;
  background-image: var(--tex-fibre), var(--tex-mottle) !important;
  padding-top: clamp(40px, 5vw, 64px) !important;
}
.gallery-tip { font-size: 1.5rem; color: var(--plum); margin: 0 0 10px; rotate: -1.5deg; }
.filters button { background: var(--paper-warm); }
.filters .n { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(42,32,36,.08); font-size: .78rem; margin-left: 4px; }
.filters button[aria-pressed="true"] .n { background: rgba(255,255,255,.2); }
.filters .shuffle { margin-left: auto; background: var(--rose); color: #fff; border-color: var(--rose); }
.filters .shuffle:hover { filter: brightness(1.05); }
.masonry { columns: auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; grid-auto-flow: dense; gap: 26px 22px; }
@media (max-width: 1000px) { .masonry { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .masonry { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; gap: 18px 14px; } }
.masonry a.gal {
  margin: 0; break-inside: auto; display: flex; flex-direction: column; position: relative; overflow: visible;
  background: #FFFDF8; padding: 9px 9px 0; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(42,32,36,.15), 0 18px 28px -16px rgba(42,32,36,.55);
  rotate: var(--rot, 0deg); transition: rotate .45s cubic-bezier(.2,.8,.2,1), transform .3s ease, box-shadow .3s ease; text-decoration: none;
}
.masonry a.gal.big { grid-column: span 2; grid-row: span 2; }
.masonry a.gal.wide { grid-column: span 2; }
.masonry a.gal img { flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; transition: transform .5s ease, filter .5s ease; }
.masonry a.gal:hover img { transform: none; filter: saturate(1.15); }
.masonry a.gal:hover { rotate: 0deg; transform: translateY(-8px) scale(1.02); z-index: 3; box-shadow: 0 2px 4px rgba(42,32,36,.15), 0 34px 44px -20px rgba(42,32,36,.6); }
.gal-cap { flex: none; font: 700 1.1rem/1.15 var(--font-hand); color: var(--ink-2); padding: 7px 4px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.gal::before { content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 20px; transform: translateX(-50%) rotate(-4deg); background-color: rgba(244,205,24,.7); z-index: 1; }
.gal:nth-child(3n+2)::before { background-color: rgba(217,72,111,.45); rotate: 6deg; }
.gal:nth-child(3n)::before { background-color: rgba(140,203,224,.75); left: 22%; }
.masonry a.gal[hidden] { display: none; }

/* Lightbox: a framed print with a thumbnail strip */
.lightbox { flex-direction: column; gap: 14px; padding: 56px 16px 16px; background: rgba(28,20,24,.94); backdrop-filter: blur(4px); }
.lb-frame { margin: 0; background: #FFFDF8; padding: 12px 12px 0; border-radius: 3px; max-width: min(1000px, 100%); max-height: calc(100vh - 190px); display: flex; flex-direction: column; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); rotate: -.6deg; }
.lb-frame img { max-height: calc(100vh - 270px); width: auto; max-width: 100%; object-fit: contain; border-radius: 1px; margin: 0 auto; }
.lb-photo.in { animation: lbIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes lbIn { from { opacity: 0; transform: scale(.96) rotate(1deg); } }
.lb-frame figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 6px 12px; font: 700 1.4rem/1.2 var(--font-hand); color: var(--ink); }
.lb-frame figcaption small { font: 800 .85rem/1 var(--font-body); color: var(--ink-2); white-space: nowrap; }
.lb-thumbs { display: flex; gap: 8px; overflow-x: auto; max-width: min(1000px, 100%); padding: 4px; scrollbar-width: thin; }
.lb-thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border: 3px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; opacity: .55; background: none; transition: opacity .2s, border-color .2s; }
.lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs button[aria-current="true"], .lb-thumbs button:hover { opacity: 1; border-color: var(--sun); }
.lightbox p { display: none; }

/* ---------- Small moving details ---------- */
/* Hearts drifting up through the yellow bands */
.section-sun { overflow: hidden; }
.section-sun > .wrap { position: relative; z-index: 1; }
.section-sun:not(.quote-band)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='20'%3E%3Cpath d='M11 18C7 15 1.5 11 2 6.5 2.4 3 6.5 1.8 9 4.2L11 6l2-1.8c2.5-2.4 6.6-1.2 7 2.3.5 4.5-5 8.5-9 11.5z' fill='%23D9486F' opacity='.35'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14'%3E%3Cpath d='M8 13C5 11 1 8 1.4 4.6 1.7 2.1 4.7 1.2 6.5 3L8 4.3 9.5 3c1.8-1.8 4.8-.9 5.1 1.6C15 8 11 11 8 13z' fill='%233F7334' opacity='.3'/%3E%3C/svg%3E");
  background-size: 22px 20px, 16px 14px;
  background-repeat: no-repeat;
  background-position: 12% 110%, 78% 110%;
  animation: hearts-rise 9s linear infinite;
}
@keyframes hearts-rise {
  0% { background-position: 12% 110%, 78% 110%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { background-position: 18% -10%, 72% -10%; opacity: 0; }
}

/* Section heads get a little hand-drawn arrow next to "see all" style links */
.section-head.split .link-arrow { position: relative; }
.section-head.split .link-arrow::before {
  content: ""; position: absolute; left: -46px; top: -20px; width: 40px; height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M3 4c10 2 20 9 26 20M29 24l1-8M29 24l-8-2' fill='none' stroke='%23D9486F' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .8;
}
@media (max-width: 700px) { .section-head.split .link-arrow::before { display: none; } }

/* Grain on photo cards so they read as printed photos */
.photo-card, .thanks-card, .snap, .gal, .yt-card { background-image: var(--tex-fibre); }

/* Links get a hand-drawn underline that draws in on hover */
.link-arrow { background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat; padding-bottom: 2px; transition: background-size .3s ease; }
.link-arrow:hover { background-size: 100% 2px; }

@media (prefers-reduced-motion: reduce) {
  .section-sun::after, .thanks-heart { animation: none; }
}

[data-rendered]:empty::before { display: none; }
.hero-note { left: -17%; top: -2%; }

/* Phones: give each hero photo and the note its own space so captions stay readable. */
@media (max-width: 600px) {
  .scrapbook { aspect-ratio: 1 / 1.42; min-height: 0; }
  .scrapbook .s1 { width: 53%; left: 0; top: 1%; }
  .scrapbook .s2 { width: 45%; right: 0; top: 4%; }
  .scrapbook .s3 { width: 52%; right: 2%; bottom: 2%; }
  .scrapbook .sticky { width: 132px; left: 3%; bottom: 7%; }
  .scrapbook .snap figcaption { font-size: 1rem; padding: 6px 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .scrapbook .doodle.sparkle { left: 42%; bottom: 40%; }
  .scrapbook .doodle.heart { left: 46%; top: -1%; width: 36px; }
}

/* Hero, round 3: everything bigger, the "best laugh" photo tucked over Endalew's. */
@media (min-width: 881px) {
  .hero-grid { grid-template-columns: .92fr 1.08fr; gap: clamp(24px, 3.5vw, 56px); }
  .scrapbook { min-height: 760px; }
  .scrapbook .s1 { width: 66%; left: 0; top: 2%; z-index: 2; }
  .scrapbook .s1 img { aspect-ratio: 4 / 4.9; }
  .scrapbook .s2 { width: 50%; right: -3%; top: 0; z-index: 3; }
  .scrapbook .s3 { width: 52%; right: 0; bottom: 0; z-index: 4; }
  .scrapbook .sticky { left: 2%; bottom: 0; width: 176px; z-index: 5; }
  .scrapbook .doodle.heart { left: 60%; top: -5%; }
  .scrapbook .doodle.star { right: -4%; top: 47%; }
  .scrapbook .doodle.sparkle { left: 36%; bottom: 3%; }
}
@media (max-width: 600px) {
  .scrapbook { aspect-ratio: 1 / 1.5; }
  .scrapbook .s1 { width: 62%; top: 1%; }
  .scrapbook .s2 { width: 50%; right: -2%; top: 3%; z-index: 3; }
  .scrapbook .s3 { width: 58%; right: 0; bottom: 1%; z-index: 4; }
  .scrapbook .sticky { width: 128px; left: 2%; bottom: 4%; }
}
@media (min-width: 881px) {
  .scrapbook .s1 figcaption { text-align: left; padding-left: 12px; }
  .hero h1 { font-size: clamp(2.6rem, 4.7vw, 4rem); }
}

/* ---------- Instagram ---------- */
.ig-btn { color: #fff; background: linear-gradient(45deg, #F58529, #DD2A7B 45%, #8134AF 75%, #515BD4); box-shadow: 0 4px 0 #6E2A8F; }
.ig-btn:hover { color: #fff; filter: brightness(1.06); }
.ig-card { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(20px, 4vw, 48px); align-items: center; background: var(--paper-warm); background-image: var(--tex-fibre); border-radius: 6px; padding: clamp(22px, 3vw, 34px); box-shadow: 0 1px 2px rgba(42,32,36,.1), 0 20px 34px -20px rgba(42,32,36,.5); position: relative; rotate: -.5deg; }
.ig-card::before { content: ""; position: absolute; top: -11px; left: 22%; width: 90px; height: 24px; rotate: -4deg; background-color: rgba(221,42,123,.35); background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 4px, transparent 4px 9px); }
.ig-copy h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 10px 0 2px; }
.ig-handle { font: 700 1.4rem/1 var(--font-hand); color: #C13584; margin: 0 0 12px; }
.ig-copy p { color: var(--ink-2); }
.ig-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: linear-gradient(45deg, #F58529, #DD2A7B 45%, #8134AF 75%, #515BD4); }
.ig-badge .ic { width: 28px; height: 28px; }
.ig-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ig-tiles a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; }
.ig-tiles img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, filter .4s; }
.ig-tiles a:hover img { transform: scale(1.08); filter: saturate(1.2); }
@media (max-width: 760px) { .ig-card { grid-template-columns: 1fr; } }
.drawer-ig { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 800; color: #C13584; text-decoration: none; }

/* ---------- Team cards: portrait photos so faces are never cropped ---------- */
.team-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: stretch; gap: 0; }
.team-card .team-photo { width: 100%; height: 100%; min-height: 320px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 28%; }
.team-card .body { display: flex; flex-direction: column; justify-content: center; padding: 18px 20px; }
@media (max-width: 760px) {
  .team-card { grid-template-columns: 1fr; }
  .team-card .team-photo { height: auto; min-height: 0; aspect-ratio: 4 / 4.4; }
}

/* ---------- Responsive fixes ---------- */
/* Grid columns must be allowed to shrink below their images' natural width. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.grid > *, .masonry > *, .article-grid > *, .donor-wall > * { min-width: 0; }

/* Gallery: the polaroid grid was wider than the screen on phones and tablets. */
.masonry { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .masonry { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; } }
.masonry a.gal img { min-width: 0; }
@media (max-width: 700px) {
  .gal-cap { font-size: .95rem; padding: 5px 2px 6px; }
  .gal::before { width: 50px; height: 16px; top: -8px; }
  .filters { gap: 6px; }
  .filters button { padding: 8px 12px; font-size: .88rem; min-height: 40px; }
  .filters .shuffle { margin-left: 0; }
}

/* Phones: two cards per row instead of one giant card per screen. */
@media (max-width: 620px) {
  [data-render="items"], [data-render="children"], [data-render="children-preview"], .grid-4.therapies {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px;
  }
  [data-render="items"] .body, [data-render="children"] .body, [data-render="children-preview"] .body { padding: 10px 4px 6px; }
  [data-render="children"] .photo-card h3, [data-render="children-preview"] .photo-card h3 { font-size: 1.35rem; }
  [data-render="children"] .photo-card p, [data-render="children-preview"] .photo-card p, [data-render="items"] .photo-card p { font-size: .85rem; line-height: 1.45; }
  .item-card h3 { font-size: 1.05rem; }
  .price { flex-direction: column; gap: 2px; }
  .price b { font-size: 1.35rem; }
  .price span { font-size: .78rem; }
  .photo-card { padding: 7px; }
  .therapies .snap figcaption { padding: 8px 2px 10px; font-size: .85rem; }
  .therapies .snap figcaption strong { font-size: 1.3rem; }
  .therapies .snap:nth-child(even) { margin-top: 0; }
}
@media (max-width: 340px) {
  [data-render="items"], [data-render="children"], [data-render="children-preview"], .grid-4.therapies { grid-template-columns: minmax(0, 1fr); }
}
