/* Stylesheet of PUBLISHED pages and of the editor canvas. Independent from the dashboard (no Tailwind, no dashboard tokens),
   so a published page looks the same wherever it is served. All values arrive as CSS variables set on .fm-page. */

/* .fm-root is the CSS container: breakpoints use @container so the SAME rules work for a real phone (container = viewport)
   and for the editor's device preview (container = the 390px / 820px canvas). Nothing here may match outside .fm-root. */
.fm-root { container: fm / inline-size; }
.fm-root *, .fm-root *::before, .fm-root *::after { box-sizing: border-box; }

.fm-page {
  min-height: 100vh;
  background-color: var(--fm-bg, #fff);
  color: var(--fm-color, #1d1a16);
  font-family: var(--fm-font, system-ui, sans-serif);
  font-size: var(--fm-size, 18px);
  line-height: var(--fm-lh, 1.6);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
.fm-page a { color: var(--fm-accent, #c2410c); }
.fm-page img { max-width: 100%; }

.fm-section[hidden] { display: none !important; }
.fm-inner { width: 100%; max-width: var(--fm-width, 1000px); margin: 0 auto; }
.fm-cols { display: flex; flex-wrap: nowrap; }
.fm-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fm-el { min-width: 0; }

.fm-heading { margin: 0; line-height: 1.15; font-weight: 700; }
h1.fm-heading { font-size: 2.6em; }
h2.fm-heading { font-size: 2em; }
h3.fm-heading { font-size: 1.6em; }
h4.fm-heading { font-size: 1.3em; }
h5.fm-heading, h6.fm-heading { font-size: 1.1em; }
.fm-text > :first-child { margin-top: 0; }
.fm-text > :last-child { margin-bottom: 0; }
.fm-text img { height: auto; }

.fm-button-wrap { display: block; }
.fm-button { display: inline-block; text-decoration: none; font-weight: 700; border: 2px solid transparent; border-radius: 10px; line-height: 1.2; text-align: center; }
.fm-button-md { padding: 12px 22px; font-size: 1em; }
.fm-button-lg { padding: 16px 30px; font-size: 1.15em; }
.fm-button:hover { filter: brightness(0.94); }
.fm-button:focus-visible { outline: 3px solid var(--fm-accent, #c2410c); outline-offset: 3px; }

.fm-divider { border: 0; border-top-style: solid; margin: 8px auto; }
.fm-spacer { height: var(--fm-h, 32px); }
.fm-image-empty { aspect-ratio: 16 / 9; background: repeating-linear-gradient(45deg, #0000000d, #0000000d 10px, #00000014 10px, #00000014 20px); display: grid; place-items: center; font-size: 14px; color: #0009; min-height: 80px; }

.fm-nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.fm-nav-brand { font-weight: 700; font-size: 1.2em; }
.fm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; flex: 1; justify-content: var(--fm-nav-justify, flex-end); }
.fm-nav a { text-decoration: none; color: inherit; }
.fm-nav a:hover { text-decoration: underline; }

.fm-html-placeholder, .fm-unknown { border: 1px dashed #0006; padding: 12px; font: 13px/1.4 ui-monospace, monospace; color: #444; background: #0000000a; }

.fm-hide-d { display: none !important; }

@container fm (max-width: 767px) {
  .fm-page { font-size: var(--fm-size-m, 16px); line-height: var(--fm-lh-m, 1.5); }
  .fm-cols { flex-direction: column; }
  .fm-col { flex: 1 1 auto !important; width: 100%; }
  .fm-hide-d { display: revert !important; }
  .fm-hide-m { display: none !important; }
  h1.fm-heading { font-size: 2em; }
  h2.fm-heading { font-size: 1.7em; }
  .fm-spacer { height: var(--fm-hm, 24px); }
  .fm-section { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- opt-in form ---- */
.fm-optin { display: flex; flex-direction: column; gap: 12px; max-width: 34rem; margin: 0 auto; }
.fm-optin-fields { display: flex; flex-direction: column; gap: 12px; }
.fm-optin[hidden], .fm-optin-fields[hidden], .fm-optin-ok[hidden], .fm-optin-err[hidden] { display: none; }
.fm-input { width: 100%; box-sizing: border-box; padding: 14px 16px; font: inherit; color: inherit; background: #fff; border: 2px solid rgba(0, 0, 0, 0.18); border-radius: 10px; }
.fm-input:focus-visible { outline: 3px solid var(--fm-accent, #c2410c); outline-offset: 1px; border-color: transparent; }
.fm-optin-submit button { cursor: pointer; width: 100%; }
.fm-optin-consent { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 0.8em; line-height: 1.45; opacity: 0.85; }
.fm-optin-consent input { margin-top: 0.25em; flex: none; width: 1.1em; height: 1.1em; }
.fm-optin-ok { margin: 0; padding: 16px; border-radius: 10px; background: rgba(21, 128, 61, 0.12); color: #14532d; font-weight: 600; text-align: center; }
.fm-optin-err { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(185, 28, 28, 0.1); color: #7f1d1d; font-weight: 600; }
.fm-optin-note { margin: 0; padding: 10px 12px; font-size: 0.8em; border: 1px dashed currentColor; border-radius: 8px; opacity: 0.7; }
.fm-optin-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@container fm (min-width: 640px) {
  .fm-optin-inline .fm-optin-fields:not(.fm-optin-consent) { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .fm-optin-inline .fm-optin-fields:not(.fm-optin-consent) .fm-input { flex: 1 1 12rem; width: auto; }
  .fm-optin-inline .fm-optin-submit { flex: 0 0 auto; }
  .fm-optin-inline .fm-optin-submit button { width: auto; }
}

/* ---- cookie box (lives on <body>, outside .fm-root, so everything is self-contained) ---- */
.fm-cookie { position: fixed; z-index: 2147483000; left: 0; right: 0; bottom: 0; padding: 12px; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1d1a16; }
.fm-cookie-center { top: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); }
.fm-cookie-inner { max-width: 44rem; margin: 0 auto; max-height: calc(100dvh - 24px); overflow: auto; padding: 20px; background: #fff; border: 1px solid #d6cfc1; border-radius: 14px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25); }
.fm-cookie-title { margin: 0 0 6px; font-size: 1.15rem; }
.fm-cookie-text { margin: 0 0 14px; font-size: 0.92rem; }
.fm-cookie-text a { color: #9a3412; }
.fm-cookie-settings { margin: 0 0 14px; display: grid; gap: 10px; }
.fm-cookie-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.fm-cookie-row input { margin-top: 0.3em; width: 1.1em; height: 1.1em; flex: none; }
.fm-cookie-row-text { display: grid; }
.fm-cookie-row-text span { color: #57514a; }
.fm-cookie-list { font-size: 0.8rem; }
.fm-cookie-list table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.fm-cookie-list th, .fm-cookie-list td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #e6e0d4; vertical-align: top; }
.fm-cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-cookie-btn { flex: 1 1 8rem; padding: 11px 16px; font: inherit; font-weight: 700; color: #1d1a16; background: #fff; border: 2px solid #1d1a16; border-radius: 10px; cursor: pointer; }
.fm-cookie-btn-accept { background: #1d1a16; color: #fff; }
.fm-cookie-btn-quiet { border-color: transparent; text-decoration: underline; flex-grow: 0; }
.fm-cookie-btn:focus-visible, .fm-cookie-reopen:focus-visible { outline: 3px solid #c2410c; outline-offset: 2px; }
.fm-cookie-settings[hidden], .fm-cookie-btn[hidden] { display: none; }
.fm-cookie-reopen { position: fixed; z-index: 2147482000; left: 12px; bottom: 12px; padding: 6px 12px; font: 13px/1.3 system-ui, sans-serif; color: #1d1a16; background: #fff; border: 1px solid #d6cfc1; border-radius: 999px; cursor: pointer; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); }
@media (prefers-reduced-motion: no-preference) { .fm-cookie-inner { animation: fm-cookie-in 0.2s ease-out; } }
@keyframes fm-cookie-in { from { transform: translateY(12px); opacity: 0; } }

/* Members area */
.fm-m-notice { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.fm-m-notice-ok { background: rgba(21, 128, 61, 0.12); color: #14532d; }
.fm-m-notice-error { background: rgba(185, 28, 28, 0.1); color: #7f1d1d; }
.fm-m-login { display: grid; gap: 14px; }
.fm-m-title { margin: 0 0 8px; font-size: 1.5em; line-height: 1.25; }
.fm-m-form { display: grid; gap: 12px; margin: 0; }
.fm-m-form label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9em; }
.fm-m-btn { cursor: pointer; background: var(--fm-accent, #c2410c); color: #fff; padding: 12px 22px; font: inherit; font-weight: 700; }
.fm-m-btn-quiet { background: transparent; color: inherit; border-color: rgba(0, 0, 0, 0.25); padding: 8px 16px; font-size: 0.9em; }
.fm-m-forgot summary { cursor: pointer; font-size: 0.9em; }
.fm-m-forgot form { margin-top: 10px; }

.fm-m-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
.fm-m-bar-brand { font-weight: 800; font-size: 1.1em; text-decoration: none; color: inherit !important; }
.fm-m-bar-user { display: flex; align-items: center; gap: 12px; font-size: 0.9em; flex-wrap: wrap; }
.fm-m-bar-link { background: none; border: 0; padding: 0; font: inherit; color: var(--fm-accent, #c2410c); text-decoration: underline; cursor: pointer; }

.fm-m-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.fm-m-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 14px; overflow: hidden; color: #1d1a16; }
.fm-m-card-cover { aspect-ratio: 16 / 9; background: #e7e0d4 center / cover no-repeat; }
.fm-m-card-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.fm-m-card-meta { font-size: 0.85em; opacity: 0.75; }
.fm-m-card-locked { opacity: 0.6; }
.fm-m-card-link { color: inherit !important; text-decoration: none; font-weight: 700; }
.fm-m-card-link::after { content: ""; position: absolute; inset: 0; }
.fm-m-card-link:focus-visible { outline: 3px solid var(--fm-accent, #c2410c); outline-offset: -3px; }
.fm-m-progress { height: 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.1); overflow: hidden; }
.fm-m-progress > span { display: block; height: 100%; background: var(--fm-accent, #c2410c); }
.fm-m-empty { opacity: 0.7; font-style: italic; }
.fm-m-streaming .fm-m-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.fm-m-streaming .fm-m-card { background: #14110d; border-color: #2a241c; color: #f4efe6; }

.fm-m-course { display: grid; gap: 28px; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); align-items: start; }
.fm-m-side { display: grid; gap: 12px; position: sticky; top: 16px; }
.fm-m-back { font-size: 0.9em; }
.fm-m-side-title { margin: 0; font-size: 1.15em; }
.fm-m-module { display: grid; gap: 6px; }
.fm-m-module h3 { margin: 8px 0 2px; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }
.fm-m-module ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fm-m-lesson-row { border-radius: 8px; }
.fm-m-lesson-row.fm-m-current { background: rgba(0, 0, 0, 0.07); font-weight: 700; }
.fm-m-lesson-link { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; color: inherit !important; text-decoration: none; }
.fm-m-locked-row { opacity: 0.55; }
.fm-m-tick { flex: none; width: 1.2em; height: 1.2em; margin-top: 0.15em; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.3); display: grid; place-items: center; font-size: 0.75em; }
.fm-m-tick-on { background: #15803d; border-color: #15803d; color: #fff; }
.fm-m-lesson-meta { display: block; font-size: 0.8em; opacity: 0.7; font-weight: 400; }
.fm-m-main { min-width: 0; }
.fm-m-lesson { display: grid; gap: 16px; }
.fm-m-video, .fm-m-image { width: 100%; border-radius: 12px; background: #000; }
.fm-m-audio { width: 100%; }
.fm-m-locked { padding: 24px; border: 1px dashed rgba(0, 0, 0, 0.3); border-radius: 12px; text-align: center; }
.fm-m-done { margin: 0; }
.fm-m-news { display: grid; gap: 14px; }
.fm-m-news-item { padding: 14px 16px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 12px; background: #fff; color: #1d1a16; }
.fm-m-streaming.fm-m-course { color: #f4efe6; }
.fm-m-streaming.fm-m-course a { color: inherit; }

@media (max-width: 760px) {
  .fm-m-course { grid-template-columns: 1fr; }
  .fm-m-side { position: static; }
}

/* Video and audio */
.fm-video { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.fm-video-el { display: block; width: 100%; height: auto; background: #000; }
.fm-video-cta { align-self: center; background: var(--fm-accent, #c2410c); color: #fff !important; }
.fm-video-cta[hidden] { display: none; }
.fm-audio { margin: 0; display: grid; gap: 8px; }
.fm-audio-title { font-weight: 700; }
.fm-wopt-slots { display: flex; flex-direction: column; gap: 6px; }
.fm-wopt-slots[hidden] { display: none; }
.fm-wopt-label { font-weight: 600; font-size: 0.9em; }
.fm-wopt-room { color: inherit; text-decoration: underline; }
.fm-wopt-choice { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.fm-wopt-choice[hidden], .fm-wopt-when[hidden] { display: none; }
.fm-wopt-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fm-spam-note { margin: 0; font-size: 0.82em; line-height: 1.4; opacity: 0.8; }
.fm-spam-after { display: block; margin-top: 8px; }
.fm-spam-help { margin-top: 8px; font-size: 0.85em; text-align: left; }
.fm-spam-help summary { cursor: pointer; font-weight: 600; }
.fm-spam-help ol { font-weight: 400; margin: 6px 0 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.fm-spam-help p:empty { display: none; }
.fm-wopt-room[hidden] { display: none; }
.fm-form { display: flex; flex-direction: column; gap: 14px; }
.fm-fld { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.fm-fld-label { font-weight: 600; font-size: 0.95em; padding: 0; }
.fm-fld-opt { font-weight: 400; opacity: 0.6; font-size: 0.85em; }
.fm-fld-radio, .fm-fld-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.fm-fld-radio input, .fm-fld-check input { margin-top: 0.3em; width: 1.1em; height: 1.1em; flex: none; }
.fm-fld-consent { font-size: 0.85em; opacity: 0.85; line-height: 1.45; }
.fm-fld-err { margin: 0; color: #991b1b; font-weight: 600; font-size: 0.9em; }
.fm-fld-err[hidden] { display: none; }
.fm-form [aria-invalid="true"] { border-color: #b91c1c; }
.fm-form-submit { cursor: pointer; width: 100%; background: var(--fm-accent, #c2410c); border-color: var(--fm-accent, #c2410c); color: #fff; }
.fm-formbox { width: 100%; }

/* ---- blog list */
.fm-blog { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.fm-blog-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fm-blog-list { grid-template-columns: 1fr; }
.fm-blog-card { display: flex; flex-direction: column; border: 1px solid rgba(0, 0, 0, .12); border-radius: 12px; overflow: hidden; background: #fff; color: #1d1a16; }
.fm-blog-list .fm-blog-card { flex-direction: row; }
.fm-blog-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.fm-blog-list .fm-blog-cover { width: 240px; aspect-ratio: 4 / 3; flex-shrink: 0; }
.fm-blog-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.fm-blog-meta { margin: 0; font-size: .8em; opacity: .7; display: flex; gap: 10px; flex-wrap: wrap; }
.fm-blog-title { margin: 0; font-size: 1.15em; line-height: 1.3; }
.fm-blog-title a { color: inherit; text-decoration: none; }
.fm-blog-title a:hover { text-decoration: underline; }
.fm-blog-title a:focus-visible { outline: 3px solid var(--fm-accent, #c2410c); outline-offset: 3px; }
.fm-blog-excerpt { margin: 0; font-size: .92em; opacity: .85; }
.fm-blog-empty { opacity: .7; }
@media (max-width: 640px) { .fm-blog-list .fm-blog-card { flex-direction: column; } .fm-blog-list .fm-blog-cover { width: 100%; aspect-ratio: 16 / 9; } }
.fm-blog-crumbs { font-size: .85em; margin: 0 0 12px; }
.fm-blog-cats { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.fm-blog-cats a { display: inline-block; padding: 4px 12px; border: 1px solid rgba(0, 0, 0, .2); border-radius: 999px; text-decoration: none; font-size: .9em; }
.fm-blog-cats a[aria-current="page"] { background: var(--fm-accent, #c2410c); border-color: transparent; color: #fff; }

/* order form: what is being bought and for how much */
.fm-order{margin:0 0 16px;padding:14px 16px;border:1px solid var(--fm-border,#e2dccf);border-radius:10px;background:var(--fm-surface,#faf8f5)}
.fm-order-name{margin:0}
.fm-order-desc{margin:4px 0 0;font-size:.9em;opacity:.8}
.fm-order-price{margin:6px 0 0;font-size:1.25em;font-weight:700}
