/* gap.css */
:root{
  --bg: #f6f1e3;
  --bg2: #efe8d6;
  --card: rgba(255,255,255,0.78);
  --ink: #1d1a14;
  --muted: #5b5347;
  --gold: #b79a45;
  --leaf: #4e6b3a;
  --shadow: 0 18px 50px rgba(20,16,10,0.12);
  --radius: 18px;
  --radius2: 26px;
  --max: 1100px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(231,211,107,0.35), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(78,107,58,0.20), transparent 55%),
    radial-gradient(900px 700px at 30% 120%, rgba(183,154,69,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.45;
}

.wrap{
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(246,241,227,0.75);
  border-bottom: 1px solid rgba(183,154,69,0.25);
}

.topbarInner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 18px;
}

.brandKicker{
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brandName{
  font-weight: 700;
  font-size: 16px;
}

.topnav{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}


.topnav a{
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(183,154,69,0.18);
  background: rgba(255,255,255,0.55);
}

.topnav a:hover{
  border-color: rgba(183,154,69,0.35);
  background: rgba(255,255,255,0.75);
}

.hero{ padding: 34px 0 22px; }

.heroInner{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: start;
}

.kicker{
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.name{
  margin: 10px 0 6px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
}

.dates{
  font-weight: 650;
  color: rgba(29,26,20,0.85);
  margin-bottom: 14px;
}

.lede{
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 60ch;
}

.ctaRow{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn{
  border: 1px solid rgba(183,154,69,0.45);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  box-shadow: 0 10px 24px rgba(20,16,10,0.10);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: inherit;
}

.btn:hover{ border-color: rgba(183,154,69,0.65); }
.btnGhost{ background: transparent; box-shadow: none; }

/* Leaf variant (used for Upload Photos) */
.btn--leaf{
  border-color: rgba(78,107,58,0.28);
  background: linear-gradient(180deg, rgba(78,107,58,0.10), rgba(255,255,255,0.06));
  color: var(--leaf);
}

/* File input: style the native file selector button to match site buttons */
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button{
  border: 1px solid rgba(183,154,69,0.45);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  margin-right: 8px;
}

/* Slightly smaller variant for file selector when using leaf styling */
input[type="file"]::file-selector-button.btn--leaf,
input[type="file"]::-webkit-file-upload-button.btn--leaf{
  border-color: rgba(78,107,58,0.28);
  color: var(--leaf);
}

.heroRight{ display: grid; gap: 14px; }

.portraitFrame{
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  padding: 12px;
  border-radius: var(--radius2);
  border: 1px solid rgba(183,154,69,0.45);
  background:
    radial-gradient(400px 240px at 30% 20%, rgba(231,211,107,0.25), transparent 60%),
    rgba(255,255,255,0.55);
  box-shadow: var(--shadow);
}

.portrait{
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 999px;
  border: 10px solid rgba(246,241,227,0.95);
}

.posterCard{
  border-radius: var(--radius2);
  border: 1px solid rgba(183,154,69,0.30);
  background: rgba(255,255,255,0.50);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.posterMeta{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(183,154,69,0.18);
}

.posterTitle{ font-weight: 700; }
.posterHint{ font-size: 12px; color: var(--muted); }
.poster{ width: 100%; display: block; height: auto; }

.section{ padding: 26px 0; }
.section.alt{
  background: rgba(255,255,255,0.20);
  border-top: 1px solid rgba(183,154,69,0.14);
  border-bottom: 1px solid rgba(183,154,69,0.14);
}

.h2{ margin: 0 0 14px; font-size: 22px; }

.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Force specific grid2 instances with the .stack modifier to a single column
   so inputs (forms) span full width and lists appear beneath them. */
.grid2.stack{
  grid-template-columns: 1fr;
}

.card{
  border-radius: var(--radius);
  border: 1px solid rgba(183,154,69,0.26);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.cardTitle{ font-weight: 800; margin-bottom: 10px; }
.cardText{ margin: 0; color: var(--muted); }

.dl{ margin: 0; }

.dlRow{
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(183,154,69,0.22);
}

.dlRow:last-child{ border-bottom: 0; }

dt{ font-weight: 700; color: rgba(29,26,20,0.88); }
dd{ margin: 0; color: var(--muted); }

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

.linkBtn{
  font: inherit;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(78,107,58,0.25);
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  text-decoration: none;
}

.linkBtn:hover{ border-color: rgba(78,107,58,0.40); }

.note{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(183,154,69,0.35);
  color: var(--muted);
  background: rgba(246,241,227,0.55);
  font-size: 13px;
}

.divider{
  height: 1px;
  background: rgba(183,154,69,0.20);
  margin: 14px 0;
}

.label{
  display: block;
  font-size: 13px;
  color: rgba(29,26,20,0.85);
  margin-bottom: 6px;
  font-weight: 650;
}

.input, .textarea{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(183,154,69,0.32);
  background: rgba(255,255,255,0.80);
  padding: 10px 12px;
  font: inherit;
}

.textarea{ resize: vertical; }
.form{ display: grid; gap: 10px; }

.formStatus, .uploadStatus{
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
}

.editorRow{ display: grid; gap: 8px; }
.editor{ display: grid; gap: 10px; }

.rendered{ color: var(--muted); white-space: pre-wrap; }

.gallery, .previewRow{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gallery img, .previewRow img{
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(183,154,69,0.22);
  background: rgba(255,255,255,0.65);
}

.uploadBox{ display: grid; gap: 10px; }
.uploadHelp{ font-size: 13px; color: var(--muted); }

.messages{ display: grid; gap: 12px; }

.msg{
  border-radius: 14px;
  border: 1px solid rgba(183,154,69,0.22);
  background: rgba(255,255,255,0.72);
  padding: 12px;
}

.msgHead{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.msgName{ font-weight: 750; }
.msgDate{ font-size: 12px; color: var(--muted); }
.msgText{ margin: 0; color: var(--muted); white-space: pre-wrap; }

.msgTitle{
  font-weight: 800;
  margin-bottom: 6px;
  color: rgba(29,26,20,0.95);
}

.msgFooter{
  margin-top: 10px;
  text-align: right;
  font-weight: 750;
  color: var(--muted);
  font-size: 13px;
}

.msgFooterName{ font-weight: 750; margin-right: 8px; }
.msgFooterDate{ font-weight: 400; color: var(--muted); font-size: 12px; }

/* Ensure long prayers/messages wrap and are not clipped */
.msg{ overflow: visible; }
.msgText{
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.footer{ padding: 22px 0 40px; }

.footerInner{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(29,26,20,0.78);
  border-top: 1px solid rgba(183,154,69,0.18);
  padding-top: 14px;
}

.footerSmall{ font-size: 13px; color: var(--muted); }

@media (max-width: 920px){
  .heroInner{ grid-template-columns: 1fr; }
  .portraitFrame{ margin-left: 0; max-width: 420px; }
}

@media (max-width: 720px){
  .grid2{ grid-template-columns: 1fr; }
  .gallery, .previewRow{ grid-template-columns: repeat(2, 1fr); }
  .dlRow{ grid-template-columns: 1fr; }
}


.galleryItem{
  display: grid;
  gap: 6px;
}

.galleryCaption{
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

.galleryTitle{ font-weight: 700; color: rgba(29,26,20,0.95); margin-bottom: 4px; }
.galleryBy{ color: var(--muted); font-size: 12px; }

.heroLeft .posterCard{
  margin-top: 14px;
  max-width: 520px;
}

.rendered .prose{
  white-space: normal;
}

.rendered .prose p{
  margin: 0 0 12px;
}

.rendered .prose p:last-child{
  margin-bottom: 0;
}

.uploadPreview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.uploadPreview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

/* Gallery: show 2 rows then scroll */
.gallery{
  --thumb: 140px;
  --gap: 10px;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr));
  gap: var(--gap);

  max-height: calc((var(--thumb) * 2) + var(--gap));
  overflow-y: auto;
  padding-right: 6px;
}

.galleryItem img{
  width: 100%;
  height: var(--thumb);
  object-fit: cover;
  display: block;
  border-radius: 10px;
  cursor: pointer;
}
/* Lightbox carousel */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.lightbox.isOpen{
  display: flex;
}

.lightboxInner{
  position: relative;
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.lightboxImg{
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.lightboxNav{
  grid-row: 2;
  height: 48px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.lightboxPrev{ grid-column: 1; }
.lightboxNext{ grid-column: 3; }

.lightboxClose{
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  height: 40px;
  width: 40px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.lightboxCap{
  grid-column: 1 / 4;
  grid-row: 3;
  color: #fff;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
  padding: 6px 0;
}
