/*
Theme Name: Move2PDX
Theme URI: https://move2pdx.com
Author: Move2PDX
Description: Lightweight block theme for move2pdx.com, the guide to Jewish life in Portland, Oregon. "Hometown" design: photo-led, forest and glacier palette. Edit everything with the standard block editor.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.27
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: move2pdx
*/

/* Most styling lives in theme.json. This file only holds the few things
   theme.json cannot express: overlays, tile hover effects and the mosaic. */

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
:where(h1, h2, h3) { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--wp--preset--color--glacier); outline-offset: 3px; }

/* Eyebrow label above headings */
.is-style-eyebrow {
	font-size: 13px !important;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1;
}

/* Ghost button (outline on dark backgrounds) */
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: rgba(255, 255, 255, .14);
	color: #fff;
	border: 1.5px solid rgba(255, 255, 255, .55);
	backdrop-filter: blur(6px);
}
.wp-block-button__link { transition: transform .2s, background-color .2s; }
.wp-block-button__link:hover { transform: translateY(-2px); }

/* ---------- Header ---------- */
.m2p-header-overlay {
	position: absolute;
	inset: 0 0 auto;
	z-index: 20;
}
.admin-bar .m2p-header-overlay { top: var(--wp-admin--admin-bar--height, 32px); }
.m2p-header { color: #fff; }
.m2p-header a { color: inherit; }
.m2p-logo { margin: 0; }
.m2p-logo img { border-radius: 0; }
.m2p-brand {
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.01em;
	line-height: 1;
	margin: 0;
}
.m2p-header .m2p-brand { font-size: 19px; line-height: 1.02; }
.m2p-footer-logo { align-items: center; margin-bottom: 14px; }
.m2p-brand a { text-decoration: none; color: inherit; }
.m2p-brand-2 { color: var(--wp--preset--color--glacier); }
footer .m2p-brand { color: var(--wp--preset--color--ink); }
footer .m2p-brand-2 { color: var(--wp--preset--color--leaf); }
.m2p-plain-list { list-style: none; padding-left: 0; line-height: 2; }
footer a { color: var(--wp--preset--color--forest-2); }
.m2p-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 5px; }
.m2p-header .wp-block-navigation .wp-block-navigation-item.is-cta > a {
	background: var(--wp--preset--color--leaf);
	color: #fff;
	padding: 11px 18px;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}
.m2p-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--forest) !important;
	color: #fff !important;
}

/* ---------- Hero ---------- */
.m2p-hero { overflow: hidden; }
/* First frame of the video shows while it loads, and stays if motion is off. */
.m2p-hero:has(.wp-block-cover__video-background) { background: #173d2a url("assets/images/hero-poster.jpg") center / cover no-repeat; }
@media (prefers-reduced-motion: reduce) {
	.m2p-hero .wp-block-cover__video-background { display: none; }
}
.m2p-hero .wp-block-cover__image-background {
	transform: scale(1.06);
	animation: m2p-drift 18s ease-out forwards;
}
@keyframes m2p-drift { to { transform: scale(1); } }
.m2p-hero h1 { max-width: 13ch; }
.m2p-hero .wp-block-cover__inner-container :is(p, h1) { text-shadow: 0 2px 16px rgba(0, 0, 0, .45); }
.m2p-hero .m2p-lede { max-width: 44ch; opacity: .94; }
.m2p-hero h1 em { font-style: normal; color: var(--wp--preset--color--glacier); }

/* ---------- Fact strip ---------- */
.m2p-facts > .wp-block-group { border-left: 1px solid rgba(255, 255, 255, .14); }
.m2p-facts > .wp-block-group:first-child { border-left: 0; }
.m2p-fact-number { font-variant-numeric: tabular-nums; }

/* ---------- Topic tiles (Cover block style "Tile") ---------- */
.wp-block-cover.is-style-tile {
	border-radius: 22px;
	overflow: hidden;
	isolation: isolate;
}
.wp-block-cover.is-style-tile .wp-block-cover__image-background { transition: transform .6s; }
.wp-block-cover.is-style-tile:hover .wp-block-cover__image-background { transform: scale(1.06); }
.wp-block-cover.is-style-tile::after {
	content: "→";
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 2;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--forest);
	display: grid;
	place-items: center;
	font-weight: 700;
	transition: transform .3s;
	pointer-events: none;
}
.wp-block-cover.is-style-tile:hover::after { transform: rotate(-45deg); }
/* The heading link covers the whole tile, so the full card is clickable */
.wp-block-cover.is-style-tile h3 a { color: inherit; text-decoration: none; }
.wp-block-cover.is-style-tile h3 a::before { content: ""; position: absolute; inset: 0; z-index: 3; }
.wp-block-cover.is-style-tile .wp-block-cover__inner-container { position: static; }

/* ---------- Perk rows (Group block style "Card") ---------- */
/* A grid placed inside a card must span the card, or it collapses to zero width. */
.is-style-card > .is-layout-grid { align-self: stretch; width: 100%; }
.is-style-card > .is-layout-grid > .is-layout-flex { min-width: 0; }
.wp-block-group.is-style-card {
	background: #fff;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px;
}
.m2p-perk .m2p-pct { min-width: 3.2ch; font-variant-numeric: tabular-nums; }
.m2p-perk .m2p-was { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.m2p-perk .m2p-was s { opacity: .7; }

/* ---------- Partner logos ---------- */
.m2p-partners-label { text-align: center; letter-spacing: .08em; text-transform: uppercase; }
.m2p-partners {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 32px 64px !important;
}
.m2p-partner { margin: 0 !important; flex: 0 0 auto; width: auto !important; }
.m2p-partner img { display: block; height: 72px; width: auto; max-width: 240px; object-fit: contain; border-radius: 0; mix-blend-mode: multiply; filter: grayscale(1); opacity: .8; transition: filter .3s, opacity .3s; }
@media (max-width: 600px) {
	.m2p-partners { gap: 24px 36px !important; }
	.m2p-partner img { height: 52px; max-width: 160px; }
}
.m2p-partner a:hover img { filter: none; opacity: 1; }

/* ---------- Photo with tag ---------- */
.m2p-tagged-photo { position: relative; }
.m2p-tagged-photo figcaption {
	position: absolute;
	left: 18px;
	bottom: 18px;
	margin: 0;
	background: #fff;
	color: var(--wp--preset--color--ink);
	border-radius: 14px;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.m2p-tagged-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

/* ---------- Photo carousel (Group with class m2p-carousel) ---------- */
/* In the editor the photos simply stack, so they are easy to swap. */
.m2p-carousel { position: relative; }
.m2p-carousel > figure { margin: 0 0 12px; }
.m2p-carousel > figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; }
/* On the site, before the script runs, show only the first photo. */
body:not(.editor-styles-wrapper) .m2p-carousel:not(.is-ready) > figure:not(:first-of-type) { display: none; }
.m2p-carousel.is-ready { aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; }
.m2p-carousel.is-ready > figure {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 1s ease;
}
.m2p-carousel.is-ready > figure.is-active { opacity: 1; }
.m2p-carousel.is-ready > figure img { height: 100%; border-radius: 0; }
.m2p-carousel > .m2p-carousel-tag {
	position: absolute;
	left: 18px;
	bottom: 18px;
	z-index: 2;
	margin: 0;
	background: #fff;
	color: var(--wp--preset--color--ink);
	border-radius: 14px;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.m2p-carousel-dots {
	position: absolute;
	right: 18px;
	bottom: 26px;
	z-index: 2;
	display: flex;
	gap: 8px;
}
.m2p-carousel-dots button {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
	cursor: pointer;
}
.m2p-carousel-dots button[aria-current="true"] { background: #fff; transform: scale(1.25); }
@media (max-width: 600px) {
	.m2p-carousel > .m2p-carousel-tag { left: 12px; bottom: 12px; font-size: 14px; padding: 10px 12px; }
	.m2p-carousel-dots { right: 12px; bottom: 50%; top: 14px; bottom: auto; }
}

/* ---------- Photo mosaic ---------- */
.m2p-mosaic {
	display: grid !important;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 200px 200px;
	gap: 12px;
}
.m2p-mosaic > figure { margin: 0 !important; height: 100%; }
.m2p-mosaic > figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.m2p-mosaic > figure:first-child { grid-row: span 2; }

/* ---------- Dot list ---------- */
ul.is-style-dots { list-style: none; padding-left: 0; display: grid; gap: 12px; }
ul.is-style-dots li { position: relative; padding-left: 26px; }
ul.is-style-dots li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 9px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--wp--preset--color--glacier);
	box-shadow: 0 0 0 4px rgba(25, 193, 222, .2);
}

/* ---------- Call-to-action panel ---------- */
.m2p-talk { position: relative; overflow: hidden; }
.m2p-talk::after {
	content: "";
	position: absolute;
	right: -120px;
	top: -120px;
	width: 380px;
	height: 380px;
	border-radius: 50%;
	border: 60px solid rgba(25, 193, 222, .12);
	pointer-events: none;
}
.m2p-talk > * { position: relative; z-index: 1; }
.m2p-avatar {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	flex: 0 0 54px;
	padding: 0 !important;
	margin: 0;
	box-sizing: border-box;
}
.m2p-contact-list p { margin: 0; }
.m2p-contact-list a { word-break: break-word; }

/* ---------- FAQ (Details block) ---------- */
/* Section links like /faq/#housing land below the sticky header. */
.m2p-faq-page [id] { scroll-margin-top: 90px; }
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: 18px;
}
.wp-block-details summary { font-weight: 600; font-size: 1.1em; cursor: pointer; }
.is-style-card .wp-block-details { border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); padding-block: 14px; }
.is-style-card .wp-block-details summary { color: var(--wp--preset--color--forest-2); }
.is-style-card .wp-block-details h4 { margin-top: 18px; }

/* ---------- Post cards ---------- */
.m2p-card-img img { border-radius: 18px; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.m2p-facts > .wp-block-group { border-left: 0; }
	.m2p-talk .wp-block-columns { gap: 28px; }
	.m2p-mosaic { grid-template-rows: 150px 150px; }
	.m2p-perk { flex-wrap: wrap !important; }
	.m2p-perk .m2p-was { margin-left: 0; text-align: left; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
