/* ==========================================================================
   Rethinking Midlife: component styles
   Colors, fonts and the type scale live in theme.json. This file styles the
   brand components (header, hero, cards, temple, carousel, pop-ups...).
   Loaded on the front end AND inside the editor.
   ========================================================================== */

:root {
	--rm-navy: var(--wp--preset--color--navy-900);
	--rm-gold: var(--wp--preset--color--gold-500);
	--rm-gold-dark: var(--wp--preset--color--gold-600);
	--rm-orange: var(--wp--preset--color--orange-600);
	--rm-cream: var(--wp--preset--color--cream-000);
	--rm-linen: var(--wp--preset--color--cream-100);
	--rm-muted: var(--wp--preset--color--warm-gray-500);
	--rm-line: var(--wp--preset--color--warm-gray-300);
	--rm-shadow: var(--wp--preset--shadow--card);
	--rm-shadow-raised: var(--wp--preset--shadow--raised);
	--rm-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--rm-header-h: 84px;
	--rm-admin-bar: var(--wp-admin--admin-bar--height, 0px);
}
@media (max-width: 781px) { :root { --rm-header-h: 68px; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(h1, h2, h3, h4, h5, h6, p) { text-wrap: pretty; }
img { height: auto; }

/* ---------- Sections ---------- */
.rm-section { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.rm-section-tight { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.rm-center { text-align: center; }
.rm-center .wp-block-buttons { justify-content: center; }

/* ---------- Text styles ---------- */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin-bottom: 0.75rem !important;
}
.is-style-eyebrow:not(.has-text-color) { color: var(--rm-orange); }
.is-style-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
.is-style-signature { font-family: var(--wp--preset--font-family--script); font-size: 1.875rem; line-height: 1.2; color: var(--rm-navy); }
.rm-muted { color: var(--rm-muted); }
.rm-meta { font-size: var(--wp--preset--font-size--small); color: var(--rm-muted); }
.has-navy-900-background-color .rm-meta { color: var(--wp--preset--color--blue-300); }
.has-navy-900-background-color :where(h1, h2, h3, h4, h5, h6):not(.has-text-color) { color: #fff; }
.has-orange-600-background-color :where(h1, h2, h3, h4, h5, h6):not(.has-text-color) { color: #fff; }

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background-color .18s var(--rm-ease), color .18s var(--rm-ease), transform .18s var(--rm-ease), box-shadow .18s var(--rm-ease); min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: var(--rm-shadow); }
.wp-block-button.is-style-orange .wp-block-button__link { background-color: var(--rm-orange); color: #fff; }
.wp-block-button.is-style-orange .wp-block-button__link:hover { background-color: #c4441c; color: #fff; }
.wp-block-button.is-style-outline-navy .wp-block-button__link,
.wp-block-button.is-style-outline-light .wp-block-button__link {
	background: transparent;
	border: 2px solid currentColor;
	padding: calc(0.9rem - 2px) calc(1.65rem - 2px);
}
.wp-block-button.is-style-outline-navy .wp-block-button__link { color: var(--rm-navy); }
.wp-block-button.is-style-outline-navy .wp-block-button__link:hover { background: var(--rm-navy); color: #fff; border-color: var(--rm-navy); }
.wp-block-button.is-style-outline-light .wp-block-button__link { color: #fff; }
.wp-block-button.is-style-outline-light .wp-block-button__link:hover { background: #fff; color: var(--rm-navy); border-color: #fff; }
.rm-text-link a, a.rm-text-link {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700; font-size: 0.8125rem; letter-spacing: .08em; text-transform: uppercase;
	text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 3px;
}

/* ---------- Header ---------- */
.rm-site-header {
	z-index: 100;
	transition: background-color .25s var(--rm-ease), box-shadow .25s var(--rm-ease), padding .25s var(--rm-ease);
	padding-top: 1.1rem !important;
	padding-bottom: 1.1rem !important;
	background-color: var(--rm-navy);
}
.rm-js .rm-site-header { position: fixed; top: var(--rm-admin-bar); left: 0; right: 0; }
.rm-js body.rm-has-hero .rm-site-header:not(.is-solid) { background-color: transparent; }
.rm-js .rm-site-header.is-solid { box-shadow: var(--rm-shadow); padding-top: .8rem !important; padding-bottom: .8rem !important; }
.rm-js body:not(.rm-has-hero) .wp-site-blocks { padding-top: var(--rm-header-h); }
.rm-site-header .rm-logo img { height: 52px; width: auto; display: block; }
@media (max-width: 781px) { .rm-site-header .rm-logo img { height: 40px; } }
.rm-site-header .wp-block-navigation a { opacity: .85; transition: opacity .2s; }
.rm-site-header .wp-block-navigation a:hover,
.rm-site-header .wp-block-navigation .current-menu-item > a { opacity: 1; color: var(--rm-gold); }
.rm-site-header .wp-block-navigation__responsive-container.is-menu-open { padding: 5rem 1.5rem 2rem; }
.rm-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 0; width: 100%; }
.rm-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid rgba(255,255,255,.12); padding: 1rem 0; font-size: 0.8125rem; }
@media (max-width: 781px) { .rm-site-header .rm-header-cta { display: none; } }

/* ---------- Hero (full-width page header: image or video) ---------- */
.wp-block-cover.rm-hero,
.wp-block-cover.rm-page-hero {
	/* Always full-width, even if the alignment control is changed. */
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-top: 0 !important;
	padding-top: calc(var(--rm-header-h) + 3rem);
	padding-bottom: 4rem;
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}
.wp-block-cover.rm-hero .wp-block-cover__inner-container,
.wp-block-cover.rm-page-hero .wp-block-cover__inner-container { width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; }
.rm-hero__copy { max-width: 560px; }
.rm-hero__copy > .wp-block-heading { color: #fff; }
.rm-hero__copy .is-style-lead { color: var(--wp--preset--color--blue-300); }
.rm-page-hero .rm-hero__copy { max-width: 720px; }
.wp-block-cover.rm-hero video,
.wp-block-cover.rm-page-hero video { pointer-events: none; }

/* ---------- Credentials bar ---------- */
.rm-cred { padding-top: 2rem; padding-bottom: 2rem; }
.rm-cred .wp-block-group.is-layout-flex { gap: .75rem; }
.rm-cred p { font-family: var(--wp--preset--font-family--serif); font-style: italic; font-size: 1.1875rem; color: #fff; margin: 0; }
.rm-cred .rm-icon img { width: 26px; height: 26px; filter: brightness(0) invert(1); }

/* ---------- Icon badges ---------- */
.wp-block-image.is-style-icon-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--rm-gold); display: flex; align-items: center; justify-content: center; margin: 0 0 1rem; flex-shrink: 0; }
.wp-block-image.is-style-icon-badge img { width: 22px !important; height: 22px !important; border-radius: 0; }
.wp-block-image.is-style-icon-badge.rm-badge-lg { width: 52px; height: 52px; }
.wp-block-image.is-style-icon-badge.rm-badge-lg img { width: 24px !important; height: 24px !important; }
.wp-block-image.is-style-icon-badge.rm-badge-cream { background: var(--rm-linen); }
.wp-block-image.is-style-icon-badge.rm-badge-clear { background: transparent; }
.wp-block-image.is-style-icon-badge.rm-badge-outline { background: rgba(255,255,255,.1); }
.rm-center .wp-block-image.is-style-icon-badge { margin-left: auto; margin-right: auto; }

/* ---------- Cards ---------- */
.is-style-card { background: #fff; box-shadow: var(--rm-shadow); padding: 1.75rem 1.5rem; transition: transform .25s var(--rm-ease), box-shadow .25s var(--rm-ease); }
.is-style-card.has-navy-900-background-color { background: var(--rm-navy); }
.is-style-card > * { margin-block: 0; }
.is-style-card > * + * { margin-block-start: .75rem; }
.rm-lift .is-style-card:hover, .is-style-card.rm-lift:hover { transform: translateY(-6px); box-shadow: var(--rm-shadow-raised); }
.rm-card-title { font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1rem; line-height: 1.25; color: var(--rm-navy); text-transform: none; letter-spacing: 0; }
.rm-card-title.is-upper { text-transform: uppercase; }
.rm-card-number { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: .8125rem; color: var(--rm-gold-dark); letter-spacing: .08em; }
.has-navy-900-background-color .rm-card-number { color: var(--rm-gold); }
.rm-recognize .is-style-card p { font-style: italic; }

/* ---------- Info bar (next workshop) ---------- */
.is-style-info-bar { background: #fff; border: 1px solid var(--rm-line); padding: 1.35rem 1.6rem; }
.is-style-info-bar .wp-block-image.is-style-icon-badge { margin: 0; }
.is-style-info-bar p { margin: 0; }

/* ---------- CARPE temple ---------- */
.rm-temple { position: relative; max-width: 460px; padding-top: 100px; margin-top: 2rem; }
.rm-temple::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 74px; background: var(--rm-navy); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.rm-temple::after { content: ""; position: absolute; top: 80px; left: 0; right: 0; height: 20px; background: var(--rm-navy); }
.rm-temple .rm-temple__pillars { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 10px 18px 10px; border-bottom: 20px solid var(--rm-navy); margin: 0 !important; }
.rm-temple .rm-temple__pillars > p {
	height: 208px; margin: 0 !important; background: #f8f8f7; border-radius: 3px;
	display: flex; align-items: center; justify-content: center;
	writing-mode: vertical-rl; transform: rotate(180deg);
	font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: .9375rem; letter-spacing: .04em; color: var(--rm-navy);
	transition: background-color .25s var(--rm-ease);
}
.rm-temple .rm-temple__pillars > p:hover { background: var(--rm-gold); }
.rm-temple .rm-temple__foundation {
	margin: 6px 0 0 !important; min-height: 62px; display: flex; align-items: center; justify-content: center;
	background: var(--rm-navy); color: #fff; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.5rem; letter-spacing: .06em; text-transform: uppercase;
	transition: background-color .25s var(--rm-ease);
}
.rm-temple .rm-temple__foundation:hover { background: var(--rm-orange); }
.rm-temple .rm-temple__caption { text-align: center; font-size: var(--wp--preset--font-size--small); color: var(--rm-navy); margin-top: .9rem !important; }
.rm-js .rm-temple .rm-temple__pillars > p { opacity: 0; transform: rotate(180deg) translateY(-24px); transition: background-color .25s var(--rm-ease), transform .7s var(--rm-ease), opacity .7s var(--rm-ease); }
.rm-js .rm-temple.is-visible .rm-temple__pillars > p { opacity: 1; transform: rotate(180deg) translateY(0); }
.rm-temple.is-visible .rm-temple__pillars > p:nth-child(2) { transition-delay: 0s, .12s, .12s; }
.rm-temple.is-visible .rm-temple__pillars > p:nth-child(3) { transition-delay: 0s, .24s, .24s; }
.rm-temple.is-visible .rm-temple__pillars > p:nth-child(4) { transition-delay: 0s, .36s, .36s; }
@media (max-width: 640px) {
	.rm-temple { padding-top: 76px; }
	.rm-temple::before { height: 54px; }
	.rm-temple::after { top: 58px; height: 16px; }
	.rm-temple .rm-temple__pillars { gap: 8px; padding: 8px 10px; }
	.rm-temple .rm-temple__pillars > p { height: 150px; font-size: .75rem; }
	.rm-temple .rm-temple__foundation { font-size: 1.25rem; }
}

/* Photo with gold brush block behind it */
.rm-photo-brush { position: relative; }
.rm-photo-brush::before { content: ""; position: absolute; inset: 8% -4% -6% 10%; background: var(--rm-gold); z-index: 0; }
.rm-photo-brush img { position: relative; z-index: 1; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 781px) { .rm-photo-brush::before { inset: 6% -3% -4% 8%; } }

/* ---------- Images ---------- */
.rm-cover-img img { width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.rm-cover-img.is-portrait img, .wp-block-image.is-style-portrait img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.rm-cover-img.is-tall img { aspect-ratio: 3 / 4; }
.rm-cover-img.is-wide img { aspect-ratio: 16 / 10; }
.rm-strip { gap: .75rem !important; }
.rm-strip .wp-block-image img { aspect-ratio: 1; object-fit: cover; width: 100%; }

/* ---------- Testimonials ---------- */
.is-style-testimonial, .rm-testimonials .wp-block-quote { margin: 0; padding: 0; border: 0; text-align: center; }
.is-style-testimonial p, .rm-testimonials .wp-block-quote p { font-family: var(--wp--preset--font-family--serif); font-style: italic; font-size: var(--wp--preset--font-size--large); line-height: 1.45; }
.is-style-testimonial cite, .rm-testimonials .wp-block-quote cite {
	display: block; margin-top: 1rem; font-style: normal; font-family: var(--wp--preset--font-family--serif);
	font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rm-gold);
}
.has-navy-900-background-color .rm-testimonials .wp-block-quote p,
.has-navy-900-background-color .is-style-testimonial p { color: #fff; }
.rm-testimonials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; max-width: 1180px; margin-left: auto !important; margin-right: auto !important; position: relative; }
@media (max-width: 1024px) { .rm-testimonials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rm-testimonials { grid-template-columns: 1fr; } }
.rm-testimonials.rm-carousel { display: block; padding: 0 56px; }
.rm-carousel__viewport { overflow: hidden; }
.rm-carousel__track { display: flex; transition: transform .6s var(--rm-ease); }
.rm-carousel__track > .wp-block-quote { flex: 0 0 calc(100% / var(--rm-per-view, 3)); padding: 0 1.25rem; box-sizing: border-box; }
.rm-carousel__arrow { position: absolute; top: 40%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: rgba(255,255,255,.7); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.rm-carousel__arrow:hover { color: var(--rm-gold); }
.rm-carousel__arrow.is-prev { left: 0; }
.rm-carousel__arrow.is-next { right: 0; }
.rm-carousel__dots { display: flex; gap: 12px; justify-content: center; margin-top: 2rem; }
.rm-carousel__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.3); }
.rm-carousel__dot.is-active { background: var(--rm-gold); }
:not(.has-navy-900-background-color) > .rm-testimonials .rm-carousel__arrow { color: var(--rm-navy); }
@media (max-width: 640px) { .rm-testimonials.rm-carousel { padding: 0 34px; } .rm-carousel__track > .wp-block-quote { padding: 0 .5rem; } }

/* Praise cards */
.rm-praise .is-style-card p:first-child { font-family: var(--wp--preset--font-family--serif); font-style: italic; font-size: .9375rem; color: var(--rm-navy); }

/* ---------- Split CTA (two halves) ---------- */
.rm-split { gap: 0 !important; margin: 0 !important; }
.rm-split > .wp-block-column { padding: var(--wp--preset--spacing--60) var(--wp--style--root--padding-left); }
.rm-split .rm-path + .rm-path { border-top: 1px solid rgba(255,255,255,.2); padding-top: 1.5rem; }
.rm-split .rm-path { padding-top: .5rem; }

/* ---------- Numbered rows (book contents, takeaways) ---------- */
.rm-row { gap: .9rem !important; flex-wrap: nowrap !important; align-items: flex-start !important; }
.rm-row > * { margin: 0 !important; }
.rm-row .rm-row__num { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1rem; color: var(--rm-gold-dark); min-width: 1ch; line-height: 1.4; }
.rm-row .wp-block-image.is-style-icon-badge { width: 36px; height: 36px; background: var(--rm-linen); }
.rm-row .wp-block-image.is-style-icon-badge img { width: 20px !important; height: 20px !important; }

/* ---------- FAQ ---------- */
.wp-block-details summary { cursor: pointer; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: .875rem; color: var(--rm-navy); text-transform: uppercase; letter-spacing: .02em; }
.wp-block-details > :not(summary) { font-size: var(--wp--preset--font-size--small); color: var(--rm-muted); margin-top: .6rem; }

/* ---------- Pull quote band ---------- */
.rm-pullquote p { font-family: var(--wp--preset--font-family--serif); font-style: italic; }

/* ---------- Page title band (templates) ---------- */
.rm-page-title { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--50); }
body.rm-hide-title .rm-page-title { display: none; }

/* ---------- Blog / events / podcast cards ---------- */
.rm-post-card { display: flex; flex-direction: column; gap: .6rem; height: 100%; }
.rm-post-card .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.rm-post-card .wp-block-post-title { font-size: 1.25rem; margin: 0; }
.rm-post-card .wp-block-post-title a { color: var(--rm-navy); text-decoration: none; }
.rm-post-card .wp-block-post-title a:hover { color: var(--rm-orange); }
.rm-post-card .wp-block-post-excerpt { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ink-700); }
.rm-post-card .wp-block-post-excerpt__more-link, .wp-block-read-more { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; }
.rm-event-date { font-weight: 700; font-size: .8125rem !important; letter-spacing: .14em; text-transform: uppercase; color: var(--rm-orange); margin: 0 !important; }
.wp-block-query-pagination { font-family: var(--wp--preset--font-family--display); text-transform: uppercase; letter-spacing: .06em; font-size: .8125rem; }
.wp-block-post-content > .wp-block-audio, .wp-block-post-content > .wp-block-embed { margin-block: 2rem; }

/* ---------- Newsletter / forms ---------- */
.rm-signup input[type="email"], .rm-signup input[type="text"],
.rm-modal input[type="email"], .rm-modal input[type="text"] {
	font: inherit; padding: 14px 16px; border: 1px solid var(--rm-line); background: #fff; color: var(--wp--preset--color--ink-700); width: 100%; border-radius: 0; box-sizing: border-box;
}

/* ---------- Pop-ups ---------- */
.rm-js .rm-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,31,62,.6); padding: 24px; align-items: center; justify-content: center; margin: 0 !important; max-width: none !important; }
.rm-js .rm-modal.is-open { display: flex; }
.rm-js .rm-modal > .wp-block-group { position: relative; background: #fff; box-shadow: var(--rm-shadow-raised); width: 100%; max-width: 480px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 3rem; text-align: center; margin: 0 !important; }
.rm-modal__close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--rm-muted); cursor: pointer; }
.rm-modal__close:hover { color: var(--rm-navy); }
.rm-modal-open { overflow: hidden; }
.rm-modal .rm-embed { text-align: left; min-height: 120px; }
@media (max-width: 640px) { .rm-js .rm-modal > .wp-block-group { padding: 2.5rem 1.4rem 2rem; } }

/* ---------- Footer ---------- */
.rm-footer { padding-top: 4rem; padding-bottom: 2rem; }
.rm-footer .rm-logo img { height: 56px; width: auto; }
.rm-footer p, .rm-footer .wp-block-navigation { font-size: var(--wp--preset--font-size--small); }
.rm-footer .rm-footer-title { font-size: .8125rem !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--blue-300); margin-bottom: 1rem !important; }
.rm-footer .wp-block-navigation { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--wp--preset--font-family--serif); }
.rm-footer .wp-block-navigation a { opacity: .82; }
.rm-footer .wp-block-navigation a:hover { opacity: 1; }
.rm-footer .rm-footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.5rem; margin-top: 2.5rem !important; }
.rm-footer .rm-footer-bottom p { font-size: .75rem; color: var(--wp--preset--color--blue-300); margin: 0; }
.rm-footer .wp-block-social-links .wp-social-link { border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }

/* ---------- Scroll reveal ---------- */
.rm-js .rm-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--rm-ease), transform .7s var(--rm-ease); }
.rm-js .rm-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.rm-js .rm-reveal { opacity: 1; transform: none; transition: none; }
	.wp-block-button__link:hover, .rm-lift .is-style-card:hover { transform: none; }
}

/* ---------- Plugin-friendly defaults ---------- */
.wp-site-blocks > main { display: block; }
.woocommerce .wp-block-button__link, .woocommerce button.button, .woocommerce a.button { border-radius: 0; }
