/* =========================================================
   JOURNAL HISTORY + SCRAPBOOK CAPTIONS
   Loaded after the original style sheets.
   ========================================================= */

/* ---------- Journal ---------- */

.journal-header {
  flex: 0 0 auto;
  min-height: 0;
}

.journal-date {
  margin: 0 0 .18em;
  font-size: clamp(9px, 1.15vw, 16px);
  line-height: 1.08;
}

.journal-title {
  margin: 0 0 .28em;
  overflow: hidden;
  color: #40342e;
  font-family: "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(9px, 1.10vw, 15px);
  font-weight: 700;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-title[hidden] {
  display: none;
}

.journal-copy {
  font-size: clamp(8px, 1.08vw, 16px);
  line-height: 1.42;
}

.journal-nav {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 0 0 auto;
  min-height: 15px;
  margin-top: .24em;
  align-items: center;
  justify-content: center;
  gap: .36em;
}

.journal-nav-button {
  position: relative;
  width: clamp(18px, 2.15vw, 25px);
  height: clamp(13px, 1.52vw, 18px);
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  color: #5e4e69;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 5px;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.98) 0%,
      rgba(232,225,239,.98) 42%,
      rgba(170,158,188,.96) 53%,
      rgba(226,215,235,.98) 100%
    );
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.95),
    inset 0 -1px 2px rgba(70,50,85,.24),
    0 1px 2px rgba(55,37,63,.24);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(7px, .82vw, 10px);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

.journal-nav-button::after {
  content: "✦";
  position: absolute;
  top: -5px;
  right: -4px;
  color: rgba(255,255,255,.95);
  font-size: 6px;
  line-height: 1;
  text-shadow: 0 0 3px rgba(172,140,205,.9);
  pointer-events: none;
}

.journal-nav-button:hover:not(:disabled),
.journal-nav-button:focus-visible:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.journal-nav-button:active:not(:disabled) {
  transform: translateY(1px) scale(.96);
}

.journal-nav-button:focus-visible {
  outline: 1px dotted rgba(70, 48, 80, .9);
  outline-offset: 1px;
}

.journal-nav-button:disabled {
  opacity: .25;
  cursor: default;
  filter: grayscale(.3);
}

.journal-counter {
  min-width: 28px;
  color: rgba(62, 49, 43, .68);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(5px, .60vw, 8px);
  line-height: 1;
  text-align: center;
}

/* Much smaller controls within the scaled-down mobile journal. */
@media (max-width: 640px) {
  .journal-entry {
    padding-top: 2.7%;
    padding-bottom: .7%;
  }

  .journal-date {
    margin-bottom: 1px;
    font-size: 6.2px;
  }

  .journal-title {
    margin-bottom: 1px;
    font-size: 6px;
  }

  .journal-copy {
    padding-right: 1px;
    font-size: 5.8px;
    line-height: 1.38;
  }

  .journal-nav {
    min-height: 8px;
    margin-top: 1px;
    gap: 2px;
  }

  .journal-nav-button {
    width: 11px;
    height: 8px;
    border-width: .5px;
    border-radius: 2.5px;
    font-size: 4.5px;
    box-shadow:
      inset 0 .5px .5px rgba(255,255,255,.95),
      inset 0 -.5px 1px rgba(70,50,85,.2),
      0 .5px 1px rgba(55,37,63,.18);
  }

  .journal-nav-button::after {
    display: none;
  }

  .journal-counter {
    min-width: 17px;
    font-size: 3.9px;
  }
}

/* ---------- Scrapbook captions ---------- */

.scrapbook-polaroid {
  display: flex;
  flex-direction: column;
  gap: 3%;
}

.scrapbook-polaroid img {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.scrapbook-polaroid .scrapbook-photo-caption {
  position: static;
  display: block !important;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: #49382d;
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-size: clamp(.42rem, .78vw, .68rem);
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#scrapbook-lightbox-caption {
  display: block !important;
  margin-top: 12px !important;
  font-size: clamp(.8rem, 2vw, 1rem);
}

#scrapbook-lightbox-date {
  display: block !important;
  margin-top: 3px !important;
  color: rgba(86, 61, 49, .72) !important;
  font-size: clamp(.64rem, 1.5vw, .78rem);
}

#scrapbook-lightbox-caption[hidden],
#scrapbook-lightbox-date[hidden] {
  display: none !important;
}

/* Keep the old in-browser upload controls hidden without hiding captions. */
.scrapbook-upload-actions,
.scrapbook-upload-button,
.scrapbook-storage-note {
  display: none !important;
}

@media (max-width: 700px) {
  .scrapbook-polaroid {
    gap: 2%;
  }

  .scrapbook-polaroid .scrapbook-photo-caption {
    font-size: clamp(.32rem, 1.65vw, .48rem);
  }
}

/* ---------- Unlimited, scrollable scrapbook pages ---------- */

/* The whole open spread scrolls together, so photo 9 and beyond continue
   beneath the first spread instead of being cut off. */
.scrapbook-inside {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(104, 68, 53, .38) transparent;
}

.scrapbook-inside::-webkit-scrollbar {
  width: 5px;
}

.scrapbook-inside::-webkit-scrollbar-track {
  background: transparent;
}

.scrapbook-inside::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(104, 68, 53, .34);
}

.scrapbook-page {
  min-height: 100%;
  height: max-content;
  align-self: stretch;
}

.scrapbook-photo-grid {
  flex: 0 0 auto;
  grid-template-rows: none !important;
  grid-auto-rows: auto;
  align-content: start;
}

.scrapbook-polaroid,
.scrapbook-empty-frame {
  height: auto !important;
  aspect-ratio: 1 / 1.12;
  }

.scrapbook-stage,
.scrapbook-polaroid {
  touch-action: pan-y;
}

/* After a phone tap opens the cover, the turned cover must stop intercepting
   the swipe gestures meant for the pages underneath it. */
.scrapbook-stage.is-open .scrapbook-cover {
  pointer-events: none;
}

@media (max-width: 700px) {
  .scrapbook-inside {
    scrollbar-width: none;
  }

  .scrapbook-inside::-webkit-scrollbar {
    display: none;
  }

  .scrapbook-page {
    padding-bottom: 10%;
  }

  .scrapbook-polaroid,
  .scrapbook-empty-frame {
    aspect-ratio: 1 / 1.18;
  }
  
}
  /* SAFE FIX: replace journal arrow emojis with CSS-drawn arrows */
#journal-older,
#journal-newer {
  position: relative;
  font-size: 0 !important;
  line-height: 0 !important;
}

#journal-older::before,
#journal-newer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid #51495f;
  border-right: 1.5px solid #51495f;
  pointer-events: none;
}

#journal-older::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

#journal-newer::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

@media (max-width: 640px) {
  #journal-older::before,
  #journal-newer::before {
    width: 3px;
    height: 3px;
    border-width: 1px;
  }
}/* FINAL SAFE WATCH FIX
   Restores the live watch, rotates the LCD clockwise,
   and enlarges the date and time. */

.watch-lcd-cleaner {
  display: none !important;
}

.watch-display {
  display: block !important;

  left: 87.8% !important;
  top: 31.35% !important;
  width: 7.7% !important;
  height: 3.85% !important;

  transform: rotate(10deg) !important;
  transform-origin: center center !important;

  clip-path: inset(0 round 5px) !important;
  border-radius: 5px !important;

  background: rgba(151, 154, 154, 0.94) !important;
  box-shadow:
    inset 0 0 4px rgba(255, 255, 255, 0.22),
    inset 0 0 7px rgba(42, 35, 38, 0.12) !important;
}

.watch-display::before,
.watch-display::after {
  display: none !important;
  content: none !important;
}

.watch-inner {
  width: 100% !important;
  height: 100% !important;
  padding: 5% 7% !important;
  gap: 2% !important;

  transform: none !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

#watch-date {
  margin: 0 !important;
  font-size: clamp(5px, 0.58vw, 9px) !important;
  line-height: 1 !important;
  letter-spacing: -0.02em !important;
}

.watch-clock {
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 2px !important;
}

#watch-time {
  font-size: clamp(10px, 1.18vw, 18px) !important;
  line-height: 0.9 !important;
  letter-spacing: -0.08em !important;
}

#watch-seconds {
  font-size: clamp(5px, 0.5vw, 8px) !important;
  line-height: 1 !important;
}
/* Tiny final watch adjustment — keep current size and placement */
.watch-display {
  transform: rotate(17deg) !important;
  background: rgba(143, 137, 126, 0.94) !important;
}
.scrapbook-page-label {
  display: none !important;
}
