/*
Theme Name: Rise of Muslims
Description: Child theme of Twenty Twenty-Five. Colors and fonts are edited in the Site Editor (Appearance > Editor > Styles); this file only reads them.
Template: twentytwentyfive
Version: 1.3.1
Text Domain: rise-of-muslims
*/

/* =====================================================================
   HOW TO CHANGE THINGS (no code needed)
   - Colors and fonts are edited in the WordPress Site Editor:
       Appearance > Editor > Styles > Colors > Palette   (light AND dark colors, named "Light - ..." / "Dark - ...")
       Appearance > Editor > Styles > Typography > Fonts (body and heading fonts; add more from the Font Library)
   - The --rm-* names below only read those settings, so this file never needs editing for colors or fonts.
   - Header, footer, pages and templates are edited with the Site Editor too.
   ===================================================================== */

/* ---------- 1. Design tokens: they follow the Styles panel (light is default) ---------- */
html {
  --rm-bg: var(--wp--preset--color--base, #f6efe2);
  --rm-bar: var(--wp--preset--color--rm-bar, #faf4e8);
  --rm-text: var(--wp--preset--color--contrast, #2a1f18);
  --rm-muted: var(--wp--preset--color--accent-4, #54473c);
  --rm-accent: var(--wp--preset--color--accent-1, #8f3f20);
  --rm-line: var(--wp--preset--color--accent-6, rgba(42, 31, 24, 0.10));
  --rm-field: var(--wp--preset--color--rm-field, rgba(70, 58, 46, 0.10));
  --rm-btn: var(--wp--preset--color--accent-2, #2a1f18);
  --rm-btn-text: var(--wp--preset--color--rm-button-text, #faf4e8);
  --rm-glow: var(--wp--preset--color--rm-glow, rgba(222, 180, 135, 0.38));
  --rm-glow2: var(--wp--preset--color--rm-glow-2, rgba(150, 165, 145, 0.30));
  --rm-sec-a: var(--wp--preset--color--rm-section-a, #f0e6d3);
  --rm-sec-b: var(--wp--preset--color--rm-section-b, #f7efe1);
  --rm-card: var(--wp--preset--color--rm-card, #fffaf1);
  --rm-serif: var(--wp--preset--font-family--eb-garamond, Georgia, serif);
  --rm-sans: var(--wp--preset--font-family--inter, system-ui, sans-serif);
  color-scheme: light;
  scroll-padding-top: 100px;
}
/* Dark: automatically for dark-mode devices (no flash), unless the visitor chose light */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --rm-bg: var(--wp--preset--color--dark-base, #0c100e); --rm-bar: var(--wp--preset--color--dark-bar, #121815);
    --rm-text: var(--wp--preset--color--dark-text, #f1ece3); --rm-muted: var(--wp--preset--color--dark-muted, #bdb8ac);
    --rm-accent: var(--wp--preset--color--dark-accent, #c9a85c); --rm-line: var(--wp--preset--color--dark-line, rgba(255, 255, 255, 0.09));
    --rm-field: var(--wp--preset--color--dark-field, #1a211e); --rm-btn: var(--wp--preset--color--dark-button, #f1ece3);
    --rm-btn-text: var(--wp--preset--color--dark-button-text, #14120f);
    --rm-glow: var(--wp--preset--color--dark-glow, rgba(158, 112, 48, 0.32)); --rm-glow2: var(--wp--preset--color--dark-glow-2, rgba(60, 100, 75, 0.20));
    --rm-sec-a: var(--wp--preset--color--dark-section-a, #0c100e); --rm-sec-b: var(--wp--preset--color--dark-section-b, #101512);
    --rm-card: var(--wp--preset--color--dark-card, #161d19);
    color-scheme: dark;
  }
}
/* Dark: when the visitor picked it with the toggle button */
html[data-theme="dark"] {
  --rm-bg: var(--wp--preset--color--dark-base, #0c100e); --rm-bar: var(--wp--preset--color--dark-bar, #121815);
  --rm-text: var(--wp--preset--color--dark-text, #f1ece3); --rm-muted: var(--wp--preset--color--dark-muted, #bdb8ac);
  --rm-accent: var(--wp--preset--color--dark-accent, #c9a85c); --rm-line: var(--wp--preset--color--dark-line, rgba(255, 255, 255, 0.09));
  --rm-field: var(--wp--preset--color--dark-field, #1a211e); --rm-btn: var(--wp--preset--color--dark-button, #f1ece3);
  --rm-btn-text: var(--wp--preset--color--dark-button-text, #14120f);
  --rm-glow: var(--wp--preset--color--dark-glow, rgba(158, 112, 48, 0.32)); --rm-glow2: var(--wp--preset--color--dark-glow-2, rgba(60, 100, 75, 0.20));
  --rm-sec-a: var(--wp--preset--color--dark-section-a, #0c100e); --rm-sec-b: var(--wp--preset--color--dark-section-b, #101512);
  --rm-card: var(--wp--preset--color--dark-card, #161d19);
  color-scheme: dark;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- 2. Page base ---------- */
html body {
  background: var(--rm-bg);
  color: var(--rm-text);
  font-family: var(--rm-sans);
  overflow-x: clip;
}
/* Form controls and buttons inherit your font instead of the browser/theme default */
html body :is(button, input, select, textarea) { font-family: inherit; }

.wp-site-blocks footer.wp-block-template-part { margin-block-start: 0; }
/* Only on pages that use the hero: remove the theme's top gap and hide the page title */
/* Remove ALL theme spacing above the hero (main, its wrapper groups and the post content) */
main:has(.rm-hero),
main:has(.rm-hero) > .wp-block-group,
main:has(.rm-hero) .wp-block-post-content,
main:has(.rm-hero) .entry-content {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}
main:has(.rm-hero) .rm-hero { margin-block-start: 0 !important; }
main:has(.rm-hero) .wp-block-post-title:not(.rm-letter .wp-block-post-title) { display: none; }
/* No gaps between full-width sections */
.wp-block-post-content .rm-hero,
.wp-block-post-content .rm-section { margin-block: 0; }

/* Keyboard focus */
.rm-bar :focus-visible, .rm-hero :focus-visible, .rm-section :focus-visible {
  outline: 2px solid var(--rm-accent); outline-offset: 3px;
}

/* ---------- 3. Header (floating bar) ---------- */
header.wp-block-template-part {
  position: sticky; top: 0; z-index: 100; background: transparent;
  padding: 12px clamp(12px, 3vw, 24px) 0; margin-block-start: 0;
}
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar header.wp-block-template-part { top: 46px; } }

.rm-bar {
  max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 24px; background: var(--rm-bar); border: 1px solid var(--rm-line); border-radius: 20px;
}
.rm-brand { margin: 0; font-family: var(--rm-serif); font-size: 1.6rem; line-height: 1; white-space: nowrap; }
.rm-brand a { color: var(--rm-text); text-decoration: none; }
.rm-brand em { font-style: italic; }

.rm-links { margin: 0; display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); }
.rm-links .wp-block-navigation { margin: 0; font-size: 1rem; font-family: var(--rm-sans); }
.rm-bar .wp-block-navigation a { color: var(--rm-muted); text-decoration: none; }
.rm-bar .wp-block-navigation a:hover { color: var(--rm-text); }
.rm-bar .wp-block-navigation__responsive-container-open,
.rm-bar .wp-block-navigation__responsive-container-close { color: var(--rm-text); }

.rm-cta { margin: 0; }
.rm-cta a {
  display: inline-block; background: var(--rm-btn); color: var(--rm-btn-text); font-weight: 600; font-size: 1rem;
  padding: 13px 20px; border-radius: 14px; text-decoration: none; white-space: nowrap;
}
.rm-cta a:hover { opacity: 0.9; }
#rm-theme { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; margin: 0; background: none; border: 0; color: var(--rm-text); cursor: pointer; }
@media (max-width: 480px) {
  .rm-bar { padding-left: 16px; }
  .rm-brand { font-size: 1.3rem; }
  .rm-cta a { padding: 11px 14px; font-size: 0.95rem; }
}

/* ---------- 4. Hero ---------- */
.rm-hero {
  text-align: center; box-sizing: border-box; font-family: var(--rm-sans); color: var(--rm-text);
  padding: clamp(40px, 5vw, 72px) clamp(16px, 4vw, 32px) clamp(64px, 9vw, 112px);
  background:
    radial-gradient(45% 50% at 28% 52%, var(--rm-glow), transparent 70%),
    radial-gradient(50% 50% at 74% 68%, var(--rm-glow2), transparent 72%);
}
.rm-hero .rm-kicker {
  margin: 0 0 clamp(20px, 4vw, 40px);
  color: var(--rm-accent); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
}
.rm-hero .rm-title {
  font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text); margin: 0 auto;
  font-size: clamp(3rem, 0.6rem + 11vw, 9.5rem); line-height: 0.95; letter-spacing: -0.03em; text-wrap: balance;
}
.rm-hero .rm-title em { font-style: italic; }
.rm-hero .rm-lead {
  max-width: 34em; margin: clamp(24px, 4vw, 40px) auto 0; color: var(--rm-text); opacity: 0.88;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem); line-height: 1.5; text-wrap: balance;
}
.rm-hero .rm-lead strong { font-weight: 600; }
.rm-hero .rm-proof { margin: 24px 0 0; color: var(--rm-muted); font-size: 0.95rem; }

/* ---------- 4b. Email form (Fluent Forms) ----------
   Put the shortcode inside the group that has the class "rm-form-wrap".
   Layout is done with fixed sizes and absolute positioning INSIDE the pill, so Fluent's own
   margins, wrapping and mobile rules cannot stretch or stack it.
   If you change the button text, adjust --rm-submit-w (the button width). */
.rm-form-wrap { max-width: 620px; margin: clamp(24px, 4vw, 36px) auto 0; }
.rm-form-wrap .fluentform { margin: 0 !important; padding: 0 !important; }

.rm-form-wrap .fluentform form.frm-fluent-form {
  --rm-submit-w: 150px; --rm-ctl-h: 52px; --rm-pad: 8px;
  position: relative !important; display: block !important; box-sizing: border-box;
  height: calc(var(--rm-ctl-h) + var(--rm-pad) * 2 + 2px) !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important;
  background: var(--rm-field) !important;
  border: 1px solid var(--rm-line) !important;
  border-radius: 999px !important;
}
.rm-form-wrap .fluentform form.frm-fluent-form:focus-within { border-color: var(--rm-accent) !important; }
.rm-form-wrap .fluentform form.frm-fluent-form fieldset {
  margin: 0 !important; padding: 0 !important; min-width: 0; border: 0 !important; background: none !important;
}

/* Email field: left side of the pill */
.rm-form-wrap .fluentform form.frm-fluent-form .ff-el-group:not(.ff_submit_btn_wrapper) {
  position: absolute !important; top: 50%; transform: translateY(-50%);
  left: var(--rm-pad); right: calc(var(--rm-submit-w) + var(--rm-pad) * 2);
  width: auto !important; max-width: none !important; height: var(--rm-ctl-h) !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important;
}
.rm-form-wrap .fluentform .ff-el-input--content { margin: 0 !important; padding: 0 !important; }

/* Submit button: right side of the pill */
.rm-form-wrap .fluentform form.frm-fluent-form .ff_submit_btn_wrapper {
  position: absolute !important; top: 50%; transform: translateY(-50%); right: var(--rm-pad);
  width: var(--rm-submit-w) !important; max-width: none !important; height: var(--rm-ctl-h) !important;
  margin: 0 !important; padding: 0 !important; display: flex !important;
}

/* Keep the label for screen readers, hide it visually */
.rm-form-wrap .fluentform .ff-el-input--label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Email input */
.rm-form-wrap .fluentform .ff-el-form-control {
  display: block; width: 100%; height: var(--rm-ctl-h) !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 12px 0 20px !important; line-height: 1.2 !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: var(--rm-text); font: inherit; font-size: 1.05rem; text-align: left;
}
.rm-form-wrap .fluentform .ff-el-form-control::placeholder { color: var(--rm-muted); opacity: 0.8; }
.rm-form-wrap .fluentform .ff-el-form-control:focus { outline: none; }

/* Submit button */
.rm-form-wrap .fluentform .ff-btn-submit {
  display: flex !important; align-items: center; justify-content: center;
  width: 100% !important; height: 100% !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; line-height: 1 !important;
  background: var(--rm-btn) !important; color: var(--rm-btn-text) !important;
  border: 0 !important; border-radius: 999px !important; box-shadow: none !important;
  font: inherit; font-size: 1rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.rm-form-wrap .fluentform .ff-btn-submit:hover { opacity: 0.9; }

/* Success and error messages */
.rm-form-wrap .fluentform .ff-message-success,
.rm-form-wrap .fluentform .ff-errors-in-stack {
  margin: 12px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important;
  box-shadow: none !important; color: var(--rm-muted); font-size: 0.95rem; text-align: center;
}
.rm-form-wrap .fluentform .text-danger { font-size: 0.85rem; }

/* Phones: a little more compact, still ONE row */
@media (max-width: 640px) {
  .rm-form-wrap .fluentform form.frm-fluent-form { --rm-submit-w: 128px; --rm-ctl-h: 46px; --rm-pad: 6px; }
  .rm-form-wrap .fluentform .ff-el-form-control { padding: 0 8px 0 16px !important; font-size: 1rem; }
  .rm-form-wrap .fluentform .ff-btn-submit { font-size: 0.95rem; }
}
/* Very narrow screens only: button under the field */
@media (max-width: 340px) {
  .rm-form-wrap .fluentform form.frm-fluent-form {
    height: calc(var(--rm-ctl-h) * 2 + var(--rm-pad) * 3 + 2px) !important; border-radius: 28px !important;
  }
  .rm-form-wrap .fluentform form.frm-fluent-form .ff-el-group:not(.ff_submit_btn_wrapper) {
    top: var(--rm-pad); transform: none; left: var(--rm-pad); right: var(--rm-pad);
  }
  .rm-form-wrap .fluentform form.frm-fluent-form .ff_submit_btn_wrapper {
    top: calc(var(--rm-ctl-h) + var(--rm-pad) * 2); transform: none; left: var(--rm-pad); right: var(--rm-pad); width: auto !important;
  }
  .rm-form-wrap .fluentform .ff-el-form-control { text-align: center; }
}

/* ---------- 5. Shared section styles ---------- */
.rm-section {
  box-sizing: border-box; text-align: center; font-family: var(--rm-sans); color: var(--rm-text);
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 32px);
  /* Speed: the browser skips rendering these until they are near the screen */
  content-visibility: auto; contain-intrinsic-size: auto 900px;
}
.rm-letters { background: var(--rm-sec-a); }
.rm-resources { background: var(--rm-sec-b); }
.rm-section .rm-h2 {
  margin: 0; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); line-height: 1; letter-spacing: -0.02em;
}
.rm-section .rm-h2 em { font-style: italic; }
.rm-letters .rm-h2 { margin: 0 0 clamp(28px, 5vw, 48px); }
.rm-resources .rm-h2 { margin: 0 0 12px; }
.rm-section .rm-sub {
  margin: 0 0 clamp(28px, 5vw, 48px);
  color: var(--rm-muted); font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
}
.rm-btn { margin: 0; }
.rm-btn a {
  display: inline-block; background: var(--rm-btn); color: var(--rm-btn-text); font-weight: 600; font-size: 0.95rem;
  padding: 14px 26px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.rm-btn a:hover { opacity: 0.9; }
.rm-letters .rm-btn { margin: clamp(32px, 5vw, 48px) 0 0; }

/* ---------- 6. Articles list (Query Loop): 2 columns x 2 rows ---------- */
/* ONE list of rows: each article = image on the left, title + date on the right */
.rm-letters-list { max-width: 960px; margin: 0 auto; text-align: left; }
.rm-letters-list .wp-block-post-template {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 64px);
}
.rm-letters-list .wp-block-post-template li { margin: 0; }
.rm-letter { margin: 0; display: flex; flex-direction: row; align-items: center; gap: clamp(28px, 5vw, 56px); }
.rm-letter .wp-block-post-featured-image { margin: 0; flex: 0 0 min(42%, 400px); }
.rm-letter .wp-block-post-featured-image img {
  display: block; width: 100%; height: auto !important; aspect-ratio: 16 / 9 !important; object-fit: cover !important;
  border-radius: 16px; background: #000;
}
.rm-letter .rm-letter-text { margin: 0; flex: 1 1 0; min-width: 0; }
/* Titles: forced visible (they were rendering invisible) */
.rm-letters .rm-letter .wp-block-post-title {
  margin: 0; font-family: var(--rm-serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em;
  color: var(--rm-text) !important; -webkit-text-fill-color: var(--rm-text) !important;
  opacity: 1 !important; visibility: visible !important;
  display: block !important; /* beats the rule that hides the page title on the homepage */
  font-size: clamp(1.6rem, 1rem + 1.9vw, 2.6rem) !important;
}
.rm-letters .rm-letter .wp-block-post-title a {
  color: var(--rm-text) !important; -webkit-text-fill-color: var(--rm-text) !important;
  opacity: 1 !important; visibility: visible !important; text-decoration: none;
}
.rm-letters .rm-letter .wp-block-post-title a:hover { opacity: 0.7 !important; }
.rm-letter .wp-block-post-date { margin: 14px 0 0; font-size: 0.9rem; color: var(--rm-muted); }
/* Phones: one column, full-width image with the title and date underneath */
@media (max-width: 640px) {
  .rm-letters-list .wp-block-post-template { grid-template-columns: 1fr; gap: 40px; }
  .rm-letter { flex-direction: column; align-items: stretch; gap: 18px; }
  .rm-letter .wp-block-post-featured-image { flex: none; width: 100%; }
  .rm-letter .wp-block-post-featured-image img { border-radius: 20px; }
  .rm-letters .rm-letter .wp-block-post-title {
    font-size: clamp(1.5rem, 1.2rem + 1.5vw, 1.8rem) !important; line-height: 1.15;
  }
  .rm-letter .wp-block-post-date { margin-top: 12px; font-size: 0.85rem; }
}

/* Dark mode: article titles in the gold accent */
html[data-theme="dark"] .rm-letters .rm-letter .wp-block-post-title,
html[data-theme="dark"] .rm-letters .rm-letter .wp-block-post-title a {
  color: var(--rm-accent) !important; -webkit-text-fill-color: var(--rm-accent) !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rm-letters .rm-letter .wp-block-post-title,
  html:not([data-theme="light"]) .rm-letters .rm-letter .wp-block-post-title a {
    color: var(--rm-accent) !important; -webkit-text-fill-color: var(--rm-accent) !important;
  }
}

/* ---------- 7. Resource cards ---------- */
.rm-cards {
  max-width: 1100px; margin: 0 auto; text-align: left;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.rm-card {
  margin: 0; background: var(--rm-card); border: 1px solid var(--rm-line); border-radius: 24px;
  padding: clamp(14px, 2vw, 20px) clamp(14px, 2vw, 20px) clamp(20px, 2.5vw, 28px);
  display: flex; flex-direction: column; gap: 12px;
}
.rm-card .wp-block-image { margin: 0; }
.rm-card .wp-block-image:not(:has(img[src])) { display: none; }  /* hide empty image slots */
.rm-card .wp-block-image img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; background: #000;
}
.rm-card .rm-card-title {
  margin: 0; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.01em;
}
.rm-card .rm-card-text { margin: 0; color: var(--rm-muted); font-size: 0.95rem; line-height: 1.5; }
.rm-card .rm-btn { margin: auto 0 0; padding-top: 8px; }
.rm-card .rm-btn a { padding: 12px 22px; font-size: 0.9rem; }

/* ---------- 8. Footer ---------- */
.rm-footer {
  box-sizing: border-box; margin: 0; background: var(--rm-sec-a); border-top: 1px solid var(--rm-line);
  color: var(--rm-text); font-family: var(--rm-sans);
  padding: clamp(40px, 6vw, 72px) clamp(16px, 4vw, 32px) clamp(24px, 3vw, 32px);
}
.rm-footer .rm-footer-inner { max-width: 1100px; margin: 0 auto; }
.rm-footer .rm-footer-top {
  margin: 0; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 32px;
}
.rm-footer .rm-footer-brand { margin: 0; max-width: 28em; }
.rm-footer .rm-brand { margin: 0 0 12px; font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem); }
.rm-footer .rm-footer-tag { margin: 0; color: var(--rm-muted); font-size: 1rem; line-height: 1.5; }
.rm-footer .wp-block-navigation { margin: 0; font-size: 1rem; font-family: var(--rm-sans); }
.rm-footer .wp-block-navigation a { color: var(--rm-muted); text-decoration: none; }
.rm-footer .wp-block-navigation a:hover { color: var(--rm-text); }
.rm-footer .rm-footer-copy {
  margin: clamp(32px, 5vw, 56px) 0 0; padding-top: 20px; border-top: 1px solid var(--rm-line);
  color: var(--rm-muted); font-size: 0.85rem;
}
.rm-footer :focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 3px; }

/* ---------- 9. Remove the strip between the last section and the footer ---------- */
main:has(.rm-hero),
main:has(.rm-hero) .wp-block-post-content {
  margin-block-end: 0 !important;
  padding-block-end: 0 !important;
}
/* Fallback: if any gap remains, make it match the last section */
main:has(.rm-hero) { background: var(--rm-sec-b); }

/* ---------- 10. Mobile refinements ---------- */
@media (max-width: 640px) {
  /* Header: compact floating pill, button shortened to "Join" */
  header.wp-block-template-part { padding: 10px 12px 0; }
  .rm-bar { padding: 8px 8px 8px 18px; border-radius: 18px; gap: 8px; }
  .rm-brand { font-size: 1.4rem; }
  .rm-links { gap: 2px; }
  #rm-theme { width: 44px; height: 44px; }
  .rm-cta a { font-size: 0; padding: 12px 20px; border-radius: 14px; }
  .rm-cta a::after { content: "Join"; font-size: 0.95rem; }
  /* Hero: bigger two-line title, stronger text, relaxed vertical rhythm */
  .rm-hero { padding-top: 48px; padding-bottom: 80px; }
  .rm-hero .rm-kicker { margin: 0 0 28px; }
  .rm-hero .rm-title { font-size: clamp(3.8rem, 22vw, 6.2rem); line-height: 1; letter-spacing: -0.03em; }
  .rm-hero .rm-lead { margin: 36px auto 0; opacity: 1; font-size: 1.15rem; font-weight: 400; line-height: 1.6; }
  .rm-form-wrap { margin-top: 36px; }
  .rm-hero .rm-proof { margin: 28px 0 0; color: var(--rm-text); opacity: 0.85; line-height: 1.5; }
  /* Section headings and spacing */
  .rm-section { padding-block: 56px; }
  .rm-footer .rm-footer-top { flex-direction: column; gap: 24px; }
}

/* ---------- 11. Opened mobile menu (overrides WordPress' white/black defaults, works in light and dark) ---------- */
.rm-bar .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open,
.rm-bar .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  background-color: var(--rm-bg) !important;
  color: var(--rm-text) !important;
}
.rm-bar .wp-block-navigation .is-menu-open .wp-block-navigation-item__content,
.rm-bar .wp-block-navigation .is-menu-open .wp-block-navigation-item__label,
.rm-bar .wp-block-navigation .is-menu-open a {
  color: var(--rm-text) !important;
  opacity: 1 !important;
  font-family: var(--rm-sans);
  font-size: 1.6rem;
  font-weight: 400;
  text-decoration: none;
}
.rm-bar .wp-block-navigation .is-menu-open a:hover { color: var(--rm-accent) !important; }
.rm-bar .wp-block-navigation .is-menu-open a:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 4px; }
.rm-bar .wp-block-navigation .wp-block-navigation__responsive-container-open,
.rm-bar .wp-block-navigation .wp-block-navigation__responsive-container-close {
  color: var(--rm-text) !important;
}

/* ---------- 12. Single post pages (does not touch the homepage) ---------- */
.single-post .wp-block-post-title {
  font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance;
}
.single-post .wp-block-post-content { font-family: var(--rm-sans); font-size: 1.125rem; line-height: 1.75; color: var(--rm-text); }
.single-post .wp-block-post-content :is(h2, h3, h4) {
  font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  line-height: 1.2; letter-spacing: -0.01em; margin-block: 2em 0.6em;
}
.single-post .wp-block-post-content h2 { font-size: clamp(1.7rem, 1.4rem + 1.5vw, 2.4rem); }
.single-post .wp-block-post-content h3 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem); }
.single-post .wp-block-post-content h4 { font-size: 1.2rem; }
/* Links in posts and inner pages (not the homepage, not buttons) - follows light/dark automatically */
body:not(.home) .wp-block-post-content :where(p:not(.rm-btn), li, td, figcaption) a:not(.wp-element-button) {
  color: var(--rm-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
body:not(.home) .wp-block-post-content :where(p:not(.rm-btn), li, td, figcaption) a:not(.wp-element-button):hover {
  color: var(--rm-text); text-decoration-thickness: 2px;
}
.single-post .wp-block-post-content blockquote {
  margin-inline: 0; padding-left: 1.2em; border-left: 3px solid var(--rm-accent);
  font-family: var(--rm-serif); font-size: 1.3em; font-style: italic; line-height: 1.4;
}
.single-post .wp-block-post-content .wp-element-button {
  background: var(--rm-btn); color: var(--rm-btn-text); border-radius: 999px; font-weight: 600; padding: 14px 26px;
}
.single-post .wp-block-post-content img { border-radius: 16px; }
.single-post .wp-block-post-date, .single-post figcaption { color: var(--rm-muted); font-size: 0.85rem; }

/* ---------- 13. Hero sits under the header + subtle professional motion ---------- */

/* Header height (used to pull the hero up behind the floating bar). Adjust if your header grows/shrinks. */
:root { --rm-header-h: 88px; }
@media (max-width: 640px) { :root { --rm-header-h: 80px; } }

/* Shadow colour for hover effects (soft brown in light mode, black in dark mode) */
html { --rm-shadow: rgba(42, 31, 24, 0.28); }
html[data-theme="dark"] { --rm-shadow: rgba(0, 0, 0, 0.6); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --rm-shadow: rgba(0, 0, 0, 0.6); } }

/* The hero starts at the very top of the page, so its glow continues BEHIND the header
   (no flat dark strip). Its content is pushed down by the same amount. */
main:has(.rm-hero) { margin-block-start: calc(var(--rm-header-h) * -1) !important; }
.rm-hero { padding-top: calc(clamp(40px, 5vw, 72px) + var(--rm-header-h)); }
@media (max-width: 640px) { .rm-hero { padding-top: calc(48px + var(--rm-header-h)); } }

/* The glow now lives on a layer behind the hero so it can drift slowly */
.rm-hero { background: none; position: relative; isolation: isolate; overflow: clip; }
.rm-hero::before {
  content: ""; position: absolute; inset: -12% -8%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(45% 50% at 28% 52%, var(--rm-glow), transparent 70%),
    radial-gradient(50% 50% at 74% 68%, var(--rm-glow2), transparent 72%);
}

/* Motion: only for visitors who have NOT asked their device to reduce motion */
@media (prefers-reduced-motion: no-preference) {

  /* Keyframes only define the START; the end is the element's normal style (so nothing "snaps") */
  @keyframes rm-rise  { from { opacity: 0; translate: 0 26px; } }
  @keyframes rm-drop  { from { opacity: 0; translate: 0 -14px; } }
  @keyframes rm-drift { from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); } to { transform: translate3d(2.5%, 2%, 0) scale(1.08); } }
  @keyframes rm-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  /* Page load: header drops in, hero lines rise one after another, glow drifts slowly */
  header.wp-block-template-part { animation: rm-drop 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .rm-hero > * { animation: rm-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .rm-hero > :nth-child(1) { animation-delay: 0.15s; }
  .rm-hero > :nth-child(2) { animation-delay: 0.27s; }
  .rm-hero > :nth-child(3) { animation-delay: 0.39s; }
  .rm-hero > :nth-child(4) { animation-delay: 0.51s; }
  .rm-hero > :nth-child(5) { animation-delay: 0.63s; }
  .rm-hero::before { animation: rm-drift 26s ease-in-out infinite alternate; will-change: transform; }

  /* Buttons: gentle lift */
  .rm-cta a, .rm-btn a, .single-post .wp-block-post-content .wp-element-button {
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease, opacity 0.2s ease;
  }
  .rm-cta a:hover, .rm-btn a:hover, .single-post .wp-block-post-content .wp-element-button:hover {
    transform: translateY(-2px); box-shadow: 0 10px 22px -10px var(--rm-shadow);
  }

  /* Menu links: underline grows from the left */
  .rm-bar .wp-block-navigation a {
    background: linear-gradient(var(--rm-accent), var(--rm-accent)) 0 100% / 0 1px no-repeat;
    padding-bottom: 3px; transition: background-size 0.3s ease, color 0.2s ease;
  }
  .rm-bar .wp-block-navigation a:hover { background-size: 100% 1px; }

  /* Theme toggle icon: small turn on hover */
  #rm-theme svg { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
  #rm-theme:hover svg { transform: rotate(25deg); }

  /* Email pill: soft glow while typing */
  .rm-form-wrap .fluentform form.frm-fluent-form { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
  .rm-form-wrap .fluentform form.frm-fluent-form:focus-within {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-accent) 20%, transparent);
  }

  /* Article images: slow zoom on hover */
  .rm-letter .wp-block-post-featured-image { overflow: hidden; border-radius: 16px; }
  .rm-letter .wp-block-post-featured-image img { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .rm-letter:hover .wp-block-post-featured-image img { transform: scale(1.045); }
  @media (max-width: 640px) { .rm-letter .wp-block-post-featured-image { border-radius: 20px; } }

  /* Resource cards: lift + soft shadow */
  .rm-card { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease; }
  .rm-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--rm-accent) 45%, var(--rm-line));
    box-shadow: 0 22px 44px -24px var(--rm-shadow);
  }
  .rm-card .wp-block-image { overflow: hidden; border-radius: 16px; }
  .rm-card .wp-block-image img { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .rm-card:hover .wp-block-image img { transform: scale(1.04); }

  /* Scroll reveal (pure CSS, no JavaScript). Browsers without support simply show everything normally. */
  @supports (animation-timeline: view()) {
    @keyframes rm-reveal { from { opacity: 0; translate: 0 32px; } }
    .rm-section .rm-h2, .rm-section .rm-sub, .rm-letters .rm-btn,
    .rm-letters-list .wp-block-post-template > li, .rm-card,
    .rm-footer .rm-footer-top, .rm-footer .rm-footer-copy {
      animation: rm-reveal linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
    /* Small stagger inside grids */
    .rm-cards > :nth-child(3n+2), .rm-letters-list .wp-block-post-template > li:nth-child(even) { animation-range: entry 6% entry 51%; }
    .rm-cards > :nth-child(3n+3) { animation-range: entry 12% entry 57%; }
  }

  /* Reading-progress bar at the top of article pages */
  @supports (animation-timeline: scroll()) {
    body.single-post::before {
      content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200; pointer-events: none;
      background: var(--rm-accent); transform-origin: 0 50%;
      animation: rm-progress linear both; animation-timeline: scroll(root block);
    }
    .admin-bar.single-post::before { top: 32px; }
  }
}

/* ---------- 14. Single post: one simple column (title, author + date, image, text) ---------- */
.rm-post {
  box-sizing: border-box; margin-block-start: 0 !important;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 32px) clamp(64px, 9vw, 112px);
}
.single-post .rm-post .wp-block-post-title {
  margin: 0; font-size: clamp(2.6rem, 1.4rem + 5vw, 4.6rem); line-height: 1.02; letter-spacing: -0.025em;
}
/* Author on the left, date on the right */
.rm-post-meta { align-items: baseline; margin: clamp(18px, 3vw, 28px) 0 clamp(28px, 4.5vw, 44px); color: var(--rm-muted); }
.rm-post-meta > * { margin: 0; }
.rm-post-meta .wp-block-post-author-name { font-size: 1rem; }
.rm-post-meta .wp-block-post-author-name::before { content: "by "; }
.rm-post-meta .wp-block-post-date { font-size: 0.85rem; }
/* Featured image */
.rm-post-image { margin: 0 0 clamp(32px, 5vw, 48px); }
.rm-post-image img {
  display: block; width: 100%; height: auto !important; aspect-ratio: 16 / 9 !important; object-fit: cover !important;
  border-radius: 16px; background: #000;
}
/* Tags + previous/next */
.rm-post-end { margin-top: clamp(40px, 6vw, 64px); }
.rm-post-end .wp-block-post-terms { margin: 0 0 clamp(24px, 4vw, 40px); font-size: 0.9rem; color: var(--rm-muted); }

/* ---------- 15. Footer newsletter band (all pages), comments, "Keep Reading" ---------- */

/* Newsletter band above the footer. The form itself reuses the .rm-form-wrap pill styles (section 4b). */
.rm-signup {
  box-sizing: border-box; margin: 0; text-align: center; font-family: var(--rm-sans); color: var(--rm-text);
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 32px);
  background: radial-gradient(55% 90% at 50% 100%, var(--rm-glow), transparent 70%), var(--rm-sec-b);
  border-top: 1px solid var(--rm-line);
}
.rm-signup .rm-signup-title {
  margin: 0; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.2rem, 1.2rem + 4vw, 4rem); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance;
}
.rm-signup .rm-signup-title em { font-style: italic; }
.rm-signup .rm-signup-sub { margin: 16px auto 0; max-width: 32em; color: var(--rm-muted); font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem); }
.rm-signup .rm-form-wrap { margin-top: clamp(24px, 4vw, 36px); }
/* The footer signup band is permanent: it shows on every page, including the homepage. */

/* ---- Comments ---- */
.rm-comments { margin-top: clamp(56px, 8vw, 88px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--rm-line); }
/* Hide the whole block when comments are closed and there are none */
.rm-comments:not(:has(.comment-respond)):not(:has(.wp-block-comment-template > li)) { display: none; }
.rm-comments .rm-comments-title { margin: 0; font-family: var(--rm-serif); font-weight: 500; font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.2rem); line-height: 1.15; }
.rm-comments .rm-comments-count { margin: 6px 0 0; font-family: var(--rm-sans); font-size: 0.95rem; font-weight: 400; color: var(--rm-muted); }
.rm-comments .wp-block-comment-template { list-style: none; margin: 24px 0 0; padding: 0; }
.rm-comments .wp-block-comment-template ol { list-style: none; margin: 0; padding-left: clamp(20px, 5vw, 56px); }
.rm-comment { gap: 16px; padding-block: 24px; border-bottom: 1px solid var(--rm-line); }
.rm-comment .avatar { display: block; border-radius: 999px; }
.rm-comment-body { flex: 1 1 0; min-width: 0; }
.rm-comment-head { align-items: baseline; gap: 4px 12px; }
.rm-comment-head > * { margin: 0; }
.rm-comment-head .wp-block-comment-author-name { font-weight: 600; color: var(--rm-text); }
.rm-comment-head .wp-block-comment-date, .rm-comment-head .wp-block-comment-date a { font-size: 0.8rem; color: var(--rm-muted); text-decoration: none; }
.rm-comments .wp-block-comment-content { margin: 8px 0 0; font-size: 1rem; line-height: 1.65; color: var(--rm-text); }
.rm-comments .wp-block-comment-content p { margin: 0 0 0.8em; }
.rm-comment-actions { gap: 16px; margin-top: 4px; font-size: 0.85rem; }
.rm-comment-actions > * { margin: 0; }
.rm-comment-actions a { color: var(--rm-accent); text-decoration: none; font-weight: 500; }
.rm-comment-actions a:hover { text-decoration: underline; }
.rm-comments .wp-block-comments-pagination { margin-top: 24px; font-size: 0.9rem; }

/* Comment form */
.rm-comments .comment-respond { margin-top: clamp(32px, 5vw, 48px); }
.rm-comments .comment-reply-title { margin: 0 0 8px; font-family: var(--rm-serif); font-weight: 500; font-size: 1.6rem; line-height: 1.2; }
.rm-comments .comment-reply-title small { font-family: var(--rm-sans); font-size: 0.85rem; margin-left: 10px; }
.rm-comments .comment-notes, .rm-comments .logged-in-as { margin: 0 0 20px; color: var(--rm-muted); font-size: 0.9rem; }
.rm-comments .comment-form p { margin: 0 0 16px; }
.rm-comments .comment-form label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--rm-muted); }
.rm-comments .comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
  display: block; width: 100%; box-sizing: border-box; padding: 14px 16px;
  background: var(--rm-field); color: var(--rm-text); border: 1px solid var(--rm-line); border-radius: 14px;
  font: inherit; font-size: 1rem; line-height: 1.5;
}
.rm-comments .comment-form textarea { min-height: 140px; resize: vertical; }
.rm-comments .comment-form :is(input, textarea):focus { outline: none; border-color: var(--rm-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-accent) 18%, transparent); }
.rm-comments .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 10px; }
.rm-comments .comment-form-cookies-consent label { margin: 0; font-size: 0.85rem; }
.rm-comments .comment-form-cookies-consent input { margin-top: 4px; accent-color: var(--rm-accent); }
.rm-comments .form-submit { margin: 8px 0 0; }
.rm-comments .form-submit :is(input[type="submit"], .wp-block-button__link) {
  background: var(--rm-btn); color: var(--rm-btn-text); border: 0; border-radius: 999px;
  padding: 14px 28px; font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.rm-comments .form-submit :is(input[type="submit"], .wp-block-button__link):hover { opacity: 0.9; }

/* ---- Keep Reading ---- */
.rm-keep { margin-top: clamp(56px, 8vw, 88px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--rm-line); }
.rm-keep .rm-keep-title { margin: 0 0 28px; font-family: var(--rm-serif); font-weight: 500; font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.2rem); line-height: 1.15; }
.rm-keep-list .wp-block-post-template { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(22px, 3.5vw, 32px); }
.rm-keep-list .wp-block-post-template > li { margin: 0; }
.rm-kr { gap: clamp(16px, 3vw, 28px); }
.rm-kr .rm-kr-img { flex: 0 0 clamp(96px, 24vw, 168px); margin: 0; }
.rm-kr .rm-kr-img img { display: block; width: 100%; height: auto !important; aspect-ratio: 16 / 9 !important; object-fit: cover !important; border-radius: 12px; background: #000; }
.rm-kr-text { flex: 1 1 0; min-width: 0; }
/* (extra specificity so the big single-post title style does not apply here) */
.single-post .rm-post .rm-kr .wp-block-post-title { margin: 0; font-family: var(--rm-serif); font-weight: 500; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.55rem); line-height: 1.15; letter-spacing: -0.01em; }
.rm-kr .wp-block-post-title a { color: var(--rm-text); text-decoration: none; }
.rm-kr .wp-block-post-title a:hover { color: var(--rm-accent); }
.rm-kr-meta { margin-top: 8px; gap: 0 10px; align-items: baseline; }
.rm-kr-meta .wp-block-post-date, .rm-kr-meta .rm-readtime { margin: 0; font-size: 0.8rem; color: var(--rm-muted); }
.rm-kr-meta .rm-readtime::before { content: "·"; margin-right: 10px; }
.rm-keep-all { margin: 32px 0 0; }
.rm-keep-all a { color: var(--rm-text); font-weight: 600; text-decoration: none; }
.rm-keep-all a:hover { color: var(--rm-accent); }

/* ---------- 16. Blog page, standard pages (About / Privacy / Terms / Contact), footer links ---------- */

/* ---- Blog page: same look as the homepage "the articles" section ---- */
.rm-blog { margin-block-start: 0 !important; content-visibility: visible; }
.rm-blog .wp-block-query-pagination { margin-top: clamp(40px, 6vw, 64px); gap: 8px; justify-content: center; align-items: center; font-size: 0.95rem; }
.rm-blog .wp-block-query-pagination-numbers { display: flex; gap: 6px; }
.rm-blog .wp-block-query-pagination :is(a, .page-numbers) {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 999px; color: var(--rm-text); text-decoration: none;
}
.rm-blog .wp-block-query-pagination a:hover { border-color: var(--rm-line); background: var(--rm-card); }
.rm-blog .wp-block-query-pagination .page-numbers.current { background: var(--rm-btn); color: var(--rm-btn-text); }
.rm-blog .wp-block-query-no-results { text-align: center; color: var(--rm-muted); }

/* ---- Standard pages (templates/simple-page.html): title, then one clean column ---- */
.rm-page {
  box-sizing: border-box; margin-block-start: 0 !important;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 32px) clamp(64px, 9vw, 112px);
}
.rm-page > .wp-block-post-title {
  margin: 0 0 clamp(28px, 4.5vw, 44px); padding-bottom: clamp(20px, 3vw, 28px); border-bottom: 1px solid var(--rm-line);
  font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.4rem, 1.3rem + 4.4vw, 4rem); line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance;
}
.rm-page .wp-block-post-content { font-family: var(--rm-sans); font-size: 1.075rem; line-height: 1.75; color: var(--rm-text); }
.rm-page .wp-block-post-content > :first-child { margin-top: 0; }
.rm-page .wp-block-post-content p { margin: 0 0 1.1em; }
.rm-page .wp-block-post-content strong { font-weight: 600; }
.rm-page .wp-block-post-content :is(h2, h3, h4) {
  font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text); line-height: 1.2; letter-spacing: -0.01em; margin-block: 2.2em 0.6em;
}
.rm-page .wp-block-post-content h2 { font-size: clamp(1.7rem, 1.4rem + 1.5vw, 2.3rem); }
.rm-page .wp-block-post-content h3 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem); }
.rm-page .wp-block-post-content h4 { font-size: 1.2rem; }
.rm-page .wp-block-post-content :is(ul, ol) { margin: 0 0 1.3em; padding-left: 1.3em; }
.rm-page .wp-block-post-content li { margin: 0.45em 0; padding-left: 0.2em; }
.rm-page .wp-block-post-content li::marker { color: var(--rm-accent); }
.rm-page .wp-block-post-content hr { border: 0; border-top: 1px solid var(--rm-line); margin: 2.5em 0; }
.rm-page .wp-block-post-content blockquote {
  margin: 1.6em 0; padding-left: 1.2em; border-left: 3px solid var(--rm-accent);
  font-family: var(--rm-serif); font-size: 1.3em; font-style: italic; line-height: 1.4;
}
.rm-page .wp-block-post-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rm-page .wp-block-post-content :is(th, td) { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--rm-line); }

/* Contact form (Fluent Forms) in the same style as the rest of the site.
   !important is needed to override the black button colour saved inside the form block. */
.rm-page .fluentform .ff-el-group { margin-bottom: 18px; }
.rm-page .fluentform .ff-el-input--label label { color: var(--rm-muted); font-size: 0.9rem; font-weight: 500; }
.rm-page .fluentform .ff-el-form-control {
  box-sizing: border-box; padding: 14px 16px; background: var(--rm-field); color: var(--rm-text);
  border: 1px solid var(--rm-line); border-radius: 14px; box-shadow: none; font: inherit; font-size: 1rem; line-height: 1.5;
}
.rm-page .fluentform textarea.ff-el-form-control { min-height: 150px; }
.rm-page .fluentform .ff-el-form-control::placeholder { color: var(--rm-muted); opacity: 0.8; }
.rm-page .fluentform .ff-el-form-control:focus {
  outline: none; background: var(--rm-field); color: var(--rm-text); border-color: var(--rm-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-accent) 18%, transparent);
}
.rm-page .fluentform .ff-btn-submit {
  background: var(--rm-btn) !important; color: var(--rm-btn-text) !important; border: 0 !important; border-radius: 999px !important;
  padding: 14px 28px !important; font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; box-shadow: none !important;
}
.rm-page .fluentform .ff-btn-submit:hover { opacity: 0.9; }
.rm-page .fluentform .text-danger { font-size: 0.85rem; }
.rm-page .fluentform .ff-message-success { background: var(--rm-card); color: var(--rm-text); border: 1px solid var(--rm-line); border-radius: 14px; padding: 14px 16px; }

/* ---- Footer: small legal links ---- */
.rm-footer .rm-footer-copy a { color: inherit; text-decoration: none; }
.rm-footer .rm-footer-copy a:hover { color: var(--rm-text); text-decoration: underline; }

/* ---------- 17. Resources page + "Get for free" buttons ---------- */
.rm-resources-page { margin-block-start: 0 !important; content-visibility: visible; }
.rm-resources-page .rm-h2 { margin: 0 0 12px; }
.rm-resources-page .wp-block-post-content { margin: 0; }
/* Small label above the title, e.g. "FREE · GUIDE" */
.rm-card .rm-card-tag {
  margin: 4px 0 -4px; color: var(--rm-accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
/* Arrow on card buttons that nudges right on hover */
.rm-card .rm-btn a::after { content: "→"; display: inline-block; margin-left: 8px; transition: transform 0.25s ease; }
.rm-card .rm-btn a:hover::after { transform: translateX(4px); }

/* ---------- 18. Header: search icon, icon buttons, search panel ---------- */
.rm-icon-btn, #rm-theme {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: 0; flex: none;
  background: none; border: 0; border-radius: 12px; color: var(--rm-text); cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.rm-icon-btn:hover, #rm-theme:hover { background: var(--rm-field); }
.rm-icon-btn:focus-visible, #rm-theme:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 2px; }
.rm-links { flex-wrap: nowrap; min-width: 0; }

/* Panel drops down under the floating bar */
.rm-search-panel {
  display: none; position: absolute; z-index: 5; box-sizing: border-box;
  left: clamp(12px, 3vw, 24px); right: clamp(12px, 3vw, 24px); top: calc(100% + 8px);
  max-width: 1200px; margin: 0 auto !important; padding: 10px;
  background: var(--rm-bar); border: 1px solid var(--rm-line); border-radius: 20px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
}
.rm-search-open .rm-search-panel { display: block; }

/* One look for both search forms (header panel + results page) */
.rm-search-form { margin: 0; max-width: none; }
.rm-search-form .wp-block-search__inside-wrapper {
  display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%;
  background: var(--rm-field); border: 1px solid var(--rm-line) !important; border-radius: 999px; padding: 6px 6px 6px 20px;
}
.rm-search-form .wp-block-search__inside-wrapper:focus-within { border-color: var(--rm-accent) !important; }
.rm-search-form .wp-block-search__input {
  flex: 1 1 auto; min-width: 0; width: 100%; height: 44px; padding: 0 !important; margin: 0;
  background: transparent !important; border: 0 !important; outline: 0 !important; box-shadow: none !important;
  color: var(--rm-text); font: inherit; font-size: 1rem;
}
.rm-search-form .wp-block-search__input::placeholder { color: var(--rm-muted); opacity: 0.8; }
.rm-search-form .wp-block-search__button {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; margin: 0;
  border: 0; border-radius: 999px; background: var(--rm-btn); color: var(--rm-btn-text); cursor: pointer;
}
.rm-search-form .wp-block-search__button svg { width: 22px; height: 22px; fill: currentColor; }
.rm-search-form .wp-block-search__button:hover { opacity: 0.9; }

@media (max-width: 640px) {
  .rm-icon-btn, #rm-theme { width: 40px; height: 40px; }
  .rm-links { gap: 0; }
  .rm-bar { gap: 4px; }
  .rm-bar .wp-block-navigation__responsive-container-open { padding: 0; }
  .rm-cta { margin-left: 4px; }
}
@media (max-width: 400px) {
  .rm-bar { padding-left: 14px; }
  .rm-brand { font-size: 1.2rem; }
  .rm-icon-btn, #rm-theme { width: 36px; height: 36px; }
  .rm-cta a::after { font-size: 0.9rem; }
  .rm-cta a { padding: 11px 14px; }
}
@media (max-width: 340px) { .rm-cta { display: none; } }  /* very small phones: the sign-up band is one tap away in the footer */

/* ---------- 19. Footer signup: missing-plugin note ---------- */
.rm-form-missing { margin: 0; font-size: 0.9rem; color: var(--rm-muted); }

/* ---------- 20. Resource cards (from Dashboard > Resources) ---------- */
.rm-cards:has(.rm-res-card) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 340px)); justify-content: center; }
.rm-card .rm-card-img { display: block; margin: 0; }
.rm-card .rm-card-img a { display: block; }
.rm-card .rm-card-img img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; background: var(--rm-field);
}
.rm-card .rm-card-title a { color: inherit; text-decoration: none; }
.rm-card .rm-card-title a:hover { color: var(--rm-accent); }
.rm-card .rm-card-title a:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 3px; border-radius: 4px; }
.rm-empty { color: var(--rm-muted); text-align: center; }

/* Topic filter on the Resources page */
.rm-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto clamp(24px, 4vw, 36px); }
.rm-filter a {
  padding: 9px 18px; border: 1px solid var(--rm-line); border-radius: 999px; background: var(--rm-card);
  color: var(--rm-muted); font-size: 0.9rem; font-weight: 500; text-decoration: none;
}
.rm-filter a:hover { color: var(--rm-text); }
.rm-filter a[aria-current] { background: var(--rm-btn); border-color: var(--rm-btn); color: var(--rm-btn-text); }
.rm-filter a:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 2px; }

/* ---------- 21. Resource landing page ---------- */
.rm-res-single { text-align: left; content-visibility: visible; padding-bottom: clamp(32px, 5vw, 56px); margin-block-start: 0 !important; }
.rm-res-single .rm-back { max-width: 1100px; margin: 0 auto clamp(20px, 3vw, 32px); font-size: 0.95rem; }
.rm-res-single .rm-back a { color: var(--rm-muted); text-decoration: none; }
.rm-res-single .rm-back a:hover { color: var(--rm-text); }
.rm-res-hero {
  max-width: 1100px; margin: 0 auto !important; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px); align-items: start;
}
.rm-res-hero > * { margin: 0 !important; }
.rm-res-cover { position: sticky; top: 110px; }
.rm-res-cover img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; border: 1px solid var(--rm-line); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.5); }
.rm-res-info > * { margin-block: 0; }
.rm-res-tag { margin: 0 0 10px; color: var(--rm-accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.rm-res-info .rm-res-title {
  margin: 0; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4rem); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance;
}
.rm-res-info .rm-res-lead { margin: 16px 0 0; color: var(--rm-muted); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); line-height: 1.6; }
.rm-res-info .rm-res-lead p { margin: 0; }
.rm-res-format { margin: 12px 0 0; color: var(--rm-muted); font-size: 0.9rem; }
.rm-res-info .rm-actions { margin-top: clamp(20px, 3vw, 28px); }

.rm-res-body { max-width: 720px; margin: clamp(40px, 6vw, 72px) auto 0 !important; color: var(--rm-text); }
.rm-res-body h2 { font-family: var(--rm-serif); font-weight: 500; font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.2rem); margin: 1.6em 0 0.5em; }
.rm-res-body h2:first-child { margin-top: 0; }
.rm-res-body p, .rm-res-body li { color: var(--rm-text); font-size: 1.05rem; line-height: 1.7; }
.rm-res-body ul { padding-left: 1.2em; }
.rm-res-body li { margin: 0.45em 0; }
.rm-res-more .rm-h2 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); margin-bottom: clamp(24px, 4vw, 40px); }

@media (max-width: 860px) {
  .rm-res-hero { grid-template-columns: minmax(0, 1fr); }
  .rm-res-cover { position: static; max-width: 560px; }
}

/* ---------- 22. Resource buttons: "Download free" + "Support this work" ---------- */
.rm-actions { font-family: var(--rm-sans); color: var(--rm-text); }
.rm-actions-row { display: flex; gap: 12px; align-items: stretch; }          /* side by side on desktop */
.rm-act {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 54px;
  padding: 14px 22px; border-radius: 999px; border: 2px solid var(--rm-btn); text-align: center;
  font-size: 1.05rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.rm-act--primary { background: var(--rm-btn); color: var(--rm-btn-text); }   /* filled */
.rm-act--ghost { background: transparent; color: var(--rm-text); }           /* outlined */
.rm-act--primary:hover { opacity: 0.9; }
.rm-act--ghost:hover { background: var(--rm-btn); color: var(--rm-btn-text); }
.rm-act:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 3px; }
@media (max-width: 560px) {                                                  /* stacked on mobile */
  .rm-actions-row { flex-direction: column; }
}
.rm-actions-note { margin: 0 0 12px; color: var(--rm-muted); font-size: 0.95rem; }
.rm-pay-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; color: var(--rm-muted); font-size: 0.9rem; }
.rm-pay-points li { margin: 0; padding-left: 26px; position: relative; }
.rm-pay-points li::before {
  content: ""; position: absolute; left: 4px; top: 0.35em; width: 6px; height: 11px; border: solid var(--rm-accent); border-width: 0 2px 2px 0; transform: rotate(40deg);
}
.rm-pay-admin { margin: 16px 0 0; padding: 10px 12px; border: 1px dashed var(--rm-line); border-radius: 12px; color: var(--rm-muted); font-size: 0.82rem; }
.rm-pay-admin a { color: inherit; }

/* ---------- 22b. Support page ---------- */
.rm-support { content-visibility: visible; margin-block-start: 0 !important; }
.rm-support .rm-support-title {
  margin: 0 0 16px; text-align: center; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); line-height: 1; letter-spacing: -0.02em;
}
.rm-support .wp-block-post-content { max-width: 960px; margin: 0 auto; text-align: left; }
.rm-support .rm-support-lead { margin: 0 auto clamp(28px, 5vw, 48px); max-width: 32em; text-align: center; color: var(--rm-muted); font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem); }
.rm-support .rm-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.rm-support .rm-support-card {
  margin: 0; box-sizing: border-box; background: var(--rm-card); border: 1px solid var(--rm-line); border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
}
.rm-support .rm-support-card h2 { margin: 0 0 12px; font-family: var(--rm-serif); font-weight: 500; font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); color: var(--rm-text); }
.rm-support .rm-support-card p, .rm-support .rm-support-card li { color: var(--rm-text); font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.rm-support .rm-support-card ul { margin: 12px 0 0; padding-left: 1.2em; }
.rm-support .rm-support-qr {
  display: grid; place-items: center; min-height: 200px; margin: 16px 0; padding: 16px; text-align: center;
  border: 2px dashed var(--rm-line); border-radius: 16px; color: var(--rm-muted) !important;
}
.rm-support .rm-support-card img { display: block; width: 100%; max-width: 280px; height: auto; margin: 16px auto; border-radius: 16px; }
.rm-support .rm-support-receipt { margin: clamp(24px, 4vw, 40px) auto 0; max-width: 36em; text-align: center; color: var(--rm-muted); }
@media (max-width: 760px) { .rm-support .rm-support-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 23. Search results page ---------- */
.rm-search-results .rm-search-title {
  margin: 0 0 20px; font-family: var(--rm-serif); font-weight: 500; color: var(--rm-text);
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.rm-search-results .rm-search-inline { max-width: 560px; margin: 0 auto clamp(28px, 5vw, 48px); }
.rm-search-results .rm-search-excerpt { margin: 6px 0 0; color: var(--rm-muted); font-size: 0.95rem; line-height: 1.5; }
.rm-search-results .rm-search-excerpt p { margin: 0; }

/* Search results: show resource covers uncropped (4:3) */
.rm-search-results .rm-letter .wp-block-post-featured-image img { aspect-ratio: 4 / 3 !important; }
