/* Cookie-Elves.com — scrapbook redesign (POC)
   Same spirit as the original: cream paper, red & green, hand-lettered type,
   the family's clip-art elves and gingerbread men. Just tidier and phone-friendly. */

:root {
  --paper: #fffbe3;
  --paper-deep: #f7efc9;
  --card: #fffef6;
  --ink: #2b2118;
  --ink-soft: #5c4a3a;
  --red: #c8102e;
  --red-dark: #9a0c23;
  --green: #1f7a3a;
  --green-dark: #155a2a;
  --gold: #d9a441;
  --ginger: #b8743a;
  --shadow: 0 2px 0 rgba(60, 40, 20, .08), 0 8px 22px -8px rgba(60, 40, 20, .35);
  --hand: "Mountains of Christmas", "Comic Sans MS", cursive;
  --body: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.22rem;
  line-height: 1.55;
  background-color: var(--paper);
  /* soft paper speckle + gentle falling-snow dots */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 45% 55%, rgba(217,164,65,.10) 0 1px, transparent 2px),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  background-size: 140px 140px, 90px 90px, 23px 23px, 100% 100%;
  background-attachment: fixed;
}

a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

img { max-width: 100%; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ---------- candy cane ---------- */

.candy {
  height: 14px;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 12px, #fff 12px 22px);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.8);
  margin: 2.5rem auto;
  max-width: 640px;
}
.candy.thin { height: 8px; max-width: 360px; margin: 1.5rem auto; }

/* ---------- header ---------- */

.site-header { padding-top: 1.25rem; }

.masthead {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}

.masthead .elf { width: 110px; height: auto; transform-origin: bottom center; }
.masthead .elf:hover { animation: hop .6s ease; }

.wordmark {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--red);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1;
  margin: 0;
  text-decoration: none;
  display: inline-block;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(31,122,58,.25);
}
.wordmark:hover { color: var(--red); }

.tagline {
  margin: .3rem 0 0;
  color: var(--green-dark);
  font-size: 1.15rem;
}

/* gingerbread nav */
.ginger-nav ul {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
}
.ginger-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.1rem;
  padding: .25rem .5rem;
  border-radius: 12px;
}
.ginger-nav img { height: 56px; width: auto; transition: transform .2s; }
.ginger-nav a:hover img, .ginger-nav a:focus-visible img { transform: rotate(-10deg) translateY(-4px); }
.ginger-nav a:hover { color: var(--red); }
.ginger-nav a[aria-current="page"] {
  color: var(--red);
  background: rgba(200,16,46,.07);
}
.ginger-nav a[aria-current="page"] span { border-bottom: 3px dotted var(--red); }

/* ---------- page headings ---------- */

.page-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: .5rem;
}
.page-title img { width: 96px; height: auto; }
.page-title h1 { margin: 0; }

h1, h2, h3 {
  font-family: var(--hand);
  font-weight: 700;
  line-height: 1.1;
}
h1 { color: var(--red); font-size: clamp(2.2rem, 5vw, 3.3rem); }
h2 { color: var(--green); font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 2rem 0 .5rem; }
h3 { color: var(--red-dark); font-size: 1.6rem; margin: 1.5rem 0 .25rem; }

.lede { font-size: 1.35rem; max-width: 46rem; }

/* ---------- cards / paper ---------- */

.note {
  position: relative;
  background: var(--card);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  /* faint ruled lines like a recipe card */
  background-image: repeating-linear-gradient(transparent 0 1.85rem, rgba(31,122,58,.09) 1.85rem calc(1.85rem + 1px));
  background-position: 0 1.4rem;
}
.note.tape::before,
.note.tape::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 92px;
  height: 26px;
  background: rgba(255, 236, 160, .75);
  border: 1px solid rgba(180, 150, 60, .25);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.note.tape::before { left: 18px; transform: rotate(-6deg); }
.note.tape::after { right: 18px; transform: rotate(5deg); }

.note.candy-border {
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px) 12;
  border-radius: 0;
}

/* ---------- home ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-top: 2rem;
}

.hero .note p:first-child { margin-top: 0; }
.hero .note p:last-child { margin-bottom: 0; }

.badge {
  position: absolute;
  right: -22px;
  bottom: -26px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--hand);
  font-weight: 700;
  line-height: .95;
  transform: rotate(12deg);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 8px var(--green), var(--shadow);
}
.badge b { display: block; font-size: 2.6rem; }
.badge small { font-size: 1rem; }

.clipping {
  display: block;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  transform: rotate(2deg);
  transition: transform .25s;
}
.clipping:hover { transform: rotate(0) scale(1.02); color: var(--ink); }
.clipping figure {
  margin: 0;
  background: #fff;
  padding: 12px 12px 6px;
  box-shadow: var(--shadow);
  position: relative;
}
.clipping figure::before { /* pushpin */
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  width: 20px; height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--red) 55%, var(--red-dark));
  box-shadow: 0 3px 4px rgba(0,0,0,.3);
}
.clipping img { display: block; width: 100%; height: auto; filter: sepia(.25); }
.clipping figcaption { font-size: 1.05rem; padding-top: .4rem; }

/* door-hanger tiles that lead into the site */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border-radius: 10px 10px 14px 14px;
  padding: 2.2rem 1rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.tile::before { /* the ribbon loop it hangs from */
  content: "";
  position: absolute;
  top: -16px; left: 50%;
  width: 34px; height: 30px;
  margin-left: -17px;
  border: 5px solid var(--green);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
}
.tile:nth-child(even)::before { border-color: var(--red); }
.tile:nth-child(odd) { transform: rotate(-1.5deg); }
.tile:nth-child(even) { transform: rotate(1.5deg); }
.tile:hover { transform: rotate(0) translateY(-6px); color: var(--ink); }
.tile img { height: 84px; width: auto; margin-bottom: .5rem; }
.tile strong { font-family: var(--hand); font-size: 1.55rem; color: var(--red); line-height: 1.1; }
.tile span { font-size: 1.02rem; color: var(--ink-soft); margin-top: .35rem; }

/* sixty years at a glance */
.timeline {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.timeline li {
  border-top: 6px dotted var(--green);
  padding-top: .6rem;
}
.timeline b {
  display: block;
  font-family: var(--hand);
  color: var(--red);
  font-size: 2rem;
  line-height: 1;
}
.timeline span { font-size: 1.05rem; color: var(--ink-soft); }

/* ---------- history ---------- */

.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 2.5rem;
  align-items: start;
}
.story p { margin: .6rem 0 1rem; }
.story .drop::first-letter {
  float: left;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 4.4rem;
  line-height: .8;
  padding: .3rem .5rem 0 0;
  color: var(--red);
}
.aside {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}
.aside .note { padding: 1.25rem; text-align: center; font-size: 1.1rem; }
.stat b { display: block; font-family: var(--hand); font-size: 2.6rem; color: var(--red); line-height: 1; }
.pullquote {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--green);
  line-height: 1.2;
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 6px solid var(--red);
}

/* ---------- poems ---------- */

.decade-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  padding: .7rem 0;
  margin: 1.5rem 0 0;
  background: linear-gradient(var(--paper) 75%, transparent);
}
.decade-nav a {
  text-decoration: none;
  font-size: 1.1rem;
  color: #fff;
  background: var(--green);
  padding: .15rem .9rem;
  border-radius: 999px;
}
.decade-nav a:nth-child(even) { background: var(--red); }
.decade-nav a:hover { filter: brightness(1.15); color: #fff; }

.decade { scroll-margin-top: 4rem; }
.decade h2 { display: flex; align-items: baseline; gap: .75rem; }
.decade h2 small { font-family: var(--body); font-size: 1.05rem; color: var(--ink-soft); font-weight: 400; }

.poem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.6rem 1.25rem;
  margin-top: 1rem;
}
.poem {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.poem img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  object-position: top;
  background: #fff;
  padding: 6px;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.poem:nth-child(3n+1) img { transform: rotate(-2deg); }
.poem:nth-child(3n+2) img { transform: rotate(1.5deg); }
.poem:nth-child(3n) img { transform: rotate(-.5deg); }
.poem:hover img, .poem:focus-visible img { transform: rotate(0) scale(1.05); }
.poem:focus-visible { outline: 3px dashed var(--green); outline-offset: 6px; }
.poem .tag {
  margin-top: -14px;
  position: relative;
  background: var(--red);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  padding: .3rem .7rem .35rem 1.1rem;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 12% 100%, 0 50%);
  white-space: nowrap;
}
.poem:nth-child(even) .tag { background: var(--green); }

/* ---------- turnabout ---------- */

.letters {
  columns: 3 220px;
  column-gap: 1.5rem;
  margin-top: 1.5rem;
}
.letters .poem { margin-bottom: 1.5rem; break-inside: avoid; width: 100%; }
.letters .poem img { height: auto; }

/* ---------- photo galleries (Juicebox, fed from Flickr) ---------- */

.jb-frame {
  margin-top: 1.5rem;
  height: min(75vh, 680px);
  min-height: 420px;
  background: var(--card);
  padding: 12px;
  box-shadow: var(--shadow);
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px) 12;
}
#juicebox-container { height: 100%; }

/* ---------- gallery placeholder ---------- */

.gallery-frame {
  margin-top: 1.5rem;
  border: 3px dashed rgba(31,122,58,.4);
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}
.gallery-frame .polaroids {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gallery-frame .polaroid {
  width: 150px;
  aspect-ratio: 4 / 5;
  background: #fff;
  padding: 10px 10px 34px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.gallery-frame .polaroid img { max-height: 100%; }
.gallery-frame .polaroid:nth-child(1) { transform: rotate(-4deg); }
.gallery-frame .polaroid:nth-child(2) { transform: rotate(2deg); }
.gallery-frame .polaroid:nth-child(3) { transform: rotate(-1deg); }

.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: 1.15rem;
  text-decoration: none;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 999px;
  padding: .45rem 1.3rem;
  box-shadow: 0 3px 0 var(--red-dark);
  cursor: pointer;
}
.btn:hover { color: #fff; transform: translateY(1px); box-shadow: 0 2px 0 var(--red-dark); }
.btn.green { background: var(--green); box-shadow: 0 3px 0 var(--green-dark); }


/* ---------- lightbox ---------- */

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(96vw, 900px);
  max-height: 94vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(30, 18, 10, .78); }
.lightbox figure {
  margin: 0;
  background: #fff;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox img { display: block; max-width: 100%; max-height: calc(94vh - 90px); margin: 0 auto; cursor: zoom-in; }
.lightbox figcaption::after {
  content: " \00b7  click to zoom in";
  font-family: var(--body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* zoomed: the whole screen becomes a scrollable reading view */
.lightbox.zoomed {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: auto;
  text-align: center;
}
.lightbox.zoomed figure { display: inline-block; margin: 2.5vh 0; }
.lightbox.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox.zoomed figcaption::after { content: " \00b7  click to zoom back out"; }
.lightbox.zoomed .lb-btn { position: fixed; }
.lightbox.zoomed .lb-prev { left: 12px; }
.lightbox.zoomed .lb-next { right: 12px; }
.lightbox.zoomed .lb-close { top: 12px; right: 12px; }
.lightbox figcaption {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--red);
  text-align: center;
  padding-top: .4rem;
}
.lightbox .lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--red);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.lightbox .lb-prev { left: -23px; }
.lightbox .lb-next { right: -23px; }
.lightbox .lb-close { top: -18px; right: -18px; transform: none; background: var(--green); font-size: 1.2rem; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4rem;
  padding: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.site-footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  justify-content: space-between;
}
.site-footer nav a { margin-right: .9rem; }
.site-footer .copy { display: flex; align-items: flex-end; gap: .6rem; }

/* ---------- motion ---------- */

@keyframes hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-14px) rotate(-6deg); }
  60% { transform: translateY(0) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 1.12rem; }
  .masthead { grid-template-columns: 70px 1fr; gap: .75rem; }
  .masthead .elf { width: 70px; }
  .ginger-nav ul { gap: 0 .25rem; }
  .ginger-nav img { height: 42px; }
  .ginger-nav a { font-size: .95rem; }
  .hero, .story { grid-template-columns: 1fr; }
  .hero { gap: 3rem; }
  .note { padding: 1.25rem 1.25rem; }
  .badge { width: 88px; height: 88px; right: -6px; bottom: -34px; }
  .badge b { font-size: 2rem; }
  .clipping { max-width: 320px; margin-inline: auto; }
  .aside { position: static; grid-template-columns: repeat(2, 1fr); }
  .page-title img { width: 64px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; }
  .tile { padding: 1.8rem .6rem 1rem; }
  .tile img { height: 60px; }
  .tile strong { font-size: 1.3rem; }
  .poem-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .poem img { height: 130px; }
  .lightbox .lb-prev { left: 4px; }
  .lightbox .lb-next { right: 4px; }
  .lightbox .lb-close { right: 4px; }
}
