/*
Theme Name: Wii Love Mario
Theme URI: https://wiilovemario.com
Author: Wii Love Mario
Description: A modern, playful revival of the classic Wii Love Mario fan site theme. Sky-blue header, coin-yellow accents, brick-and-hills footer.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: wiilovemario
*/

/* ---------- Tokens ---------- */
:root {
	--red: #e4261f;
	--red-dark: #b5170f;
	--blue: #0a74c9;
	--blue-dark: #075a9c;
	--sky-1: #5fb4ff;
	--sky-2: #bfe5ff;
	--coin: #fbc531;
	--coin-dark: #d99a0b;
	--green: #2fa84f;
	--green-dark: #1e7a37;
	--brick: #c0662d;
	--brick-dark: #8a3f14;

	--ink: #1d2230;
	--ink-soft: #545b6e;
	--paper: #fffaf3;
	--card: #ffffff;
	--line: #eadfce;
	--cream: #f6ece0;

	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(29, 34, 48, .06), 0 6px 20px rgba(29, 34, 48, .07);
	--shadow-pop: 0 4px 0 rgba(29, 34, 48, .18);

	--font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-pixel: "Press Start 2P", ui-monospace, monospace;
	--wrap: 1180px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--paper);
	overflow-x: hidden;
}
img, video, iframe, embed, object { max-width: 100%; height: auto; }
iframe { border: 0; }
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 900; letter-spacing: -.01em; margin: 1.4em 0 .5em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 1000;
	top: 8px; left: 8px; padding: 10px 16px; background: #fff; color: var(--ink);
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Header / sky ---------- */
.site-header {
	position: relative;
	background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
	overflow: hidden;
}
/* Clouds drift left-to-right across the sky. Each .cloud is a full-width
   track moved by its own width (100%), so the loop spans the header at any
   size; negative delays spread them out on load. Small = far = slower/fainter. */
.site-header .clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud {
	position: absolute; left: 0; top: var(--y); width: 100%; height: 0;
	opacity: var(--o, 1);
	transform: translateX(var(--x));
	animation: cloud-drift var(--d) linear var(--delay) infinite;
	will-change: transform;
}
.cloud::before {
	content: ""; position: absolute; top: 0; left: 0;
	width: var(--w); aspect-ratio: 2 / 1;
	background: url("assets/cloud.svg") no-repeat center / contain;
	animation: cloud-bob var(--bob, 7s) ease-in-out infinite alternate;
}
@keyframes cloud-drift { from { transform: translateX(-200px); } to { transform: translateX(100%); } }
@keyframes cloud-bob { from { translate: 0 0; } to { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
	.cloud, .cloud::before { animation: none; }
}

.header-inner {
	position: relative;
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding-top: 34px; padding-bottom: 30px;
}
.brand { display: inline-flex; flex-direction: column; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.wordmark {
	display: inline-flex; align-items: center; gap: 10px;
	font-weight: 900; font-size: clamp(38px, 7vw, 68px); line-height: 1; letter-spacing: -.02em;
}
.wordmark .wii {
	color: #fff;
	-webkit-text-stroke: 4px var(--blue);
	paint-order: stroke fill;
	text-shadow: 0 4px 0 var(--blue-dark);
	font-style: italic;
	padding-right: .06em;
}
.wordmark .heart { width: .7em; height: .7em; flex: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); }
.wordmark .mario {
	color: var(--red);
	text-transform: uppercase;
	-webkit-text-stroke: 3px #fff;
	paint-order: stroke fill;
	text-shadow: 0 4px 0 var(--red-dark);
}
.wordmark .tld { font-size: .32em; color: var(--blue-dark); align-self: flex-end; margin-bottom: .35em; font-weight: 900; }
.brand .logo {
	display: block; width: clamp(210px, 40vw, 330px); height: auto; overflow: visible;
	filter: drop-shadow(0 4px 0 rgba(0,0,0,.18));
	transition: transform .15s ease;
}
.brand:hover .logo { transform: translateY(-2px) rotate(-1deg); }
@media (prefers-reduced-motion: reduce) { .brand:hover .logo { transform: none; } }

/* Block widgets added from the admin. */
.widget .wp-block-heading, .widget h2 { margin: 0 0 14px; font-family: var(--font-pixel); font-size: 12px; line-height: 1.5; color: var(--red); }
.widget .wp-block-search__inside-wrapper { display: flex; gap: 6px; }
.widget .wp-block-search__input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.widget .wp-block-search__button { font: inherit; font-weight: 800; border: 0; border-radius: var(--radius-sm); background: var(--red); color: #fff; padding: 8px 14px; cursor: pointer; }
.widget .wp-block-search__label { display: none; }
.tagline {
	margin: 10px 0 0;
	font-family: var(--font-pixel); font-size: 11px; letter-spacing: .04em;
	color: var(--blue-dark);
}
.header-search { flex: 0 1 320px; }

/* ---------- Search form ---------- */
.search-form { display: flex; background: #fff; border-radius: 999px; box-shadow: var(--shadow); padding: 4px; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px;
	padding: 8px 14px; color: var(--ink);
}
.search-form input[type="search"]:focus { outline: none; }
.search-form:focus-within { outline: 3px solid var(--coin); }
.search-form button {
	border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer;
	font: inherit; font-weight: 800; font-size: 14px; color: #fff; background: var(--red);
}
.search-form button:hover { background: var(--red-dark); }

/* ---------- Navigation ---------- */
.site-nav {
	position: sticky; top: 0; z-index: 50;
	background: #fff;
	border-bottom: 4px solid var(--red);
	box-shadow: 0 2px 10px rgba(29, 34, 48, .08);
}
.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-nav { top: 0; } }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.menu-toggle {
	display: none; border: 0; background: var(--cream); border-radius: var(--radius-sm);
	font: inherit; font-weight: 800; padding: 8px 14px; cursor: pointer; color: var(--ink);
}
.primary-menu, .primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; flex-wrap: wrap; gap: 4px; }
.primary-menu > li { position: relative; }
.primary-menu a {
	display: block; padding: 8px 14px; border-radius: 999px;
	font-weight: 800; font-size: 15px; text-decoration: none; color: var(--ink);
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-cat > a,
.primary-menu .current-menu-ancestor > a { background: var(--cream); color: var(--red); }
.primary-menu .sub-menu, .primary-menu .children {
	display: none; position: absolute; left: 0; top: 100%; min-width: 220px;
	background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px;
}
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu,
.primary-menu li:hover > .children, .primary-menu li:focus-within > .children { display: block; }
.primary-menu .sub-menu a, .primary-menu .children a { border-radius: 8px; }

@media (max-width: 860px) {
	.header-inner { flex-direction: column; align-items: flex-start; }
	.header-search { flex: none; width: 100%; }
	.menu-toggle { display: inline-flex; }
	.nav-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
	.primary-menu { display: none; width: 100%; flex-direction: column; padding: 8px 0; }
	.site-nav.is-open .primary-menu { display: flex; }
	.primary-menu .sub-menu, .primary-menu .children { position: static; display: block; box-shadow: none; padding-left: 16px; }
}

/* ---------- Layout ---------- */
.site-main { padding: 36px 0 64px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.page-heading { margin: 0 0 24px; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); }
.page-heading p { margin: 6px 0 0; color: var(--ink-soft); }
.eyebrow {
	display: inline-block; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .06em;
	color: var(--red); margin-bottom: 10px;
}

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.post-grid .card--featured { grid-column: 1 / -1; }
@media (max-width: 680px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }

.card {
	display: flex; flex-direction: column;
	background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
	overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(29,34,48,.06), 0 14px 30px rgba(29,34,48,.12); }
.card-thumb { display: block; aspect-ratio: 16 / 9; background: var(--cream); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb--empty {
	display: grid; place-items: center; aspect-ratio: 16 / 5;
	background:
		linear-gradient(180deg, transparent 72%, var(--green) 72%, var(--green) 78%, var(--brick) 78%),
		linear-gradient(180deg, var(--sky-1), var(--sky-2));
}
.card-thumb--empty img { width: 44px; height: 44px; object-fit: contain; margin-bottom: 8%; }
.card--featured .card-thumb--empty { aspect-ratio: 16 / 4; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card-title { margin: 6px 0 8px; font-size: 21px; }
.card--featured .card-title { font-size: clamp(24px, 3vw, 32px); }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--red); }
.card-excerpt { color: var(--ink-soft); font-size: 16px; margin: 0 0 16px; }
.card-excerpt p { margin: 0; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.chip {
	display: inline-block; align-self: flex-start;
	padding: 3px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
	background: #e6f2fc; color: var(--blue-dark);
}
.chip:hover { background: var(--blue); color: #fff; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-soft); }
.meta a { color: inherit; }
.meta .reads::before { content: "★ "; color: var(--coin-dark); }

.btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 16px; border-radius: 10px; border: 0; cursor: pointer;
	font: inherit; font-weight: 900; font-size: 14px; text-decoration: none;
	background: var(--coin); color: var(--ink);
	box-shadow: inset 0 -4px 0 var(--coin-dark), var(--shadow-pop);
	transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--coin-dark); }
.btn--red { background: var(--red); color: #fff; box-shadow: inset 0 -4px 0 var(--red-dark), var(--shadow-pop); }
.btn--red:hover { color: #fff; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
	min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center;
	border-radius: 10px; background: #fff; box-shadow: var(--shadow);
	font-weight: 900; text-decoration: none; color: var(--ink);
}
.pagination .page-numbers.current { background: var(--red); color: #fff; }
.pagination a.page-numbers:hover { background: var(--coin); color: var(--ink); }

/* ---------- Single / page ---------- */
.entry {
	background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
	padding: clamp(22px, 4vw, 48px);
}
.entry-header h1 { margin: 10px 0 12px; font-size: clamp(30px, 4.4vw, 46px); }
.entry-hero { margin: 0 0 28px; border-radius: var(--radius-sm); overflow: hidden; }
.entry-hero img { display: block; width: 100%; }
.entry-content { margin-top: 28px; font-size: 18px; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { font-size: 28px; }
.entry-content h3 { font-size: 22px; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content blockquote {
	margin: 1.5em 0; padding: 14px 22px; border-left: 6px solid var(--coin);
	background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content pre, .entry-content code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.entry-content pre { background: var(--ink); color: #f5f5f5; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.entry-content td img { display: inline-block; margin: 4px auto; }
.entry-content .wp-block-embed, .entry-content .video-wrap { margin: 1.5em 0; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="vimeo"] { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: var(--radius-sm); }
.wlm-video { margin: 1.5em 0; clear: both; }
.wlm-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius-sm); background: #000; }
.wlm-dead-embed {
	padding: 14px 18px; border-radius: var(--radius-sm); background: var(--cream);
	color: var(--ink-soft); font-size: 15px; border: 2px dashed var(--line);
}
.wlm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 1.5em 0; clear: both; }
.wlm-gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--cream); }
.wlm-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .2s ease; }
.wlm-gallery a:hover img { transform: scale(1.05); }
.entry-content embed, .entry-content object { max-width: 100%; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 600px) { .alignleft, .alignright { float: none; margin: 1em 0; } }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--ink-soft); text-align: center; margin-top: 6px; }
.entry-content::after { content: ""; display: table; clear: both; }

.entry-tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags a {
	font-size: 13px; font-weight: 800; text-decoration: none; padding: 4px 12px; border-radius: 999px;
	background: var(--cream); color: var(--ink-soft);
}
.entry-tags a:hover { background: var(--coin); color: var(--ink); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav a {
	display: block; padding: 16px 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
	text-decoration: none; color: var(--ink); font-weight: 800;
}
.post-nav a:hover { color: var(--red); }
.post-nav span { display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.post-nav .next { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { text-align: left; } }

/* ---------- Comments ---------- */
.comments { margin-top: 24px; }
.comments-title { font-size: 24px; margin: 0 0 16px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: clamp(12px, 4vw, 40px); }
.comment-body { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 14px; }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.comment-meta img { border-radius: 50%; }
.comment-author .fn { font-weight: 900; color: var(--ink); font-style: normal; }
.comment-metadata a { color: inherit; text-decoration: none; }
.comment-content { margin-top: 8px; }
.reply a { font-size: 14px; font-weight: 800; }
.comment-respond { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-top: 20px; }
.comment-respond label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
	width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
.comment-respond input:focus, .comment-respond textarea:focus { outline: none; border-color: var(--blue); }
.comment-respond .submit {
	font: inherit; font-weight: 900; border: 0; cursor: pointer; padding: 10px 18px; border-radius: 10px;
	background: var(--red); color: #fff; box-shadow: inset 0 -4px 0 var(--red-dark);
}

/* ---------- Sidebar ---------- */
.sidebar { display: grid; gap: 24px; }
.widget { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.widget-title {
	margin: 0 0 14px; font-family: var(--font-pixel); font-size: 12px; line-height: 1.5;
	color: var(--red); letter-spacing: .03em;
}
.widget ul, .widget ol { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-top: 1px dashed var(--line); font-size: 15px; line-height: 1.4; }
.widget li:first-child { border-top: 0; padding-top: 0; }
.widget li a { color: var(--ink); text-decoration: none; font-weight: 700; }
.widget li a:hover { color: var(--red); }
.widget .count, .widget .post-date { display: block; font-size: 13px; color: var(--ink-soft); }

.rank-list { counter-reset: rank; }
.rank-list li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.rank-list li::before {
	counter-increment: rank; content: counter(rank);
	width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px;
	font-family: var(--font-pixel); font-size: 10px;
	background: var(--coin); color: var(--ink); box-shadow: inset 0 -3px 0 var(--coin-dark);
}

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button {
	flex: 1; border: 0; cursor: pointer; padding: 7px 8px; border-radius: 8px;
	font: inherit; font-weight: 800; font-size: 13px; background: var(--cream); color: var(--ink-soft);
}
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.tab-panel[hidden] { display: none; }

.widget--hello { background: linear-gradient(160deg, #fff 0%, #fff5dc 100%); }
.widget--hello p { margin: 0 0 12px; font-size: 15px; color: var(--ink-soft); }

/* ---------- Empty / 404 ---------- */
.empty {
	text-align: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 48px 24px;
}
.empty .big { font-family: var(--font-pixel); font-size: clamp(36px, 8vw, 64px); color: var(--red); margin: 0 0 16px; line-height: 1.2; }
.empty .search-form { max-width: 420px; margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 40px; color: #fff; }
.footer-scene {
	height: 110px;
	background: url("assets/hills.svg") repeat-x left bottom / auto 110px;
}
.footer-ground {
	background-color: var(--brick);
	background-image:
		linear-gradient(var(--brick-dark) 3px, transparent 3px),
		linear-gradient(90deg, var(--brick-dark) 3px, transparent 3px),
		linear-gradient(90deg, var(--brick-dark) 3px, transparent 3px);
	background-size: 48px 24px, 48px 48px, 48px 48px;
	background-position: 0 0, 0 0, 24px 24px;
	border-top: 8px solid var(--green-dark);
	padding: 36px 0 28px;
}
.footer-inner {
	background: rgba(29, 34, 48, .82); border-radius: var(--radius);
	padding: 24px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
}
.footer-inner p { margin: 0; font-size: 14px; }
.footer-inner a { color: #fff; }
.footer-inner a:hover { color: var(--coin); }
.footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; font-weight: 800; font-size: 14px; }
.footer-menu a { text-decoration: none; }
.footer-brand { font-family: var(--font-pixel); font-size: 11px; line-height: 1.6; }
.footer-note { font-size: 12px; opacity: .75; width: 100%; }
