/* Birthday photo book. Theme taken from ~/source/gibbons-poetry (src/styles.scss and the site header):
   Manrope, navy headings, pale-blue header over an amber rule, amber for lines only, never text.
   @author: tgibbons via Claude */
:root {
  --ps-navy: #1f3864;        /* headings, links, primary buttons */
  --ps-navy-dark: #14213d;   /* hover on navy */
  --ps-link: #2b5797;
  --ps-header-bg: #eaf0f8;   /* pale blue header */
  --ps-accent: #e09a3e;      /* amber: dividing lines only, never text */
  --ps-text: #1f2937;
  --ps-muted: #4a5468;
  --ps-placeholder-bg: #f7f8fa;
  --ps-placeholder-border: #b8c2d6;
  --ps-line: #dde3ee;
  --ps-error: #b3261e;
  --ps-ok: #2e6b3a;
  --ps-rule: 4px;
  --ps-radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; background: #fff; color: var(--ps-text); }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { color: var(--ps-navy); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.8rem; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 0 0 14px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }

.container { max-width: 1000px; margin: 0 auto; padding-inline: 16px; }
main.container { padding-block: 24px 48px; }

.lead { margin: 0 0 22px; }
.muted { color: var(--ps-muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.error { color: var(--ps-error); margin: 0 0 12px; font-weight: 600; }
.saved { color: var(--ps-ok); font-size: 0.9rem; font-weight: 600; }

/* ---------- header (matches the poetry site header) ---------- */
.site-header {
  background: var(--ps-header-bg);
  border-bottom: var(--ps-rule) solid var(--ps-accent);
  padding-top: env(safe-area-inset-top);
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 1rem;
  padding-block: 1rem 0.5rem;
}
.brand { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1; color: var(--ps-navy); }
.brand-tagline { font-size: 0.95rem; font-weight: 500; font-style: italic; line-height: 1.2; color: var(--ps-muted); }
.header-user { margin: 0; color: var(--ps-muted); font-size: 0.95rem; }
.header-user strong { color: var(--ps-navy); }
nav { width: 100%; }
.header-bar:has(nav[hidden]) { padding-bottom: 1rem; }

.nav-list { display: flex; flex-wrap: wrap; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
.nav-list button {
  font: inherit; cursor: pointer; background: none; border: 0; border-radius: 0;
  padding: 10px 0; font-size: 1.05rem; font-weight: 600;
  color: var(--ps-muted);
  border-bottom: 3px solid transparent;
}
.nav-list button:hover { color: var(--ps-navy); }
.nav-list button.active { color: var(--ps-navy); font-weight: 700; border-bottom-color: var(--ps-accent); }

@media (max-width: 767.98px) {
  .brand-name { font-size: 1.5rem; }
  .brand-tagline { display: none; }
  .header-bar { padding-top: 12px; }
  .nav-list { justify-content: center; gap: 0 20px; }
  .nav-list button { font-size: 1rem; padding: 6px 0; }
}

/* ---------- cards and forms ---------- */
.card {
  background: #fff;
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
  padding: 20px;
  margin-bottom: 20px;
}
.narrow { max-width: 480px; margin: 8px auto; }

label { display: block; margin-bottom: 16px; font-weight: 600; color: var(--ps-navy); }
label .muted { font-weight: 500; }
input, textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--ps-text);
  padding: 12px; border: 1px solid var(--ps-placeholder-border); border-radius: 10px; background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--ps-link); outline-offset: 0; border-color: transparent; }

button, .file-button {
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 10px 18px;
  border: 1px solid var(--ps-placeholder-border); background: #fff; color: var(--ps-navy);
}
button:hover, .file-button:hover { border-color: var(--ps-navy); }
.primary { background: var(--ps-navy); color: #fff; border-color: var(--ps-navy); }
.primary:hover { background: var(--ps-navy-dark); border-color: var(--ps-navy-dark); }
.big { display: block; width: 100%; padding: 16px; font-size: 1.1rem; text-align: center; }
.ghost { background: transparent; }
.danger { color: var(--ps-error); }
.danger:hover { border-color: var(--ps-error); }
.link { background: none; border: none; color: var(--ps-link); padding: 4px; text-decoration: underline; font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.segmented { display: flex; gap: 6px; background: var(--ps-header-bg); padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.seg { flex: 1; border: none; background: transparent; padding: 10px 6px; color: var(--ps-muted); }
.seg.active { background: #fff; color: var(--ps-navy); box-shadow: 0 1px 3px rgba(20, 33, 61, .15); }

/* ---------- photos ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.photo { background: #fff; border: 1px solid var(--ps-line); border-radius: var(--ps-radius); overflow: hidden; display: flex; flex-direction: column; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--ps-placeholder-bg); display: block; }
.photo .body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.photo textarea { margin: 0; }
.photo .owner { font-weight: 700; color: var(--ps-navy); }

.progress { list-style: none; padding: 0; margin: 14px 0 0; }
.progress li { padding: 6px 0; border-bottom: 1px solid var(--ps-line); font-size: 0.95rem; }

/* ---------- captions ---------- */
.photo-head { justify-content: space-between; gap: 4px 12px; }
.photo-head .link { padding: 0; font-size: 0.9rem; }
.captions-section { display: flex; flex-direction: column; gap: 8px; }
.captions { list-style: none; margin: 0; padding: 0; }
.caption { padding: 6px 0 8px; border-bottom: 1px solid var(--ps-line); font-size: 0.95rem; }
.caption:first-child { border-top: 1px solid var(--ps-line); }
.caption-name { font-weight: 700; color: var(--ps-navy); }
.caption-text { margin: 2px 0 0; white-space: pre-wrap; font-size: 0.95rem; line-height: 1.5; }
.caption textarea { margin-top: 4px; }
.caption-actions { gap: 4px 12px; }
.caption-actions .link { padding: 2px 0; font-size: 0.9rem; }
.caption-actions .primary, .caption-actions .ghost { padding: 6px 12px; font-size: 0.9rem; }
.link.danger { color: var(--ps-error); }

.intro { margin: 0 0 18px; }

/* ---------- how it works ---------- */
.how { max-width: 720px; margin-inline: auto; }
.how h2 { margin: 26px 0 8px; padding-top: 16px; border-top: var(--ps-rule) solid var(--ps-accent); font-size: 1.2rem; }
.how p { margin: 0 0 10px; }
.how ul { margin: 0; padding-left: 1.2em; }
.how li { margin-bottom: 6px; }

/* ---------- messages ---------- */
.message .text { white-space: pre-wrap; margin: 0 0 14px; }
.message .muted.small { margin-bottom: 6px; }

/* Amber divider between sections, as on the poetry site */
.section-title { margin-top: 32px; padding-top: 20px; border-top: var(--ps-rule) solid var(--ps-accent); }

/* ---------- owner table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { color: var(--ps-navy); }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--ps-line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
