/*
Theme Name: Alpine
Description: Alpine Journals theme: the photo-wall look of the original site, rebuilt mobile-first with managed ad slots and affiliate gear boxes.
Version: 1.3.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: alpine
*/

:root {
	--ink: #16161d;
	--text: #404040;
	--heading: #333;
	--muted: #8a8a8a;
	--bg: #fff;
	--line: #e6e6e6;
	--night: #111;
	--mint: #00ffd3;
	--mint-ink: #00a88b;
	--link: #117bb8;
	--wrap: 1180px;
	--measure: 780px;
	--header: 56px;
	--sans: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--display: Montserrat, "Helvetica Neue", Helvetica, Arial, sans-serif;
	--serif: "Noto Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@view-transition { navigation: auto; }
:focus-visible { outline: 2px solid var(--mint-ink); outline-offset: 2px; }
::selection { background: var(--mint); color: #000; }
body { margin: 0; padding-top: var(--header); background: var(--bg); color: var(--text); font: 400 1.0625rem/1.75 var(--sans); overflow-wrap: break-word; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--link); }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 2em 0 .6em; }
h1 { font: 800 clamp(1.9rem, 5vw, 2.625rem)/1.28 var(--sans); margin-top: 0; }
h2 { font: 400 clamp(1.5rem, 3.6vw, 2rem)/1.3 var(--serif); color: var(--ink); }
h3 { font: 700 1.25rem/1.35 var(--sans); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip-path: none; background: var(--ink); color: var(--mint); padding: 8px 12px; }

/* Header: plain white bar, black wordmark, mint-on-black for the active item */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: rgba(255, 255, 255, .97); transition: box-shadow .25s; }
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 8px 24px rgba(22, 22, 29, .08); }
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.site-header .wrap { display: flex; align-items: center; gap: 40px; min-height: var(--header); }
.site-title { font: 600 1.5rem/1 var(--sans); color: #000; text-decoration: none; white-space: nowrap; }
.site-title:hover { color: #000; }
.nav-toggle { margin-left: auto; background: #000; color: var(--mint); border: 0; padding: 9px 14px; font: 400 .9rem var(--display); cursor: pointer; }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--night); padding: 8px 18px 18px; max-height: calc(100vh - var(--header)); overflow: auto; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 11px 4px; color: #eee; text-decoration: none; font: 400 1rem var(--display); }
.site-nav a:hover, .site-nav [class*="current"] > a { color: var(--mint); }
.site-nav ul ul a { padding-left: 20px; font-weight: 300; color: #bbb; }

@media (min-width: 900px) {
	.nav-toggle { display: none; }
	.site-nav { display: block; position: static; background: none; padding: 0; overflow: visible; max-height: none; }
	.site-nav > ul { display: flex; gap: 2px; }
	.site-nav li { position: relative; }
	.site-nav a { padding: 8px 10px 7px; color: #000; transition: background .15s, color .15s; }
	.site-nav > ul > li:hover > a, .site-nav > ul > li:focus-within > a, .site-nav > ul > [class*="current"] > a { background: #000; color: var(--mint); }
	.site-nav ul ul { display: none; position: absolute; top: 100%; left: 0; min-width: 250px; background: #000; padding: 6px 0; }
	.site-nav li:hover > ul, .site-nav li:focus-within > ul { display: block; }
	.site-nav ul ul a { padding: 8px 14px; color: #eee; font-size: .92rem; }
	.site-nav ul ul a:hover { color: var(--mint); }
}

/* Photo wall: edge-to-edge tiles with a caption that highlights each line */
.wall { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; background: var(--ink); }
.wall li { width: 100%; height: 300px; margin: 0; }
@media (min-width: 800px) { .wall li { width: 50%; height: 400px; } }
@media (min-width: 1100px) { .wall li { width: 33.3333%; } }
@media (min-width: 1300px) { .wall li { width: 25%; } }
@media (min-width: 2000px) { .wall li { width: 20%; } }
.tile { position: relative; display: block; height: 100%; overflow: hidden; text-decoration: none; background: var(--ink); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .6, .2, 1); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 22, 29, .28), rgba(22, 22, 29, 0) 45%, rgba(22, 22, 29, .35)); transition: background-color .3s; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile:hover::after, .tile:focus-visible::after { background-color: rgba(0, 0, 0, .38); }
.tile-cap { position: relative; z-index: 1; display: block; padding: 12px 12px 12px 20px; }
.tile-cap span { font: 300 1.25rem/2.2 var(--display); color: rgba(255, 255, 255, .82); background: rgba(22, 22, 29, .9); box-shadow: 0 0 10px rgba(22, 22, 29, .2); padding: 8px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .2s, color .2s; }
.tile:hover .tile-cap span, .tile:focus-visible .tile-cap span { background: rgba(255, 255, 255, .82); color: rgba(0, 0, 0, .78); }
.tile-kicker { position: absolute; z-index: 1; left: 12px; bottom: 12px; font: 400 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--mint); background: #000; padding: 6px 9px; }
.tile-kicker::after { content: " \2192"; display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; white-space: pre; transition: width .25s; }
.tile:hover .tile-kicker::after, .tile:focus-visible .tile-kicker::after { width: 1.5em; }
.wall .wall-ad { width: 100%; height: auto; display: grid; place-items: center; padding: 14px 0 18px; background: var(--night); }
.wall-ad .ad { margin: 0; width: 100%; max-width: 1000px; min-height: 100px; }

/* Tiles ease in as they scroll into view (only when scripts run) */
.js .wall li:not(.wall-ad) { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .6, .2, 1); }
.js .wall li.in { opacity: 1; transform: none; }

/* Home strip under the feature */
.strip { background: var(--night); color: #eee; }
.strip .wrap { max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 13px; padding-bottom: 13px; }
.strip h1 { font: 300 .95rem/1.4 var(--display); color: #eee; margin: 0; }
.strip ul { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 0; padding: 0; }
.strip a, .subcats a { display: block; padding: 5px 10px; font: 400 .82rem var(--display); color: var(--mint); background: #000; text-decoration: none; border: 1px dotted rgba(0, 255, 211, .45); transition: background .15s, color .15s; }
.strip a:hover, .subcats a:hover { background: var(--mint); color: #000; }

.btn { display: inline-block; background: var(--mint); color: #000; font: 400 .9rem var(--display); letter-spacing: .02em; padding: 12px 20px; text-decoration: none; transition: transform .2s, box-shadow .2s; }
a:hover .btn, .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 255, 211, .28); }
.kicker { display: block; font: 400 .72rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--mint); margin: 0 0 10px; }
.kicker a { color: inherit; text-decoration: none; }
.kicker::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--mint); vertical-align: middle; margin-right: 10px; }

/* Full-bleed parallax banner with the title set over it */
.banner { position: relative; display: grid; align-items: end; min-height: clamp(300px, 46vw, 640px); background: var(--ink); color: #fff; overflow: hidden; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 22, 29, 0) 35%, rgba(22, 22, 29, .82)); }
.banner-inner { position: relative; z-index: 1; width: 100%; padding-top: 70px; padding-bottom: 30px; }
.banner h1 { color: #fff; margin: 0; max-width: 24ch; text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); animation: rise .7s cubic-bezier(.2, .6, .2, 1) both; }
.banner .kicker { display: inline-block; background: #000; padding: 6px 10px; margin-bottom: 12px; animation: rise .7s cubic-bezier(.2, .6, .2, 1) both; }
.banner .kicker::before { width: 16px; margin-right: 8px; }
.banner-sub { margin-top: 8px; font: 300 .95rem var(--display); color: rgba(255, 255, 255, .85); max-width: 60ch; }
.banner-plain { min-height: 0; }
.banner-plain::after { display: none; }
.banner-plain .banner-inner { padding-top: 48px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Home feature */
.feature { min-height: clamp(380px, 62vh, 680px); text-decoration: none; }
.feature .banner-inner { display: block; padding-bottom: 40px; }
.feature-title { display: block; font: 800 clamp(2rem, 5.4vw, 3.5rem)/1.15 var(--sans); color: #fff; max-width: 20ch; text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); animation: rise .7s .05s cubic-bezier(.2, .6, .2, 1) both; }
.feature-excerpt { display: block; max-width: 58ch; margin: 12px 0 20px; color: rgba(255, 255, 255, .88); font-size: 1.02rem; line-height: 1.6; animation: rise .7s .12s cubic-bezier(.2, .6, .2, 1) both; }
.feature .btn { animation: rise .7s .2s cubic-bezier(.2, .6, .2, 1) both; }
.feature:hover { color: #fff; }

/* Archive */
.page-head { padding-top: 22px; padding-bottom: 22px; }
.page-head p { max-width: 75ch; margin: 0 0 8px; }
.subcats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.subcats b { font-weight: 400; opacity: .6; margin-left: 4px; }
.archive-description + .subcats { margin-top: 14px; }
.pagination { display: flex; justify-content: center; gap: 4px; padding: 30px 0; background: var(--night); }
.pagination .page-numbers { padding: 8px 14px; font: 400 .9rem var(--display); background: #000; color: #eee; text-decoration: none; }
.pagination .current, .pagination a:hover { color: var(--mint); }

/* Single */
.progress { position: fixed; top: var(--header); left: 0; right: 0; height: 3px; z-index: 49; pointer-events: none; }
.admin-bar .progress { top: calc(var(--header) + var(--wp-admin--admin-bar--height, 32px)); }
.progress i { display: block; height: 100%; width: 100%; background: var(--mint); transform: scaleX(0); transform-origin: 0 50%; }
.entry-meta { font-size: .8125rem; color: #999; margin: 0; padding: 22px 0 20px; }
.entry-meta b { color: var(--text); }
article.page .layout > div:first-child { padding-top: 30px; }
.layout { display: block; }
.rail { display: none; }
@media (min-width: 1100px) {
	.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; }
	.rail { display: block; }
	.rail-sticky { position: sticky; top: calc(var(--header) + 20px); }
}
.rail h2 { font: 700 1rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin: 26px 0 10px; }
.rail ul, .site-footer ul { list-style: none; margin: 0; padding: 0; }
.rail li { border-top: 1px dotted var(--mint-ink); }
.rail li a { display: block; padding: 11px 0; color: var(--text); text-decoration: none; font-style: italic; font-size: .875rem; line-height: 1.5; }
.rail li a { transition: color .15s, padding-left .2s; }
.rail li a:hover { color: var(--link); padding-left: 6px; }

.entry-content { max-width: var(--measure); font-size: 1.1875rem; line-height: 1.79; }
@media (max-width: 619px) { .entry-content { font-size: 1.0625rem; line-height: 1.75; } }
.entry-content > * { margin-top: 0; margin-bottom: 1.4em; }
.entry-content h2 { margin-top: 1.9em; margin-bottom: .6em; }
.entry-content h2::before { content: ""; display: block; width: 44px; height: 3px; background: var(--mint); margin-bottom: 16px; }
.entry-content > p:first-of-type { font-size: 1.08em; color: var(--ink); }
.entry-content a { text-decoration-color: rgba(17, 123, 184, .4); text-underline-offset: .18em; transition: text-decoration-color .15s; }
.entry-content a:hover { text-decoration-color: currentColor; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-caption-text { font-size: .85rem; font-style: italic; color: var(--muted); text-align: center; margin-top: 6px; }
.entry-content blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--mint); font-family: var(--serif); color: var(--ink); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content iframe { width: 100%; }
.entry-content .wp-block-embed.is-type-video .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.entry-content .wp-block-embed.is-type-video iframe { height: 100%; }
.entry-content .wp-caption { max-width: 100%; }
.entry-footer { max-width: var(--measure); font-size: .85rem; color: var(--muted); border-top: 1px dotted var(--mint-ink); margin-top: 34px; padding-top: 14px; }
.more { margin-top: 56px; background: var(--night); }
.more > .ad { margin: 0 auto; padding: 18px 0 4px; max-width: 1000px; min-height: 100px; }
.more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; }
.more-head h2 { font: 300 1.15rem var(--display); color: #eee; margin: 0; }
.more-head h2::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--mint); vertical-align: middle; margin-right: 12px; }
.more-head a { font: 400 .85rem var(--display); color: var(--mint); text-decoration: none; white-space: nowrap; }

/* Ads: reserve height so content does not jump when an ad loads */
.ad { clear: both; margin: 30px 0; min-height: 280px; text-align: center; }
.ad::before { content: "Advertisement"; display: block; font: 400 .62rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: #b5b5b5; margin-bottom: 4px; }
.ad-rail { min-height: 600px; margin: 0; }
.ad ins[data-ad-status="unfilled"] { display: none !important; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }

/* Gear box: dark panel in the same language as the tile captions */
.gear { background: var(--ink); color: #ddd; padding: 22px 22px 14px; margin: 36px 0; font-family: var(--sans); border-top: 3px solid var(--mint); }
.gear h2 { font: 300 1.3rem var(--display); color: #fff; margin: 0 0 4px; }
.gear-intro { font-size: .9rem; line-height: 1.55; color: #aaa; margin: 0 0 14px; }
.gear ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 28px; }
@media (min-width: 620px) { .gear ul { grid-template-columns: repeat(2, 1fr); } }
.gear li { margin: 0; border-top: 1px dotted rgba(0, 255, 211, .5); }
.gear-item { display: flex; flex-direction: column; height: 100%; padding: 11px 0 12px; color: #ddd; text-decoration: none; }
.gear-item strong { font: 400 1rem/1.3 var(--display); color: #fff; }
.gear-item span { font-size: .85rem; line-height: 1.5; color: #aaa; margin: 3px 0 7px; }
.gear-item em { margin-top: auto; font: 400 .78rem var(--display); letter-spacing: .04em; color: var(--mint); transition: transform .2s; }
.gear-item:hover em { transform: translateX(4px); }
.gear-item:hover strong { color: var(--mint); }
.gear-note { font-size: .72rem; color: #888; margin: 12px 0 0; border-top: 1px dotted rgba(0, 255, 211, .5); padding-top: 10px; }
/* Phones: one tight row per item so the box stays short. */
@media (max-width: 619px) {
	.gear-item { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
	.gear-item span { display: none; }
	.gear-item em { margin: 0; white-space: nowrap; font-size: 0; }
	.gear-item em::after { content: "Amazon ›"; font-size: .78rem; }
}

/* Comments and forms */
.comments-area { max-width: var(--measure); padding: 24px 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { border-top: 1px dotted var(--mint-ink); padding: 14px 0; font-size: .95rem; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea, .search-form input[type=search] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); font: inherit; }
.comment-form input[type=submit], .search-form button, .search-form input[type=submit] { background: #000; color: var(--mint); border: 0; padding: 11px 18px; font: 400 .95rem var(--display); cursor: pointer; }

/* Footer */
main > .wrap:last-child { padding-bottom: 56px; }
.site-footer { background: var(--night); color: #eee; font-size: .875rem; }
.site-footer .wrap { padding-top: 44px; padding-bottom: 44px; display: grid; gap: 30px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; } }
.site-footer h2 { font: 700 .95rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.site-footer li { border-top: 1px dotted var(--mint); }
.site-footer li a { display: block; padding: 10px 0; color: #eee; text-decoration: none; font-style: italic; line-height: 1.5; transition: color .15s, padding-left .2s; }
.site-footer li a:hover { padding-left: 6px; }
.site-footer a:hover { color: var(--mint); }
.site-footer p { margin: 0 0 10px; max-width: 46ch; line-height: 1.6; }
.site-footer .fine { font-size: .78rem; color: #999; }

/* Motion is decoration: switch it all off for anyone who asks for less */
@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.js .wall li:not(.wall-ad) { opacity: 1; transform: none; }
	.banner img { transform: none !important; }
}
