/*
Theme Name: Nate On A Mission
Theme URI: https://natemission.com
Author: Nate Roberts
Description: Blog and vlog theme for the Nate On A Mission YouTube channel. Each post carries one video; Shorts get vertical cards.
Version: 1.0.2
Requires at least: 6.5
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: natemission
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 3px; }

.nm-eyebrow { font-size: 0.8rem !important; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--ember) !important; margin: 0; }
.nm-eyebrow a { color: inherit; text-decoration: none; }
.nm-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--muted); }
.nm-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.nm-section--sand { background: var(--wp--preset--color--sand); }
.nm-section-head { align-items: flex-end !important; gap: 1rem; margin-bottom: 1.75rem; }
.nm-section-head h2 { margin: 0.25rem 0 0; }
.nm-section-head .nm-more { margin: 0; font-weight: 700; white-space: nowrap; }
.nm-section-head .nm-more a { text-decoration: none; }

/* ---------- Header ---------- */
.nm-header { background: var(--wp--preset--color--midnight); color: #fff; position: sticky; top: 0; z-index: 50; }
.admin-bar .nm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .nm-header { top: 0; position: relative; } }
.nm-header__inner { padding-block: 0.85rem; gap: 1.25rem; }
.nm-brand { display: flex; align-items: center; gap: 0.7rem; color: #fff !important; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 1.15rem; line-height: 1.1; }
.nm-brand__logo { width: 44px; height: 44px; border-radius: 50%; flex: none; display: block; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14); }
.nm-brand small { display: block; font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); margin-top: 0.15rem; }
.nm-header .wp-block-navigation { font-weight: 600; font-size: 0.95rem; gap: 1.4rem; }
.nm-header .wp-block-navigation a { color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.nm-header .wp-block-navigation a:hover { color: #fff; }
.nm-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--midnight); color: #fff; padding: 2rem 1.5rem; }
.nm-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { font-size: 1.25rem; gap: 1.1rem; }
.nm-header .wp-block-navigation__responsive-container-open, .nm-header .wp-block-navigation__responsive-container-close { color: #fff; }
.nm-header__actions { gap: 1rem; flex-wrap: nowrap; }
.nm-header .wp-block-button__link { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
@media (max-width: 600px) { .nm-header .nm-subscribe { display: none; } }

/* ---------- Hero ---------- */
.nm-hero { background: radial-gradient(1100px 500px at 85% -10%, rgba(226, 85, 43, 0.35), transparent 60%), linear-gradient(180deg, var(--wp--preset--color--midnight), var(--wp--preset--color--night)); color: #fff; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.nm-hero h1, .nm-hero h2, .nm-hero h3 { color: #fff; }
.nm-hero h1 { font-family: var(--wp--preset--font-family--display); font-weight: 600; letter-spacing: -0.02em; margin: 0.5rem 0 1rem; }
.nm-hero .nm-lead { color: rgba(255, 255, 255, 0.78); max-width: 34rem; }
.nm-hero .nm-eyebrow { color: var(--wp--preset--color--gold) !important; }
.nm-hero .wp-block-columns { align-items: center !important; gap: clamp(1.5rem, 4vw, 3.5rem); }
.nm-hero .is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: transparent; }
.nm-hero .is-style-outline .wp-block-button__link:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.nm-hero-feature .wp-block-post-title { font-size: 1.35rem; margin: 1rem 0 0.35rem; }
.nm-hero-feature .wp-block-post-title a { color: #fff; text-decoration: none; }
.nm-hero-feature .wp-block-post-date { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }
.nm-hero-feature .nm-thumb { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); }

/* ---------- Thumbnails & player ---------- */
.nm-thumb { position: relative; margin: 0; border-radius: var(--wp--custom--radius); overflow: hidden; background: var(--wp--preset--color--midnight); aspect-ratio: 16 / 9; }
.nm-thumb--short { aspect-ratio: 9 / 16; }
.nm-thumb a { display: block; height: 100%; }
.nm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.nm-thumb__badge { position: absolute; left: 0.7rem; bottom: 0.7rem; background: rgba(12, 20, 36, 0.82); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25rem 0.55rem; border-radius: 6px; }
.nm-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--wp--preset--color--ember); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); transition: transform 0.25s ease, background 0.25s ease; }
.nm-play::after { content: ""; position: absolute; left: 26px; top: 20px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.nm-thumb .nm-play { width: 52px; height: 52px; margin: -26px 0 0 -26px; opacity: 0.92; }
.nm-thumb .nm-play::after { left: 21px; top: 16px; border-width: 10px 0 10px 16px; }
.wp-block-post:hover .nm-thumb img, .nm-thumb:hover img { transform: scale(1.04); }
.wp-block-post:hover .nm-play, .nm-video__poster:hover .nm-play { transform: scale(1.08); background: var(--wp--preset--color--ember-dark); }

.nm-video { position: relative; margin: 0 0 2rem; border-radius: var(--wp--custom--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; box-shadow: var(--wp--custom--shadow); }
.nm-video--short { aspect-ratio: 9 / 16; max-width: 400px; margin-inline: auto; }
.nm-video__poster { display: block; height: 100%; }
.nm-video__poster img, .nm-video iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }

/* ---------- Cards ---------- */
.nm-grid .wp-block-post-template { gap: clamp(1.25rem, 3vw, 2rem); }
.nm-card { display: flex; flex-direction: column; gap: 0.55rem; }
.nm-card .wp-block-post-title { font-size: 1.12rem; line-height: 1.3; margin: 0.4rem 0 0; letter-spacing: -0.01em; }
.nm-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.nm-card .wp-block-post-title a:hover { color: var(--wp--preset--color--ember-dark); }
.nm-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: 0.95rem; margin: 0; }
.nm-card .wp-block-post-excerpt__excerpt { margin: 0; }
.nm-meta { gap: 0.5rem !important; font-size: 0.8rem; color: var(--wp--preset--color--muted); align-items: center; }
.nm-meta > * { margin: 0 !important; }
.nm-meta .wp-block-post-terms a { color: var(--wp--preset--color--ember-dark); font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }

/* Shorts strip: horizontal scroll on small screens */
.nm-shorts .wp-block-post-template { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.nm-shorts .wp-block-post-title { font-size: 0.92rem; margin-top: 0.5rem; }
@media (max-width: 1000px) {
	.nm-shorts .wp-block-post-template { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.75rem; }
	.nm-shorts .wp-block-post { scroll-snap-align: start; }
}
@media (max-width: 520px) { .nm-shorts .wp-block-post-template { grid-auto-columns: 62%; } }

/* Shorts in regular grids (archives) keep the grid tidy with a landscape crop */
.nm-grid:not(.nm-shorts) .nm-thumb--short { aspect-ratio: 16 / 9; }

/* ---------- Topic chips ---------- */
.nm-chips { gap: 0.6rem !important; }
.nm-chips .wp-block-button__link, .nm-chips a { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 0.55rem 1.05rem; font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.nm-chips .wp-block-button__link:hover, .nm-chips a:hover { border-color: var(--wp--preset--color--ember); color: var(--wp--preset--color--ember-dark); background: #fff; }
.wp-block-categories-list.nm-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; }
.wp-block-categories-list.nm-chips li { margin: 0; }

.nm-topics .wp-block-column { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius); padding: 1.5rem; transition: border-color 0.2s, transform 0.2s; }
.nm-topics .wp-block-column:hover { border-color: var(--wp--preset--color--ember); transform: translateY(-2px); }
.nm-topics h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.nm-topics h3 a { color: var(--wp--preset--color--ink); text-decoration: none; }
.nm-topics h3 a::after { content: " →"; color: var(--wp--preset--color--ember); }
.nm-topics p { margin: 0; color: var(--wp--preset--color--muted); font-size: 0.93rem; }

/* ---------- Archive & page heads ---------- */
.nm-page-head { background: var(--wp--preset--color--sand); padding-block: clamp(2.25rem, 5vw, 3.5rem); border-bottom: 1px solid var(--wp--preset--color--line); }
.nm-page-head h1 { margin: 0.4rem 0 0.5rem; font-size: clamp(2rem, 5vw, 3rem); }
.nm-page-head .wp-block-term-description p, .nm-page-head .nm-lead { margin: 0; color: var(--wp--preset--color--muted); }
.wp-block-query-pagination { margin-top: 2.5rem; gap: 0.5rem; font-weight: 700; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 8px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--ink); color: #fff; }

/* ---------- Single post ---------- */
.nm-single-head { padding-top: clamp(1.75rem, 4vw, 3rem); }
.nm-single-head h1 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); margin: 0.6rem 0 0.75rem; }
.nm-single .wp-block-post-content { font-size: 1.1rem; }
.nm-single .wp-block-post-content > .wp-block-shortcode:first-child, .nm-single .wp-block-post-content > .nm-video:first-child { margin-top: 0.5rem; }
.nm-disclosure { font-size: 0.85rem !important; color: var(--wp--preset--color--muted); font-style: italic; }
.nm-single .wp-block-post-terms.nm-tags a { display: inline-block; background: var(--wp--preset--color--sand); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--wp--preset--color--ink); margin: 0 0.3rem 0.4rem 0; }
.nm-single .wp-block-post-terms.nm-tags .wp-block-post-terms__separator { display: none; }
.nm-post-nav { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.5rem; gap: 1rem; font-weight: 700; }
.nm-post-nav a { text-decoration: none; }

/* ---------- Subscribe band ---------- */
.nm-cta { background: var(--wp--preset--color--midnight); color: #fff; border-radius: calc(var(--wp--custom--radius) * 1.5); padding: clamp(2rem, 5vw, 3.25rem); position: relative; overflow: hidden; }
.nm-cta::before { content: ""; position: absolute; inset: auto -120px -160px auto; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(226, 85, 43, 0.45), transparent 70%); }
.nm-cta > * { position: relative; }
.nm-cta h2 { color: #fff; margin: 0 0 0.5rem; }
.nm-cta p { color: rgba(255, 255, 255, 0.78); margin: 0; }
.nm-cta .wp-block-columns { align-items: center !important; }

/* ---------- Prose pages ---------- */
.nm-prose h2 { margin-top: 2.5rem; font-size: 1.6rem; }
.nm-resources { list-style: none; padding: 0 !important; display: grid; gap: 0.6rem; }
.nm-resources li { background: var(--wp--preset--color--sand); border-radius: 12px; padding: 0.85rem 1.1rem; }
.nm-resources a { font-weight: 700; text-decoration: none; }
.nm-resources a::after { content: " ↗"; font-weight: 400; }

/* ---------- Footer ---------- */
.nm-footer { background: var(--wp--preset--color--midnight); color: rgba(255, 255, 255, 0.72); padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; font-size: 0.95rem; margin-top: clamp(3rem, 7vw, 5rem); }
.nm-footer h2, .nm-footer h3 { color: #fff; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 1rem; }
.nm-footer a { color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.nm-footer a:hover { color: #fff; text-decoration: underline; }
.nm-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.nm-footer .nm-brand { margin-bottom: 0.9rem; }
.nm-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2.5rem; padding-top: 1.25rem; font-size: 0.82rem; color: rgba(255, 255, 255, 0.55); gap: 1rem; }
.nm-footer__bottom p { margin: 0; }
main.nm-main + .nm-footer, .nm-footer { margin-block-start: 0; }

/* Shorts archive keeps the vertical format */
body.tag-shorts .nm-grid .wp-block-post-template { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.tag-shorts .nm-grid .nm-thumb--short { aspect-ratio: 9 / 16; }
body.tag-shorts .nm-card .wp-block-post-excerpt { display: none; }
@media (max-width: 900px) { body.tag-shorts .nm-grid .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
