/*
Theme Name: Jacky Morgan
Theme URI: https://jackymorgan.com.au/
Author: Jacky Morgan Coaching & Consulting
Description: Custom block theme for Jacky Morgan Coaching & Consulting. Light, warm and fast, built around the tree logo colours.
Version: 1.2.18
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jacky-morgan
*/

/* Global WordPress resets. Page designs live in assets/css/<page>.css */
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: #1F1E22; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }
.admin-bar .site-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-head { top: 46px; } }

/* Generic pages (privacy, terms) and blog posts until the article template is styled */
.jm-generic { padding-block: clamp(32px, 5vw, 72px) clamp(56px, 7vw, 96px); }
.jm-generic .wrap { max-width: 760px; }
.jm-generic h1 { font-size: clamp(2rem, 1.6rem + 2vw, 3rem); margin-bottom: 20px; }
.jm-generic .wp-block-post-content > * + * { margin-block-start: 1em; }
.jm-generic .wp-block-post-content h2 { margin-block-start: 1.6em; }
.jm-generic .wp-block-post-content a { color: var(--gold-ink); }
.jm-generic img { max-width: 100%; height: auto; border-radius: 14px; }
.jm-list .wp-block-post-template { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.jm-list .wp-block-post { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; }
.jm-list .wp-block-post-title { font-size: 1.25rem; }
.jm-list .wp-block-post-title a { color: var(--ink); text-decoration: none; }

/* ---------- Articles (dynamic parts of the article design) ---------- */
.art-head .cat { justify-self: start; }
.art-head .cat a { color: inherit; text-decoration: none; }
.art-head .wp-block-post-title { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.3rem); letter-spacing: -.015em; margin: 0; }
.byline .meta .wp-block-post-date { display: inline; }
.byline .meta .wp-block-post-date::before { content: "Published "; }
.art-hero .wp-block-post-featured-image { margin: 0; }
.art-hero .wp-block-post-featured-image img { width: 100%; height: auto; aspect-ratio: 760 / 500; object-fit: cover; border-radius: var(--radius); }
.art-hero .wrap:empty, .art-hero:has(.wrap:empty) { display: none; }
.prose .wp-block-post-content > * + * { margin-top: 1.1em; }
.prose .wp-block-post-content > :first-child { margin-top: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose figure { margin: 1.6em 0; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--gold); font: 600 italic 1.3rem/1.45 var(--f-display); }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* Post grids: related articles and the Insights page */
.jm-posts .wp-block-post-template { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.jm-posts .wp-block-post { display: grid; gap: 10px; align-content: start; min-width: 0; }
.jm-posts .wp-block-post-featured-image { margin: 0; }
.jm-posts .wp-block-post-featured-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; transition: transform .3s ease; }
.jm-posts .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.02); }
.jm-posts .jm-cat { font: 700 .78rem/1.3 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--rose-ink); }
.jm-posts .jm-cat a { color: inherit; text-decoration: none; }
.jm-posts .wp-block-post-title { font-size: var(--step-1); margin: 0; }
.jm-posts .wp-block-post-title a { color: var(--ink); text-decoration: none; transition: color .2s; }
.jm-posts .wp-block-post-title a:hover { color: var(--gold-ink); }
.jm-posts .wp-block-post-date { font-size: var(--step--1); color: var(--muted); }
.jm-posts .wp-block-query-pagination { margin-top: 36px; display: flex; gap: 10px; justify-content: center; font-weight: 700; }
.jm-posts .wp-block-query-pagination a, .jm-posts .page-numbers { padding: 8px 14px; border-radius: 999px; background: var(--surface); text-decoration: none; }
.jm-posts .page-numbers.current { background: var(--gold); }
.jm-insights-head .wrap { max-width: var(--wrap); }
.jm-insights-head h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.3rem); }
@media (max-width: 880px) { .jm-posts .wp-block-post-template { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .jm-posts .wp-block-post-template { grid-template-columns: 1fr; } }

/* Article main image: 20% narrower than the content area */
.art-hero .wrap { max-width: 880px; }
.prose .takeaways ul { margin: 0; padding-left: 1.2em; }
.prose .takeaways h2 { margin-top: 0; }

/* Author photos always round, whatever other plugins set for images */
.byline img, .author img { aspect-ratio: 1 / 1; height: auto !important; max-width: none; object-fit: cover; object-position: 50% 22%; border-radius: 50% !important; }
.byline img { width: 52px !important; }
.author img { width: 96px !important; }

/* Simple pages (privacy policy, terms and older pages) */
.jm-page-body { padding-top: clamp(32px, 4vw, 56px); }
.jm-page-body .wrap { max-width: 900px; }
.jm-page-head .wrap { max-width: 900px; }

/* Old pages use h4 for section headings */
.prose h4 { font: 700 1.3rem/1.3 var(--f-display); margin-top: 1.8em; }
.prose h4 strong { font-weight: 700; }

/* Anything marked hidden stays hidden (thank-you and error messages until needed) */
[hidden] { display: none !important; }

/* Use size-matched fallback fonts while the web fonts load, so nothing jumps */
:root { --f-display: "Playfair Display", "Playfair Display Fallback", Georgia, "Times New Roman", serif; --f-body: Figtree, "Figtree Fallback", Arial, system-ui, sans-serif; }

/* The menu item for the current page is highlighted */
.nav a[aria-current="page"] { background: var(--gold-soft); }

/* Phones: smaller hero badges that sit on the photo's edges, not across it */
@media (max-width: 600px) {
	.badge { padding: 8px 12px; border-radius: 12px; font-size: .74rem; line-height: 1.3; gap: 1px; right: -2px; bottom: 6%; max-width: 48%; }
	.badge strong { font-size: 1.15rem; }
	.badge2 { left: -2px; right: auto; top: 4%; bottom: auto; }
}

/* Email pop-up (site.js) */
.jm-mail{border:0;border-radius:20px;padding:32px 28px 26px;width:min(440px,calc(100vw - 32px));background:var(--surface,#fff);color:var(--ink,#26252B);box-shadow:0 24px 60px rgba(38,37,43,.22);text-align:center}
.jm-mail::backdrop{background:rgba(38,37,43,.45)}
.jm-mail h2{font-size:1.6rem;margin:0 0 6px}
.jm-mail-addr{font-weight:700;font-size:1.1rem;margin:0 0 20px;word-break:break-all;user-select:all}
.jm-mail-btns{display:flex;flex-direction:column;gap:10px}
.jm-mail-btns .btn{justify-content:center;width:100%}
.jm-mail-web{margin:16px 0 0;font-size:.95rem;color:var(--muted,#6B6A70)}
.jm-mail-web a{color:var(--ink,#26252B);font-weight:600}
.jm-mail-x{position:absolute;top:10px;right:12px;width:44px;height:44px;border:0;background:none;font-size:1.8rem;line-height:1;cursor:pointer;color:var(--charcoal,#6B6A70);border-radius:50%}
.jm-mail-x:hover,.jm-mail-x:focus-visible{background:var(--paper,#F7F5F7)}
