:root{
  --mdm-red: #b3191f;
  --mdm-red-hover: #9f141a;

  --mdm-gray-900: #121417;
  --mdm-gray-800: #1b1f24;
  --mdm-gray-700: #2a3138;
  --mdm-gray-600: #4b5563;
  --mdm-gray-500: #6b7280;

  --mdm-gray-200: #e5e7eb;
  --mdm-gray-150: #eef0f3;
  --mdm-gray-100: #f6f7f9;

  --mdm-white: #ffffff;

  --mdm-radius: 18px;
  --mdm-shadow: 0 8px 24px rgba(18, 20, 23, .08);
  --mdm-shadow-soft: 0 4px 14px rgba(18, 20, 23, .06);
}

body.mdm-body{
  color: var(--mdm-gray-900);
  background: var(--mdm-gray-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ text-decoration: none; }
a:hover{ text-decoration: none; }

/* =========================================
   HEADER
========================================= */
.mdm-header{
  background: var(--mdm-white);
  border-bottom: 1px solid var(--mdm-gray-200);
  position: relative;
  top: auto;
  z-index: auto;
}

.mdm-brand-link{
  display:flex;
  align-items:center;
  gap:.5rem;
  color: var(--mdm-gray-900);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.15rem;
}

.mdm-brand-mark{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mdm-red);
  display:inline-block;
}

.mdm-nav-list{
  display:flex;
  align-items:center;
  gap: 1rem;
  list-style:none;
  margin:0;
  padding:0;
}

.mdm-nav-list a{
  color: var(--mdm-gray-700);
  font-weight: 600;
  padding:.4rem .5rem;
  border-radius: 10px;
}

.mdm-nav-list a:hover{
  background: var(--mdm-gray-150);
  color: var(--mdm-gray-900);
}

.mdm-nav-list .current-menu-item > a,
.mdm-nav-list .current_page_item > a{
  color: var(--mdm-red);
  background: rgba(179, 25, 31, .06);
}

/* =========================================
   LAYOUT / BLOCKS / TYPO
========================================= */
.mdm-main{ padding-bottom: 2rem; }

.mdm-block{
  border-radius: var(--mdm-radius);
  background: var(--mdm-white);
  box-shadow: var(--mdm-shadow-soft);
  border: 1px solid var(--mdm-gray-150);
}

.mdm-block-inner{ padding: 1.1rem; }

.mdm-section-title{
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin:0;
}

.mdm-page-title{
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin:0 0 .75rem 0;
}

.mdm-muted{ color: var(--mdm-gray-600); font-size: .92rem; }
.mdm-link{ color: var(--mdm-red); font-weight: 700; }
.mdm-link:hover{ color: var(--mdm-red-hover); }

/* =========================================
   BUTTONS
========================================= */
.mdm-btn{
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  padding: .7rem .9rem;
}

.mdm-btn-primary{
  background: var(--mdm-red);
  color: var(--mdm-white);
  border: 1px solid var(--mdm-red);
}

.mdm-btn-primary:hover{
  background: var(--mdm-red-hover);
  border-color: var(--mdm-red-hover);
  color: var(--mdm-white);
}

.mdm-btn-secondary{
  background: var(--mdm-white);
  color: var(--mdm-gray-900);
  border: 1px solid var(--mdm-gray-200);
}

.mdm-btn-secondary:hover{ background: var(--mdm-gray-150); }

.mdm-btn-primary-outline{
  background: transparent;
  color: var(--mdm-red);
  border: 1px solid rgba(179, 25, 31, .25);
}

.mdm-btn-primary-outline:hover{
  background: rgba(179, 25, 31, .06);
  color: var(--mdm-red-hover);
  border-color: rgba(179, 25, 31, .35);
}

/* =========================================
   FOOTER
========================================= */
.mdm-footer{
  background: var(--mdm-white);
  border-top: 1px solid var(--mdm-gray-200);
}

.mdm-footer-brand{ font-weight: 950; letter-spacing: -.02em; }
.mdm-footer-meta{ color: var(--mdm-gray-600); font-size: .92rem; }

.mdm-footer-nav-list{
  display:flex;
  gap: 1rem;
  list-style:none;
  padding:0;
  margin:0;
}

.mdm-footer-nav-list a{ color: var(--mdm-gray-700); font-weight: 700; }
.mdm-footer-nav-list a:hover{ color: var(--mdm-red); }

/* =========================================
   WORDPRESS CONTENT SPACING
========================================= */
.mdm-single-content > * { margin-bottom: 1rem; }
.mdm-single-content h2, .mdm-single-content h3 { margin-top: 1.3rem; }

/* mobile toggle button */
.mdm-nav-toggle{
  border: 1px solid rgba(18,20,23,.14);
  background: rgba(255,255,255,.85);
  border-radius: 12px;
  padding: .5rem .7rem;
  line-height: 1;
}

/* collapsed panel styling */
.mdm-mobile-nav-inner{
  padding: .75rem 0 1rem 0;
  border-top: 1px solid rgba(18,20,23,.10);
}

.mdm-mobile-nav-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .25rem;
}

.mdm-mobile-search{
  margin-top: .75rem;
}

.mdm-mobile-nav-list a{
  color: var(--mdm-gray-700);
  font-weight: 600;
  display: block;
  padding: .7rem .85rem;
  border-radius: 12px;
  text-decoration: none;
}

.mdm-mobile-nav-list a:hover{
  background: var(--mdm-gray-150);
  color: var(--mdm-gray-900);
}

.mdm-mobile-nav-list .current-menu-item > a,
.mdm-mobile-nav-list .current_page_item > a{
  color: var(--mdm-red);
  background: rgba(179, 25, 31, .06);
}

/* =========================================
   SIDEBAR (sitewide)
========================================= */
.mdm-sidebar .mdm-block{
  position: static;  /* keep cards static; no sticky stacking */
  top: auto;
}

.mdm-sidebar .mdm-sidebar-block{ margin-bottom: 1rem; }

/* =========================================
   HIDE SIDEBAR ON SMARTPHONES
========================================= */
@media (max-width: 991.98px){
  .mdm-sidebar{ display: none !important; }
}

/* =========================================
   SINGLE POST / PAGE (Publication styling)
   Option B scope: .mdm-content-main
========================================= */

.mdm-content-main .mdm-single-article{
  background: var(--mdm-white);
  border: 1px solid var(--mdm-gray-150);
  border-radius: var(--mdm-radius);
  box-shadow: var(--mdm-shadow-soft);
  overflow: hidden;
}

/* generous interior rhythm like a publication */
.mdm-content-main .mdm-single-head{
  padding: 1.35rem 1.35rem 1rem 1.35rem;
  border-bottom: 1px solid rgba(18,20,23,.08);
}

.mdm-single-kicker{
  margin-bottom: .55rem;
}

.mdm-single-kicker-link{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .6rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: .85rem;
  color: var(--mdm-red);
  background: rgba(179, 25, 31, .06);
  border: 1px solid rgba(179, 25, 31, .12);
}

.mdm-single-kicker-link:hover{
  background: rgba(179, 25, 31, .09);
  color: var(--mdm-red-hover);
  border-color: rgba(179, 25, 31, .18);
}

.mdm-content-main .mdm-single-title{
  margin: 0 0 .65rem 0;
  font-weight: 950;
  letter-spacing: -.035em;
  line-height: 1.03;
  font-size: clamp(2.05rem, 3.2vw, 3.1rem);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.mdm-content-main .mdm-single-dek{
  margin: 0 0 .9rem 0;
  color: rgba(18,20,23,.72);
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.35;
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  max-width: 72ch;
}

.mdm-content-main .mdm-single-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.1rem;
  align-items: baseline;
  color: rgba(18,20,23,.64);
  font-size: .95rem;
}

.mdm-content-main .mdm-single-byline{
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
}

.mdm-content-main .mdm-single-byline-label{
  font-weight: 650;
  opacity: .9;
}

.mdm-content-main .mdm-single-author{
  font-weight: 850;
  letter-spacing: -.01em;
  color: rgba(18,20,23,.84);
}

.mdm-content-main .mdm-single-author:hover{
  color: var(--mdm-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mdm-content-main .mdm-single-datestamp{
  font-weight: 650;
}

/* Featured image */
.mdm-content-main .mdm-single-figure{
  margin: 0;
  border-bottom: 1px solid rgba(18,20,23,.08);
  background: var(--mdm-gray-100);
}

.mdm-content-main .mdm-single-featured-img{
  width: 100%;
  height: auto;
  display: block;
}

.mdm-content-main .mdm-single-caption{
  padding: .65rem 1.35rem .9rem 1.35rem;
  color: rgba(18,20,23,.62);
  font-size: .92rem;
  line-height: 1.35;
}

/* Body wrapper */
.mdm-content-main .mdm-single-body{
  padding: 1.15rem 1.35rem 1.2rem 1.35rem;
}

/* “Publication” prose: readable measure, softer contrast, elegant rhythm */
.mdm-content-main .mdm-prose{
  /* editorial serif body + your sans UI elsewhere */
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.08rem;
  line-height: 1.78;
  color: rgba(18,20,23,.92);
}

.mdm-content-main .mdm-prose > *{
  max-width: 72ch;          /* NYT-ish measure */
}

.mdm-content-main .mdm-prose > * + *{
  margin-top: 1.05rem;
}

/* Headings inside post/page */
.mdm-content-main .mdm-prose h2,
.mdm-content-main .mdm-prose h3,
.mdm-content-main .mdm-prose h4{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  letter-spacing: -.02em;
  color: rgba(18,20,23,.96);
}

.mdm-content-main .mdm-prose h2{
  font-weight: 950;
  font-size: 1.65rem;
  line-height: 1.15;
  margin-top: 1.7rem;
}

.mdm-content-main .mdm-prose h3{
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1.18;
  margin-top: 1.4rem;
}

.mdm-content-main .mdm-prose h4{
  font-weight: 850;
  font-size: 1.12rem;
  line-height: 1.25;
  margin-top: 1.2rem;
}

/* Links: understated, publication-style underline */
.mdm-content-main .mdm-prose a{
  color: rgba(18,20,23,.92);
  text-decoration: underline;
  text-decoration-color: rgba(179, 25, 31, .35);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.mdm-content-main .mdm-prose a:hover{
  color: rgba(18,20,23,.98);
  text-decoration-color: rgba(179, 25, 31, .7);
}

/* Lists */
.mdm-content-main .mdm-prose ul,
.mdm-content-main .mdm-prose ol{
  padding-left: 1.25rem;
}

.mdm-content-main .mdm-prose li{
  margin: .35rem 0;
}

/* Inline code / code blocks */
.mdm-content-main .mdm-prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95em;
  background: rgba(18,20,23,.06);
  border: 1px solid rgba(18,20,23,.10);
  padding: .12rem .35rem;
  border-radius: 10px;
}

.mdm-content-main .mdm-prose pre{
  max-width: 100%;
  overflow: auto;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: rgba(18,20,23,.06);
  border: 1px solid rgba(18,20,23,.10);
}

.mdm-content-main .mdm-prose pre code{
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

/* Images in post/page body */
.mdm-content-main .mdm-prose img{
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(18,20,23,.10);
  border: 1px solid rgba(18,20,23,.08);
}

.mdm-content-main .mdm-prose figure{
  margin: 1.35rem 0;
}

.mdm-content-main .mdm-prose figcaption{
  margin-top: .55rem;
  color: rgba(18,20,23,.62);
  font-size: .94rem;
  line-height: 1.35;
}

/* HR */
.mdm-content-main .mdm-prose hr{
  border: 0;
  height: 1px;
  background: rgba(18,20,23,.12);
  margin: 1.6rem 0;
}

/* =========================================
   BLOCKQUOTE (Sharp, professional)
========================================= */
.mdm-content-main .mdm-prose blockquote,
.mdm-content-main .mdm-prose .wp-block-quote{
  position: relative;
  margin: 1.4rem 0;
  padding: 1.05rem 1.15rem 1.05rem 1.2rem;

  border-left: 4px solid rgba(179, 25, 31, .75);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(179,25,31,.07), rgba(18,20,23,.02));

  box-shadow: 0 18px 44px rgba(18,20,23,.06);
  border: 1px solid rgba(18,20,23,.08);
}

.mdm-content-main .mdm-prose blockquote::before,
.mdm-content-main .mdm-prose .wp-block-quote::before{
  content: "“";
  position: absolute;
  top: -14px;
  left: 10px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-weight: 900;
  font-size: 3.2rem;
  line-height: 1;
  color: rgba(179,25,31,.35);
  pointer-events: none;
}

.mdm-content-main .mdm-prose blockquote p,
.mdm-content-main .mdm-prose .wp-block-quote p{
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.7;
  color: rgba(18,20,23,.92);
}

.mdm-content-main .mdm-prose blockquote p + p,
.mdm-content-main .mdm-prose .wp-block-quote p + p{
  margin-top: .85rem;
}

.mdm-content-main .mdm-prose blockquote cite,
.mdm-content-main .mdm-prose .wp-block-quote cite{
  display: inline-block;
  margin-top: .8rem;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-style: normal;
  font-weight: 800;
  font-size: .92rem;
  color: rgba(18,20,23,.68);
}

.mdm-content-main .mdm-prose blockquote cite::before,
.mdm-content-main .mdm-prose .wp-block-quote cite::before{
  content: "— ";
  opacity: .8;
}

/* =========================================
   FOOT (tags)
========================================= */
.mdm-content-main .mdm-single-foot{
  padding: 0 1.35rem 1.25rem 1.35rem;
}

.mdm-content-main .mdm-single-tags{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .95rem;
  border-top: 1px solid rgba(18,20,23,.08);
}

.mdm-content-main .mdm-single-tag{
  display: inline-flex;
  align-items: center;
  padding: .3rem .65rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: .88rem;
  color: rgba(18,20,23,.78);
  background: var(--mdm-gray-100);
  border: 1px solid var(--mdm-gray-150);
}

.mdm-content-main .mdm-single-tag:hover{
  color: var(--mdm-red);
  border-color: rgba(179,25,31,.22);
  background: rgba(179,25,31,.06);
}

/* Pages nav (if paginated posts/pages) */
.mdm-content-main .mdm-single-pages{
  margin-top: 1.25rem;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: rgba(18,20,23,.70);
  font-weight: 700;
}

.mdm-content-main .mdm-single-pages a{
  text-decoration: none;
  color: var(--mdm-red);
  font-weight: 850;
}

.mdm-content-main .mdm-single-pages a:hover{
  color: var(--mdm-red-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 991.98px){
  .mdm-content-main .mdm-single-head{
    padding: 1.15rem 1.05rem .95rem 1.05rem;
  }

  .mdm-content-main .mdm-single-body{
    padding: 1.05rem 1.05rem 1.1rem 1.05rem;
  }

  .mdm-content-main .mdm-single-foot{
    padding: 0 1.05rem 1.1rem 1.05rem;
  }

  .mdm-content-main .mdm-prose{
    font-size: 1.05rem;
  }
}

/* =========================================
   SINGLE POST: COMMENTS CARD
========================================= */

#mdmSingleComments{
  margin-top: 1.25rem; /* space below article */
}

/* Make the inner match article padding/measure */
#mdmSingleComments .mdm-single-comments-inner{
  padding: 1.15rem 1.35rem; /* matches your single article body padding */
}

/* Optional: cap the readable width inside the comments card */
#mdmSingleComments .mdm-single-comments-inner > *{
  max-width: 72ch;
}

#mdmSingleComments .mdm-block-inner > *:first-child{
  margin-top: 0 !important;
}

/* add margin to the inner blocks */
.inner-block-margin-top { margin-top: .25rem !important; }

/* ============================================================
   MDM / MemberPress Paywall (copy/paste)
   Goals:
   - Match hero block (bg #f6f1e9)
   - Separate snippet from explainer text
   - Put the lock INSIDE the snippet block
   - Keep “subscribers” / “log in” as link-style pills (not buttons)
   - Clean, tight login form (no weird artifacts)
============================================================ */

/* ---------- Theme vars ---------- */
:root{
  --mdm-hero-bg: #f6f1e9;
  --mdm-card-bg: #ffffff;
  --mdm-ink: #1b1b1b;
  --mdm-muted: #6b6b6b;
  --mdm-border: rgba(0,0,0,.10);
  --mdm-shadow: 0 18px 40px rgba(0,0,0,.10);
  --mdm-red: #b5161a;
  --mdm-red-ink: #9f1216;
  --mdm-red-tint: rgba(181,22,26,.10);
}

/* ---------- Outer wrapper (the whole paywall module) ---------- */
/* MemberPress varies markup; these selectors are intentionally broad. */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall, .mepr-login-form-wrap),
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall, .mepr-login-form-wrap) *{
  box-sizing: border-box;
}

.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall){
  background: var(--mdm-hero-bg);
  border: 1px solid var(--mdm-border);
  border-top: 3px solid var(--mdm-red);
  border-radius: 18px;
  box-shadow: var(--mdm-shadow);
  padding: 22px;
  margin: 22px 0 28px;
}

/* Kill any earlier “lock in explainer” pseudo-elements */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall) :is(.mdm-paywall-explainer, .mepr-unauthorized-message__text)::after,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall) :is(.mdm-paywall-explainer, .mepr-unauthorized-message__text)::before{
  content: none !important;
  display: none !important;
}

/* ---------- Snippet (post excerpt) ---------- */
/* Try a few common containers: excerpt, blockquote, first “content-ish” block */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall) :is(
  .mdm-paywall-snippet,
  .mepr-unauthorized-message__excerpt,
  .mepr-unauthorized-excerpt,
  blockquote
){
  position: relative;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  padding: 18px 44px 18px 18px; /* space for lock */
  margin: 0 0 16px 0;
  color: var(--mdm-muted);
  line-height: 1.55;
}

/* Make it read like an excerpt/blockquote */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall) :is(
  .mdm-paywall-snippet,
  .mepr-unauthorized-message__excerpt,
  .mepr-unauthorized-excerpt,
  blockquote
)::before{
  content: "“";
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 44px;
  line-height: 1;
  color: rgba(0,0,0,.18);
  pointer-events: none;
}

/* LOCK ICON IN THE SNIPPET (top-right) */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall) :is(
  .mdm-paywall-snippet,
  .mepr-unauthorized-message__excerpt,
  .mepr-unauthorized-excerpt,
  blockquote
)::after{
  content: "🔒";
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 16px;
  opacity: .55;
  filter: grayscale(100%);
  pointer-events: none;
}

/* If your snippet is NOT a blockquote but a div, ensure nested <p> doesn’t add huge margins */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  :is(.mdm-paywall-snippet, .mepr-unauthorized-message__excerpt, .mepr-unauthorized-excerpt) p{
  margin: 0;
}

/* ---------- Explainer text (availability + subscribe/login links) ---------- */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  :is(.mdm-paywall-explainer, .mepr-unauthorized-message__text, .mepr-unauthorized-message__content, .mepr-unauthorized-message__message){
  margin: 8px 0 14px;
  color: rgba(0,0,0,.72);
  line-height: 1.55;
  font-size: 16px;
}

/* “subscribers” / “log in” -> link-pills (not buttony blocks) */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  a{
  color: var(--mdm-red-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  a:is(.mdm-pill, .mepr-pill, .mepr-login-link, .mepr-subscribe-link),
/* also catch “highlighted” links inside that sentence */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  :is(.mdm-paywall-explainer, .mepr-unauthorized-message__text, .mepr-unauthorized-message__content) a{
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--mdm-red-tint);
  border: 1px solid rgba(181,22,26,.25);
  text-decoration: none;
  font-weight: 650;
}

/* ---------- Login form (tight + clean) ---------- */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.10);
}

/* Tighten spacing */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(p, .mp-form-row, .mepr-form-row, .mepr_form_row){
  margin: 0 0 12px 0 !important;
}

/* Labels */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form label{
  display: block;
  font-weight: 700;
  color: rgba(0,0,0,.75);
  margin: 0 0 6px 0;
}

/* Inputs */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="text"],
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="email"],
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="password"]{
  width: 100%;
  max-width: 720px;
  height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.90);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="text"]:focus,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="email"]:focus,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="password"]:focus{
  border-color: rgba(181,22,26,.55);
  box-shadow: 0 0 0 4px rgba(181,22,26,.10);
  background: #fff;
}

/* Remember me row */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(.rememberme, .mepr-remember-me, .mepr_remember_me, .mp-remember-me){
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px !important;
}

.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="checkbox"]{
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Primary submit button */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="submit"],
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form button[type="submit"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(181,22,26,.35);
  background: var(--mdm-red);
  color: #fff;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(181,22,26,.18);
}

.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="submit"]:hover,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form button[type="submit"]:hover{
  filter: brightness(.98);
  transform: translateY(-1px);
}

/* “Forgot password” link */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  :is(.forgot-password, .mepr-forgot-password, .mepr_forgot_password, .mp-forgot-password){
  margin-top: 10px;
}

/* ---------- Remove weird “artifact square” safely ----------
   This typically comes from empty elements (e.g., <span class="mp-hide-pw">)
   DO NOT hide wrappers; hide only empty leaf nodes that are rendered as boxes. */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(span,i,svg,a,button)[class*="hide"][aria-hidden="true"],
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(span,i,svg)[class*="pw"],
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(span,i,svg,a,button).mp-hide-pw,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(span,i,svg,a,button).mepr-hide-pw,
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form :is(span,i,svg,a,button).wp-hide-pw{
  display: none !important;
}

/* Ensure password input never gets hidden */
.mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall)
  form input[type="password"]{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px){
  .mdm-single-body.mdm-prose .mp_wrapper :is(.mepr-unauthorized-message, .mepr-protected, .mepr-paywall){
    padding: 16px;
    border-radius: 16px;
  }

  .mdm-single-body.mdm-prose .mp_wrapper :is(
    .mepr-unauthorized-message, .mepr-protected, .mepr-paywall
  ) :is(.mdm-paywall-snippet, .mepr-unauthorized-message__excerpt, .mepr-unauthorized-excerpt, blockquote){
    padding-right: 38px;
  }
}

.mdm-single-body.mdm-prose .mp_wrapper form :is(button,a,span,svg,i)[class*="hide-pw"],
.mdm-single-body.mdm-prose .mp_wrapper form :is(button,a,span,svg,i).mp-hide-pw,
.mdm-single-body.mdm-prose .mp_wrapper form :is(button,a,span,svg,i).mepr-hide-pw,
.mdm-single-body.mdm-prose .mp_wrapper form :is(button,a,span,svg,i).wp-hide-pw{
  display: none !important;
}

/* Safety: never hide the actual password input */
.mdm-single-body.mdm-prose .mp_wrapper form input[type="password"]{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* =========================================
   MemberPress paywall login form (actual markup)
   Targets:
   .mepr-login-form-wrap .mp_login_form #mepr_loginform
========================================= */

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap{
  margin-top: 1rem;
}

/* Optional: give the form its own subtle card feel without changing layout much */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap .mp_login_form{
  background: var(--mdm-white);
  border: 1px solid var(--mdm-gray-150);
  border-radius: 16px;
  padding: 1rem 1rem .9rem 1rem;
  box-shadow: var(--mdm-shadow-soft);
}

/* Form rows */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-form-row{
  margin: 0 0 .95rem 0 !important; /* MemberPress sometimes uses inline/odd spacing */
}

/* Label wrapper */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-form-label{
  margin-bottom: .4rem;
}

/* Labels */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform label{
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-weight: 800;
  letter-spacing: -.01em;
  color: rgba(18,20,23,.78);
  margin: 0;
}

/* Inputs (MemberPress uses unclassed inputs) */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input[type="text"],
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input[type="password"]{
  width: 100%;
  max-width: 860px;
  height: 46px;
  padding: .65rem .85rem;
  border-radius: 14px;
  border: 1px solid var(--mdm-gray-200) !important;
  background: var(--mdm-white) !important;
  box-shadow: 0 1px 0 rgba(18,20,23,.02);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Focus ring */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input[type="text"]:focus,
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input[type="password"]:focus{
  outline: none;
  border-color: rgba(179,25,31,.45) !important;
  box-shadow: 0 0 0 4px rgba(179,25,31,.08) !important;
}

/* Password row: align the show/hide button nicely */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-hide-pw{
  display: flex;
  align-items: center;
  gap: .5rem;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-hide-pw input[type="password"]{
  flex: 1 1 auto;
}

/* Show password button (MemberPress uses .button.mp-hide-pw.hide-if-no-js) */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-hide-pw button.mp-hide-pw{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--mdm-gray-200) !important;
  background: var(--mdm-gray-100) !important;
  color: rgba(18,20,23,.70) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .mp-hide-pw button.mp-hide-pw:hover{
  background: var(--mdm-gray-150) !important;
}

/* Remember me row (your markup is a plain <div><label><input ...> Remember Me</label></div>) */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform > div:has(#rememberme){
  margin: .15rem 0 1rem 0;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform #rememberme{
  width: 16px;
  height: 16px;
  margin-right: .45rem;
  accent-color: var(--mdm-red);
}

/* Kill spacer blocks without breaking layout */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap .mp-spacer{
  display: none !important;
}

/* Submit button (your input has classes: button-primary mepr-share-button) */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform .submit{
  margin-top: .25rem;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input#wp-submit{
  height: 46px;
  padding: 0 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--mdm-red) !important;
  background: var(--mdm-red) !important;
  color: var(--mdm-white) !important;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-weight: 900;
  letter-spacing: -.01em;
  box-shadow: var(--mdm-shadow-soft);
  cursor: pointer;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input#wp-submit:hover{
  background: var(--mdm-red-hover) !important;
  border-color: var(--mdm-red-hover) !important;
}

/* Forgot password */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-actions{
  margin-top: .75rem;
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-actions a{
  color: var(--mdm-red);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(179,25,31,.35);
}

.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-actions a:hover{
  color: var(--mdm-red-hover);
  text-decoration-color: rgba(179,25,31,.70);
}

/* Safety: never hide the actual password input */
.mdm-content-main .mdm-single-body.mdm-prose .mp_wrapper .mepr-login-form-wrap #mepr_loginform input[type="password"]{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* =========================================
   PAGES ONLY: center images
   (do not affect single posts)
========================================= */

/* Center Gutenberg image blocks on pages */
body.page .mdm-content-main .mdm-single-body.mdm-prose figure.wp-block-image{
  /* keep it in your 72ch content measure, but center its contents */
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Make sure the image (and linked image) can actually center */
body.page .mdm-content-main .mdm-single-body.mdm-prose figure.wp-block-image > a,
body.page .mdm-content-main .mdm-single-body.mdm-prose figure.wp-block-image img{
  display: inline-block;
}

/* If a caption exists, keep it centered too */
body.page .mdm-content-main .mdm-single-body.mdm-prose figure.wp-block-image figcaption{
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   HEADER LOGO IMAGE
========================================= */

.mdm-header-logo{
  width: 64px !important;
  height: 64px !important;

  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;

  display: block;
  border-radius: 2px;
}

/* Align logo + text cleanly */
.mdm-brand-link{
  display: flex;
  align-items: center;
  gap: .55rem;
}

/* Site name styling */
.mdm-brand-text{
  font-weight: 850;
  letter-spacing: -.02em;
  font-size: 1.15rem;
  color: var(--mdm-gray-900);
}

/* DARKPOOL RANK DELTAS */

#rrank_carousel span.rank_increase,
#rrank_list span.rank_increase {
    color: #2E8B57;
    font-weight: bold;
}

#rrank_carousel span.rank_decrease,
#rrank_list span.rank_decrease {
    color: #B22222;
    font-weight: bold;
}

/* Darkpool plugin CSS colors arrow icons by direction only.
   Override with rank-aware colors so increase=green, decrease=red. */
#rrank_list span.rank_increase i.fa-arrow-up,
#rrank_list span.rank_increase i.fa-caret-up,
#rrank_list span.rank_increase i.fa-sort-up,
#rrank_list span.rank_increase i.fa-angle-up,
#rrank_list span.rank_increase i.fa-arrow-down,
#rrank_list span.rank_increase i.fa-caret-down,
#rrank_list span.rank_increase i.fa-sort-down,
#rrank_list span.rank_increase i.fa-angle-down {
    color: #2E8B57 !important;
}

#rrank_list span.rank_decrease i.fa-arrow-up,
#rrank_list span.rank_decrease i.fa-caret-up,
#rrank_list span.rank_decrease i.fa-sort-up,
#rrank_list span.rank_decrease i.fa-angle-up,
#rrank_list span.rank_decrease i.fa-arrow-down,
#rrank_list span.rank_decrease i.fa-caret-down,
#rrank_list span.rank_decrease i.fa-sort-down,
#rrank_list span.rank_decrease i.fa-angle-down {
    color: #B22222 !important;
}

/* =========================================
   DARKPOOL RRank Legacy Layout Fixes
========================================= */

#rrank_list .memo.rrank_memo .row{
  margin-left: 0;
  margin-right: 0;
}

#rrank_list .memo.rrank_memo .row > [class*="col-"]{
  min-width: 0;
}

#rrank_list .memo.rrank_memo .title,
#rrank_list .memo.rrank_memo .developer-name-label,
#rrank_list .memo.rrank_memo .rrank_meta{
  overflow-wrap: anywhere;
}

#rrank_list div[id^="sparkline_"]{
  overflow: visible;
  box-sizing: border-box;
}

#rrank_list div[id^="sparkline_"].row{
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

#rrank_list div[id^="sparkline_"] .sparkline,
#rrank_list div[id^="sparkline_"] .mdm-sparkline-image{
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (max-width: 575.98px){
  #rrank_list .memo.rrank_memo > .row:first-child,
  #rrank_list .memo.rrank_memo > .row:nth-child(2){
    display: grid;
    grid-template-columns: 2rem 56px minmax(0, 1fr);
    column-gap: .55rem;
    align-items: start;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  #rrank_list .memo.rrank_memo > .row:first-child > .col-1,
  #rrank_list .memo.rrank_memo > .row:first-child > .col-3,
  #rrank_list .memo.rrank_memo > .row:first-child > .col-7,
  #rrank_list .memo.rrank_memo > .row:first-child > .col-md-8,
  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-1,
  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-3,
  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-6,
  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-md-8{
    max-width: none;
    width: auto;
    flex: none;
    padding-left: 0;
    padding-right: 0;
  }

  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-6 > .row{
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .45rem;
  }

  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-6 > .row > [class*="col-"]{
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    padding-left: 0;
    padding-right: 0;
  }

  #rrank_list .memo.rrank_memo .app-name-label{
    margin-bottom: .15rem;
    line-height: 1.08;
  }

  #rrank_list .memo.rrank_memo .click_to_show_chart{
    display: block;
    width: 100%;
    text-align: left;
    padding-left: calc(2rem + 56px + .55rem);
  }

  #rrank_list .memo.rrank_memo .click_to_show_chart p{
    margin-bottom: 0;
  }

  #rrank_list div[id^="sparkline_"]{
    padding-left: calc(8px + 2rem + 56px + .55rem) !important;
    padding-right: 8px !important;
  }

  #rrank_list .seven_day_rank_delta,
  #rrank_list .thirty_day_rank_delta{
    display: none !important;
  }

  #rrank_list .memo.rrank_memo > .row:nth-child(2) > .col-6 > .row{
    display: block;
  }
}

/* =========================================
   RRank Chart Lightbox
========================================= */

body.mdm-lightbox-open{
  overflow: hidden;
}

.mdm-lightbox{
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.mdm-lightbox[hidden]{
  display: none !important;
}

.mdm-lightbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 23, .64);
  backdrop-filter: blur(2px);
}

.mdm-lightbox-panel{
  position: relative;
  z-index: 1;
  width: min(1200px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--mdm-radius);
  background: var(--mdm-hero-bg, #f6f1e9);
  border: 1px solid var(--mdm-gray-150);
  border-top: 3px solid var(--mdm-red);
  box-shadow: var(--mdm-shadow);
  overflow: hidden;
}

.mdm-lightbox-head{
  display: flex;
  justify-content: flex-end;
  padding: .5rem .6rem 0  .6rem;
}

.mdm-lightbox-close{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--mdm-gray-200);
  background: var(--mdm-white);
  color: var(--mdm-gray-700);
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mdm-lightbox-close:hover{
  background: var(--mdm-gray-100);
  color: var(--mdm-gray-900);
}

.mdm-lightbox-body{
  padding: .35rem .9rem .8rem .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.mdm-lightbox-image{
  max-width: 100%;
  max-height: calc(92vh - 110px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--mdm-gray-150);
  box-shadow: var(--mdm-shadow-soft);
  background: var(--mdm-white);
}

.mdm-lightbox-foot{
  display: flex;
  justify-content: center;
  gap: .55rem;
  padding: 0 .9rem .95rem .9rem;
}

.mdm-rankings-sparkline img,
.mdm-sparkline-image{
  cursor: zoom-in;
}

@media (max-width: 575.98px){
  .mdm-lightbox{
    padding: .45rem;
  }

  .mdm-lightbox-panel{
    width: 100%;
    max-height: calc(100vh - .9rem);
  }

  .mdm-lightbox-body{
    padding: .2rem .45rem .55rem .45rem;
  }

  .mdm-lightbox-image{
    max-height: calc(100vh - 200px);
  }
}
