/* altered.css — the altered.re look for Listmonk's public pages.
 *
 * Loaded by static/public/templates/index.html INSTEAD of Listmonk's own
 * style.css, so it styles both our chrome (.al-* classes: top bar, nav band,
 * landing page, footer) and the upstream classes used by the pages we do not
 * override (.form, .button, .lists, .archive, .pagination, .login, ...).
 *
 * Tokens come from altered.re's "Azure" theme (light) and its dark variant.
 * Tiller is the site's typeface, served from fonts/ next to this file.
 */

@font-face { font-family: "Tiller"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Tiller-Regular.otf") format("opentype"); }
@font-face { font-family: "Tiller"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/Tiller-Bold.otf") format("opentype"); }

:root {
  --bg: #F0F6FF; --surface: #FAFCFF; --surface-2: #FFFFFF;
  --border: #D6E8F8; --border-strong: #B8D0EE;
  --text: #0C1A32; --body: #1A2E4A; --muted: #4468A0;
  --primary: #1A6FD9; --primary-hover: #3B8EF0; --primary-soft: #72B4F6; --primary-tint: #E2EEFB;
  --on-primary: #FFFFFF; --topbar: #FFFFFF; --nav: #1A6FD9; --nav-text: #FFFFFF; --nav-active: rgba(255, 255, 255, .16);
  --danger: #C8102E;
  --shadow: 0 2px 12px rgba(26, 111, 217, .08); --hero-overlay: rgba(6, 16, 30, .38);
  --font: "Tiller", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1a2e; --surface: #14253f; --surface-2: #0f1f36;
    --border: #1e3254; --border-strong: #2d4870;
    --text: #deeaf8; --body: #b0c8e8; --muted: #7aa0cc;
    --primary: #3B8EF0; --primary-hover: #72B4F6; --primary-soft: #72B4F6; --primary-tint: #1a3358;
    --topbar: #06101e; --nav: #123a6b; --nav-active: rgba(255, 255, 255, .1);
    --danger: #ff6b81;
    --shadow: 0 2px 14px rgba(0, 0, 0, .35); --hero-overlay: rgba(6, 16, 30, .52);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1a2e; --surface: #14253f; --surface-2: #0f1f36;
  --border: #1e3254; --border-strong: #2d4870;
  --text: #deeaf8; --body: #b0c8e8; --muted: #7aa0cc;
  --primary: #3B8EF0; --primary-hover: #72B4F6; --primary-soft: #72B4F6; --primary-tint: #1a3358;
  --topbar: #06101e; --nav: #123a6b; --nav-active: rgba(255, 255, 255, .1);
  --danger: #ff6b81;
  --shadow: 0 2px 14px rgba(0, 0, 0, .35); --hero-overlay: rgba(6, 16, 30, .52);
}

/* ---- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { padding: 0; margin: 0; min-width: 320px; }
body { background: var(--bg); color: var(--body); font-family: var(--font); font-size: 17px; line-height: 1.55; overflow-x: clip; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--primary); text-decoration-color: var(--primary-soft); }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { color: var(--text); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
.al-i { width: 1em; height: 1em; flex: none; fill: currentColor; vertical-align: -.15em; }
.al-sr-only, .al-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.al-skip { position: absolute; left: -9999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.al-skip:focus { left: 16px; }
.al-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; }

/* ---- Buttons (ours and upstream's .button) ------------------------------- */
.al-btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; height: 42px; border-radius: 8px; font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.al-btn-primary, .button { background: var(--primary); color: var(--on-primary); }
.al-btn-primary:hover, .button:hover { background: var(--primary-hover); color: var(--on-primary); }
.al-btn-outline, .button.button-outline { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.al-btn-outline:hover, .button.button-outline:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.al-btn-lg { height: 48px; padding-inline: 24px; font-size: 1.05rem; }
.al-btn[disabled], .button[disabled] { opacity: .55; cursor: not-allowed; }
.button img { height: 1.2em; width: auto; }

/* ---- Top bar ------------------------------------------------------------- */
.al-topbar { background: var(--topbar); border-bottom: 1px solid var(--border); }
.al-topbar .al-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; min-width: 0; }
.al-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; min-width: 0; white-space: nowrap; }
.al-brand:hover { color: var(--primary); }
.al-brand img { width: 38px; height: 38px; border-radius: 50%; display: block; object-fit: cover; }
.al-topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.al-icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.05rem; }
.al-icon-btn:hover { border-color: var(--border-strong); }
.al-theme .al-i-sun { display: none; }
:root[data-theme="dark"] .al-theme .al-i-sun { display: block; }
:root[data-theme="dark"] .al-theme .al-i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .al-theme .al-i-sun { display: block; }
  :root:not([data-theme="light"]) .al-theme .al-i-moon { display: none; }
}
.al-back { height: 40px; }

/* Language picker: the current flag opens a list of flags (same as altered.re). */
.al-flag { width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); flex: none; display: block; }
.al-lang { position: relative; }
.al-lang-btn .al-flag { display: none; }
html[lang="en"] .al-lang-btn .al-flag[data-flag="en"], html:not([lang="fr"]) .al-lang-btn .al-flag[data-flag="en"] { display: block; }
html[lang="fr"] .al-lang-btn .al-flag[data-flag="fr"] { display: block; }
html[lang="fr"] .al-lang-btn .al-flag[data-flag="en"] { display: none; }
.al-lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 6px; z-index: 20; display: grid; gap: 2px; }
.al-lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); font-weight: 700; font-size: .95rem; }
.al-lang-menu a:hover { background: var(--primary-tint); color: var(--text); }
.al-lang-menu a.active { background: var(--primary); color: var(--on-primary); }

/* ---- Nav band ------------------------------------------------------------ */
.al-nav { background: var(--nav); }
.al-nav .al-wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.al-nav .al-wrap::-webkit-scrollbar { display: none; }
.al-nav a { color: var(--nav-text); text-transform: uppercase; font-weight: 700; letter-spacing: .05em; font-size: .86rem; padding: 15px 18px; text-decoration: none; display: flex; gap: 9px; align-items: center; white-space: nowrap; opacity: .92; }
.al-nav a:hover { opacity: 1; color: var(--nav-text); background: var(--nav-active); }
.al-nav a.active { opacity: 1; background: var(--nav-active); box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .75); }
.al-nav .al-nav-ext { margin-left: auto; }

/* ---- Main: full-width sections on the landing page, one card elsewhere --- */
.al-main { display: grid; gap: 30px; padding-block: 24px 8px; align-content: start; flex: 1 0 auto; }
.al-main:not(:has(> .al-full)) { max-width: 700px; margin: 32px auto 8px; padding: 32px; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.al-main > section, .al-main > form { min-width: 0; }
.al-main > section + section, .al-main > form + section, .al-main > section + form { margin-top: 20px; }

/* Section titles with the site's blue bar */
.al-bar-title { display: flex; align-items: center; gap: 14px; font-size: 1.55rem; margin: 0; }
.al-bar-title::before { content: ""; width: 4px; height: 1.35em; border-radius: 2px; background: var(--primary); flex: none; }
.al-bar-title .al-i { color: var(--primary); font-size: 1.15em; }

/* ---- Landing page: hero ------------------------------------------------- */
.al-hero { position: relative; isolation: isolate; border-radius: 14px; overflow: hidden; min-height: 320px; background: #0c1a2e url("hero.jpg") center 35% / cover no-repeat; display: grid; place-items: center; text-align: center; color: #fff; padding: 60px 24px; }
.al-hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); z-index: -1; }
.al-hero-inner { display: grid; gap: 18px; justify-items: center; max-width: 720px; }
.al-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.3rem); text-shadow: 0 2px 14px rgba(0, 0, 0, .45); margin: 0; }
.al-hero p { color: rgba(255, 255, 255, .92); font-size: 1.15rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); max-width: 56ch; margin: 0; }
.al-hero .al-btn { box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }

/* ---- Landing page: subscribe card --------------------------------------- */
.al-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.al-subscribe { padding: 30px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; }
.al-subscribe-copy { display: grid; gap: 12px; }
.al-subscribe-copy p { max-width: 48ch; margin: 0; }
.al-form { display: grid; gap: 10px; }
.al-field { display: flex; gap: 10px; flex-wrap: wrap; }
.al-field input[type="email"] { flex: 1 1 220px; height: 46px; }
.al-field .al-btn { height: 46px; }
.al-hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .86rem; line-height: 1.45; margin: 0; }
.al-hint .al-i { margin-top: .25em; }
.al-form-error { color: var(--danger); font-size: .95rem; margin: 0; }
.al-captcha { margin-top: 4px; }
altcha-widget { --altcha-border-width: 1px; --altcha-border-radius: 8px; --altcha-color-base: var(--surface-2); --altcha-color-border: var(--border-strong); --altcha-color-border-focus: var(--primary); --altcha-color-text: var(--text); --altcha-color-footer-bg: var(--primary-tint); --altcha-max-width: 100%; display: block; }

/* ---- Landing page: latest newsletters ----------------------------------- */
.al-latest { display: grid; gap: 16px; }
.al-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.al-section-head a { font-weight: 700; text-decoration: none; font-size: .95rem; display: inline-flex; gap: .35em; align-items: baseline; }
.al-powered { display: inline-flex; gap: .3em; }
.al-latest-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.al-latest-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 17px 22px; border-top: 1px solid var(--border); }
.al-latest-list li:first-child { border-top: 0; }
.al-latest-list li.al-latest-empty { display: block; color: var(--muted); }
.al-date, .archive .date { font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--on-primary); background: var(--primary); padding: 5px 11px; border-radius: 6px; white-space: nowrap; }
.al-subject { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.al-subject:hover { color: var(--primary); }
.al-read { color: var(--muted); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.al-read:hover { color: var(--primary); }
p.al-latest-empty { color: var(--muted); }

/* ---- Footer -------------------------------------------------------------- */
.al-footer { border-top: 1px solid var(--border); margin-top: 36px; padding-block: 26px 30px; color: var(--muted); font-size: .9rem; }
.al-footer .al-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: center; }
.al-footer p { margin: 0; }
.al-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.al-footer a { color: var(--muted); text-decoration: none; }
.al-footer a:hover { color: var(--primary); text-decoration: underline; }
.al-footer .al-admin { opacity: .75; }

/* ---- Upstream classes (pages we do not override) -------------------------- */
label { cursor: pointer; color: var(--body); }
.form label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.form p { margin: 0 0 16px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem; }
input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-tint); }
input::placeholder { color: var(--muted); opacity: .85; }
input:focus::placeholder { color: transparent; }
input[disabled] { opacity: .5; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 1.05em; height: 1.05em; margin: 0 .5em 0 0; vertical-align: -.1em; }
.center { text-align: center; }
.right { text-align: right; }
.small { font-size: .875em; }
.error { color: var(--danger); }
.section { margin-bottom: 24px; }
.row { margin-bottom: 16px; }
.description { color: var(--muted); font-size: .9rem; margin: 2px 0 0 1.6em; }
.nonce { display: none; }
.lists { list-style: none; padding: 0; margin: 12px 0 20px; }
.lists h2 { font-size: 1.1rem; margin: 0 0 8px; }
.lists li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; padding: 8px 0; }
.lists li label { display: inline; font-weight: 700; margin: 0; }
.lists li .description { flex-basis: 100%; }
.unsub-all { margin-top: 16px; }
.optin-form ul { padding-left: 1.2em; }
.submit { margin-top: 8px; }
.login h2 { margin-bottom: 16px; }
.captcha { margin: 8px 0 16px; }
.archive { list-style: none; padding: 0; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.archive li { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); }
.archive li:first-child { border-top: 0; }
.archive li a { font-weight: 700; color: var(--text); text-decoration: none; }
.archive li a:hover { color: var(--primary); }
.feed { vertical-align: middle; margin-right: 8px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; }
.pagination .current, .pagination a:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 800px) {
  .al-subscribe { grid-template-columns: 1fr; padding: 22px; }
  .al-latest-list li { grid-template-columns: 1fr; gap: 8px; padding: 15px 18px; }
  .al-date, .al-read { justify-self: start; }
  .al-hero { min-height: 260px; padding: 44px 18px; }
  .al-main:not(:has(> .al-full)) { padding: 22px; margin-top: 20px; }
}
@media (max-width: 640px) {
  .al-back .al-back-label { display: none; }
  .al-back { width: 40px; padding: 0; }
  .al-brand { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
