/*
Theme Name: Casa China
Theme URI: https://example.com/casa-china-theme
Author: Casa China Guide
Description: A fast, mobile-first WordPress theme for the Casa China game guide. Lacquer-red and gold design, sticky header with mobile menu, long-form content styling, Rank Math friendly (breadcrumbs, FAQ block styles), no page-builder required.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: casa-china
Tags: blog, one-column, custom-menu, custom-logo, featured-images, translation-ready, accessibility-ready
*/

/* ==========================================================
   Tokens
   ========================================================== */
:root {
	--red: #8f1422;
	--red-dark: #5e0b16;
	--red-deep: #7d0f1e;
	--gold: #d9a441;
	--gold-light: #f3d58a;
	--jade: #157a64;
	--ink: #1b1210;
	--muted: #5d4f49;
	--paper: #fbf6ea;
	--card: #ffffff;
	--line: #eadfc6;
	--radius: 14px;
	--shadow: 0 10px 30px rgba(94, 11, 22, .12);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--wrap: 1120px;
	--read: 820px;
}

/* ==========================================================
   Base
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.72;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 8px; top: -60px; z-index: 100;
	background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 0 0 8px 8px; font-weight: 700;
}
.skip-link:focus { top: 0; }
.cc-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }

/* ==========================================================
   Buttons
   ========================================================== */
.btn, .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 12px 24px;
	border: 2px solid transparent; border-radius: 999px;
	font: 700 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
	background: var(--gold); color: var(--ink);
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover, .wp-block-button__link:hover { background: var(--gold-light); color: var(--ink); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.is-style-ghost .wp-block-button__link, .wp-block-button.is-ghost .wp-block-button__link {
	background: transparent; color: #fff; border-color: rgba(255,255,255,.65);
}
.wp-block-button.is-ghost .wp-block-button__link:hover { background: rgba(255,255,255,.12); color: #fff; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px auto; }
.wp-block-buttons.is-center { justify-content: center; }

/* ==========================================================
   Header + navigation
   ========================================================== */
.site-header {
	position: sticky; top: 0; z-index: 60;
	background: var(--red-deep);
	border-bottom: 3px solid var(--gold);
	transition: box-shadow .2s ease;
}
.site-header.is-stuck { box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.cc-bar {
	max-width: var(--wrap); margin-inline: auto; padding: 8px 16px;
	display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 800 21px/1.1 var(--serif); letter-spacing: .5px; color: var(--gold-light); text-transform: uppercase; }
.brand-text small { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: #f1d8d3; }
.cc-mark { flex: none; }
.custom-logo { max-height: 46px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav li a {
	display: block; padding: 10px 14px; border-radius: 8px;
	color: #fff; text-decoration: none; font-weight: 600; font-size: 15.5px;
}
.site-nav li a:hover, .site-nav li.current-menu-item > a, .site-nav li.current_page_item > a { background: rgba(255,255,255,.14); color: var(--gold-light); }
.nav-cta { min-height: 42px; padding: 8px 20px; font-size: 15px; }

.nav-toggle {
	display: none; width: 46px; height: 46px; padding: 0;
	background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.35); border-radius: 10px; cursor: pointer;
	align-items: center; justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
	display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 8px;
		background: var(--red-dark); padding: 12px 16px 18px;
		border-bottom: 3px solid var(--gold); box-shadow: 0 16px 24px rgba(0,0,0,.35);
		max-height: calc(100vh - 70px); overflow-y: auto;
	}
	.site-nav.is-open { display: flex; }
	.site-nav ul { flex-direction: column; gap: 2px; }
	.site-nav li a { padding: 14px 12px; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 0; }
	.nav-cta { width: 100%; margin-top: 6px; }
}

/* ==========================================================
   Content layout
   ========================================================== */
.site-main { min-height: 50vh; }
.entry-home > *:not(.cc-hero),
.entry-body > * {
	max-width: var(--read); margin-inline: auto; padding-inline: 16px;
}
.entry-body.list, .entry-body > .cc-wrap { max-width: var(--wrap); }
.entry-home > *:not(.cc-hero):first-of-type { margin-top: 0; }
.entry-home, .entry-body { padding-bottom: 56px; }
.entry-body { padding-top: 28px; }

.page-head { background: linear-gradient(135deg, var(--red-dark), var(--red)); color: #fff; padding: 34px 0 30px; border-bottom: 4px solid var(--gold); }
.page-title { margin: 6px 0 0; font: 800 clamp(28px, 5vw, 42px)/1.15 var(--serif); color: #fff; }
.page-head .meta { margin: 8px 0 0; color: var(--gold-light); font-size: 14px; }
.cc-crumbs, .rank-math-breadcrumb { font-size: 14px; color: #f5d9d5; }
.cc-crumbs a, .rank-math-breadcrumb a { color: var(--gold-light); }
.rank-math-breadcrumb p { margin: 0; }

/* Headings */
.entry h1, .entry h2, .entry h3, .entry h4 { font-family: var(--serif); line-height: 1.22; color: var(--red-dark); }
.entry h2 {
	font-size: clamp(25px, 4.2vw, 34px); margin: 56px auto 14px; padding-bottom: 12px; position: relative;
	scroll-margin-top: 90px;
}
.entry h2::after { content: ""; position: absolute; left: 16px; bottom: 0; width: 64px; height: 4px; background: var(--gold); border-radius: 4px; }
.entry h3 { font-size: clamp(20px, 3.2vw, 24px); margin: 34px auto 8px; scroll-margin-top: 90px; color: var(--ink); }
.entry p { margin-block: 0 1.1em; }
.entry ul, .entry ol { padding-left: 1.4em; margin-block: 0 1.2em; }
.entry li { margin-bottom: .5em; }
.entry li::marker { color: var(--red); font-weight: 700; }
.entry strong { color: var(--ink); }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 40px auto; }

/* Images */
.entry figure { margin-block: 28px; }
.entry figure.cc-fig img, .entry .wp-block-image img {
	display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: #f0e6d0;
}
.entry figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }

/* Tables */
.entry .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: 24px; }
.entry table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; font-size: 15.5px; box-shadow: 0 2px 10px rgba(94,11,22,.08); }
.entry th, .entry td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry th { background: var(--red-deep); color: #fff; font-weight: 700; white-space: nowrap; }
.entry tbody tr:nth-child(even) td { background: #fdf9ef; }
.entry tbody th { background: #f4e9cc; color: var(--ink); white-space: normal; width: 34%; }

/* Callouts */
.cc-note, .cc-warn {
	padding: 16px 20px; border-radius: var(--radius); margin-block: 24px; border-left: 6px solid var(--gold); background: #fff6df;
}
.cc-warn { border-left-color: var(--red); background: #fdecee; }
.cc-note p:last-child, .cc-warn p:last-child { margin-bottom: 0; }

/* TOC */
.cc-toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-block: 30px; box-shadow: 0 2px 12px rgba(94,11,22,.06); }
.cc-toc .cc-toc-title { margin: 0 0 8px; font: 800 18px var(--serif); color: var(--red-dark); }
.cc-toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.cc-toc li { margin-bottom: .35em; break-inside: avoid; }
.cc-toc a { text-decoration: none; font-weight: 600; }
.cc-toc a:hover { text-decoration: underline; }
@media (max-width: 640px) { .cc-toc ol { columns: 1; } }

/* Pros / cons */
.cc-procon { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-block: 26px; max-width: var(--read); }
.cc-procon > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cc-procon h3 { margin: 0 0 10px !important; font-size: 20px; }
.cc-procon .pros { border-top: 5px solid var(--jade); }
.cc-procon .cons { border-top: 5px solid var(--red); }
.cc-procon ul { margin: 0; padding-left: 1.2em; }
@media (max-width: 640px) { .cc-procon { grid-template-columns: 1fr; } }

/* ==========================================================
   Hero (lives inside page content)
   ========================================================== */
.cc-hero {
	display: grid; grid-template-columns: 1.05fr .95fr; column-gap: 40px; align-content: center; align-items: center;
	padding: 52px max(16px, calc((100% - var(--wrap)) / 2 + 16px)) 56px;
	color: #fff;
	background:
		radial-gradient(circle at 12% 18%, rgba(217,164,65,.18) 0 90px, transparent 91px),
		radial-gradient(circle at 92% 82%, rgba(217,164,65,.14) 0 130px, transparent 131px),
		linear-gradient(135deg, var(--red-dark) 0%, var(--red) 58%, #6f0e1b 100%);
	border-bottom: 5px solid var(--gold);
}
.cc-hero > * { grid-column: 1; margin-block: 0 16px; min-width: 0; }
.cc-hero > figure { grid-column: 2; grid-row: 1 / span 6; margin: 0; }
.cc-hero h1 { font: 800 clamp(31px, 5.6vw, 52px)/1.1 var(--serif); color: #fff; margin: 0 0 18px; }
.cc-hero p { color: #fbe9e5; font-size: clamp(16.5px, 2.2vw, 19px); max-width: 60ch; }
.cc-hero .hero-eyebrow { color: var(--gold-light); letter-spacing: 3px; text-transform: uppercase; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.cc-hero .hero-small { font-size: 14px; color: #f2cfc9; }
.cc-hero .wp-block-buttons { margin: 8px 0 20px; }
.cc-hero figure img { width: 100%; border-radius: 18px; border: 3px solid var(--gold); box-shadow: 0 18px 44px rgba(0,0,0,.4); }
@media (max-width: 860px) {
	.cc-hero { grid-template-columns: 1fr; padding-top: 34px; padding-bottom: 40px; }
	.cc-hero > figure { grid-column: 1; grid-row: auto; margin-top: 8px; }
}

/* Rank Math FAQ block */
.wp-block-rank-math-faq-block { max-width: var(--read); }
.rank-math-list-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 6px; margin-bottom: 12px; }
.rank-math-question { font: 700 19px/1.35 var(--serif) !important; margin: 14px 0 6px !important; color: var(--red-dark); }
.rank-math-answer { padding-bottom: 10px; }
.rank-math-answer p:last-child { margin-bottom: 0; }

/* ==========================================================
   Lists (blog index / search)
   ========================================================== */
.card-post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-post h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; }
.card-post h2 a { text-decoration: none; }
.search-form { display: flex; gap: 8px; max-width: 460px; }
.search-form label { flex: 1; }
.search-field { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.search-submit { min-height: 48px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer { background: var(--ink); color: #e9ddd6; border-top: 5px solid var(--gold); font-size: 15.5px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 32px; padding-block: 46px 28px; }
.site-footer a { color: #f3d58a; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer .brand { margin-bottom: 12px; }
.f-title { margin: 0 0 12px; font: 800 17px var(--serif); color: var(--gold-light); letter-spacing: .5px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer p { margin: 0 0 12px; }
.age-badge { display: inline-block; background: var(--red); color: #fff; font-weight: 800; padding: 2px 9px; border-radius: 999px; font-size: 13px; margin-right: 4px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.14); padding-block: 20px 28px; font-size: 13.5px; color: #bfb1a9; }
.footer-legal .copy { color: #d9cbc2; margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ==========================================================
   Sticky mobile CTA
   ========================================================== */
.sticky-cta { display: none; }
@media (max-width: 700px) {
	body { padding-bottom: 74px; }
	.sticky-cta {
		display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(27,18,16,.97);
		border-top: 2px solid var(--gold);
	}
	.sticky-cta .btn { flex: 1; min-height: 46px; }
	.sticky-note { color: #e9ddd6; font-size: 12px; line-height: 1.2; max-width: 90px; }
	body.nav-open .sticky-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
@media print {
	.site-header, .sticky-cta, .site-footer .f-col:not(.f-about) { display: none; }
}
