/*
Theme Name: VBMWMO Heritage
Theme URI: https://vintagebmw.org/
Author: Vintage BMW Motorcycle Owners, Inc.
Author URI: https://vintagebmw.org/
Description: Heritage-modern theme for the Vintage BMW Motorcycle Owners club. Cream paper, ink, BMW blue and brass; Playfair Display + Inter. Includes a marketing home page, member-gated article and library templates, and a Paid Memberships Pro bridge with safe fallbacks. Pairs with the "VBMWMO Club Content" companion plugin for the library, events, classifieds and magazine archives.
Version: 1.1.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vbmwmo
Tags: two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks

VBMWMO Heritage is distributed under the GPL v2 or later.
The BMW roundel and the "BMW Motorrad / Official Club" lockup are trademarks of
BMW AG and are used by the club under its chartered-club agreement. They are not
covered by this theme's licence — see WEBMASTER-GUIDE for details.
*/

/* ==========================================================================
   Vintage BMW Motorcycle Owners — Design System
   Heritage-modern: cream paper, ink, BMW blue, brass. Playfair Display + Inter.
   ========================================================================== */

:root {
  --ink: #191b1f;
  --ink-2: #262a31;
  --ink-3: #3a3f48;
  --paper: #f7f4ec;
  --paper-2: #fffdf7;
  --line: #e2dbc9;
  --line-dark: #3f434b;
  --blue: #0166B1;
  --blue-dark: #084e86;
  --blue-tint: #e8f1f9;
  --brass: #a8801f;
  --brass-light: #c9a24b;
  --brass-tint: #f6efdd;
  --muted: #676c74;
  --success: #2e7d43;
  --danger: #b23b2e;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 3px rgba(25, 27, 31, 0.08);
  --shadow-md: 0 6px 24px rgba(25, 27, 31, 0.12);
  --shadow-lg: 0 16px 48px rgba(25, 27, 31, 0.18);
  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.9rem;
}

.lead { font-size: 1.16rem; color: var(--ink-3); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
/* Button labels are short phrases; never let them wrap mid-label. Without this
   the header's "Log in" and "Join the club" break onto two lines. */
.btn { white-space: nowrap; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; box-shadow: var(--shadow-md); }

.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: #8f6c18; color: #fff; box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-outline-light:hover { background: #fff; color: var(--ink); }

.btn-sm { padding: 10px 18px; font-size: 0.88rem; }
.btn-lg { padding: 17px 34px; font-size: 1.08rem; }
.btn-block { display: block; width: 100%; }

/* --------------------------------------------------------------------------
   Header / Navigation
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--ink);
  color: #cfd3da;
  font-size: 0.82rem;
  padding: 7px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.topbar a { color: #e6e9ee; }
.topbar .social { display: flex; gap: 14px; align-items: center; }
.topbar .social a { opacity: 0.85; }
.topbar .social a:hover { opacity: 1; }
.topbar .social svg { width: 15px; height: 15px; display: block; fill: currentColor; }

.site-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .roundel { width: 46px; height: 46px; flex: none; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.13rem;
  line-height: 1.15;
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-2);
  padding: 9px 13px;
  border-radius: 8px;
}
.main-nav a:hover { background: var(--brass-tint); color: var(--ink); text-decoration: none; }
.main-nav a.active { color: var(--blue); }
.main-nav a[aria-current="page"] { color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.member-chip {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--blue-tint);
  color: var(--blue-dark);
  border: 1px solid #bcd7ec;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
}
body.is-member .member-chip { display: inline-flex; }
body.is-member .guest-only { display: none !important; }
body:not(.is-member) .member-only-ui { display: none !important; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  transition: 0.2s;
}

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    padding: 10px 18px 18px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 10px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .header-actions .btn { display: none; }
  .header-actions .btn.always { display: inline-block; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(10, 102, 176, 0.28), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(168, 128, 31, 0.22), transparent 60%),
    var(--ink);
  color: #eef0f4;
  padding: 84px 0 76px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.025) 0 2px,
    transparent 2px 14px
  );
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lead { color: #c8cdd6; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

.stat-band { border-top: 1px solid rgba(255,255,255,0.14); margin-top: 56px; padding-top: 30px; }
.stat-band .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-band .stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  color: var(--brass-light);
}
.stat-band .stat span { font-size: 0.88rem; color: #aab0ba; }
@media (max-width: 700px) { .stat-band .stats { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------------------------
   Sections, cards, grids
   -------------------------------------------------------------------------- */
.section { padding: 76px 0; }
.section-tight { padding: 48px 0; }
.section-dark { background: var(--ink); color: #dfe3e9; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-cream { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: 42px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h2,
.card h3,
.card h4 { font-size: 1.35rem; margin-top: 14px; }
.card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-tint);
  color: var(--blue);
}
.card .icon svg { width: 26px; height: 26px; }
.card-link { font-weight: 700; font-size: 0.93rem; }
.card-link::after { content: " →"; }

/* Article / content cards */
.post-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-cover {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ink-2), var(--ink));
  color: var(--brass-light);
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}
.post-cover.alt { background: linear-gradient(135deg, var(--blue-dark), var(--ink)); color: #cfe4f5; }
.post-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body h2,
.post-body h3,
.post-body h4 { font-size: 1.18rem; margin: 0; }
.post-meta { font-size: 0.82rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-free { background: #e3efe6; color: var(--success); }
.badge-member { background: var(--brass-tint); color: var(--brass); }
.badge-blue { background: var(--blue-tint); color: var(--blue-dark); }

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
@media (max-width: 980px) { .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; } }

.price-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.price-card.featured {
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}
.price-card .flag {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.price-card .tier-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.price-card .price { font-family: var(--serif); font-size: 2.8rem; font-weight: 700; margin: 10px 0 2px; }
.price-card .price small { font-family: var(--sans); font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 26px; flex: 1; }
.price-card li { padding: 8px 0 8px 30px; position: relative; font-size: 0.96rem; border-bottom: 1px dashed var(--line); }
.price-card li:last-child { border-bottom: 0; }
.price-card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center / contain no-repeat;
}
.price-card li.no::before { background: #c9c4b8; -webkit-mask: none; mask: none; border-radius: 2px; height: 2px; top: 20px; }

/* --------------------------------------------------------------------------
   Paywall / gates
   -------------------------------------------------------------------------- */
.gate { position: relative; }
.gate-content { position: relative; }
body:not(.is-member) .gate .gate-content {
  max-height: 260px;
  overflow: hidden;
}
body:not(.is-member) .gate .gate-content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, var(--paper) 92%);
}
body.is-member .lock-card { display: none; }

.lock-card {
  background: var(--paper-2);
  border: 2px solid var(--brass-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 38px 34px;
  max-width: 620px;
  margin: -30px auto 0;
  position: relative;
  z-index: 2;
  text-align: center;
}
.lock-card .lock-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brass-tint);
  color: var(--brass);
}
.lock-card .lock-icon svg { width: 26px; height: 26px; }
.lock-card h2,
.lock-card h3,
.lock-card h4 { font-size: 1.35rem; margin-bottom: 8px; }
.lock-card p { color: var(--ink-3); max-width: 44ch; margin-left: auto; margin-right: auto; }
.lock-card .lock-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.lock-card .fine { font-size: 0.82rem; color: var(--muted); margin: 14px 0 0; }

/* Blurred teaser rows (library) */
body:not(.is-member) .locked-row { filter: blur(4px); user-select: none; pointer-events: none; }

/* --------------------------------------------------------------------------
   Tables & lists (library, forums)
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 640px;
}
table.data th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}
table.data td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbf8f0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0;
  align-items: center;
}
.filter-bar select, .filter-bar input[type="search"], .filter-bar input[type="text"] {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  min-width: 160px;
}
.filter-bar input[type="search"] { flex: 1; min-width: 220px; }

/* Forum */
.forum-cat {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  transition: box-shadow 0.15s ease;
}
.forum-cat:hover { box-shadow: var(--shadow-md); }
.forum-cat .icon {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--blue-tint); color: var(--blue);
}
.forum-cat .icon svg { width: 22px; height: 22px; }
.forum-cat h2,
.forum-cat h3,
.forum-cat h4 { font-size: 1.12rem; margin: 0 0 4px; }
.forum-cat p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.forum-cat .counts { margin-left: auto; text-align: right; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.forum-cat .counts b { display: block; color: var(--ink); font-size: 1.05rem; }
@media (max-width: 640px) { .forum-cat .counts { display: none; } }

/* Events */
.event-row {
  display: flex;
  gap: 22px;
  padding: 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  align-items: flex-start;
}
.event-date {
  flex: none;
  width: 76px;
  text-align: center;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 12px 8px;
}
.event-date b { display: block; font-family: var(--serif); font-size: 1.6rem; line-height: 1; }
.event-date span { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-light); }
.event-row h2,
.event-row h3,
.event-row h4 { margin: 0 0 6px; font-size: 1.2rem; }
.event-row .where { font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   Article page
   -------------------------------------------------------------------------- */
.article-head { max-width: 780px; margin: 0 auto; padding: 60px 22px 30px; }
.article-body { max-width: 720px; margin: 0 auto; padding: 0 22px 60px; font-size: 1.08rem; }
/*
 * :where() keeps these prose sizes at zero specificity for the tag, so a
 * component nested inside the content area (.forum-cat, .post-body, .card)
 * still wins with its own heading size. Without it these rules tie with the
 * component rules on specificity and win purely by appearing later in the
 * file, which silently restyled every card heading inside a page.
 */
.article-body :where(h2) { font-size: 1.6rem; margin-top: 1.6em; }
.article-body :where(h3) { font-size: 1.25rem; margin-top: 1.4em; }
.article-body figure { margin: 2em 0; }
.article-body figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; padding-top: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--brass);
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-2);
}
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); }

/* --------------------------------------------------------------------------
   Banners / CTA strips
   -------------------------------------------------------------------------- */
.cta-strip {
  background: linear-gradient(120deg, var(--blue-dark), var(--blue));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 46px 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-lg);
}
.cta-strip h2 { color: #fff; margin: 0 0 6px; font-size: 1.7rem; }
.cta-strip p { margin: 0; color: #d7e6f3; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  background: var(--brass-tint);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.92rem;
  margin: 18px 0;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.97rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

/* --------------------------------------------------------------------------
   Modal (demo checkout)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 26, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  max-width: 470px;
  width: 100%;
  padding: 34px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal .modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal h2,
.modal h3,
.modal h4 { margin-bottom: 4px; }
.order-summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
  font-size: 0.95rem;
}
.order-summary .row { display: flex; justify-content: space-between; padding: 4px 0; }
.order-summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 1.05rem; }
.pay-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.demo-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* --------------------------------------------------------------------------
   Demo mode pill
   -------------------------------------------------------------------------- */
.demo-pill {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 90;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.8rem;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.demo-pill button {
  background: var(--brass);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.demo-pill button:hover { background: var(--brass-light); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #b9bec7;
  padding: 60px 0 30px;
  margin-top: 0;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-dark);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2,
.site-footer h3,
.site-footer h4 {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #b9bec7; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 0.82rem;
  color: #7e848e;
}
.footer-brand { margin-bottom: 10px; }

.footer-brand b { color: #fff; font-family: var(--serif); font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 28px; }
.mt-4 { margin-top: 44px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

.brand-mark{display:block;height:52px;width:auto;}
@media (max-width:920px){ .brand-mark{height:42px;} }

.footer-about{display:flex;gap:18px;align-items:flex-start;}
.footer-about-copy{flex:1 1 auto;min-width:0;}
.footer-official{padding:0;display:block;flex:0 0 auto;}
.footer-official .official-logo{height:112px;width:auto;display:block;}


/* ==========================================================================
   WORDPRESS INTEGRATION LAYER
   Everything below this line was added when the static prototype was turned
   into a WordPress theme. The design system above is unchanged — edit that
   section to restyle the site; edit this section to change how WordPress
   furniture (admin bar, comments, captions, PMPro forms) fits into it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Accessibility / WordPress core requirements
   -------------------------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--paper-2);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  clip: auto !important;
  clip-path: none;
  color: var(--blue-dark);
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 14px 22px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

/* The header is sticky; the WordPress admin bar must not cover it. */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* --------------------------------------------------------------------------
   Core content classes (captions, alignment, galleries)
   -------------------------------------------------------------------------- */
.alignleft {
  float: left;
  margin: 0.4em 1.6em 1em 0;
}
.alignright {
  float: right;
  margin: 0.4em 0 1em 1.6em;
}
.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignnone { margin: 1em 0; }

.wp-caption { max-width: 100%; margin-bottom: 1.5em; }
.wp-caption img { display: block; }
.wp-caption-text,
.gallery-caption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding-top: 8px;
}

.sticky .post-card { border-color: var(--brass-light); }
.bypostauthor > .comment-body .comment-author-name::after {
  content: " · author";
  color: var(--brass);
  font-weight: 700;
  font-size: 0.78rem;
}

/* Block editor width classes inside a constrained column */
.entry-content > .alignwide,
.article-body > .alignwide {
  margin-left: calc(50% - 46vw);
  margin-right: calc(50% - 46vw);
  max-width: 92vw;
  width: 92vw;
}
.entry-content > .alignfull,
.article-body > .alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: 100vw;
}
@media (max-width: 860px) {
  .entry-content > .alignwide,
  .article-body > .alignwide,
  .entry-content > .alignfull,
  .article-body > .alignfull {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Editor content: make ordinary WordPress output inherit the design system
   .entry-content is the WordPress twin of the prototype's .article-body
   -------------------------------------------------------------------------- */
.entry-content { font-size: 1.06rem; }
.entry-content :where(h2) { font-size: 1.6rem; margin-top: 1.6em; }
.entry-content :where(h3) { font-size: 1.25rem; margin-top: 1.4em; }
.entry-content ul,
.entry-content ol,
.article-body ul,
.article-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li,
.article-body li { margin-bottom: 0.45em; }
.entry-content blockquote,
.article-body blockquote {
  border-left: 3px solid var(--brass);
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-2);
}
.entry-content img,
.article-body img { border-radius: var(--radius); }
.entry-content table,
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.6em 0;
}
.entry-content th,
.article-body th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}
.entry-content td,
.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.entry-content pre,
.article-body pre {
  background: var(--ink);
  color: #e6e9ee;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
}
.entry-content code,
.article-body code {
  background: var(--brass-tint);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.entry-content pre code,
.article-body pre code { background: none; padding: 0; }

/* Standard page shell for ordinary WordPress pages */
.page-shell { padding: 56px 0 76px; }
.page-shell .entry-content { max-width: 760px; }
.page-shell.page-narrow .entry-content { margin: 0 auto; }
.page-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 52px 0 40px;
}
.page-hero h1 { margin-bottom: 0.25em; }
.page-hero .lead { margin-bottom: 0; max-width: 62ch; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 48px;
}
.pagination .page-numbers {
  display: inline-block;
  min-width: 42px;
  text-align: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.pagination .page-numbers:hover { background: var(--brass-tint); text-decoration: none; }
.pagination .page-numbers.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.pagination .page-numbers.dots { border-color: transparent; background: none; }

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 22px 0;
  border-top: 1px solid var(--line);
}
.post-nav a { font-weight: 600; }
.post-nav .nav-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */
.comments-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 46px 22px 70px;
}
.comments-area .comment-list { list-style: none; margin: 0; padding: 0; }
.comments-area .comment-list ol.children {
  list-style: none;
  margin: 0 0 0 26px;
  padding: 0;
  border-left: 2px solid var(--line);
  padding-left: 20px;
}
.comments-area .comment-body {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.comments-area .comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.comments-area .comment-meta img { border-radius: 50%; }
.comments-area .comment-author-name { font-weight: 700; color: var(--ink); }
.comments-area .comment-reply-link {
  font-size: 0.85rem;
  font-weight: 700;
}
.comment-respond {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  margin-top: 26px;
}
.comment-respond label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.97rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 14px;
}
.comment-respond textarea { min-height: 130px; resize: vertical; }
.comment-respond .submit {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.comment-respond .submit:hover { background: var(--blue-dark); }

/* --------------------------------------------------------------------------
   Search form
   -------------------------------------------------------------------------- */
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form label { flex: 1; min-width: 220px; }
.search-form .search-field {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.97rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}
.search-form .search-submit {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.search-form .search-submit:hover { background: var(--ink); color: var(--paper); }

/* --------------------------------------------------------------------------
   Empty states / admin-only notices
   -------------------------------------------------------------------------- */
.empty-state {
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 46px 34px;
  text-align: center;
  color: var(--muted);
}
.empty-state h2,
.empty-state h3,
.empty-state h4 { font-size: 1.35rem; color: var(--ink); margin-bottom: 8px; }

.admin-hint {
  border: 1px solid #d9c7a0;
  border-left: 4px solid var(--brass);
  background: #fdf8ec;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.9rem;
  margin: 18px 0;
  color: var(--ink-2);
}
.admin-hint b { color: var(--brass); }

/* --------------------------------------------------------------------------
   Member / guest visibility helpers (server-rendered; see inc/membership.php)
   The .is-member body class is added in PHP, not JavaScript.
   -------------------------------------------------------------------------- */
.vb-members-only,
.vb-guests-only { display: block; }

/* Library rows the visitor may not download */
.doc-locked td { color: var(--muted); }
.doc-locked .doc-title { display: flex; align-items: center; gap: 8px; }
.doc-locked .doc-title svg { width: 15px; height: 15px; flex: none; color: var(--brass); }

/* --------------------------------------------------------------------------
   Paid Memberships Pro — make PMPro's own pages wear the club's clothes.
   These selectors are PMPro's; if PMPro is not installed they simply never match.
   -------------------------------------------------------------------------- */
.pmpro_content_message,
.pmpro_message {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  background: var(--brass-tint);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 22px 0;
}
.pmpro_message.pmpro_error {
  border-left-color: var(--danger);
  background: #fbeceb;
}
.pmpro_message.pmpro_success {
  border-left-color: var(--success);
  background: #e9f3ec;
}
.pmpro_btn,
.pmpro_btn-submit-checkout,
.pmpro_btn-submit,
input[type="submit"].pmpro_btn,
.pmpro_form .pmpro_btn {
  display: inline-block;
  font-family: var(--sans) !important;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--blue);
  color: #fff !important;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}
.pmpro_btn:hover,
.pmpro_btn-submit-checkout:hover { background: var(--blue-dark); color: #fff !important; }
.pmpro_btn-cancel { background: var(--danger); }

.pmpro_form .pmpro_checkout,
.pmpro_checkout {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.pmpro_checkout h2,
.pmpro_checkout h3 { font-size: 1.25rem; margin-top: 0; }
.pmpro_form input[type="text"],
.pmpro_form input[type="email"],
.pmpro_form input[type="password"],
.pmpro_form input[type="tel"],
.pmpro_form select,
.pmpro_form textarea {
  font-family: var(--sans);
  font-size: 0.97rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  max-width: 100%;
}
.pmpro_form label { font-weight: 600; font-size: 0.9rem; }
table.pmpro_table { width: 100%; border-collapse: collapse; }
table.pmpro_table thead th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}
table.pmpro_table td { padding: 14px 18px; border-bottom: 1px solid var(--line); }

/* PMPro levels list rendered through the pricing grid */
.pmpro_level_notice { font-size: 0.85rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   bbPress / forum plugin light touch-ups (harmless when absent)
   -------------------------------------------------------------------------- */
#bbpress-forums {
  font-family: var(--sans);
  font-size: 0.97rem;
}
#bbpress-forums div.bbp-forum-title,
#bbpress-forums div.bbp-topic-title { font-family: var(--serif); }
#bbpress-forums .bbp-forums-list { border-color: var(--line); }
#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer {
  background: var(--paper);
  border-color: var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
#bbpress-forums button,
#bbpress-forums input[type="submit"] {
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .topbar, .site-header, .site-footer, .lock-card, .cta-strip, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .article-body, .entry-content { max-width: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover, .post-card:hover, .btn:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Menu markup
   The prototype's nav was a flat list of <a> elements. wp_nav_menu() wraps
   everything in <ul>/<li>, so the flex layout moves onto the list.
   -------------------------------------------------------------------------- */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav li { position: relative; }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-ancestor > a,
.main-nav a[aria-current="page"] { color: var(--blue); }

/* Second-level menus */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 70;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { display: block; padding: 9px 12px; font-size: 0.92rem; }

@media (max-width: 920px) {
  .main-nav ul { flex-direction: column; align-items: stretch; width: 100%; }
  .main-nav .sub-menu {
    display: flex;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0 0 0 14px;
    background: none;
  }
}

/* The member chip is a link now (it goes to the member's account page). */
a.member-chip:hover { text-decoration: none; background: #dceaf6; color: var(--blue-dark); }

/* Featured-image cover on a post card, replacing the typographic panel. */
.post-cover-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }
.post-cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Comment list items carry no bullet. */
.comments-area .comment-list > li { list-style: none; }

/* Article meta directly under the header needs a little air. */
.article-head .post-meta { margin-bottom: 14px; }
