/* The reading pages (Tips, Terms, Privacy, Refunds, Contact, Gallery). Shares the site's palette (style.css). */
body.page { min-height: 100vh; }
body.page .site-header { position: sticky; top: 0; background: rgba(26, 39, 80, 0.95); backdrop-filter: blur(10px); }

.page-foot a { color: var(--muted); text-decoration: none; }
.page-foot a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page-foot a[aria-current="page"] { color: var(--accent); }

.page-main { max-width: 860px; margin: 0 auto; padding: 36px 20px 40px; }
.doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 38px 44px 44px; box-shadow: 0 24px 48px -30px rgba(26, 39, 80, 0.35);
}
.doc h1 { font-size: clamp(1.9rem, 4.8vw, 2.7rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
.doc .updated { margin: 6px 0 22px; color: var(--muted); font-size: 0.85rem; }
.doc .lead { font-size: 1.08rem; color: var(--text); margin: 12px 0 4px; }
.doc h2 { margin: 34px 0 8px; font-size: 1.3rem; line-height: 1.25; scroll-margin-top: 92px; }
.doc h3 { margin: 20px 0 4px; font: 700 1rem/1.3 var(--font-ui); color: var(--heading); }
.doc p + p, .doc ul + p, .doc ol + p, .doc p + ul, .doc p + ol { margin-top: 12px; }
.doc p, .doc li { line-height: 1.65; }
.doc ul, .doc ol { margin: 8px 0 0; padding-left: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { color: var(--cta-hover); }
.doc strong { font-weight: 650; color: var(--heading); }
.doc code { font: 500 0.88em var(--font-mono); background: var(--raise); border-radius: 6px; padding: 1px 6px; }

.callout {
  margin: 18px 0 4px; padding: 13px 18px; background: var(--raise);
  border-left: 4px solid var(--stitch); border-radius: 10px;
}
.callout p + p { margin-top: 8px; }

.toc { margin: 18px 0 4px; padding: 16px 20px; background: var(--raise); border-radius: 14px; }
.toc p { font: 600 0.75rem/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.toc li { break-inside: avoid; margin: 0 0 6px; }

.table-wrap { overflow-x: auto; margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 420px; }
.doc th { text-align: left; font: 600 0.72rem/1.3 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: var(--raise); }
.doc td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.doc td .muted { color: var(--muted); font-size: 0.85em; }

.doc .cta { margin-top: 28px; }
.doc .cta a.btn { display: inline-block; text-decoration: none; padding: 14px 24px; font-size: 1rem; color: var(--on-cta); }
.doc a.btn-quiet { color: var(--text); }
.doc a.btn-quiet:hover { color: var(--text); }

.page-foot { max-width: 860px; margin: 0 auto; padding: 0 20px 56px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.page-foot p + p { margin-top: 6px; }

@media (max-width: 760px) {
  body.page .site-header { position: relative; }               /* two rows tall on a phone: too much to keep pinned */
}
@media (max-width: 620px) {
  .page-main { padding-top: 22px; }
  .doc { padding: 26px 20px 30px; border-radius: 14px; }
  .toc ul { columns: 1; }
}

/* Gallery: a picture, and what the converter made of it, side by side (stacked on a narrow screen). */
.example { margin-top: 30px; }
.example h2 { margin-top: 0; }
.ba { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; align-items: start; }
.ba-fig { margin: 0; }
.ba-fig a { display: block; line-height: 0; }
.ba-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ba-fig figcaption { margin-top: 7px; font-size: 0.85rem; line-height: 1.45; color: var(--text); }
.ba-fig figcaption strong { color: var(--heading); }
.ba-fig .facts { display: inline-block; margin-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; }
.ba-fig a { cursor: zoom-in; }

/* A gallery picture opened over the page (gallery.js): the picture, its name, and a close button. */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 64px 16px 20px;
  background: rgba(10, 18, 48, 0.9);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; gap: 10px; justify-items: center; }
.lightbox-figure img {
  display: block; width: auto; height: auto; max-width: min(calc(100vw - 32px), 1100px); max-height: calc(100vh - 150px);
  border-radius: 12px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.lightbox-caption { color: #f3f6fc; font-size: 0.92rem; text-align: center; }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #fff; color: var(--heading); font: 400 1.9rem/1 var(--font-ui); cursor: pointer; z-index: 1;
  display: grid; place-items: center; padding: 0 0 3px;
}
.lightbox-close:hover { background: #e8ecf8; }
.lightbox-close:focus-visible { outline: 3px solid var(--stitch); outline-offset: 2px; }
html.lightbox-open { overflow: hidden; }
.ba-photo img { border-color: var(--stitch); }
.example .settings { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.example .try { margin-top: 10px; }
.example .try a.btn { text-decoration: none; }

/* My designs (sign in, then your paid designs) */
.md-form label { display: block; margin: 18px 0 6px; font-weight: 600; }
.md-row { display: flex; flex-wrap: wrap; gap: 10px; }
.md-row input { flex: 1 1 260px; min-width: 0; }
.md-row .btn { padding: 11px 20px; }
.md-error { margin-top: 10px; padding: 9px 12px; border: 1.5px solid var(--bad); border-radius: 10px; background: rgba(184, 67, 59, 0.07); color: #7c2620; font-size: 0.92rem; }
.md-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.md-who { font-weight: 600; }
.md-designs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.md-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); }
.md-thumb { width: 150px; height: 150px; object-fit: contain; border-radius: 10px; background: #e3dac7; border: 1px solid var(--line); }
.md-body h3 { margin: 0 0 4px; text-transform: capitalize; }
.md-meta { color: var(--muted); font-size: 0.9rem; }
.md-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; }
.md-format { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.md-format select { width: auto; min-width: 190px; max-width: 100%; }
.md-actions .btn { padding: 10px 16px; }
.md-remove { margin-left: auto; color: var(--bad); }
@media (max-width: 560px) {
  .md-card { grid-template-columns: minmax(0, 1fr); }
  .md-thumb { width: 100%; height: 190px; }
}

/* About me: the photo beside the words (stacked, photo first, on a narrow screen). */
.about { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 12px 34px; align-items: start; margin-top: 22px; }
.about-photo { margin: 0; position: sticky; top: 112px; }       /* stays beside the story as it scrolls */
.about-photo img {
  display: block; width: 100%; height: auto; border-radius: 20px; background: var(--raise);
  border: 1px solid var(--line); box-shadow: 0 18px 36px -24px rgba(26, 39, 80, 0.5);
}
.about-text .lead { margin-top: 0; font-size: 1.2rem; font-weight: 600; color: var(--heading); }
.about-text h2 { margin: 26px 0 6px; font-size: 1.12rem; }
.about-text .about-note { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
@media (max-width: 680px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-photo { position: static; max-width: 340px; }
}
