/* Scroll reveal */
.js-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal { opacity: 1; transform: none; transition: none; }
}

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; z-index: 30; height: 3px; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }

/* News video */
.news-video { max-width: 860px; margin: 32px auto; }
.news-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--navy); }
.news-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.news-video figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--muted); }

/* News item with a link: visible button, whole card clickable */
.item--link { position: relative; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.item--link:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(27, 42, 74, .10); transform: translateY(-2px); }
.news-open {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 0 16px;
  border-radius: 999px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
}
.news-open::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.item--link:hover .news-open, .news-open:focus-visible { background: var(--gold-2); }
.news-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .news-open { background: var(--gold); color: var(--navy); } }
@media (prefers-reduced-motion: reduce) { .item--link, .item--link:hover { transition: none; transform: none; } }

/* Prayer letter form */
.letter { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.letter label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.letter input[type="text"], .letter input[type="email"] {
  box-sizing: border-box; width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-weight: 400;
}
.letter .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.6; color: var(--muted); }
.letter .consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.letter .hp { position: absolute; left: -9999px; }
.letter .btn { justify-content: center; border: 0; cursor: pointer; font-family: inherit; }
.letter__status { margin: 0; min-height: 1.5em; font-size: 14px; font-weight: 700; text-align: center; }

/* Mobile action bar */
.actionbar { display: none; }
@media (max-width: 900px) {
  .actionbar {
    display: grid; grid-template-columns: repeat(2, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--navy); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0, 0, 0, .2);
  }
  .actionbar a { display: grid; place-items: center; min-height: 54px; color: #fff; font-size: 14px; font-weight: 700; }
  .actionbar a.primary { background: var(--gold); color: var(--navy); }
  body { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
}

/* Admin */
.admin { max-width: 960px; margin: 0 auto; padding: 40px 20px 100px; min-height: 70vh; }
.admin h1 { font-family: "Noto Serif KR", serif; font-size: 30px; margin: 0 0 8px; }
.admin__muted { color: var(--muted); font-size: 14px; }
.admin__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 20px 0; }
.admin__tabs { display: flex; gap: 8px; }
.admin button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.admin button.primary, .admin button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.admin button.danger { color: var(--wine); }
.admin__row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.admin__row h3 { margin: 0; font-size: 16px; }
.admin__row p { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.admin__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin__form { display: grid; gap: 14px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.admin__form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.admin__form input, .admin__form select, .admin__form textarea {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
.admin__msg { min-height: 1.5em; font-size: 14px; font-weight: 700; color: var(--wine); }
@media (max-width: 600px) { .admin__row { grid-template-columns: 1fr; } .admin__actions { justify-content: flex-start; } }

/* Book videos */
.book-videos { margin-top: 56px; }
.book-videos h3 { margin: 0 0 20px; text-align: center; font-family: "Noto Serif KR", serif; font-size: 22px; color: var(--navy); }
.book-videos__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.book-video { margin: 0; }
.book-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--navy); }
.book-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.book-video figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; }
.book-video figcaption a { display: inline-block; margin-top: 2px; color: var(--gold-2); font-size: 13px; font-weight: 700; }
@media (max-width: 900px) { .book-videos__grid { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .book-videos h3 { color: #fff; } }

/* Event popup */
.event-pop {
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow: auto;
  padding: 30px 24px 18px; border: 1px solid var(--gold); border-radius: 16px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; text-align: center;
}
.event-pop::backdrop { background: rgba(10, 16, 32, .6); }
.event-pop__x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 26px; cursor: pointer; }
.event-pop__eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 14px; font-weight: 700; }
.event-pop h2 { margin: 0 0 18px; font-family: "Noto Serif KR", serif; font-size: 22px; line-height: 1.45; word-break: keep-all; }
.event-pop__facts { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 15px; line-height: 1.55; }
.event-pop__facts li { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .07); word-break: keep-all; }
.event-pop__go { display: flex; justify-content: center; width: 100%; box-sizing: border-box; }
.event-pop__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.event-pop__foot button { min-height: 44px; padding: 0; border: 0; background: none; color: rgba(255, 255, 255, .85); font: inherit; text-decoration: underline; cursor: pointer; }

/* Images carry width/height for layout stability; let CSS aspect-ratio decide the height. */
.leader .ph, .cover-img { height: auto; }

/* First screen: night-river paper art behind the text, with slowly twinkling stars and a breathing glow. */
.hero {
  background:
    linear-gradient(180deg, rgba(16, 26, 50, .78) 0%, rgba(20, 32, 60, .62) 45%, rgba(20, 32, 60, .86) 100%),
    url("/img/hero-river.jpg") center 35% / cover no-repeat,
    var(--navy);
}
@media (max-width: 700px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(16, 26, 50, .8) 0%, rgba(20, 32, 60, .66) 45%, rgba(20, 32, 60, .9) 100%),
      url("/img/hero-river-m.jpg") center top / cover no-repeat,
      var(--navy);
  }
}
.hero-in h1, .hero-in .brothers-ko { text-shadow: 0 2px 18px rgba(8, 14, 30, .55); }
.hero-stars { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #f2d08a; box-shadow: 0 0 6px 1px rgba(242, 208, 138, .7);
  opacity: .25; animation: twinkle 4.5s ease-in-out infinite;
}
.hero-stars i:nth-child(1)  { left: 8%;  top: 12%; animation-delay: 0s; }
.hero-stars i:nth-child(2)  { left: 17%; top: 30%; animation-delay: 1.2s; width: 2px; height: 2px; }
.hero-stars i:nth-child(3)  { left: 26%; top: 8%;  animation-delay: 2.6s; }
.hero-stars i:nth-child(4)  { left: 34%; top: 22%; animation-delay: .7s;  width: 2px; height: 2px; }
.hero-stars i:nth-child(5)  { left: 44%; top: 5%;  animation-delay: 3.1s; }
.hero-stars i:nth-child(6)  { left: 57%; top: 14%; animation-delay: 1.8s; width: 2px; height: 2px; }
.hero-stars i:nth-child(7)  { left: 66%; top: 6%;  animation-delay: .3s; }
.hero-stars i:nth-child(8)  { left: 74%; top: 26%; animation-delay: 2.2s; width: 2px; height: 2px; }
.hero-stars i:nth-child(9)  { left: 83%; top: 10%; animation-delay: 3.6s; }
.hero-stars i:nth-child(10) { left: 92%; top: 20%; animation-delay: 1s; }
.hero-stars i:nth-child(11) { left: 5%;  top: 42%; animation-delay: 2.9s; width: 2px; height: 2px; }
.hero-stars i:nth-child(12) { left: 95%; top: 40%; animation-delay: .5s;  width: 2px; height: 2px; }
.hero-stars i:nth-child(13) { left: 50%; top: 32%; animation-delay: 4s;   width: 2px; height: 2px; }
.hero-stars i:nth-child(14) { left: 38%; top: 38%; animation-delay: 1.5s; width: 2px; height: 2px; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
.hero::after { animation: glow 7s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero-stars i, .hero::after { animation: none; }
  .hero-stars i { opacity: .6; }
}

/* Event notice as a compact corner card that leaves the first screen visible. */
.event-pop--corner {
  inset: auto 20px 20px auto; margin: 0; z-index: 30;
  width: min(340px, calc(100vw - 32px)); padding: 20px 18px 8px; text-align: left;
  box-shadow: 0 18px 44px rgba(8, 14, 30, .45);
  animation: pop-in .5s ease-out;
}
.event-pop--corner .event-pop__x { top: 2px; right: 2px; font-size: 22px; }
.event-pop--corner .event-pop__eyebrow { font-size: 13px; margin-bottom: 6px; padding-right: 28px; }
.event-pop--corner h2 { font-size: 17px; margin-bottom: 10px; }
.event-pop--corner .event-pop__facts { margin-bottom: 14px; font-size: 13.5px; gap: 6px; }
.event-pop--corner .event-pop__facts li { padding: 7px 10px; }
.event-pop--corner .event-pop__facts li:nth-child(2) { display: none; }
.event-pop--corner .event-pop__go { min-height: 44px; font-size: 14.5px; }
.event-pop--corner .event-pop__foot { margin-top: 4px; font-size: 12px; }
@media (max-width: 900px) {
  .event-pop--corner { inset: auto 12px calc(66px + env(safe-area-inset-bottom)) 12px; width: auto; }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .event-pop--corner { animation: none; } }
@media (max-width: 900px) {
  .event-pop--corner { padding: 10px 44px 10px 14px; display: flex; align-items: center; gap: 10px; }
  .event-pop--corner h2, .event-pop--corner .event-pop__facts, .event-pop--corner .event-pop__foot { display: none; }
  .event-pop--corner .event-pop__eyebrow { margin: 0; padding: 0; flex: 1; font-size: 13px; line-height: 1.4; word-break: keep-all; }
  .event-pop--corner .event-pop__go { width: auto; flex: none; min-height: 40px; padding: 0 14px; font-size: 13px; }
  .event-pop--corner .event-pop__x { top: 50%; transform: translateY(-50%); right: 0; }
}
.event-pop__go-short, .event-pop__when { display: none; }
@media (max-width: 900px) {
  .event-pop--corner .event-pop__go-long { display: none; }
  .event-pop--corner .event-pop__go-short, .event-pop--corner .event-pop__when { display: inline; }
}

/* Flowing-river canvas drawn by river.js, under the stars and text. */
.hero-river { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
