/* ==========================================================================
   Embassy of the State of Kuwait, London: invitation and RSVP pages
   One stylesheet for every page. No JavaScript. Light theme only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   Palatino Linotype is a licensed system font (Windows; "Palatino" on macOS
   and iOS), so it is used from the device and never downloaded.
   TeX Gyre Pagella (GUST Font License) is a free Palatino-compatible design,
   self-hosted from /fonts for devices without Palatino (Android, Linux).
   Amiri (SIL Open Font License) is used for any Arabic text (lang="ar").
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "TeX Gyre Pagella";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("TeX Gyre Pagella"), local("TeXGyrePagella-Regular"),
       url("fonts/texgyrepagella-regular.woff2") format("woff2");
}
@font-face {
  font-family: "TeX Gyre Pagella";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local("TeX Gyre Pagella Italic"), local("TeXGyrePagella-Italic"),
       url("fonts/texgyrepagella-italic.woff2") format("woff2");
}
@font-face {
  font-family: "TeX Gyre Pagella";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("TeX Gyre Pagella Bold"), local("TeXGyrePagella-Bold"),
       url("fonts/texgyrepagella-bold.woff2") format("woff2");
}
@font-face {
  font-family: "TeX Gyre Pagella";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: local("TeX Gyre Pagella Bold Italic"), local("TeXGyrePagella-BoldItalic"),
       url("fonts/texgyrepagella-bolditalic.woff2") format("woff2");
}
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Amiri"), local("Amiri-Regular"), url("fonts/amiri-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF,
                 U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Amiri Bold"), local("Amiri-Bold"), url("fonts/amiri-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF,
                 U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --navy:      #12284c;  /* headings, primary buttons, links, the guest's name */
  --gold:      #b08d3c;  /* thin rules, ornament, top border accents           */
  --gold-soft: #d9c9a3;  /* card borders and dividers                          */
  --ivory:     #f4efe4;  /* page margins, section backgrounds                  */
  --paper:     #ffffff;  /* the surface the skyline and the form sit on        */
  --ink:       #1f2a37;  /* body text                                          */
  --muted:     #5b6472;  /* secondary text, hints, field borders               */
  --ok:        #1d6b3a;  /* confirmation notices                               */
  --err:       #a1262b;  /* error text and borders, always with a message      */

  /* Added: --gold is 3.1:1 on white, too low for small text. Small uppercase
     labels use this darker gold instead: 5.8:1 on paper, 5.0:1 on ivory. */
  --gold-ink:  #7d6224;

  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella",
           "URW Palladio L", P052, Georgia, serif;
  --arabic: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --sheet-width: 47.5rem;            /* 760px: the white "card" */
  --measure: 36rem;                  /* reading column inside the card */
  --gutter: 1rem;                    /* 16px phone gutter */
  --skyline-ratio: 1255 / 971;       /* proportions of skyline*.svg (4:3 art + bend) */
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

:lang(ar) { font-family: var(--arabic); }

img, svg { max-width: 100%; }

h1, h2, h3 {
  color: var(--navy);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.25rem); }
h2 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.5rem); }

p { margin: 0 0 1rem; }

sup {
  font-size: 0.62em;
  line-height: 0;
  position: relative;
  top: -0.52em;
  vertical-align: baseline;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--paper);
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   The sheet: a white card on ivory, framed in soft gold
   -------------------------------------------------------------------------- */
.sheet {
  container-type: inline-size;
  max-width: var(--sheet-width);
  margin: 2rem auto;
  background: var(--paper);
  border: 1px solid var(--gold-soft);
  box-shadow: 0 1px 2px rgba(18, 40, 76, 0.06), 0 18px 40px -24px rgba(18, 40, 76, 0.28);
}

/* Header and footer bands: the docx artwork, reproduced exactly; never restyled */
.doc-header img,
.doc-footer-band img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   The scene: the main surface. The skyline is its background, anchored to the
   bottom edge and full width, so the content runs down into the open sky and
   the gap in the middle of the panorama.
   -------------------------------------------------------------------------- */
.scene {
  display: block;
  padding: 1.75rem var(--gutter) 2.5rem;
  background-color: var(--paper);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
}

/* Where the content stops, measured from the bottom of the art (cqi = % of card width;
   the art is 77.4cqi tall). Content ends just above the tallest towers, so text and
   fields only ever overlap open sky, never the line work or the outline. */
.sky .scene {
  aspect-ratio: var(--skyline-ratio);   /* acts as a minimum height: the whole skyline always shows */
  padding-bottom: 60cqi;
}

.sky-london-kuwait-navy :is(.scene, .a4-art) { background-image: url("images/skyline-london-kuwait-navy.svg"); }

/* Text drawn over the skyline gets a soft paper-coloured halo, so lines in the
   art never cut through letters. Form fields have their own white fill. */
.sky .scene :is(h1, h2, p, li, dt, dd, legend, label, figcaption, .hint, .label) {
  text-shadow: 0 0 2px var(--paper), 0 0 6px var(--paper), 0 0 12px var(--paper);
}

.content {
  max-width: var(--measure);
  margin: 0 auto;
}

.centred { text-align: center; }

/* --------------------------------------------------------------------------
   Ornament and labels
   -------------------------------------------------------------------------- */
.label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--gold-ink);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* A thin gold rule with a small diamond at its centre */
.ornament {
  position: relative;
  height: 0.75rem;
  margin: 1.75rem auto;
  max-width: 14rem;
  border: 0;
  background: linear-gradient(var(--gold), var(--gold)) left center / calc(50% - 0.75rem) 1px no-repeat,
              linear-gradient(var(--gold), var(--gold)) right center / calc(50% - 0.75rem) 1px no-repeat;
}
.ornament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.rule {
  height: 0;
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--gold-soft);
}

/* --------------------------------------------------------------------------
   The invitation
   -------------------------------------------------------------------------- */
.occasion {
  margin: 0;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
}
.occasion .amp {
  display: block;
  color: var(--gold-ink);
  font-style: normal;
}

.host {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
}

.request {
  margin: 0 0 0.5rem;
  font-style: italic;
}

.guest-name {
  margin: 0 0 1.25rem;
  color: var(--navy);
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.guest-name--small {
  font-size: clamp(1.3rem, 1.15rem + 0.8vw, 1.6rem);
  margin-bottom: 0.5rem;
}

.event-line {
  margin: 0 0 1.25rem;
  font-style: italic;
}

/* Date, time, venue... centred formal lines, two columns where there is room */
.particulars {
  display: grid;
  gap: 1.1rem 1.5rem;
  margin: 0 0 1.75rem;
  text-align: center;
}
.particulars dt {
  margin: 0 0 0.15rem;
  color: var(--gold-ink);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.particulars dd { margin: 0; }

.reply-by {
  margin: 0 0 1.25rem;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;                 /* 48px, above the 44px minimum */
  padding: 0.65rem 1.5rem;
  border: 2px solid var(--navy);
  border-radius: 2px;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--navy);
  color: var(--paper);
}
.btn-primary:hover {
  background: #0b1a33;
  border-color: #0b1a33;
}
.btn-secondary {
  background: var(--paper);
  color: var(--navy);
}
.btn-secondary:hover { background: var(--ivory); }

/* --------------------------------------------------------------------------
   QR passes
   -------------------------------------------------------------------------- */
.pass {
  margin: 0 auto;
  text-align: center;
}
.pass img {
  display: block;
  width: 200px;
  height: 200px;
  margin: 0 auto 0.75rem;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--gold-soft);
}
.pass figcaption { line-height: 1.45; }
.pass-name {
  display: block;
  color: var(--ink);
  font-weight: 700;
}
.ref {
  display: block;
  margin: 0.15rem 0 0.5rem;
  color: var(--navy);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
}
.pass-note {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.passes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}
.passes .pass img {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1;
}
.passes .ref {
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */
.notice {
  margin: 0 0 1.75rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--ok);
  background: #eef5f0;
  color: var(--ink);
}
.notice strong { color: var(--ok); }

.summary-box {
  margin: 0 0 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--ivory);
  border-top: 2px solid var(--gold);
}
.summary-box p:last-child { margin-bottom: 0; }

/* Answers summary */
.answers {
  margin: 0 0 1.75rem;
  border-top: 1px solid var(--gold-soft);
}
.answers > div {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--gold-soft);
}
.answers dt { font-weight: 700; }
.answers dd { margin: 0.1rem 0 0; }

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;              /* 44px target */
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.back-link::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.6rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
form { margin: 0; }

fieldset {
  min-width: 0;
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.section-legend {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0 0 0.4rem;
  border-bottom: 1px solid var(--gold-soft);
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1.3;
}

.field { margin: 0 0 1.5rem; }

.field-label,
.group-label {
  display: block;
  margin: 0 0 0.2rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}
.group-label { padding: 0; }

.hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.input,
.textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--muted);          /* 6:1 on white: meets the 3:1 rule for field edges */
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.0625rem;                     /* 17px: no zoom on iPhone */
  line-height: 1.4;
}
.input--short { max-width: 16rem; }
.textarea {
  min-height: 7.5rem;
  resize: vertical;
}
.input:focus-visible,
.textarea:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px var(--navy);
}

/* Checkboxes and radios: native controls, navy, with a 44px tap row */
.choices {
  display: grid;
  gap: 0.25rem 1.5rem;
}
.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}
.choice input {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  accent-color: var(--navy);
}
.choice label { cursor: pointer; }
.choices + .field { margin-top: 1.25rem; }

/* Conditional guest fields: hidden while "I will attend alone" is selected.
   CSS :has() only; browsers without :has() simply keep the fields visible. */
.plus-one-fields {
  margin: 0.75rem 0 0;
  padding: 1rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--gold-soft);
}
.guest-choice:has(input[name="plus_one"][value="no"]:checked) .plus-one-fields {
  display: none;
}

/* Errors: always a text message, never colour alone */
.error-summary {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border: 3px solid var(--err);
  background: var(--paper);
}
.error-summary h2 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
}
.error-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.error-summary a {
  color: var(--err);
  font-weight: 700;
}
.error-summary:focus { outline: 3px solid var(--navy); outline-offset: 3px; }

.field--error {
  padding-left: 0.9rem;
  border-left: 4px solid var(--err);
}
.field--error .input { border: 2px solid var(--err); }
.error-message {
  margin: 0.4rem 0 0;
  color: var(--err);
  font-weight: 700;
}

.form-actions {
  margin: 0.5rem 0 0;
}

/* --------------------------------------------------------------------------
   Footer: enquiries, then the docx footer band
   -------------------------------------------------------------------------- */
.enquiries {
  padding: 1.25rem var(--gutter) 1rem;
  border-top: 1px solid var(--gold-soft);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.enquiries p { margin: 0 0 0.25rem; }
.enquiries a { color: var(--navy); }

/* --------------------------------------------------------------------------
   A4 invitation: the PDF attached to the invitation email (invitation-a4.html)
   One A4 page, laid out in millimetres. The docx header and footer are scaled
   to the A4 width (the docx page is US Letter, 6 mm wider). The skyline sits on
   the bottom edge, full width; the text column runs down into the open middle
   of the panorama and stops above the buildings.
   -------------------------------------------------------------------------- */
@page {
  size: A4;
  margin: 0;
}

.a4-body {
  margin: 0;
  background: var(--ivory);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.a4 {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 10mm auto;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-size: 12pt;
  line-height: 1.42;
  text-align: center;
  box-shadow: 0 1px 2px rgba(18, 40, 76, 0.08), 0 18px 40px -20px rgba(18, 40, 76, 0.3);
}

.a4-header,
.a4-footer {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 2;
}
.a4-header { top: 0; }
.a4-footer { bottom: 0; }
.a4-header img,
.a4-footer img {
  display: block;
  width: 100%;
  height: auto;
}

.a4-art {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: var(--skyline-ratio);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
}

.a4-content {
  position: absolute;
  z-index: 1;
  top: 43mm;
  left: 24.7mm;                      /* the docx 1 in side margins, scaled to A4 */
  right: 24.7mm;
}
.a4-content :where(p) { margin: 0; }

.a4-occasion {
  font-size: 12.5pt;
  font-style: italic;
  line-height: 1.5;
}
.a4-occasion .amp {
  display: block;
  color: var(--gold-ink);
  font-style: normal;
}

.ornament.a4-ornament { margin: 4.5mm auto; max-width: 52mm; }

.a4-host { font-size: 12.5pt; }
.a4-request {
  margin-top: 3.5mm;
  font-style: italic;
}
.a4-name {
  margin: 1.5mm 0 4mm;
  color: var(--navy);
  font-size: 23pt;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.a4-event { line-height: 1.55; }
.a4-dress { margin-top: 2.5mm; }
.a4-rsvp { font-style: italic; }
.a4-rsvp a { font-style: normal; }

.a4-pass {
  display: inline-flex;
  align-items: center;
  gap: 5mm;
  margin-top: 5mm;
  text-align: left;
}
.a4-pass img {
  display: block;
  width: 30mm;
  height: 30mm;
  padding: 1.5mm;
  background: var(--paper);
  border: 0.3mm solid var(--gold-soft);
}
.a4-pass-text { line-height: 1.4; }
.a4-pass .ref { margin: 0.5mm 0 1.5mm; font-size: 10.5pt; }
.a4-pass .pass-note { font-size: 10pt; }

@media screen and (max-width: 849px) { .a4 { zoom: 0.8; margin: 4mm auto; } }
@media screen and (max-width: 679px) { .a4 { zoom: 0.6; } }
@media screen and (max-width: 519px) { .a4 { zoom: 0.44; } }

@media print {
  .a4-body { background: none; }
  .a4 { margin: 0; box-shadow: none; }
}

/* --------------------------------------------------------------------------
   Overview page (index.html) for reviewing the variants
   -------------------------------------------------------------------------- */
.variant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.variant-table th,
.variant-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--gold-soft);
  text-align: left;
  vertical-align: top;
}
.variant-table th { color: var(--gold-ink); font-size: 0.78rem; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; }
.variant-table ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.variant-table a { display: inline-flex; min-height: 2.75rem; align-items: center; }

/* --------------------------------------------------------------------------
   Wider screens
   -------------------------------------------------------------------------- */
@media (min-width: 30rem) {
  .particulars { grid-template-columns: 1fr 1fr; }
  .particulars .wide { grid-column: 1 / -1; }
  .choices--two { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 40rem) {
  .scene {
    padding: 2.5rem 11.8cqi 3rem;          /* the docx side margins: 1in of 8.5in */
  }
  .enquiries { padding-inline: 11.8cqi; }
  .actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (max-width: 49.99rem) {
  .sheet {
    margin: 0 auto;
    border-width: 0 0 1px;
    box-shadow: none;
  }
}

/* --------------------------------------------------------------------------
   Additions for the live system
   -------------------------------------------------------------------------- */
.select { appearance: auto; }
.notice--ok { border-color: #1d6b3a; }
.notice--warn { border-color: #8a5a00; }
.pass-download { display: block; margin-top: 4px; font-size: 0.95em; }
.passes .pass-download { margin-top: 6px; }
