/* Chantry Lodge No. 4065 — booking site (booking.chantrylodge.org.uk) */
:root {
  /* Same palette as chantrylodge.org.uk (these names are shared with its stylesheet) */
  --navy: #112d3b;
  --navy-2: #1d4356;
  --gold: #c4a36b;
  --gold-text: #7a5f30;
  --gold-soft: #f3ecdd;
  --ink: #233c47;
  --muted: #56656e;
  --line: #d9dcd5;
  --bg: #f7f5ef;
  --ok: #1d6b3a;
  --ok-bg: #e7f4ec;
  --err: #a12a2a;
  --err-bg: #fbeaea;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.fb-header {
  background: var(--navy);
  color: #fff;
  padding: 1.25rem 1rem;
  border-bottom: 4px solid var(--gold);
  text-align: center;
}
.fb-header .lodge { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); margin: 0; }
.fb-header h1 { margin: .2rem 0 0; font-weight: normal; font-size: 1.8rem; }

main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
main.wide { max-width: 1150px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 .75rem; font-weight: normal; color: var(--navy); font-size: 1.35rem; }
.card h3 { margin: 0 0 .5rem; color: var(--navy); font-size: 1.1rem; }

.event-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .75rem 0 0; }
.fact { background: var(--gold-soft); border-radius: 8px; padding: .6rem .8rem; }
.fact .k { display: block; font-size: .8rem; color: var(--muted); font-family: Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.fact .v { font-size: 1.1rem; }

.menu-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.menu-list h4 { margin: 0 0 .3rem; font-family: Arial, sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); }
.menu-list ul { margin: 0; padding-left: 1.1rem; }

label, legend { font-family: Arial, sans-serif; font-size: .92rem; font-weight: bold; color: var(--navy); }
.field { margin-bottom: .9rem; }
.field label { display: block; margin-bottom: .25rem; }
.hint { font-family: Arial, sans-serif; font-size: .82rem; color: var(--muted); font-weight: normal; }

input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local], textarea, select {
  width: 100%;
  font: inherit;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  padding: .6rem .7rem;
  border: 1px solid #b9bfcc;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 4.5rem; resize: vertical; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(184,150,62,.45); border-color: var(--gold); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.diner { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 1rem; margin: 0 0 1rem; }
.diner-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.diner-head strong { font-size: 1.05rem; color: var(--navy); }

fieldset.course { border: 0; padding: 0; margin: 0 0 .9rem; }
fieldset.course legend { margin-bottom: .35rem; padding: 0; }
.choice { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .35rem; cursor: pointer; font-family: Arial, sans-serif; font-size: .95rem; font-weight: normal; color: var(--ink); }
.choice:hover { background: #fafaf7; }
.choice input { margin-top: .2rem; accent-color: var(--navy); }
.choice:has(input:checked) { border-color: var(--navy); background: #eef1f7; }

.check { display: flex; gap: .5rem; align-items: center; font-weight: normal; color: var(--ink); cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); }

.btn {
  display: inline-block;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  padding: .7rem 1.2rem;
  border-radius: 6px;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: #eef1f7; }
.btn.small { font-size: .85rem; padding: .35rem .7rem; }
.btn.link { background: none; border: 0; color: var(--err); padding: 0; font-weight: normal; text-decoration: underline; }

.total { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 1.15rem; }
.total .amount { font-size: 1.5rem; color: var(--navy); }

.msg { border-radius: 8px; padding: .8rem 1rem; margin: 0 0 1rem; font-family: Arial, sans-serif; font-size: .95rem; }
.msg.error { background: var(--err-bg); color: var(--err); border: 1px solid #ecc2c2; }
.msg.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bfe0cb; }
.msg.info { background: #eef1f7; color: var(--navy); border: 1px solid #cdd5e6; }

.privacy { font-family: Arial, sans-serif; font-size: .8rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hidden { display: none !important; }
#sumup-card { min-height: 120px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { font-family: Arial, sans-serif; font-size: .95rem; padding: .5rem 1rem; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--navy); color: #fff; border-color: var(--navy); }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { margin: 0; min-width: 260px; flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--gold-soft); border-radius: 8px; padding: .6rem .8rem; font-family: Arial, sans-serif; }
.stat .k { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.stat .v { font-size: 1.4rem; color: var(--navy); }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; font-family: Arial, sans-serif; font-size: .9rem; }
.counts table { width: 100%; }

table.data { width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; font-size: .88rem; }
table.data th, table.data td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { border-bottom: 2px solid var(--navy); color: var(--navy); white-space: nowrap; }
table.data tr.diet td { background: #fff8e6; }
.table-wrap { overflow-x: auto; }
.signed-in { font-family: Arial, sans-serif; font-size: .85rem; color: var(--gold-soft); margin-top: .35rem; }
.linkbox { display: flex; gap: .5rem; }
.linkbox input { flex: 1; }

/* ---------- steward's desk ---------- */
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }
table.data td.missing { color: var(--err); font-style: italic; }
table.bookings tbody.group { border-top: 2px solid var(--line); }
table.bookings td.booking-cell { background: #fafaf7; min-width: 220px; border-left: 1px solid var(--line); }
.pay { font-weight: bold; margin: .2rem 0; }
.pay-ok { color: var(--ok); }
.pay-due { color: #9a5b00; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .4rem; }
.btn.link.small { font-size: .82rem; }
.msg .btn { margin-left: .5rem; vertical-align: middle; }

dialog#editor { width: min(760px, 96vw); max-height: 92vh; border: 0; border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog#editor::backdrop { background: rgba(20, 26, 40, .55); }
dialog#editor h2 { margin: 0 0 .25rem; font-weight: normal; color: var(--navy); }
dialog#editor h3 { color: var(--navy); margin: .5rem 0; }
.dialog-actions { display: flex; gap: .5rem; margin-top: 1rem; position: sticky; bottom: -1.25rem; background: #fff; padding: .75rem 0; }

/* ---------- printing ---------- */
#print-area { display: none; }

@page { size: A4 portrait; margin: 12mm; }
@page cards { size: A4 portrait; margin: 0; }

@media print {
  body { background: #fff; }
  body.printing-list #screen, body.printing-cards #screen { display: none !important; }
  body.printing-list #print-area, body.printing-cards #print-area { display: block; }
  dialog { display: none !important; }

  /* Central booking list */
  .pl-head { border-bottom: 2px solid #000; margin-bottom: 4mm; padding-bottom: 2mm; font-family: Arial, sans-serif; font-size: 9.5pt; }
  .pl-head h1 { font-family: Georgia, serif; font-weight: normal; font-size: 16pt; margin: 1mm 0; }
  .pl-lodge { text-transform: uppercase; letter-spacing: .08em; font-size: 8.5pt; }
  .pl-counts { display: flex; gap: 10mm; font-family: Arial, sans-serif; font-size: 9pt; margin-bottom: 3mm; }
  .pl-counts ul, .pl-diet ul { margin: 1mm 0 0; padding-left: 4mm; }
  .pl-money { display: flex; gap: 8mm; font-family: Arial, sans-serif; font-size: 9pt; font-weight: bold; margin-bottom: 3mm; }
  .pl-diet { font-family: Arial, sans-serif; font-size: 9pt; margin-bottom: 4mm; border: 1px solid #000; padding: 2mm 3mm; }
  .pl-table { width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 9pt; }
  .pl-table th, .pl-table td { border: 1px solid #999; padding: 1.2mm 1.5mm; text-align: left; vertical-align: top; }
  .pl-table th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pl-table tr { break-inside: avoid; }
  .pl-table td:last-child { width: 7mm; }

  /* Place cards: 4 per A4 sheet, each 105 x 148.5 mm, folded across the middle */
  .pc-sheet {
    page: cards;
    width: 210mm; height: 296.5mm; overflow: hidden;
    display: grid; grid-template-columns: 105mm 105mm; grid-template-rows: 148.25mm 148.25mm;
    break-after: page;
  }
  .pc-sheet:last-child { break-after: auto; }
  .pc-card { position: relative; border: 0.2mm dashed #bbb; font-family: Georgia, "Times New Roman", serif; color: #000; }
  .pc-back, .pc-front { height: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6mm 8mm; }
  .pc-back { transform: rotate(180deg); }
  .pc-front { border-top: 0.2mm dotted #999; justify-content: flex-start; padding-top: 7mm; }
  .pc-lodge { font-family: Arial, sans-serif; font-size: 7pt; letter-spacing: .06em; text-transform: uppercase; color: #555; margin-bottom: 2mm; }
  .pc-name { font-size: 19pt; line-height: 1.15; }
  .pc-name.s { font-size: 15pt; }
  .pc-name.xs { font-size: 12pt; }
  .pc-menu { margin-top: 3mm; font-size: 9pt; line-height: 1.35; }
  .pc-course { display: inline-block; font-family: Arial, sans-serif; font-size: 6.5pt; text-transform: uppercase; letter-spacing: .06em; color: #666; margin-right: 1.5mm; }
  .pc-diet { margin-top: 2mm; font-family: Arial, sans-serif; font-size: 8pt; font-weight: bold; }
}

/* ---------- event selector ---------- */
.back-link { font-family: Arial, sans-serif; font-size: .9rem; margin: 0 0 1rem; }
.back-link a { color: var(--navy); }
.event-choice .event-type { margin: 0 0 .2rem; font-family: Arial, sans-serif; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
.event-choice h2 { margin-bottom: .25rem; }
.event-link { font-family: monospace; font-size: .85rem; }

/* ---------- page title (public pages) ---------- */
.fb-title {
  background: var(--navy);
  color: #fff;
  padding: 1.25rem 1rem;
  border-bottom: 4px solid var(--gold);
  text-align: center;
}
.fb-title .lodge { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); margin: 0; }
.fb-title .lodge-section { display: none; }
.fb-title h1 { margin: .2rem 0 0; font-weight: normal; font-size: 1.8rem; line-height: 1.2; letter-spacing: 0; }

/* ---------- when the main site's top bar and stylesheet are present ---------- */
/* (added by functions/_middleware.js; these undo the main site's dark contact-form styling) */
body.with-site-header .fb-title { background: transparent; color: var(--navy); border-bottom: 0; text-align: left;
  max-width: 760px; margin: 0 auto; padding: 2.25rem 1rem .25rem; }
body.with-site-header .fb-title .lodge { color: var(--gold-text); font-size: 12px; letter-spacing: 3px; }
body.with-site-header .fb-title .lodge-name { display: none; }
body.with-site-header .fb-title .lodge-section { display: inline; }
body.with-site-header .fb-title h1 { font-size: clamp(30px, 4vw, 42px); margin: .4rem 0 0; letter-spacing: -.5px; }
body.with-site-header header .links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.fb-main label, .fb-main legend { color: var(--navy); font-size: .92rem; margin-bottom: .25rem; }
.fb-main .choice, .fb-main .check { font-size: .95rem; margin-bottom: .35rem; }
.fb-main .choice { color: var(--ink); }
.fb-main input[type=radio], .fb-main input[type=checkbox] { width: 1.1rem; height: 1.1rem; padding: 0; margin: .2rem 0 0; flex: none; background: none; }
.fb-main textarea { min-height: 4.5rem; }
.fb-main h2 { letter-spacing: 0; }
.fb-main .card h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
body.with-site-header footer { margin-top: 2rem; }
.fb-main .check { display: flex; gap: .55rem; align-items: center; }
.fb-main .check input { margin: 0; }
#event-card #event-title { display: none; } /* the page heading already shows the event title */

/* lodge name + number on one row */
.row-lodge { display: grid; grid-template-columns: 1fr 8rem; gap: 0 1rem; }
@media (max-width: 560px) { .row-lodge { grid-template-columns: 1fr 6rem; } }
