/* Single reflection posts only. Frames every photo at 16:9 and opens the original in a lightbox. */

#reflection-note .reflection-frame {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #efeae3;
  font-size: 0;
  line-height: 0;
  cursor: zoom-in;
  appearance: none;
  -webkit-appearance: none;
}

#reflection-note .book-hero-cover .reflection-frame {
  border-radius: 16px;
}

#reflection-note .reflection-film .reflection-frame {
  align-self: start;
  border-radius: 12px;
}

#reflection-note .reflection-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

#reflection-note .reflection-frame:focus-visible {
  outline: 3px solid #8d6a2a;
  outline-offset: 3px;
}

/* Photo on top at every width. The date pill stays with the title underneath. */
#reflection-note .book-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

#reflection-note .book-hero-cover {
  order: -1;
  width: 100%;
  max-width: none;
  margin: 0;
}

@media (min-width: 992px) {
  #reflection-note .book-hero {
    gap: 28px;
  }
}

/* More days cards inherit the light reader color, so titles disappear on the white card. */
#reflection-note[data-reader="dark"] .reflection-more .insight-card {
  background: #221f1c;
  color: #f4efe8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

#reflection-note[data-reader="dark"] .reflection-more .insight-title {
  color: #f4efe8;
}

#reflection-note[data-reader="dark"] .reflection-more .insight-message {
  color: #d9d2c8;
}

#reflection-note[data-reader="dark"] .reflection-more .insight-age {
  color: #c8bfb4;
}

#reflection-note[data-reader="dark"] .reflection-more .insight-media.is-mark {
  background: #221f1c;
}

#reflection-note[data-reader="dark"] .reflection-more .day-meter,
#reflection-note[data-reader="dark"] .reflection-more .day-meter strong {
  color: #f4efe8;
}

#reflection-note[data-reader="dark"] .reflection-more .day-meter span {
  color: #c8bfb4;
}

.reflection-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 72px 24px 24px;
  background: rgba(20, 18, 16, 0.92);
  cursor: zoom-out;
  touch-action: manipulation;
}

.reflection-lightbox[hidden] {
  display: none !important;
}

.reflection-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  object-position: center;
  cursor: default;
  border-radius: 2px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.reflection-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f6f1ea;
  color: #1c1916;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.reflection-lightbox-close:hover,
.reflection-lightbox-close:focus-visible {
  background: #fff;
}

.reflection-lightbox-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

html.reflection-lightbox-open,
body.reflection-lightbox-open {
  overflow: hidden;
}

body.reflection-lightbox-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  touch-action: none;
}

#reflection-note .book-prose a {
  color: #9a4e12;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#reflection-note .book-prose a:hover,
#reflection-note .book-prose a:focus-visible {
  text-decoration-thickness: 2px;
}

#reflection-note .book-prose a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#reflection-note[data-reader="dark"] .book-prose a {
  color: #f3d48a;
}

@media (prefers-reduced-motion: no-preference) {
  .reflection-lightbox {
    animation: reflection-lightbox-in 0.16s ease;
  }
}

@keyframes reflection-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
