/**
 * Better Mind Daily Custom — design system
 * Visual language inspired by The Practice (warm, editorial, spacious).
 * Content comes from WordPress — this file only styles.
 */

:root {
  --bmd-bg: #f4e6e0;
  --bmd-bg-2: #efe0d8;
  --bmd-bg-soft: #faf3ef;
  --bmd-ink: #141711;
  --bmd-ink-soft: rgba(20, 23, 17, 0.72);
  --bmd-muted: rgba(20, 23, 17, 0.55);
  --bmd-line: rgba(20, 23, 17, 0.12);
  --bmd-cream: #fbf6ee;
  --bmd-white: #ffffff;
  --bmd-accent: #8c6a4f;
  --bmd-lime: #e2e6a6;
  --bmd-green: #788c58;
  --bmd-sky: #a9bedb;

  --bmd-font-sans: "Switzer", system-ui, -apple-system, sans-serif;
  --bmd-font-serif: "Instrument Serif", Georgia, serif;

  --bmd-space-1: 0.5rem;
  --bmd-space-2: 1rem;
  --bmd-space-3: 1.5rem;
  --bmd-space-4: 2.5rem;
  --bmd-space-5: 4rem;
  --bmd-space-6: 6.5rem;
  --bmd-space-7: 9rem;

  --bmd-width: 72rem;
  --bmd-width-narrow: 42rem;
  --bmd-width-wide: 88rem;

  --bmd-radius-pill: 999px;
  --bmd-radius-soft: 1.75rem;
  --bmd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bmd-header-h: 5.5rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bmd-bg);
  color: var(--bmd-ink);
  font-family: var(--bmd-font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.screen-reader-text,
.bmd-skip-link {
  position: absolute;
  left: -9999px;
}
.bmd-skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--bmd-ink);
  color: var(--bmd-cream);
}

/* ---------- Buttons ---------- */
.bmd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.85rem 1.45rem;
  border-radius: var(--bmd-radius-pill);
  border: 1px solid transparent;
  font-family: var(--bmd-font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.25s var(--bmd-ease), background 0.25s var(--bmd-ease), color 0.25s var(--bmd-ease);
}
.bmd-btn:hover { transform: translateY(-1px); }
.bmd-btn:focus-visible {
  outline: 2px solid var(--bmd-ink);
  outline-offset: 3px;
}
.bmd-btn--dark {
  background: var(--bmd-ink);
  color: var(--bmd-cream) !important;
}
.bmd-btn--dark:hover { background: #000; }
.bmd-btn--lime {
  background: var(--bmd-lime);
  color: var(--bmd-ink) !important;
}
.bmd-btn--lime:hover { background: #edf0b8; }
.bmd-btn--lime .bmd-btn__mark {
  display: inline-flex;
  width: 1.55rem;
  height: 1.55rem;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: var(--bmd-ink);
  position: relative;
}
.bmd-btn--lime .bmd-btn__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / 0.55rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 9.5 9.5 2.5M4 2.5h5.5V8' stroke='%23fbf6ee' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.bmd-btn--ghost {
  background: transparent;
  border-color: var(--bmd-line);
  color: var(--bmd-ink) !important;
}
.bmd-btn--sm {
  min-height: 2.55rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.84rem;
}

/* ---------- Header ---------- */
.bmd-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(244, 230, 224, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--bmd-ease), background 0.3s var(--bmd-ease);
}
.bmd-site-header.is-scrolled {
  border-bottom-color: var(--bmd-line);
  background: rgba(244, 230, 224, 0.94);
}
.bmd-site-header__inner {
  width: min(100% - 1.5rem, 92rem);
  margin-inline: auto;
  min-height: var(--bmd-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bmd-site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  text-decoration: none;
  flex: 0 0 auto;
  color: var(--bmd-ink);
  background: transparent;
  line-height: 0;
}
.bmd-site-header__wordmark {
  font-family: var(--bmd-font-serif);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.bmd-site-header__wordmark em {
  font-style: italic;
}
.bmd-site-header__logo,
.bmd-site-header .custom-logo {
  display: block;
  width: auto;
  height: clamp(2.1rem, 3.2vw, 2.75rem);
  max-width: min(14rem, 48vw);
  object-fit: contain;
  object-position: left center;
  background: transparent;
  /* Black logo on transparent — do not invert. */
  filter: none;
}
.bmd-site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.bmd-site-header__cta-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--bmd-cream);
  display: inline-block;
}

/* ---------- Social icons ---------- */
.bmd-social__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bmd-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--bmd-ease), opacity 0.2s var(--bmd-ease), background 0.2s var(--bmd-ease);
}
.bmd-social__link svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.bmd-social__link:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}
.bmd-social--header {
  display: none;
  flex: 0 0 auto;
  color: #141711;
}
.bmd-social--header .bmd-social__link:hover {
  background: rgba(20, 23, 17, 0.06);
  opacity: 1;
}
@media (min-width: 1100px) {
  .bmd-social--header {
    display: block;
  }
}
.bmd-social--mobile {
  margin: 1.25rem 0 0.35rem;
  color: #141711;
}
.bmd-social--footer {
  margin-top: 1rem;
  color: var(--bmd-lime);
}
.bmd-social--footer .bmd-social__link:hover {
  background: rgba(226, 230, 166, 0.14);
  opacity: 1;
}

.bmd-nav--desktop { display: none; }
.bmd-nav-toggle { display: inline-grid; }
@media (min-width: 1100px) {
  .bmd-nav--desktop { display: block; }
  .bmd-nav-toggle { display: none !important; }
}

.bmd-nav__list {
  display: flex;
  align-items: center;
  gap: 0.1rem 0.35rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  list-style: none;
  background: rgba(251, 246, 238, 0.92);
  border: 1px solid rgba(20, 23, 17, 0.06);
  border-radius: var(--bmd-radius-pill);
  box-shadow: 0 1px 0 rgba(251, 246, 238, 0.8);
}
.bmd-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--bmd-radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--bmd-ink);
}
.bmd-nav__link:hover { background: rgba(20, 23, 17, 0.05); }
.bmd-nav__caret {
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}
.bmd-nav__item--parent { position: relative; }
.bmd-nav__sub {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  min-width: 15rem;
  margin: 0;
  padding: 0.65rem;
  list-style: none;
  background: var(--bmd-cream);
  border: 1px solid var(--bmd-line);
  border-radius: 0.85rem;
  box-shadow: 0 18px 40px rgba(20, 23, 17, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--bmd-ease), transform 0.2s var(--bmd-ease), visibility 0.2s;
}
.bmd-nav__item--parent:hover > .bmd-nav__sub,
.bmd-nav__item--parent:focus-within > .bmd-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.bmd-nav__sublink {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  text-decoration: none;
  font-size: 0.9rem;
}
.bmd-nav__sublink:hover { background: rgba(20, 23, 17, 0.05); }

.bmd-nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  border-radius: var(--bmd-radius-pill);
}
.bmd-nav-toggle__bars,
.bmd-nav-toggle__bars::before,
.bmd-nav-toggle__bars::after {
  display: block;
  width: 1.25rem;
  height: 1.5px;
  background: var(--bmd-ink);
  border-radius: 2px;
  position: relative;
  transition: transform 0.25s var(--bmd-ease);
}
.bmd-nav-toggle__bars::before,
.bmd-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.bmd-nav-toggle__bars::before { top: -6px; }
.bmd-nav-toggle__bars::after { top: 6px; }
.bmd-nav-toggle[aria-expanded="true"] .bmd-nav-toggle__bars { background: transparent; }
.bmd-nav-toggle[aria-expanded="true"] .bmd-nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.bmd-nav-toggle[aria-expanded="true"] .bmd-nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.bmd-mobile-nav {
  position: fixed;
  inset: var(--bmd-header-h) 0 0;
  z-index: 999;
  background: var(--bmd-bg);
  padding: 1.25rem 1.25rem 2rem;
  overflow: auto;
}
.bmd-mobile-nav[hidden] { display: none !important; }
.bmd-mobile-nav__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 0;
  display: block;
}
.bmd-mobile-nav__list .bmd-nav__item { border-bottom: 1px solid var(--bmd-line); }
.bmd-mobile-nav__list .bmd-nav__link,
.bmd-mobile-nav__list .bmd-nav__sublink {
  display: block;
  padding: 0.95rem 0.15rem;
  text-decoration: none;
  font-size: 1.15rem;
}
.bmd-mobile-nav__list .bmd-nav__sub {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0 0 0.75rem 0.75rem;
  min-width: 0;
}

body.bmd-nav-open { overflow: hidden; }

/* ---------- Main / content ---------- */
.bmd-main {
  min-height: 50vh;
}

.bmd-entry__content,
.bmd-article__body {
  width: min(100% - 2rem, var(--bmd-width));
  margin: 0 auto;
  padding: var(--bmd-space-5) 0 var(--bmd-space-6);
}

/* Commercial BMD pages already include their own wrap — don't double-constrain */
.bmd-has-bmd-page .bmd-entry__content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.bmd-entry__content > *:first-child { margin-top: 0; }

.bmd-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bmd-muted);
}

h1, .bmd-article__title, .bmd-archive__title {
  font-family: var(--bmd-font-sans);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 1.25rem;
}

.bmd-article__header {
  width: min(100% - 2rem, var(--bmd-width-narrow));
  margin: 0 auto;
  padding: var(--bmd-space-5) 0 var(--bmd-space-3);
}
.bmd-article__title {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
}
.bmd-article__meta,
.bmd-article__date,
.bmd-card__meta,
.bmd-card__date {
  color: var(--bmd-muted);
  font-size: 0.88rem;
}
.bmd-article__media {
  width: min(100% - 2rem, var(--bmd-width));
  margin: 0 auto var(--bmd-space-4);
  border-radius: var(--bmd-radius-soft);
  overflow: hidden;
}
.bmd-article__body {
  width: min(100% - 2rem, var(--bmd-width-narrow));
  font-size: 1.08rem;
  line-height: 1.75;
}
.bmd-article__body h2,
.bmd-article__body h3 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2.25rem;
}
.bmd-article__body p { margin: 0 0 1.15rem; }
.bmd-article__body em,
.bmd-article__body i {
  font-family: var(--bmd-font-serif);
  font-style: italic;
}

.bmd-archive__header {
  width: min(100% - 2rem, var(--bmd-width));
  margin: 0 auto;
  padding: var(--bmd-space-5) 0 var(--bmd-space-4);
}
.bmd-archive__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
}
.bmd-archive__grid {
  width: min(100% - 2rem, var(--bmd-width-wide));
  margin: 0 auto var(--bmd-space-6);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}
@media (max-width: 960px) {
  .bmd-archive__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .bmd-archive__grid { grid-template-columns: 1fr; }
}
.bmd-card {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--bmd-line);
  border-radius: var(--bmd-radius-soft);
  overflow: hidden;
}
.bmd-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.bmd-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s var(--bmd-ease);
}
.bmd-card__link:hover .bmd-card__media img { transform: scale(1.03); }
.bmd-card__body { padding: 1.25rem 1.2rem 1.4rem; }
.bmd-card__title {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.bmd-404 {
  width: min(100% - 2rem, 40rem);
  margin: 0 auto;
  padding: var(--bmd-space-7) 0;
}

/* Neutralize leftover Elementor chrome classes if present in content */
.elementor-widget-container > :first-child { margin-top: 0; }

/* ---------- Footer (Practice dark shell) ---------- */
.bmd-site-footer {
  width: min(100% - 1rem, 96rem);
  margin: 0 auto 1rem;
  padding: 0;
  background: transparent;
}
.bmd-site-footer__shell {
  background: #141711;
  color: rgba(251, 246, 238, 0.88);
  border-radius: clamp(1.35rem, 2.5vw, 2rem);
  padding: clamp(2.25rem, 5vw, 3.75rem) clamp(1.25rem, 3.5vw, 3.25rem) clamp(1.35rem, 2.5vw, 1.85rem);
  overflow: hidden;
}
.bmd-site-footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
@media (min-width: 980px) {
  .bmd-site-footer__top {
    grid-template-columns: minmax(16rem, 1.45fr) minmax(8rem, 0.65fr) minmax(9rem, 0.85fr) minmax(12rem, 0.95fr);
  }
}
.bmd-site-footer__cta-title {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-family: var(--bmd-font-sans);
  font-size: clamp(2rem, 3.6vw, 3.15rem);
  font-weight: 450;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: #fbf6ee;
}
.bmd-site-footer__cta-title em {
  font-family: var(--bmd-font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--bmd-lime);
}
.bmd-site-footer__cta-body {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  color: rgba(251, 246, 238, 0.62);
  font-size: 0.98rem;
  line-height: 1.55;
}
.bmd-site-footer__col-label {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 246, 238, 0.45);
}
.bmd-site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.bmd-site-footer__links a {
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 450;
  color: rgba(251, 246, 238, 0.82);
}
.bmd-site-footer__links a:hover { color: #fbf6ee; }

.bmd-site-footer__note-card {
  padding: 1.25rem 1.2rem 1.35rem;
  border-radius: 1.15rem;
  background: rgba(251, 246, 238, 0.06);
  border: 1px solid rgba(251, 246, 238, 0.08);
}
.bmd-site-footer__note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 246, 238, 0.22);
  color: rgba(251, 246, 238, 0.75);
}
.bmd-site-footer__note-title {
  margin: 0 0 0.55rem;
  font-family: var(--bmd-font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fbf6ee;
}
.bmd-site-footer__note {
  margin: 0 0 0.85rem;
  color: rgba(251, 246, 238, 0.58);
  font-size: 0.9rem;
  line-height: 1.5;
}
.bmd-site-footer__email {
  margin: 0;
  font-size: 0.9rem;
}
.bmd-site-footer__email a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: rgba(251, 246, 238, 0.78);
}
.bmd-site-footer__email a:hover { color: #fbf6ee; }

.bmd-site-footer__wordmark {
  margin: clamp(2.75rem, 7vw, 5.5rem) 0 clamp(1.75rem, 4vw, 2.75rem);
  font-family: var(--bmd-font-sans);
  font-size: clamp(3.4rem, 12.5vw, 9.5rem);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: #fbf6ee;
  text-align: left;
  white-space: nowrap;
}
.bmd-site-footer__wordmark em {
  font-family: var(--bmd-font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--bmd-lime);
}

.bmd-site-footer__bar {
  padding-top: 1.15rem;
  border-top: 1px solid rgba(251, 246, 238, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.bmd-site-footer__copy {
  margin: 0;
  color: rgba(251, 246, 238, 0.42);
  font-size: 0.78rem;
}
.bmd-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.bmd-footer-legal a {
  text-decoration: none;
  font-size: 0.78rem;
  color: rgba(251, 246, 238, 0.42);
}
.bmd-footer-legal a:hover { color: rgba(251, 246, 238, 0.78); }
.bmd-footer-legal li:not(:last-child)::after {
  content: "·";
  margin: 0 0.55rem;
  color: rgba(251, 246, 238, 0.32);
  pointer-events: none;
}

@media (max-width: 720px) {
  .bmd-site-footer__wordmark {
    white-space: normal;
    font-size: clamp(2.6rem, 14vw, 4rem);
  }
}
