/*
 * Word Online shortform review page.
 *
 * A long, unlisted gallery of portrait (9:16) sermon clips for the review
 * group to watch and comment on. Cards are numbered 1..N; videos stream
 * from Cloudflare R2 and only load on play (preload="none" + poster).
 */

.sf {
  padding: 48px 0 96px;
}

.sf__header {
  max-width: 760px;
  margin: 0 auto 8px;
  text-align: center;
}

.sf__title {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  line-height: 1.15;
  font-weight: var(--weight-bold);
  color: var(--color-heading);
  margin: 0 0 20px;
}

.sf__intro {
  text-align: left;
}

.sf__stats {
  margin: 24px 0 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.sf__stats strong {
  color: var(--color-brand);
}

/* Sermon jump list */
.sf-toc {
  margin: 32px auto 0;
  padding: 20px 24px;
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  text-align: left;
}

.sf-toc__heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-heading);
  margin: 0 0 12px;
}

.sf-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sf-toc__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, color 0.15s;
}

.sf-toc__list a:hover,
.sf-toc__list a:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.sf-toc__count {
  font-size: 0.72rem;
  font-weight: var(--weight-semibold);
  background: var(--color-brand);
  color: var(--color-on-brand);
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Sermon section */
.sf-sermon {
  margin-top: 56px;
  scroll-margin-top: 16px;
}

.sf-sermon__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px solid var(--color-brand);
  padding-bottom: 10px;
  margin-bottom: 24px;
}

.sf-sermon__headtext {
  flex: 1;
  min-width: 0;
}

.sf-sermon__title {
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  color: var(--color-heading);
  margin: 0;
}

/* The passage is rendered through the scripture macro, so it arrives as a
   .scripture-ref link; make it read as a heading here, not body text. */
.sf-sermon__title .scripture-ref {
  color: inherit;
  text-decoration: none;
}

.sf-sermon__title .scripture-ref:hover,
.sf-sermon__title .scripture-ref:focus-visible {
  color: var(--color-brand);
  text-decoration: underline;
}

.sf-sermon__meta {
  margin: 6px 0 0;
  color: var(--color-text);
  font-size: 0.95rem;
}

.sf-sermon__watch {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

/* Clip grid */
.sf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}

.sf-card {
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 16px;
}

.sf-card__media {
  position: relative;
  background: #000;
}

.sf-card__video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
}

.sf-card__num {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-weight: var(--weight-bold);
  font-size: 0.85rem;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
}

.sf-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.sf-card__title {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  margin: 0;
}

.sf-card__hash {
  color: var(--color-brand);
}

.sf-card__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text);
}

.sf-card__facts > span::after {
  content: "";
}

.sf-card details {
  font-size: 0.85rem;
}

.sf-card summary {
  cursor: pointer;
  color: var(--color-brand);
  font-weight: var(--weight-semibold);
  list-style-position: inside;
}

.sf-card summary:hover {
  text-decoration: underline;
}

.sf-card__transcript p,
.sf-card__note p {
  margin: 8px 0 0;
  line-height: 1.6;
  color: var(--color-text);
}

.sf-card__score {
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.sf-card__src {
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-rule);
  font-size: 0.82rem;
  color: var(--color-text);
}

.sf__back {
  margin: 56px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

/* Phones: one column so each portrait clip is big and watchable, rather
   than two cramped columns. Cap the card width so it does not become huge
   on the widest phones. */
@media (max-width: 560px) {
  .sf-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sf-card {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
  .sf-bar {
    padding: 10px 14px;
  }
  .sf-bar__stats {
    font-size: 0.82rem;
  }
}

/* ---- Buttons (shared) ---- */
.sf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.sf-btn:hover,
.sf-btn:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.sf-btn--primary {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-on-brand);
}

.sf-btn--primary:hover,
.sf-btn--primary:focus-visible {
  background: #a11010;
  color: var(--color-on-brand);
}

.sf-btn--ghost {
  margin-left: auto;
}

/* ---- Controls bar ---- */
.sf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 36px;
}

/* ---- Section collapse ---- */
.sf-sermon__toggle {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--color-heading);
  cursor: pointer;
  margin-top: 2px;
}

.sf-sermon__toggle:hover,
.sf-sermon__toggle:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.sf-chevron {
  transition: transform 0.18s ease;
}

.sf-sermon.is-collapsed .sf-chevron {
  transform: rotate(-90deg);
}

.sf-sermon.is-collapsed .sf-grid {
  display: none;
}

.sf-sermon__progress {
  flex: none;
  align-self: center;
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  background: #f3f3f3;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.sf-sermon__progress:empty {
  display: none;
}

.sf-sermon__progress.is-complete {
  background: #157f3b;
  color: #fff;
}

/* ---- Proposed Shorts copy ---- */
.sf-card__shorts summary {
  cursor: pointer;
  color: var(--color-brand);
  font-weight: var(--weight-semibold);
  font-size: 0.85rem;
}

.sf-shorts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.sf-shorts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sf-shorts__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.sf-copybtn {
  border: 1px solid var(--color-rule);
  border-radius: 5px;
  background: #fff;
  color: var(--color-brand);
  font: inherit;
  font-size: 0.72rem;
  font-weight: var(--weight-semibold);
  padding: 2px 9px;
  cursor: pointer;
}

.sf-copybtn:hover,
.sf-copybtn:focus-visible {
  border-color: var(--color-brand);
}

.sf-copybtn.is-copied {
  background: #157f3b;
  border-color: #157f3b;
  color: #fff;
}

.sf-shorts__val {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text);
  background: #f7f7f7;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 8px 10px;
}

.sf-shorts__val--multi {
  white-space: pre-wrap;
}

/* ---- Per-clip review controls ---- */
.sf-review {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-review__prompt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.sf-review__verdict {
  display: flex;
  gap: 6px;
}

.sf-vbtn {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.sf-vbtn:hover,
.sf-vbtn:focus-visible {
  border-color: currentColor;
}

.sf-vbtn--yes:hover { color: #157f3b; }
.sf-vbtn--maybe:hover { color: #b45309; }
.sf-vbtn--no:hover { color: #b91c1c; }

.sf-vbtn.is-active {
  color: #fff;
}

.sf-vbtn--yes.is-active { background: #157f3b; border-color: #157f3b; }
.sf-vbtn--maybe.is-active { background: #b45309; border-color: #b45309; }
.sf-vbtn--no.is-active { background: #b91c1c; border-color: #b91c1c; }

.sf-review__comment {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text);
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 7px 9px;
}

.sf-review__comment:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
  border-color: var(--color-brand);
}

/* ---- Feedback summary panel ---- */
.sf-summary {
  margin: 64px auto 0;
  max-width: 760px;
  padding: 24px;
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  background: #fafafa;
}

.sf-summary__title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: var(--weight-bold);
  color: var(--color-heading);
}

.sf-summary__intro {
  margin: 0 0 16px;
  color: var(--color-text);
  font-size: 0.95rem;
}

.sf-summary__name {
  display: block;
  font-size: 0.85rem;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  margin-bottom: 14px;
}

.sf-summary__name input {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 5px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
}

.sf-summary__stats {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.sf-summary__output {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 12px;
}

.sf-summary__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* ---- Sticky progress bar ---- */
.sf-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #fff;
  border-top: 1px solid var(--color-rule);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.sf-bar[hidden] {
  display: none;
}

.sf-bar__stats {
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.sf-bar__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--color-brand);
  color: var(--color-on-brand);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
}

.sf-bar__link:hover,
.sf-bar__link:focus-visible {
  background: #a11010;
}
