/*
 * Manager Warsztatów theme on top of Bootstrap 5.
 *
 * Colours follow the Ecclesia association's site (navy from the logo, gold accent of icons).
 * Type is larger than Bootstrap's default: many participants are older people (PRD §3).
 */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-ext-400-normal.e1a2aef42b3c.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-400-normal.289ab8c3689e.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-ext-600-normal.55e10958c8c5.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-600-normal.a6d99d784ef0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-ext-700-normal.79486fdcff93.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../vendor/open-sans-5.3.0/open-sans-latin-700-normal.a957c7ebe6c1.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --mw-primary: #283878;
  --mw-primary-rgb: 40, 56, 120;
  --mw-primary-dark: #1c2757;
  --mw-primary-light: #e8ebf5;
  --mw-accent: #b8862b;
  --mw-accent-dark: #8a6420;
  --mw-footer-bg: #222222;

  --bs-primary: var(--mw-primary);
  --bs-primary-rgb: var(--mw-primary-rgb);
  --bs-link-color: var(--mw-primary);
  --bs-link-color-rgb: var(--mw-primary-rgb);
  --bs-link-hover-color: var(--mw-primary-dark);
  --bs-body-font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  --bs-body-font-size: 1.125rem;
  --bs-body-color: #2b2b2b;
  --bs-focus-ring-color: rgba(var(--mw-primary-rgb), 0.35);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* Skip link: invisible until focused with the keyboard. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  padding: 0.75rem 1rem;
  background: #fff;
  color: var(--mw-primary);
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* --- Header and footer --- */

.site-header {
  background: #fff;
  border-bottom: 4px solid var(--mw-accent);
}

.site-header .navbar-brand {
  color: var(--mw-primary);
  font-weight: 700;
  line-height: 1.2;
}

.site-header .site-logo {
  max-height: 48px;
  width: auto;
}

.site-header .navbar-brand small {
  display: block;
  color: #666;
  font-size: 0.8rem;
  font-weight: 400;
}

.site-header .nav-link {
  color: #333;
  font-weight: 600;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  color: var(--mw-primary);
}

.site-footer {
  background: var(--mw-footer-bg);
  color: #bbb;
  font-size: 0.95rem;
}

.site-footer a {
  color: #fff;
}

/* --- Buttons and forms --- */

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.6rem;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-font-size: 1.05rem;
}

.btn-primary {
  --bs-btn-bg: var(--mw-primary);
  --bs-btn-border-color: var(--mw-primary);
  --bs-btn-hover-bg: var(--mw-primary-dark);
  --bs-btn-hover-border-color: var(--mw-primary-dark);
  --bs-btn-active-bg: var(--mw-primary-dark);
  --bs-btn-active-border-color: var(--mw-primary-dark);
  --bs-btn-disabled-bg: var(--mw-primary);
  --bs-btn-disabled-border-color: var(--mw-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--mw-primary);
  --bs-btn-border-color: var(--mw-primary);
  --bs-btn-hover-bg: var(--mw-primary);
  --bs-btn-hover-border-color: var(--mw-primary);
  --bs-btn-active-bg: var(--mw-primary-dark);
  --bs-btn-active-border-color: var(--mw-primary-dark);
}

/* White on the lighter gold would fail WCAG AA contrast; the darker gold passes (≈5.5:1). */
.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--mw-accent-dark);
  --bs-btn-border-color: var(--mw-accent-dark);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #6f5019;
  --bs-btn-hover-border-color: #6f5019;
  --bs-btn-active-bg: #6f5019;
  --bs-btn-active-border-color: #6f5019;
}

.form-control,
.form-select {
  font-size: 1.125rem;
  padding: 0.65rem 0.85rem;
}

.form-label {
  font-weight: 600;
}

.form-check-input {
  width: 1.4em;
  height: 1.4em;
  margin-top: 0.15em;
}

.form-check-label {
  padding-left: 0.35rem;
}

/* Visible focus for keyboard users everywhere (WCAG 2.4.7). */
:focus-visible {
  outline: 3px solid var(--mw-accent);
  outline-offset: 2px;
}

/* --- Content --- */

.page-title {
  color: var(--mw-primary);
  font-weight: 700;
}

.empty-state {
  background: var(--mw-primary-light);
  border-radius: 0.75rem;
}

.empty-state .bi {
  color: var(--mw-primary);
  font-size: 3rem;
}

/* htmx: its own indicator styles are switched off (they would need an inline <style> under CSP). */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Sign-in and code pages: one narrow column. */
.auth-page > * {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.text-accent {
  color: var(--mw-accent-dark);
}

.workshop-card .card-title a {
  color: var(--mw-primary);
}

/* --- Panel --- */

.panel-nav .nav-link.active {
  background-color: var(--mw-primary);
}

.panel-nav .nav-link:not(.active) {
  color: var(--mw-primary);
}

.save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #dee2e6;
  z-index: 10;
}

/* --- Application form --- */

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.choice-list > div > div {
  margin-bottom: 0.5rem;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  cursor: pointer;
  background: #fff;
}

.choice-list label:hover {
  border-color: var(--mw-primary);
}

.choice-list input[type="radio"],
.choice-list input[type="checkbox"] {
  width: 1.4em;
  height: 1.4em;
  margin-top: 0.1em;
  flex-shrink: 0;
  accent-color: var(--mw-primary);
}

.question + .question {
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.summary dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

.summary dd {
  margin-left: 0;
}

.choice-list label:has(input:checked) {
  border: 2px solid var(--mw-primary);
  background: var(--mw-primary-light);
  font-weight: 600;
}

/* --- Settings and e-mail --- */

.settings-logo-preview {
  max-height: 64px;
  width: auto;
}

.email-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #f4f4f7;
}

.email-text {
  white-space: pre-wrap;
  font-size: 0.95rem;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 0.5rem;
}

.placeholder-list dt {
  font-weight: 400;
}

.placeholder-list dd {
  margin-bottom: 0.4rem;
  color: #555;
}

/* --- Error pages --- */

.error-code {
  color: var(--mw-accent-dark);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* --- Help --- */

.help-link {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--mw-primary);
  text-decoration: none;
  font-size: 1.1em;
  line-height: 1;
  vertical-align: middle;
}

.help-toc .nav-link {
  color: var(--mw-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
}

.help-toc .nav-link.active {
  background: var(--mw-primary);
  color: #fff;
}

.help-content h2 {
  color: var(--mw-primary);
  font-size: 1.4rem;
  margin-top: 2.25rem;
  scroll-margin-top: 1rem;
}

.help-content h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.help-content .tip {
  background: var(--mw-primary-light);
  border-left: 4px solid var(--mw-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
}

.help-content .warning {
  background: #fff4e0;
  border-left: 4px solid var(--mw-accent-dark);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
}

.help-shot {
  margin: 1.25rem 0;
}

.help-shot img {
  max-width: 100%;
  height: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.help-shot figcaption {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0.4rem;
}

.help-content kbd,
.help-content .ui {
  font-weight: 600;
}

.help-content .ui {
  color: var(--mw-primary-dark);
}

.page-title .help-link {
  font-size: 0.6em;
}
