/* Word from the Well: family page styles.
   Values match design-reference/family-page.html. The only change is layout:
   the page stretches to fill a phone instead of sitting at a fixed 390px. */

:root {
  --ground: #F6F1E6;
  --ink: #2E1A0B;
  --body: #2C2822;
  --muted: #6B6155;
  --card: #FFFFFF;
  --border: #E3D8C4;
  --btn-border: #C9B999;
  --accent: #9A3B08;
  --video-bg: #221E19;

  --display: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Karla, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Make the hidden attribute always win, even over display: flex below */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  font-family: var(--sans);
  color: var(--body);
}

/* The page column. Full width on a phone, capped and centered on bigger screens.
   The max() calls keep content clear of the iPhone notch and rounded corners. */
.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
           max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.header { display: flex; flex-direction: column; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; }
.well { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.title {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.date {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.banner {
  display: block;
  width: 100%;
  height: auto;
}

/* Video placeholder: always 16:9, whatever the screen width */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--video-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--ground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Wraps the post (video down to the earlier row), same spacing as the page */
.post-area { display: flex; flex-direction: column; gap: 18px; }

/* "Nothing posted yet" / "Couldn't load" */
.status-line {
  margin: 8px 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

/* Small uppercase labels */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.eyebrow.small { font-size: 12px; }
.eyebrow.accent { color: var(--accent); }
.eyebrow.muted { color: var(--muted); }

/* Conrad's message */
.message { display: flex; flex-direction: column; gap: 7px; }
.message p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
}

/* Scripture card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.scripture { padding: 18px 18px 16px; }
.scripture .eyebrow { margin-bottom: 8px; }
.verse {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
}
.reference { font-size: 13px; color: var(--muted); }
/* Reference shown by itself (no words): no gap left underneath */
.verse:has(+ .reference[hidden]) { margin-bottom: 0; }

/* Amen / Send a note */
.actions { display: flex; gap: 10px; align-items: center; }
.btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--btn-border);
  background: var(--card);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: #1F1B16;
  cursor: pointer;
}
.btn:disabled { cursor: default; }
/* After this phone has said Amen: a warm tint so it reads as "done" */
.btn.amened {
  border-color: var(--accent);
  background: #FBF3EA;
  color: var(--accent);
}

/* Send a note panel */
.note-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: #FFFDF8;
  font-family: var(--sans);
  font-size: 16px; /* 16px or larger stops iPhones from zooming in on tap */
  line-height: 1.45;
  color: var(--body);
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.char-count {
  font-size: 13px;
  color: var(--muted);
  align-self: flex-end;
}
.char-count.near-limit { color: var(--accent); }
.form-error {
  margin: 0;
  font-size: 15px;
  color: #A50021;
}
.panel-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.link-btn {
  min-height: 44px;
  padding: 0 14px;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}
.primary-btn {
  min-width: 120px;
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: #7A4A1F;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: #FFFDF8;
  cursor: pointer;
}
.primary-btn:disabled { opacity: 0.6; cursor: default; }

/* Notes from the family */
.notes { display: flex; flex-direction: column; gap: 9px; }
.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.note-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.note-name { font-size: 15px; font-weight: 500; color: var(--ink); }
.note-time { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.note-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--body);
  white-space: pre-wrap;      /* keep line breaks the person typed */
  overflow-wrap: anywhere;    /* a very long word or link can't push the page sideways */
}
.notes-empty {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}

/* Earlier posts. Three columns so each thumbnail keeps the reference size,
   even though only two earlier posts are kept. */
.earlier { display: flex; flex-direction: column; gap: 9px; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.thumb {
  display: block;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font-family: var(--sans);
  cursor: pointer;
}
.thumb-img {
  /* 350px-wide column in the reference gives ~110 x 68 thumbnails; this keeps that shape */
  aspect-ratio: 110 / 68;
  border-radius: 10px;
  background: #2E2820;
}
.thumb:nth-child(2) .thumb-img { background: #33291F; }
.thumb-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

/* Who plays when (sizes from the design reference) */
.games {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.game { display: flex; align-items: center; gap: 10px; }
.game-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.game-matchup { flex: 1; font-size: 15px; color: var(--ink); }
.game-time { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Keyboard focus ring, so tabbing through the page is visible */
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
