/* ==========================================================================
   MyEndoConsult — block patterns & block-editor content styles
   Loaded on the front end AND inside the Gutenberg editor, so what you build
   in the editor matches what visitors see.
   ========================================================================== */
:root {
  --myec-bg: #F1F4F9;
  --myec-surface: #FFFFFF;
  --myec-surface-2: #EDF1F7;
  --myec-ink: #172538;
  --myec-ink-soft: #3C4B5E;
  --myec-muted: #6C7A8C;
  --myec-primary: #5B8DC9;
  --myec-primary-dark: #3D6FAB;
  --myec-primary-tint: #E5EEF8;
  --myec-accent: #A8C7E5;
  --myec-line: #DBE2EC;
  --myec-edge: #172538;
  --myec-amber: #FBBF24;
  --myec-display: 'Fraunces', Georgia, serif;
  --myec-body: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --myec-radius: 10px;
  --myec-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --myec-shadow-sm: 3px 3px 0 var(--myec-edge);
  --myec-shadow-md: 5px 5px 0 var(--myec-edge);
}

/* --------------------------------------------------------------------------
   1. Sections
   -------------------------------------------------------------------------- */
.myec-section {
  padding-block: clamp(3.25rem, 7vw, 6rem);
  padding-inline: 1.5rem;
}
.myec-section.myec-tint { background: var(--myec-surface-2); }
.myec-section.myec-ink {
  background: var(--myec-primary);
  color: #F0F6FC;
}
.myec-section.myec-ink h1,
.myec-section.myec-ink h2,
.myec-section.myec-ink h3 { color: #fff; }

.myec-section-head {
  max-width: 640px;
  margin-inline: auto !important;
  text-align: center;
  margin-bottom: 2.6rem;
}
.myec-section-head > * { margin-block: 0; }
.myec-section-head > * + * { margin-top: 0.7rem; }

/* --------------------------------------------------------------------------
   2. Typographic helpers
   -------------------------------------------------------------------------- */
.myec-eyebrow {
  font-family: var(--myec-body);
  font-size: 0.78rem !important;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--myec-accent);
  margin-bottom: 0.6rem;
}
.myec-ink .myec-eyebrow { color: #C6DCEF; }

.myec-display {
  font-family: var(--myec-display);
  font-weight: 500;
  font-size: clamp(2.3rem, 4.8vw, 3.6rem) !important;
  line-height: 1.14;
  letter-spacing: -0.015em;
}
.myec-lead {
  font-size: 1.16rem !important;
  color: var(--myec-ink-soft);
  line-height: 1.65;
}
.myec-ink .myec-lead { color: #E5EEF8; }

/* --------------------------------------------------------------------------
   3. Hero
   -------------------------------------------------------------------------- */
.myec-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.myec-hero::before {
  content: "";
  position: absolute;
  top: -34%; right: -10%;
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(91,141,201,0.10), transparent 63%);
  pointer-events: none;
}
.myec-hero::after {
  content: "";
  position: absolute;
  bottom: -38%; left: -12%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(168,199,229,0.20), transparent 64%);
  pointer-events: none;
}
.myec-hero > * { position: relative; z-index: 1; }
.myec-hero .myec-display { margin-block: 0.4rem 0; }
.myec-hero .myec-lead {
  max-width: 38em;
  margin: 1.2rem auto 0;
}
.myec-hero .wp-block-buttons { margin-top: 1.9rem; justify-content: center; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.wp-block-button__link {
  font-family: var(--myec-body);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.85rem 1.7rem;
  border-radius: var(--myec-radius);
  background-color: var(--myec-primary);
  color: #fff;
  border: 2px solid var(--myec-edge);
  box-shadow: var(--myec-shadow-sm);
  transition: transform 0.18s var(--myec-ease), box-shadow 0.18s var(--myec-ease),
              background-color 0.2s var(--myec-ease), color 0.2s var(--myec-ease);
}
.wp-block-button__link:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--myec-shadow-md);
  background-color: var(--myec-primary-dark);
  color: #fff;
}
.wp-block-button__link:active {
  transform: translate(0, 0);
  box-shadow: var(--myec-shadow-sm);
}
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link {
  background-color: var(--myec-surface);
  color: var(--myec-ink);
  border-color: var(--myec-edge);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--myec-surface-2);
  border-color: var(--myec-edge);
  color: var(--myec-ink);
}
.wp-block-button.myec-btn-light .wp-block-button__link {
  background-color: #fff;
  color: var(--myec-primary);
  border-color: var(--myec-edge);
}
.wp-block-button.myec-btn-light .wp-block-button__link:hover {
  background-color: #E5EEF8;
  color: var(--myec-primary-dark);
}

/* --------------------------------------------------------------------------
   5. Cards (resource / audience grids — styled columns)
   -------------------------------------------------------------------------- */
.myec-card {
  background: var(--myec-surface);
  border: 2px solid var(--myec-edge);
  border-radius: var(--myec-radius);
  padding: 1.7rem !important;
  box-shadow: var(--myec-shadow-sm);
  transition: transform 0.22s var(--myec-ease), box-shadow 0.22s var(--myec-ease);
}
.myec-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--myec-shadow-md);
}
.myec-card > *:first-child { margin-top: 0; }
.myec-card > *:last-child { margin-bottom: 0; }
.myec-card h3,
.myec-card h4 {
  font-family: var(--myec-display);
  font-size: 1.22rem !important;
  font-weight: 500;
  color: var(--myec-ink);
  margin-bottom: 0.45rem;
}
.myec-card p {
  font-size: 0.95rem;
  color: var(--myec-muted);
  margin-bottom: 0;
}
.myec-card .myec-eyebrow { font-size: 0.7rem !important; }
/* accent rule on top of cards */
.myec-card::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: var(--myec-accent);
  margin-bottom: 1.1rem;
}

/* --------------------------------------------------------------------------
   6. Stats band
   -------------------------------------------------------------------------- */
.myec-stats { text-align: center; }
.myec-stat-num {
  font-family: var(--myec-display) !important;
  font-size: clamp(2.2rem, 4vw, 2.9rem) !important;
  font-weight: 600;
  line-height: 1;
  margin: 0 0 0.35rem !important;
  color: #fff;
}
.myec-ink .myec-stat-num { color: #fff; }
.myec-stat-label {
  font-size: 0.86rem !important;
  letter-spacing: 0.04em;
  color: #AFBECF !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   7. Latest posts (the journal grid)
   -------------------------------------------------------------------------- */
.wp-block-latest-posts.is-grid {
  gap: 1.6rem;
  margin: 0;
}
.wp-block-latest-posts.is-grid li {
  background: var(--myec-surface);
  border: 2px solid var(--myec-edge);
  border-radius: var(--myec-radius);
  overflow: hidden;
  padding: 0;
  box-shadow: var(--myec-shadow-sm);
  transition: transform 0.22s var(--myec-ease), box-shadow 0.22s var(--myec-ease);
}
.wp-block-latest-posts.is-grid li:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--myec-shadow-md);
}
.wp-block-latest-posts__featured-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.wp-block-latest-posts.is-grid li > a:first-child {
  display: block;
  font-family: var(--myec-display);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--myec-ink);
  line-height: 1.3;
  padding: 1.2rem 1.3rem 0;
}
.wp-block-latest-posts__featured-image + a {
  padding-top: 1.2rem;
}
.wp-block-latest-posts__post-date {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--myec-accent);
  padding: 0.6rem 1.3rem 0;
}
.wp-block-latest-posts__post-excerpt {
  font-size: 0.93rem;
  color: var(--myec-muted);
  padding: 0.55rem 1.3rem 1.3rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   8. Content blocks (posts & pages)
   -------------------------------------------------------------------------- */
.myec-callout {
  background: var(--myec-primary-tint);
  border: 2px solid var(--myec-edge);
  border-left-width: 6px;
  border-radius: var(--myec-radius);
  padding: 1.6rem 1.8rem !important;
  box-shadow: var(--myec-shadow-sm);
}
.myec-callout > *:first-child { margin-top: 0; }
.myec-callout > *:last-child { margin-bottom: 0; }
.myec-callout h3,
.myec-callout h4 {
  color: var(--myec-primary);
  margin-bottom: 0.6rem;
}

.myec-feature .wp-block-column { align-self: center; }
.myec-feature .wp-block-image img { border-radius: var(--myec-radius); }

/* generic block niceties shared with the editor */
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--myec-line);
  max-width: 90px;
  opacity: 1;
}
.wp-block-separator.is-style-wide { max-width: 100%; }
.wp-block-pullquote {
  border-top: 2px solid var(--myec-accent);
  border-bottom: 2px solid var(--myec-accent);
}
.wp-block-pullquote p {
  font-family: var(--myec-display);
  font-style: italic;
  color: var(--myec-ink);
}
.wp-block-table figcaption { color: var(--myec-muted); }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 781px) {
  .myec-card::before { margin-bottom: 0.85rem; }
  .myec-section-head { margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .myec-card, .wp-block-button__link, .wp-block-latest-posts.is-grid li {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   9. Homepage section width — let section content run wider than body text
   -------------------------------------------------------------------------- */
.myec-section > .wp-block-columns,
.myec-section > .wp-block-buttons,
.myec-section > .wp-block-latest-posts,
.myec-section > .wp-block-group:not(.myec-section-head) {
  max-width: 1100px;
  margin-inline: auto;
}
.myec-section > .wp-block-columns { gap: 1.4rem; }
