/*
Theme Name: Show Me Costa Rica
Theme URI: https://showmecostarica.com
Description: Lightweight block theme for the Show Me Costa Rica public site. Shares the app's design tokens, header, footer, language cookie and inquiry flow. Pair with the SMCR Connector plugin.
Author: Show Me Costa Rica
Version: 1.6.2
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: show-me-costa-rica
*/

/* Values come from assets/tokens.css (generated from the app's src/styles.css). */

body {
	background: var(--smcr-background);
	color: var(--smcr-foreground);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { text-wrap: balance; }
:where(a) { color: inherit; }
:focus-visible { outline: 2px solid var(--smcr-ring); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html { scroll-padding-top: 5rem; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > main { flex: 1; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Layout helpers shared with the app */
.smcr-container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; box-sizing: border-box; }
@media (min-width: 640px) { .smcr-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .smcr-container { padding-inline: 2rem; } }
.smcr-eyebrow, .is-style-smcr-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--smcr-primary); }
.smcr-muted { color: var(--smcr-muted-foreground); }

/* Buttons */
.smcr-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.5rem; padding: 0 1rem; border-radius: 999px; font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, opacity .15s; }
.smcr-btn--primary { background: var(--smcr-primary); color: var(--smcr-primary-foreground); }
.smcr-btn--primary:hover { background: color-mix(in oklch, var(--smcr-primary) 90%, black); }
.smcr-btn--gold { background: var(--smcr-gold); color: var(--smcr-gold-foreground); }
.smcr-btn--block { width: 100%; min-height: 3rem; font-size: 1rem; }

/* Skip link */
.smcr-skip { position: absolute; left: -9999px; top: .75rem; z-index: 60; background: var(--smcr-card); padding: .5rem 1rem; border-radius: .5rem; box-shadow: var(--smcr-shadow-card); }
.smcr-skip:focus { left: .75rem; }

/* Header — mirrors app SiteHeader */
.smcr-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid color-mix(in oklch, var(--smcr-border) 70%, transparent); background: color-mix(in oklch, var(--smcr-background) 90%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.admin-bar .smcr-header { top: var(--wp-admin--admin-bar--height, 0); }
.smcr-header__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; height: 4rem; }
.smcr-brand { display: flex; align-items: baseline; gap: .375rem; flex-shrink: 0; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1.125rem; letter-spacing: -.01em; text-decoration: none; color: var(--smcr-foreground); }
@media (min-width: 768px) { .smcr-brand { font-size: 1.25rem; } }
.smcr-brand__accent { color: var(--smcr-primary); }
.smcr-nav { display: none; align-items: center; gap: .25rem; }
.smcr-nav__link { white-space: nowrap; padding: .5rem .75rem; border-radius: .375rem; font-size: .875rem; font-weight: 500; color: var(--smcr-muted-foreground); text-decoration: none; transition: background-color .15s, color .15s; }
.smcr-nav__link:hover { background: var(--smcr-muted); color: var(--smcr-foreground); }
.smcr-nav__link.is-active { background: var(--smcr-secondary); color: var(--smcr-primary); }
/* Site sections (Scarlet Hills, Riders) fit in the bar only on wide screens; they stay in the phone menu. */
.smcr-nav__link--wide { display: none; }
@media (min-width: 1280px) { .smcr-nav__link--wide { display: inline-block; } }
.smcr-header__actions { display: flex; align-items: center; gap: .5rem; }
.smcr-header__link { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .625rem; font-size: .875rem; font-weight: 500; color: var(--smcr-muted-foreground); text-decoration: none; white-space: nowrap; }
.smcr-header__link:hover { color: var(--smcr-foreground); }
.smcr-lang { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.5rem; padding: 0 .75rem; border: 1px solid var(--smcr-border); border-radius: 999px; background: var(--smcr-card); color: var(--smcr-foreground); font-size: .875rem; font-weight: 500; text-decoration: none; }
.smcr-lang:hover { background: var(--smcr-secondary); }
.smcr-lang__long, .smcr-desktop { display: none; }
.smcr-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: .375rem; background: transparent; color: var(--smcr-foreground); cursor: pointer; }
.smcr-menu-toggle:hover { background: var(--smcr-muted); }
.smcr-menu-toggle .smcr-icon-close, .smcr-menu-toggle[aria-expanded="true"] .smcr-icon-open { display: none; }
.smcr-menu-toggle[aria-expanded="true"] .smcr-icon-close { display: block; }
.smcr-mobile-menu { border-top: 1px solid var(--smcr-border); background: var(--smcr-background); }
.smcr-mobile-menu nav { display: flex; flex-direction: column; gap: .25rem; padding-block: 1rem; }
.smcr-mobile-menu a:not(.smcr-btn) { padding: .75rem; border-radius: .375rem; font-size: 1rem; font-weight: 500; text-decoration: none; color: var(--smcr-foreground); }
.smcr-mobile-menu a:not(.smcr-btn):hover { background: var(--smcr-muted); }
.smcr-mobile-menu hr { width: 100%; border: 0; border-top: 1px solid var(--smcr-border); margin: .5rem 0; }
.smcr-mobile-menu .smcr-btn { margin-top: .5rem; }
@media (min-width: 1024px) {
	.smcr-nav { display: flex; }
	.smcr-lang__long, .smcr-desktop { display: inline-flex; }
	.smcr-lang__short, .smcr-menu-toggle { display: none; }
	.smcr-mobile-menu { display: none !important; }
}

/* Footer — mirrors app SiteFooter */
.smcr-footer { margin-top: auto; background: linear-gradient(180deg, oklch(.17 .02 220) 0%, oklch(.22 .035 190) 100%); color: var(--smcr-surface-dark-foreground); }
.smcr-footer a { color: inherit; text-decoration: none; }
.smcr-footer a:hover { color: var(--smcr-gold); }
.smcr-footer__grid { display: grid; gap: 2.5rem; padding-block: 3.5rem; }
@media (min-width: 768px) { .smcr-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .smcr-footer__grid { grid-template-columns: 2fr repeat(var(--smcr-footer-cols, 2), 1fr); } }
.smcr-footer__name { margin: 0; font-family: var(--wp--preset--font-family--display); font-size: 1.5rem; font-weight: 600; }
.smcr-footer__accent { color: var(--smcr-gold); }
.smcr-footer__tagline { max-width: 24rem; margin: .75rem 0 1.25rem; font-size: .875rem; opacity: .75; }
.smcr-lang--dark { border-color: rgb(255 255 255 / .2); background: rgb(255 255 255 / .05); color: inherit; }
.smcr-lang--dark:hover { background: rgb(255 255 255 / .1); }
.smcr-footer__heading { margin: 0; font-family: var(--wp--preset--font-family--body); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.smcr-footer ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .625rem; font-size: .875rem; }
.smcr-footer__legal { border-top: 1px solid rgb(255 255 255 / .1); }
.smcr-footer__legal-row { display: flex; flex-direction: column; gap: .5rem; padding-block: 1.25rem; font-size: .75rem; opacity: .6; }
.smcr-footer__legal-row p { margin: 0; max-width: 48rem; }
@media (min-width: 768px) { .smcr-footer__legal-row { flex-direction: row; justify-content: space-between; align-items: center; } }

/* Page intro band — mirrors app PageIntro */
.smcr-page-intro { background: color-mix(in oklch, var(--smcr-secondary) 40%, transparent); border-bottom: 1px solid var(--smcr-border); }

/* Hero cover — Smart Guide gradient */
.wp-block-cover.is-style-smcr-hero .wp-block-cover__background,
.smcr-hero .wp-block-cover__background { background: linear-gradient(180deg, oklch(.12 .02 220 / 55%) 0%, oklch(.15 .03 170 / 75%) 100%) !important; opacity: 1 !important; }
.smcr-hero h1 { font-size: clamp(2.25rem, 6vw, 4.5rem); line-height: 1.05; }

/* Cards used by patterns (pillars, posts) */
.smcr-card, .is-style-smcr-card { background: var(--smcr-card); border: 1px solid var(--smcr-border); border-radius: 1rem; box-shadow: var(--smcr-shadow-soft); transition: box-shadow .2s; }
.smcr-card:hover, .is-style-smcr-card:hover { box-shadow: var(--smcr-shadow-card); }
.smcr-card a { text-decoration: none; }
.smcr-dark-band { background: linear-gradient(180deg, oklch(.17 .02 220) 0%, oklch(.22 .035 190) 100%); color: var(--smcr-surface-dark-foreground); border-radius: 1.5rem; }

/* Post cards in query loops */
.wp-block-post-template.is-layout-grid > li { background: var(--smcr-card); border: 1px solid var(--smcr-border); border-radius: 1rem; overflow: hidden; box-shadow: var(--smcr-shadow-soft); }
.wp-block-post-template.is-layout-grid .wp-block-post-featured-image { margin: 0; }
.wp-block-post-template.is-layout-grid .smcr-post-body { padding: 1.25rem; }

/* Sections used by patterns */
.smcr-section { padding-block: 3.5rem; }
@media (min-width: 768px) { .smcr-section { padding-block: 5.5rem; } }
.smcr-section--card { background: var(--smcr-card); }
.smcr-section--sand { background: color-mix(in oklch, var(--smcr-sand) 60%, transparent); }
.smcr-section--cta { padding-top: 0; }
.smcr-section > .smcr-eyebrow + h2 { margin-top: .5rem; }
.smcr-section .smcr-more { margin-top: 1.5rem; font-weight: 600; font-size: .875rem; }
.smcr-section .smcr-more a { text-decoration: none; }
.smcr-page-intro { padding-block: 2.5rem; }
@media (min-width: 768px) { .smcr-page-intro { padding-block: 3.5rem; } }
.smcr-page-intro .wp-block-post-title { margin: 0; }
.smcr-lead { font-size: 1.125rem; color: var(--smcr-muted-foreground); max-width: 42rem; }
.smcr-pad { padding: 1.5rem; }
.smcr-article { padding-block: 2.5rem 4rem; }

/* Hero */
.smcr-hero .wp-block-cover__inner-container { color: #fff; }
.smcr-hero__content { max-width: 42rem; }
.smcr-hero__eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgb(255 255 255 / .75); }
.smcr-hero__title { margin-top: 1rem; color: #fff; }
.smcr-hero__lead { font-size: clamp(1.125rem, 2vw, 1.25rem); color: rgb(255 255 255 / .85); max-width: 36rem; }
.smcr-hero .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgb(255 255 255 / .4); }
.smcr-hero .wp-block-button.is-style-outline .wp-block-button__link:hover { background: rgb(255 255 255 / .1); }

/* Pillars */
.smcr-pillars { gap: 1rem; }
.smcr-pillar { padding: 1.5rem; height: 100%; box-sizing: border-box; }
.smcr-pillar h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.smcr-pillar h3 a { color: var(--smcr-foreground); text-decoration: none; }
.smcr-pillar h3 a::after { content: " →"; color: var(--smcr-primary); }
.smcr-pillar p { margin: 0; font-size: .875rem; line-height: 1.6; }

/* Dark CTA */
.smcr-dark-band { padding: 3rem 1.5rem; }
@media (min-width: 768px) { .smcr-dark-band { padding: 3rem 4rem; } }
.smcr-dark-band h2 { color: inherit; margin: 0; }
.smcr-dark-band p { opacity: .8; max-width: 36rem; margin-inline: auto; }
.smcr-btn-gold .wp-block-button__link { background: var(--smcr-gold); color: var(--smcr-gold-foreground); }
.smcr-btn-gold .wp-block-button__link:hover { background: color-mix(in oklch, var(--smcr-gold) 90%, black); }

/* Give */
.smcr-give { gap: 2.5rem; margin-top: 2rem; }
.smcr-leaf-list { list-style: none; padding: 0; display: grid; gap: .75rem; color: var(--smcr-muted-foreground); }
.smcr-leaf-list li { position: relative; padding-left: 1.75rem; }
.smcr-leaf-list li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1rem; height: 1rem; background: var(--smcr-primary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E") center/contain no-repeat; }

/* Guide pages (About, Planning, Regions…) */
.smcr-cardgrid { gap: 1rem; margin-block: 1.5rem 0; }
.smcr-info { height: 100%; box-sizing: border-box; }
.smcr-info h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.smcr-info .smcr-eyebrow { margin: 0 0 .5rem; }
.smcr-info p { margin: 0; font-size: .9rem; line-height: 1.6; }
.smcr-info p + p { margin-top: 1rem; }
.smcr-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.smcr-chips a { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: var(--smcr-secondary); color: var(--smcr-foreground); font-size: .8rem; font-weight: 500; text-decoration: none; }
.smcr-chips a:hover { background: color-mix(in oklch, var(--smcr-primary) 15%, var(--smcr-secondary)); }
.smcr-band-gap { margin-top: 3rem; }
.smcr-article h2 { margin-top: 2.5rem; }
/* Lead paragraphs line up with the content beside and below them instead of centring. */
.smcr-article > .smcr-lead { max-width: var(--wp--style--global--content-size); }
.smcr-section.smcr-guide > .smcr-lead, .smcr-section.smcr-guide > .smcr-disclosure, .smcr-section.smcr-guide > .smcr-eyebrow { margin-left: max(0px, (100% - 80rem) / 2) !important; }
.smcr-section.smcr-guide { padding-top: 2.5rem; }

/* Home: starting paths, featured development, next steps */
.smcr-path { padding: 1.75rem; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.smcr-path h3 { margin: .25rem 0 .5rem; font-size: 1.35rem; }
.smcr-path p { margin: 0; }
.smcr-path__num { font-family: var(--wp--preset--font-family--display); font-size: 2.25rem; font-weight: 600; line-height: 1; color: var(--smcr-gold); }
.smcr-path .smcr-muted { flex: 1; margin-bottom: 1rem; line-height: 1.6; }
.smcr-path__link a { font-weight: 600; text-decoration: none; }
.smcr-feature { gap: 3rem; align-items: center; }
.smcr-feature__img img { width: 100%; aspect-ratio: 522 / 740; max-height: 32rem; object-fit: cover; object-position: top; border-radius: 1rem; box-shadow: var(--smcr-shadow-card); }
.smcr-small { font-size: .85rem; }
/* Blog drafts: placeholder for the author's own story (replace before publishing). */
.smcr-your-story { border: 2px dashed var(--smcr-clay); border-radius: .75rem; padding: .75rem 1rem; background: color-mix(in oklch, var(--smcr-clay) 6%, transparent); }
.smcr-your-story p { margin: 0; }
/* Audience pages */
.smcr-rules { border-left: 4px solid var(--smcr-primary); }
.smcr-rules .smcr-leaf-list { margin-block: .75rem; }
.smcr-rules .smcr-leaf-list li { font-size: .92rem; }
.smcr-sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.smcr-fit { box-sizing: border-box; max-width: 80rem; margin-inline: max(0px, (100% - 80rem) / 2) !important; margin-block: 2.5rem 0; border: 1px solid color-mix(in oklch, var(--smcr-clay) 45%, transparent); background: color-mix(in oklch, var(--smcr-clay) 6%, var(--smcr-card)); }
.smcr-fit h2 { margin: .25rem 0 .5rem; font-size: 1.5rem; }
.smcr-fit p { margin: 0 0 .75rem; max-width: 65ch; }
.smcr-audience-inquire { margin-top: 3rem; max-width: 48rem; margin-left: max(0px, (100% - 80rem) / 2) !important; }
.smcr-audiences .smcr-info h3 a { color: inherit; text-decoration: none; }
.smcr-audiences .smcr-info h3 a:hover { text-decoration: underline; }
.smcr-steps .smcr-step { border-top: 3px solid var(--smcr-primary); padding-top: 1rem; }
.smcr-step p { margin: 0 0 .5rem; }
.smcr-disclosure { margin-top: .5rem; }
.smcr-dev-inquire { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--smcr-border); scroll-margin-top: 5rem; }
.smcr-dev-inquire > * { max-width: 48rem; }

/* 404 */
.smcr-404-code { font-family: var(--wp--preset--font-family--display); font-size: 4.5rem; font-weight: 600; color: var(--smcr-primary); margin: 0; }

/* Hero content follows the site container (80rem, same side padding as the app). */
.smcr-hero > .wp-block-cover__inner-container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; box-sizing: border-box; }
/* Core gives left-positioned cover content width:auto and margin:0 with a doubled class; match it so hero text lines up with the header. */
.wp-block-cover.smcr-hero.has-custom-content-position.has-custom-content-position > .wp-block-cover__inner-container { width: 100%; max-width: 80rem; margin-inline: auto; }
@media (min-width: 640px) { .smcr-hero > .wp-block-cover__inner-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .smcr-hero > .wp-block-cover__inner-container { padding-inline: 2rem; } }
.smcr-hero.wp-block-cover { padding-inline: 0; }
.smcr-hero .smcr-hero__content > * { margin-inline: 0 !important; }
/* Full-width sections sit edge to edge, like the app (no block-gap strips between them). */
.wp-block-post-content > .alignfull { margin-block: 0 !important; }

/* Scroll-reveal timeline (.shc-timeline > .shc-tl__item, plain blocks).
   Without JavaScript or with reduced motion everything is simply shown. */
.shc-timeline { position: relative; margin: 2.5rem 0 1rem; --tl-progress: 1; }
.shc-timeline::before,
.shc-timeline::after { content: ""; position: absolute; left: 0.95rem; top: 0.4rem; width: 3px; border-radius: 3px; }
.shc-timeline::before { bottom: 0.4rem; background: var(--smcr-border); }
.shc-timeline::after { height: calc((100% - 0.8rem) * var(--tl-progress)); background: linear-gradient(var(--smcr-primary), var(--smcr-clay)); }
.shc-timeline > .shc-tl__item { position: relative; box-sizing: border-box; margin: 0; padding: 0 0 2.4rem 3.25rem; }
.shc-timeline > .shc-tl__item::before { content: ""; position: absolute; left: 0.45rem; top: 0.3rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--smcr-card); border: 3px solid var(--smcr-primary); box-sizing: border-box; z-index: 1; }
.shc-timeline > .shc-tl__item.is-key::before { left: 0.3rem; width: 1.3rem; height: 1.3rem; top: 0.15rem; background: var(--smcr-clay); border-color: var(--smcr-clay); box-shadow: 0 0 0 6px color-mix(in oklch, var(--smcr-clay) 18%, transparent); }
.shc-timeline .shc-tl__year { margin: 0; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--smcr-clay); }
.shc-timeline .shc-tl__item h3 { margin: 0.3rem 0 0.45rem; }
.shc-timeline .shc-tl__item p:not(.shc-tl__year) { margin: 0; max-width: 60ch; }
.shc-timeline > .shc-tl__item:last-child { padding-bottom: 0.5rem; }
@media (min-width: 900px) {
	.shc-timeline::before, .shc-timeline::after { left: calc(50% - 1.5px); }
	.shc-timeline > .shc-tl__item { width: 50%; padding: 0 3rem 3rem 0; text-align: right; }
	.shc-timeline > .shc-tl__item:nth-child(even) { margin-left: 50%; padding: 0 0 3rem 3rem; text-align: left; }
	.shc-timeline > .shc-tl__item::before { left: auto; right: -0.5rem; }
	.shc-timeline > .shc-tl__item.is-key::before { left: auto; right: -0.65rem; }
	.shc-timeline > .shc-tl__item:nth-child(even)::before { right: auto; left: -0.5rem; }
	.shc-timeline > .shc-tl__item.is-key:nth-child(even)::before { left: -0.65rem; }
	.shc-timeline > .shc-tl__item:nth-child(odd) p:not(.shc-tl__year) { margin-left: auto; }
}
.js-reveal .shc-timeline > .shc-tl__item { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
@media (min-width: 900px) {
	.js-reveal .shc-timeline > .shc-tl__item:nth-child(odd) { transform: translateX(-32px); }
	.js-reveal .shc-timeline > .shc-tl__item:nth-child(even) { transform: translateX(32px); }
}
.js-reveal .shc-timeline > .shc-tl__item.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.js-reveal .shc-timeline > .shc-tl__item { opacity: 1; transform: none; transition: none; }
}
