/* Visuell stil hämtad från frimurarorden.se: Cormorant Garamond, gråton, röd accent */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,700&display=swap");

:root {
  --bg: #fbfcfc;
  --panel: #f2f3f4;
  --text: #59595b;
  --ink: #141414;
  --red: #de2029;
  --red-dark: #bc1b22;
  --line: #d6d6d6;
  --ok: #3f7a52;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
a { color: var(--red); }
html, body { margin: 0; }
body {
  /* Långa ord (t.ex. ett namn utan mellanslag) bryts i stället för att spräcka layouten */
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
}

/* Header */
.site-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 78px;
  background: var(--panel);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.brand-mark { width: auto; height: 56px; }
.site-nav { display: flex; align-items: center; gap: 22px; padding: 0 28px; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--red); }

/* Hero */
.hero { text-align: center; padding: 72px 16px 40px; }
.eyebrow { font-style: italic; font-weight: 700; color: var(--red); font-size: 20px; margin: 0 0 8px; }
.hero h1 {
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(40px, 8vw, 84px);
  line-height: 1.02;
}
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px;
  margin-top: 24px; font-style: italic; font-size: 20px;
}

/* Layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 80px; }
.split { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 48px; align-items: start; }
.split > .divider { background: var(--line); align-self: stretch; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split > .divider { display: none; }
  .site-nav a:not(.keep) { display: none; }
}

h2 { font-weight: 700; font-size: 36px; margin: 0 0 12px; text-align: center; color: var(--text); }
.prose { font-style: italic; text-align: center; }
.prose p { margin: 0 0 12px; }
.details { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.details li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details strong { font-weight: 700; color: var(--ink); }

/* Program */
.program { max-width: 640px; margin: 72px auto 0; padding-top: 48px; border-top: 1px solid var(--line); }
.program h3 { font-size: 22px; margin: 32px 0 8px; color: var(--red); font-style: italic; }
.schedule { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.schedule li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.schedule time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.contact { text-align: center; }
.privacy p { margin: 0 0 12px; }
.program.page { margin-top: 32px; padding-top: 0; border-top: 0; }
.steps { padding-left: 22px; margin: 8px 0 16px; }
.steps li { margin-bottom: 10px; }
.links { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--line); }
.links li { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 480px) { .links li { grid-template-columns: 1fr; gap: 0; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { display: grid; gap: 6px; padding: 20px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.card strong { color: var(--red); font-size: 20px; }
.card:hover { border-color: var(--red); }
.welcome .prose { margin-top: 16px; }
.lead { font-size: 20px; font-style: italic; }
.map-static { margin: 16px 0; }
.map-static img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.map-static figcaption { font: 12px var(--sans); color: #888; text-align: right; margin-top: 4px; }
.map-static figcaption a { color: inherit; }
.map-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 24px; }
@media (max-width: 480px) { .schedule li { grid-template-columns: 1fr; gap: 0; } }

.seats { text-align: center; margin-top: 24px; font-style: italic; }
.seats-bar { height: 4px; background: var(--line); margin: 8px auto 0; max-width: 260px; }
.seats-bar span { display: block; height: 100%; background: var(--red); }

/* Form */
form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 700; font-style: italic; margin-bottom: 4px; color: var(--ink); }
.field .hint { font-size: 15px; font-style: italic; }
input, select, textarea {
  width: 100%;
  font: 16px/1.4 var(--sans);
  color: var(--ink);
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: transparent; }

/* Egen rullgardinslista (web/dropdown.js). Den riktiga <select> ligger dold och håller värdet. */
.dd { position: relative; }
.dd-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.dd-button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  font: 500 19px/1.4 var(--serif); color: var(--ink); text-align: left;
  padding: 9px 14px; background: #fff; border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s;
}
.dd-button::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--red); border-bottom: 2px solid var(--red);
  transform: translateY(-25%) rotate(45deg); transition: transform .2s;
}
.dd.open .dd-button::after { transform: translateY(25%) rotate(225deg); }
.dd-button:hover { border-color: var(--red); }
.dd-button:focus-visible, .dd.open .dd-button { outline: 2px solid var(--red); outline-offset: -1px; border-color: transparent; }
.dd-button:disabled { background: var(--panel); color: var(--text); cursor: not-allowed; }
.dd-face { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 100%;
  max-height: 320px; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.dd-list:focus { outline: none; }
.dd-list [role="option"] { padding: 9px 16px; font: 500 19px/1.3 var(--serif); color: var(--ink); cursor: pointer; white-space: nowrap; }
.dd-list [role="option"].active { background: #f6eded; color: var(--red-dark); }
.dd-list [role="option"][aria-selected="true"] { color: var(--red); font-weight: 700; }
.dd-list .dd-sep { height: 1px; margin: 6px 0; background: var(--line); font-size: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; font-style: italic; }
.check input { width: auto; margin-top: 4px; accent-color: var(--red); }
.error { color: var(--red-dark); font-size: 15px; font-style: italic; min-height: 1em; }

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: 0;
  padding: 8px 22px;
  font: italic 700 20px var(--serif);
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { background: var(--line); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.total strong { font-size: 26px; color: var(--ink); }

/* Steg/bekräftelse */
.panel { background: #fff; border: 1px solid var(--line); padding: 32px; text-align: center; max-width: 560px; margin: 0 auto; }
.panel h2 { margin-bottom: 8px; }
.ticket-code { font: 600 22px var(--sans); letter-spacing: .15em; color: var(--ink); margin: 16px 0; }
.details.pay { text-align: left; margin: 20px 0; }
.details.pay li { gap: 16px; align-items: baseline; }
.details.pay strong { text-align: right; }
.details.pay .ticket-code { margin: 0; font-size: 18px; }
@media (max-width: 520px) { .details.pay li { flex-direction: column; gap: 0; } .details.pay strong { text-align: left; } }
.mock-note {
  font: 13px var(--sans); background: #fff8d6; border: 1px solid #e8d77a; color: #5b4d00;
  padding: 8px 12px; margin: 0 auto 24px; max-width: 560px; text-align: center;
}
[hidden] { display: none !important; }

/* Footer */
.site-footer {
  background: var(--panel);
  padding: 32px 16px;
  text-align: center;
  font-style: italic;
}
.site-footer a { color: var(--text); margin: 0 12px; }
/* Tillägg för produktionsversionen (inga inline-stilar p.g.a. CSP) */
.center { text-align: center; }
.small { font-size: 16px; }
.hero.compact { padding: 48px 16px 24px; }
.hero.compact h1 { font-size: clamp(34px, 6vw, 56px); }
.panel .total { margin: 20px 0; }
.panel .btn + .btn { margin-left: 8px; }
.notice { font-style: italic; text-align: center; color: var(--ink); background: var(--panel); padding: 10px 14px; margin: 0 auto 24px; max-width: 560px; }
.muted { color: #888; }
#turnstile:empty { display: none; }

/* Språkväxlare */
.site-nav a.lang { font-size: 16px; font-style: normal; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); padding: 2px 10px; }
.site-nav a.lang:hover { border-color: var(--red); }

/* Startsidan */
.hero.landing { padding: 96px 16px 72px; background: linear-gradient(180deg, var(--bg) 0%, var(--panel) 100%); border-bottom: 1px solid var(--line); }
.hero .tagline { max-width: 620px; margin: 20px auto 0; font-size: 23px; font-style: italic; color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.btn.big { padding: 12px 32px; font-size: 22px; }
.cta-note { margin: 16px 0 0; font-size: 16px; font-style: italic; }
.cta-note strong { color: var(--ink); }
.pill { display: inline-block; margin-top: 14px; padding: 3px 14px; border: 1px solid var(--red); color: var(--red); font-style: italic; font-weight: 700; font-size: 17px; }

.section { max-width: 1040px; margin: 0 auto; padding: 72px 0 0; }
.section > h2 { margin-bottom: 8px; }
.section > .sub { text-align: center; font-style: italic; max-width: 600px; margin: 0 auto 32px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature { background: #fff; padding: 28px 24px; }
.feature .num { display: block; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.feature h3 { margin: 0 0 8px; font-size: 24px; color: var(--ink); font-weight: 700; }
.feature p { margin: 0; }

.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.day { border-top: 3px solid var(--red); padding-top: 14px; }
.day h3 { margin: 0; font-size: 24px; color: var(--ink); }
.day .when { display: block; font-style: italic; color: var(--red); font-weight: 700; margin-bottom: 8px; }
.day ul { margin: 0; padding-left: 18px; }
.day li { margin-bottom: 4px; }
.more { text-align: center; margin-top: 24px; font-style: italic; font-weight: 700; }

.quote { max-width: 720px; margin: 0 auto; text-align: center; font-size: 26px; line-height: 1.4; font-style: italic; color: var(--ink); }
.quote::before { content: "”"; display: block; font-size: 72px; line-height: .6; color: var(--red); }

.cta-band { margin: 80px 0 0; padding: 56px 16px; text-align: center; background: var(--ink); color: #e9e9e9; }
.cta-band h2 { color: #fff; }
.cta-band p { font-style: italic; font-size: 20px; margin: 0 0 24px; }
.cta-band .pill { border-color: #fff; color: #fff; margin: 0 0 20px; }
.cta-band .btn.ghost { color: #fff; border-color: #777; }
.quote + .prose { margin-top: 24px; }
.spaced { margin-top: 32px; }
.section > .prose { max-width: 680px; margin-left: auto; margin-right: auto; font-size: 20px; }
@media (max-width: 560px) {
  .brand { font-size: 0; gap: 0; padding: 0 12px; }
  .site-nav { gap: 14px; padding: 0 12px; }
  .site-nav a { font-size: 18px; }
  .site-nav a.lang { font-size: 13px; padding: 2px 8px; }
  .hero.landing { padding: 56px 16px 48px; }
  .quote { font-size: 22px; }
}

/* Programpunkter med rubrik, beskrivning och separat damspår */
.schedule .item { display: block; font-weight: 700; color: var(--ink); }
.schedule .desc { display: block; font-style: italic; font-size: 16px; }
.schedule .track { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.schedule .track b { color: var(--red); font-style: italic; }
.offer { max-width: 520px; margin: 24px auto 0; padding: 14px 18px; text-align: center; font-style: italic; border: 1px solid var(--red); background: #fff; color: var(--ink); }
.offer strong { color: var(--red); font-style: normal; font-size: 22px; display: block; }

/* GDPR-information vid formuläret */
.gdpr { background: var(--panel); border-left: 3px solid var(--red); padding: 14px 18px; font-size: 16px; }
.gdpr h3 { margin: 0 0 8px; font-size: 19px; color: var(--ink); font-style: italic; }
.gdpr ul { margin: 0; padding-left: 18px; }
.gdpr li { margin-bottom: 6px; }
.gdpr strong { color: var(--ink); }

/* Betalningsinformation: anmälningssidan före och efter anmälan */
.paybox { text-align: left; background: #eef3f9; border: 1px solid #cdd9e8; border-top: 4px solid var(--red); padding: 20px 24px; margin: 24px 0; }
.paybox h3 { margin: 0 0 12px; font-size: 24px; color: var(--ink); }
.paybox dl { margin: 0; }
.paybox dl > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid #d6e0ec; }
.paybox dl > div:last-child { border-bottom: 0; }
.paybox dt { color: var(--text); }
.paybox dd { margin: 0; color: var(--ink); }
.paybox dd strong { font-weight: 700; }
.paybox .mono { font: 600 19px var(--sans); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.paybox #done-ref { font-size: 22px; letter-spacing: .12em; }
.paybox .copy { font: 500 13px var(--sans); color: var(--red); background: #fff; border: 1px solid #cdd9e8; border-radius: 4px; padding: 2px 8px; margin-left: 8px; cursor: pointer; vertical-align: middle; }
.paybox .copy:hover { border-color: var(--red); }
.paybox-note { margin: 12px 0 0; font-style: italic; }
.paybox.compact { padding: 16px 20px; }
.paybox.compact h3 { font-size: 21px; }
.paybox.compact .mono { font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.paybox.compact dl > div { grid-template-columns: 7em 1fr; padding: 6px 0; }
@media (max-width: 520px) {
  .paybox { padding: 16px; }
  .paybox dl > div, .paybox.compact dl > div { grid-template-columns: 1fr; gap: 0; }
}

/* Grad: klickbara rutor I–XI på en rad i stället för en lista */
fieldset.degrees { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.degrees legend { padding: 0; font-weight: 700; font-style: italic; margin-bottom: 4px; color: var(--ink); }
.degree-picker { display: grid; grid-template-columns: repeat(11, 1fr); border: 1px solid var(--line); background: #fff; }
.degree-picker label { position: relative; margin: 0; cursor: pointer; }
.degree-picker label + label { border-left: 1px solid var(--line); }
.degree-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; pointer-events: none; }
.degree-picker span { display: flex; align-items: center; justify-content: center; height: 48px; font: 600 18px var(--serif); font-style: normal; color: var(--ink); transition: background .15s, color .15s; }
.degree-picker label:hover span { background: #f6eded; color: var(--red-dark); }
.degree-picker input:checked + span { background: var(--red); color: #fff; }
.degree-picker input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -4px; }
.degree-picker input:checked:focus-visible + span { outline-color: #fff; }
@media (max-width: 520px) {
  .degree-picker { grid-template-columns: repeat(6, 1fr); }
  .degree-picker label + label { border-left: 0; }
  .degree-picker label { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .degree-picker label:nth-child(6n) { border-right: 0; }
  .degree-picker label:nth-child(n+7) { border-bottom: 0; }
}

/* Vad som saknas innan anmälan kan skickas */
.missing { margin: 0; padding: 10px 14px; background: #f6eded; border-left: 3px solid var(--red); color: var(--ink); font-size: 16px; font-style: italic; }

/* Diskret ingång till personalvyn. Skyddet är inloggningen (Cognito med MFA), inte att länken är gömd. */
.site-footer .staff-link { display: block; width: max-content; margin: 18px auto 0; font: 13px var(--sans); color: #a3a3a5; text-decoration: none; letter-spacing: .04em; }
.site-footer .staff-link:hover { color: var(--text); text-decoration: underline; }

/* Telefon: landsväljare (flagga + landsnummer) framför numret */
.phone-input { display: flex; }
.phone-input .dd-phone { flex: none; }
.dd-phone .dd-button { height: 100%; font: 16px var(--sans); border-right: 0; padding-right: 12px; }
.dd-phone .dd-list { min-width: 300px; }
.dd-phone .dd-list [role="option"] { font: 15px/1.3 var(--sans); }
.phone-input input { flex: 1; min-width: 0; }

/* Erbjudande: ordinarie pris överstruket */
.price-was { color: #888; font-weight: 500; font-size: .85em; margin-left: 6px; }
.price-offer { display: block; color: var(--red); font-style: italic; font-weight: 600; font-size: 15px; }
.cta-note .price-offer { display: inline; font-size: inherit; }

/* Min anmälan (manage.html) */
.manage .panel { margin-bottom: 24px; }
.manage-summary .details { margin-top: 12px; }
.badge-status { font: 600 13px var(--sans); padding: 2px 10px; border: 1px solid currentColor; }
.badge-status.reserved { color: #8a6d00; }
.badge-status.paid { color: var(--ok); }
.badge-status.cancelled { color: #888; }
.paid-note { margin: 16px 0 0; color: var(--ok); font-style: italic; text-align: center; }
.readonly { margin: 0; padding: 10px 0; font: 16px var(--sans); color: var(--ink); }
.label-text { display: block; font-weight: 700; font-style: italic; margin-bottom: 4px; color: var(--ink); }
.saved { color: var(--ok); font-style: italic; min-height: 1em; margin: 0; }
.link-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.link-form .field { flex: 1 1 260px; margin: 0; }
input:disabled, textarea:disabled { background: var(--panel); color: var(--text); cursor: not-allowed; }
.degree-picker:has(input:disabled) { opacity: .6; pointer-events: none; }
.manage .panel, .manage .paybox { max-width: 640px; margin: 0 auto 24px; }
.manage #m-form-section, .manage #m-form-section .prose { text-align: left; }
.manage #m-form-section h2, .manage #m-form-section .center { text-align: center; }
