/*
Theme Name: JaponMundo
Theme URI: https://japonmundo.es/
Author: JaponMundo
Author URI: https://japonmundo.es/detras-del-noren/
Description: Tema editorial rápido y accesible para JaponMundo, con integración nativa para JaponMundo Tools.
Version: 1.1.0
Requires at least: 6.6
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: japonmundo
Tags: blog, news, education, custom-logo, custom-menu, featured-images, wide-blocks
*/

:root {
	--ink: #17191c;
	--ink-soft: #4c4e52;
	--paper: #fffaf2;
	--white: #ffffff;
	--line: #dfd9cf;
	--coral: #e54836;
	--coral-dark: #bc2f22;
	--gold: #f2bf3b;
	--teal: #147d78;
	--violet: #6755a5;
	--blue: #276f9c;
	--pink: #cf5a78;
	--green: #168260;
	--orange: #d8742d;
	--accent: var(--coral);
	--accent-soft: #ffe2dc;
	--radius-sm: 10px;
	--radius: 18px;
	--radius-lg: 30px;
	--shadow: 0 18px 50px rgba(23, 25, 28, 0.09);
	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-jp: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
	--container: 1180px;
	--reading: 780px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

body,
button,
input,
textarea,
select { font-family: var(--font-sans); }

img,
svg,
video { display: block; max-width: 100%; }

img { height: auto; }

figure { margin: 0; }

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover { color: var(--coral-dark); }

button,
input,
textarea,
select { font: inherit; }

button,
[type="submit"] { cursor: pointer; }

:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px rgba(242, 191, 59, 0.55);
}

/* На темних поверхнях контур інвертується, щоб лишатися помітним. */
.site-footer :focus-visible,
.trust-section :focus-visible,
.utility-bar :focus-visible {
	outline-color: var(--paper);
	box-shadow: 0 0 0 6px rgba(23, 25, 28, 0.6);
}

::selection {
	background: var(--gold);
	color: var(--ink);
}

[lang="ja"] { font-family: var(--font-jp); }

.site-container {
	width: min(calc(100% - 40px), var(--container));
	margin-inline: auto;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
	top: 10px;
	left: 10px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 10px 16px;
	clip: auto;
	background: var(--ink);
	color: var(--white);
	border-radius: 8px;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(255, 250, 242, 0.97);
	box-shadow: 0 1px 0 rgba(23, 25, 28, 0.1);
	backdrop-filter: blur(12px);
}

.admin-bar .site-header { top: 32px; }

.utility-bar {
	background: var(--ink);
	color: var(--white);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.utility-inner {
	min-height: 34px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.utility-inner p { margin: 0; }
.utility-inner p span { color: var(--gold); margin-right: 7px; }

.utility-links { display: flex; gap: 22px; }
.utility-links a { text-decoration: none; color: #f8f2e8; }
.utility-links a:hover { color: var(--gold); }

.header-main {
	min-height: 78px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
}

.site-branding { flex: 0 1 270px; line-height: 0; }
.site-branding .custom-logo-link,
.brand-fallback { display: inline-block; }
.site-branding .custom-logo,
.brand-fallback img { width: auto; height: 58px; object-fit: contain; }

.header-controls {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	flex: 1;
}

.search-form {
	position: relative;
	display: flex;
	align-items: center;
}

.search-form label { display: block; }
.search-field {
	width: 250px;
	height: 42px;
	padding: 0 46px 0 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--white);
	color: var(--ink);
	font-size: 0.9rem;
}

.search-field::placeholder { color: #77736d; opacity: 1; }
.search-field:focus { border-color: var(--ink); outline: 3px solid rgba(242, 191, 59, 0.5); }

.search-submit {
	position: absolute;
	right: 4px;
	top: 4px;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ink);
	color: var(--white);
}

.menu-toggle {
	display: none;
	align-items: center;
	gap: 9px;
	min-height: 42px;
	padding: 8px 13px;
	border: 1px solid var(--ink);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font-weight: 750;
}

.menu-toggle-lines { width: 18px; display: grid; gap: 4px; }
.menu-toggle-lines i { display: block; height: 2px; background: currentColor; border-radius: 2px; }

.nav-wrap { border-top: 1px solid rgba(23, 25, 28, 0.09); }
.primary-navigation { min-height: 48px; display: flex; align-items: stretch; }
.primary-menu,
.primary-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu {
	width: 100%;
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.primary-menu > li { position: relative; display: flex; align-items: stretch; }
.primary-menu a {
	display: flex;
	align-items: center;
	padding: 10px 14px;
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 760;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a { color: var(--coral-dark); }

.primary-menu .menu-tools { margin-left: auto; }
.primary-menu .menu-tools > a,
.primary-menu > li:last-child > a {
	margin-block: 7px;
	padding-block: 2px;
	border-radius: 999px;
	background: var(--coral-dark);
	color: var(--white);
}

.primary-menu .menu-item-has-children > a::after { content: "↓"; margin-left: 6px; font-size: 0.75em; }
.primary-menu .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 230px;
	padding: 8px;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-menu .sub-menu a { padding: 8px 10px; }

/* Common headings and controls */
.section-shell { padding-block: 76px; }
.section-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 30px;
	margin-bottom: 28px;
}

.section-kicker,
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--coral-dark);
	font-size: 0.76rem;
	font-weight: 850;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

a.eyebrow { text-decoration: none; }
.section-heading h2,
.trust-intro h2 {
	max-width: 760px;
	margin: 5px 0 0;
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.07;
	letter-spacing: -0.04em;
}

.text-link {
	flex: 0 0 auto;
	font-weight: 800;
	text-decoration-color: var(--coral);
	text-decoration-thickness: 2px;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 12px 22px;
	border: 2px solid var(--ink);
	border-radius: 999px;
	font-weight: 850;
	line-height: 1;
	text-decoration: none;
}

.button-primary { background: var(--ink); color: var(--white); box-shadow: 5px 5px 0 var(--gold); }
.button-primary:hover { background: var(--coral-dark); border-color: var(--coral-dark); color: var(--white); transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--gold); }
.button-ghost { background: transparent; }
.button-ghost:hover { background: var(--white); color: var(--ink); }

/* Homepage hero */
.home-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(circle at 10% 0%, rgba(242, 191, 59, 0.24), transparent 31%),
		linear-gradient(135deg, #fffaf2 0%, #ffe8df 100%);
	border-bottom: 1px solid var(--line);
}

.home-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(23, 25, 28, 0.12) 1px, transparent 1px);
	background-size: 24px 24px;
	mask-image: linear-gradient(to right, transparent, rgba(0,0,0,0.35));
	pointer-events: none;
}

.hero-grid {
	position: relative;
	min-height: 595px;
	display: grid;
	grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
	align-items: center;
	gap: 58px;
	padding-block: 70px;
}

.hero-kicker {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 850;
	font-size: 0.82rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.hero-kicker i { width: 24px; height: 4px; background: var(--coral); border-radius: 4px; }
.hero-copy h1 {
	max-width: 760px;
	margin: 17px 0 23px;
	font-size: clamp(3.3rem, 6.1vw, 5.6rem);
	line-height: 0.96;
	letter-spacing: -0.062em;
}

.hero-copy > p { max-width: 670px; margin: 0; color: var(--ink-soft); font-size: 1.18rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 19px; margin: 30px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 0.82rem; font-weight: 760; }
.hero-proof li::before { content: "✓"; margin-right: 6px; color: var(--green); font-weight: 900; }

.hero-visual {
	position: relative;
	min-height: 440px;
	isolation: isolate;
}

.hero-disc {
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(385px, 82vw);
	aspect-ratio: 1;
	translate: -50% -50%;
	display: grid;
	place-content: center;
	text-align: center;
	border: 7px solid var(--ink);
	border-radius: 50%;
	background: var(--coral);
	color: var(--white);
	box-shadow: 18px 18px 0 rgba(23, 25, 28, 0.95);
}

.hero-disc span { font-size: clamp(5rem, 10vw, 8rem); line-height: 1; font-weight: 850; letter-spacing: -0.08em; }
.hero-disc small { margin-top: 10px; font-size: 0.8rem; font-weight: 850; letter-spacing: 0.28em; text-transform: uppercase; }
.hero-disc::after {
	content: "";
	position: absolute;
	left: 4%; right: 4%; bottom: 18%; height: 19%;
	border-top: 12px solid var(--white);
	border-radius: 50%;
	transform: rotate(-7deg);
	opacity: 0.95;
}

.floating-note {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 155px;
	padding: 12px 15px;
	border: 2px solid var(--ink);
	border-radius: 14px;
	background: var(--white);
	box-shadow: 6px 6px 0 var(--ink);
	transform: rotate(var(--tilt, 0deg));
}

.floating-note > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--accent); color: var(--white); font-family: var(--font-jp); font-size: 1.35rem; }
.floating-note p { display: grid; margin: 0; line-height: 1.15; }
.floating-note b { font-size: 0.92rem; }
.floating-note small { margin-top: 4px; color: var(--ink-soft); font-size: 0.73rem; }
.note-name { --accent: var(--coral); --tilt: -4deg; left: 0; top: 24px; }
.note-era { --accent: var(--violet); --tilt: 4deg; right: -5px; top: 86px; }
.note-phrase { --accent: var(--teal); --tilt: -2deg; right: 20px; bottom: 18px; }

/* Tool launcher */
.tool-launcher { background: var(--white); border-bottom: 1px solid var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool-card {
	--accent: var(--coral);
	--accent-soft: #ffe2dc;
	position: relative;
	display: grid;
	grid-template-columns: 64px 1fr auto;
	align-items: center;
	gap: 17px;
	min-height: 126px;
	padding: 20px;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--accent-soft);
	text-decoration: none;
	box-shadow: 5px 5px 0 var(--ink);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tool-card:hover { color: var(--ink); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.tool-glyph { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--white); font-size: 2rem; font-weight: 800; }
.tool-card > span:nth-child(2) { display: grid; gap: 4px; }
.tool-card b { font-size: 1.1rem; line-height: 1.25; }
.tool-card small { color: var(--ink-soft); font-size: 0.85rem; }
.tool-card > i { font-style: normal; font-size: 1.6rem; }

.tone-coral { --accent: var(--coral); --accent-soft: #ffe2dc; }
.tone-gold { --accent: var(--gold); --accent-soft: #fff0b8; }
.tone-teal { --accent: var(--teal); --accent-soft: #d8f1ed; }
.tone-violet { --accent: var(--violet); --accent-soft: #e8e2ff; }
.tone-blue { --accent: var(--blue); --accent-soft: #dceffc; }
.tone-pink { --accent: var(--pink); --accent-soft: #f9dce6; }
.tone-green { --accent: var(--green); --accent-soft: #d9f2e7; }
.tone-orange { --accent: var(--orange); --accent-soft: #ffe5d2; }

/* Post cards */
.latest-section { background: var(--paper); }
.latest-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.latest-grid > .post-card { grid-column: span 3; }
.latest-grid > .post-card:nth-child(2),
.latest-grid > .post-card:nth-child(3) { grid-column: span 4; }
.latest-grid > .latest-lead { grid-column: span 8; grid-row: span 2; }

.post-card {
	--accent: var(--coral);
	--accent-soft: #ffe2dc;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--white);
	box-shadow: 0 9px 26px rgba(23, 25, 28, 0.045);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--accent-soft); text-decoration: none; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.post-card:hover .post-card-media img { transform: scale(1.025); }
.post-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--accent-soft); }
.post-card-placeholder::before,
.post-card-placeholder::after { content: ""; position: absolute; border: 3px solid var(--accent); border-radius: 50%; opacity: 0.28; }
.post-card-placeholder::before { width: 70%; aspect-ratio: 1; right: -18%; top: -34%; }
.post-card-placeholder::after { width: 48%; aspect-ratio: 1; left: -14%; bottom: -38%; }
.post-card-placeholder b { position: relative; z-index: 1; width: 82px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--white); font-size: 2.7rem; box-shadow: 6px 6px 0 var(--ink); }
.post-card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 20px; }
.post-card-title { margin: 8px 0 12px; font-size: clamp(1.18rem, 2vw, 1.42rem); line-height: 1.18; letter-spacing: -0.025em; }
.post-card-title a { text-decoration: none; }
.post-card-title a:hover { color: var(--coral-dark); }
.post-card-excerpt { margin: 0 0 18px; color: var(--ink-soft); }
.post-card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 7px; color: #716f6b; font-size: 0.76rem; }
.post-card-featured .post-card-body { padding: 28px; }
.post-card-featured .post-card-title { max-width: 780px; font-size: clamp(1.75rem, 3vw, 2.45rem); }
.post-card-featured .post-card-media { aspect-ratio: 16 / 8.2; }

.post-grid { display: grid; gap: 22px; }
.post-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Topic and trust sections */
.topics-section { background: var(--white); border-block: 1px solid var(--line); }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.topic-card {
	--accent: var(--coral);
	--accent-soft: #ffe2dc;
	display: grid;
	grid-template-columns: 56px 1fr auto;
	align-items: center;
	gap: 15px;
	min-height: 102px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--paper);
	text-decoration: none;
}

.topic-card:hover { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.topic-glyph { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: var(--white); font-size: 1.8rem; }
.topic-card > span:nth-child(2) { display: grid; }
.topic-card b { line-height: 1.25; }
.topic-card small { margin-top: 4px; color: var(--ink-soft); }
.topic-card > i { font-style: normal; font-size: 1.2rem; }

.trust-section { position: relative; overflow: hidden; background: var(--ink); color: var(--white); }
.trust-section::after { content: "信"; position: absolute; right: -20px; bottom: -130px; color: rgba(255,255,255,0.045); font: 700 25rem/1 var(--font-jp); }
.trust-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 70px; align-items: center; }
.trust-intro .section-kicker { color: var(--gold); }
.trust-intro p { max-width: 520px; color: #c9c7c2; font-size: 1.05rem; }
.trust-cards { display: grid; gap: 12px; }
.trust-cards a { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; padding: 19px; border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius); text-decoration: none; }
.trust-cards a:hover { background: rgba(255,255,255,0.07); color: var(--white); border-color: var(--gold); }
.trust-cards span { grid-row: span 2; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 900; }
.trust-cards b { align-self: end; font-size: 1.04rem; }
.trust-cards small { color: #bbb9b4; }

/* Archives */
.archive-hero,
.page-header,
.article-header {
	--accent: var(--coral);
	--accent-soft: #ffe2dc;
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, var(--accent-soft), var(--paper));
	border-bottom: 1px solid var(--line);
}

.archive-hero-inner { min-height: 330px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; padding-block: 54px; }
.archive-hero-inner > div { max-width: 850px; }
.archive-hero h1 { margin: 9px 0 0; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.055em; }
.archive-description,
.archive-hero-inner > div > p { max-width: 700px; margin-top: 18px; color: var(--ink-soft); font-size: 1.08rem; }
.archive-description p { margin: 0; }
.archive-glyph,
.page-glyph { width: 176px; height: 176px; display: grid; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: var(--accent); color: var(--white); font-size: 6rem; font-weight: 800; box-shadow: 10px 10px 0 var(--ink); }
.archive-content { padding-block: 62px 82px; }
.empty-state,
.search-empty { max-width: 720px; margin: 40px auto; padding: 35px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-align: center; }
.search-empty .search-form { justify-content: center; margin-top: 24px; }
.search-empty .search-field { width: min(100%, 420px); }

.nav-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 50px; }
.nav-links .page-numbers { min-width: 42px; min-height: 42px; display: grid; place-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); text-decoration: none; font-weight: 750; }
.nav-links .current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 28px; color: #686660; font-size: 0.78rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: center; min-width: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: #aaa59c; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs [aria-current="page"] { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Article and page */
.article-header-inner { max-width: 980px; padding-block: 54px 62px; }
.article-header h1,
.page-header h1 { margin: 10px 0 18px; font-size: clamp(2.75rem, 5.4vw, 5.1rem); line-height: 1.01; letter-spacing: -0.055em; text-wrap: balance; }
.article-deck { max-width: 830px; margin: 0 0 25px; color: var(--ink-soft); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #62605c; font-size: 0.84rem; }
.entry-author { display: inline-flex; align-items: center; gap: 9px; }
.author-initials { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 2px solid var(--white); border-radius: 50%; background: var(--ink); color: var(--white); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.04em; }
.entry-author a { font-weight: 800; }
.updated-note { margin: 12px 0 0; color: #77736d; font-size: 0.78rem; }
.article-hero-image { margin-top: 40px; }
.article-hero-image img { width: 100%; max-height: 680px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, var(--reading)); justify-content: center; gap: 58px; padding-block: 55px 78px; }
.article-aside { min-width: 0; }
.toc { position: sticky; top: 155px; font-size: 0.78rem; }
.toc details { border-top: 4px solid var(--accent); padding-top: 14px; }
.toc summary { cursor: pointer; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.toc ol { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.toc li { line-height: 1.35; }
.toc .toc-level-3 { padding-left: 14px; color: #6c6963; }
.toc a { text-decoration: none; }

.entry-content {
	min-width: 0;
	font-size: 1.075rem;
	line-height: 1.77;
}

.entry-content > :first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.45em; }
.entry-content h2,
.entry-content h3,
.entry-content h4 { color: var(--ink); scroll-margin-top: 150px; text-wrap: balance; }
.entry-content h2 { margin: 2.25em 0 0.7em; font-size: clamp(1.85rem, 3.4vw, 2.55rem); line-height: 1.13; letter-spacing: -0.038em; }
.entry-content h3 { margin: 1.9em 0 0.65em; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; letter-spacing: -0.025em; }
.entry-content h4 { margin: 1.6em 0 0.6em; font-size: 1.15rem; }
.entry-content a { color: #a52c22; text-decoration-color: rgba(229,72,54,0.55); text-decoration-thickness: 2px; }
.entry-content a:hover { color: var(--ink); background: #ffe5b3; }
.entry-content strong { font-weight: 800; }
.entry-content ul,
.entry-content ol { margin: 0 0 1.6em; padding-left: 1.35em; }
.entry-content li { margin-bottom: 0.5em; padding-left: 0.22em; }
.entry-content li::marker { color: var(--coral); font-weight: 900; }
.entry-content blockquote {
	position: relative;
	margin: 2em 0;
	padding: 24px 28px 24px 32px;
	border: 0;
	border-left: 6px solid var(--coral);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: #fff0df;
	font-size: 1.13rem;
}

.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: 12px; color: var(--ink-soft); font-size: 0.85rem; font-style: normal; font-weight: 750; }
.entry-content figure { margin: 2.1em 0; }
.entry-content figure img { width: 100%; border-radius: 14px; }
.entry-content figcaption { margin-top: 9px; color: #6f6b65; font-size: 0.78rem; line-height: 1.45; text-align: center; }
.entry-content iframe { max-width: 100%; }
.entry-content table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; margin: 2em 0; font-size: 0.92rem; -webkit-overflow-scrolling: touch; }
.entry-content th,
.entry-content td { min-width: 135px; padding: 11px 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content th { background: var(--ink); color: var(--white); }
.entry-content tr:nth-child(even) td { background: #fff7e9; }
.entry-content code { padding: 0.12em 0.35em; border-radius: 5px; background: #eee8de; font-size: 0.9em; }
.entry-content pre { overflow-x: auto; padding: 20px; border-radius: 12px; background: var(--ink); color: var(--white); font-size: 0.88rem; }
.entry-content hr { margin: 3em 0; border: 0; border-top: 2px solid var(--line); }
.entry-content .alignwide { width: min(100vw - 40px, 1040px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

.share-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.share-tools > span { margin-right: 5px; font-size: 0.78rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.share-tools button { min-height: 38px; padding: 7px 13px; border: 1px solid var(--ink); border-radius: 999px; background: var(--white); font-size: 0.82rem; font-weight: 750; }
.share-tools button:hover { background: var(--ink); color: var(--white); }

.author-box { max-width: 940px; display: grid; grid-template-columns: 88px 1fr; gap: 24px; margin-bottom: 75px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.author-initials-large { width: 88px; height: 88px; border: 0; background: var(--coral); font-size: 1.4rem; }
.author-box h2 { margin: 3px 0 8px; }
.author-box p { margin: 0 0 10px; color: var(--ink-soft); }
.related-posts { padding-bottom: 82px; }

.page-header-inner { min-height: 330px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 50px; padding-block: 48px; }
.page-header-inner > div { max-width: 900px; }
.page-layout { max-width: calc(var(--reading) + 40px); padding-block: 58px 82px; }
.tool-page-header { --accent: var(--coral); --accent-soft: #ffe2dc; }
.tool-layout { max-width: 1060px; padding-block: 54px 82px; }
.tool-layout.has-toc { display: grid; grid-template-columns: 210px minmax(0, 820px); gap: 50px; }
.tool-content { max-width: 900px; }

/* JaponMundo Tools plugin */
.tool-content .jm-lead { margin-bottom: 1.5em; color: var(--ink-soft); font-size: 1.18rem; }
.tool-content .jm-box { margin: 1.7em 0; padding: 18px 20px; border: 0; border-left: 6px solid var(--teal); border-radius: 0 14px 14px 0; background: #e4f4f1; }
.tool-content .jm-box.jm-aviso { border-left-color: var(--orange); background: #fff0dc; }
.tool-content .jm-box p:last-child { margin-bottom: 0; }
.tool-content .jm-hero { margin: 1.8em 0; padding: 30px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--accent-soft); box-shadow: 7px 7px 0 var(--ink); }
.tool-content .jm-kana { color: var(--ink); font-size: clamp(3rem, 10vw, 5rem); }
.tool-content .jm-romaji { color: var(--ink-soft); }
.tool-content .jm-grid { gap: 15px; }
.tool-content .jm-card { border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); box-shadow: 0 6px 18px rgba(23,25,28,0.05); }
.tool-content .jm-card:hover { border-color: var(--coral); color: var(--ink); transform: translateY(-2px); }
.tool-content .jm-card .jm-kanji { color: var(--coral); }
.tool-content .jm-form { gap: 12px; margin: 1.6em 0; padding: 20px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--white); }
.tool-content .jm-form label { color: var(--ink); font-weight: 800; }
.tool-content .jm-form input { min-height: 46px; border: 1px solid #aaa39a; background: var(--paper); color: var(--ink); }
.tool-content .jm-form input:focus { border-color: var(--ink); outline: 3px solid rgba(242,191,59,0.5); }
.tool-content .jm-form button,
.tool-content .jm-tts { min-height: 44px; border: 2px solid var(--ink); border-radius: 999px; background: var(--coral-dark); color: var(--white); font-weight: 800; }
.tool-content .jm-form button:hover,
.tool-content .jm-tts:hover { background: var(--ink); opacity: 1; }
.tool-content .jm-tts { min-height: 36px; padding: 5px 13px; font-size: 0.82rem; }
.tool-content .jm-mora { border-color: var(--ink); background: var(--white); }
.tool-content .jm-lista a,
.tool-content .jm-anos a { border-color: var(--line); background: var(--white); color: var(--ink); }
.tool-content .jm-lista a:hover,
.tool-content .jm-anos a:hover { border-color: var(--coral); background: var(--accent-soft); }
.tool-content .jm-frase { border-color: var(--line); background: var(--white); }
.tool-content .jm-widget { border: 2px solid var(--ink); border-radius: var(--radius); background: var(--accent-soft); box-shadow: 5px 5px 0 var(--ink); }
.tool-content .jm-nav { border-top-color: var(--line); }

/* Comments */
.comments-shell { max-width: 900px; padding-bottom: 80px; }
.comments-area { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.comments-title { margin-top: 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author img { border-radius: 50%; }
.comment-meta { font-size: 0.78rem; }
.comment-content { margin-left: 62px; }
.comment-form label { display: block; margin-bottom: 5px; font-weight: 750; }
.comment-form input:not([type="checkbox"]),
.comment-form textarea { width: 100%; padding: 11px 13px; border: 1px solid #aaa39a; border-radius: 9px; background: var(--paper); }
.comment-form .submit { padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 800; }

/* 404 */
.not-found { min-height: 650px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 70px; text-align: center; }
.not-found-mark { width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 26px; border: 5px solid var(--ink); border-radius: 50%; background: var(--coral); color: var(--white); font-size: 5rem; box-shadow: 9px 9px 0 var(--ink); }
.not-found h1 { margin: 8px 0 13px; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -0.05em; }
.not-found > p { max-width: 650px; color: var(--ink-soft); font-size: 1.08rem; }
.not-found .search-form { margin: 20px 0; }
.not-found .search-field { width: min(75vw, 430px); }
.not-found-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.not-found-links a { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); text-decoration: none; font-weight: 750; }

/* Footer */
.site-footer { position: relative; overflow: hidden; padding-top: 72px; background: #111315; color: #f5f0e8; }
.footer-sun { position: absolute; right: -100px; top: -160px; width: 390px; aspect-ratio: 1; border: 44px solid rgba(229,72,54,0.16); border-radius: 50%; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: 45px; padding-bottom: 55px; }
.footer-brand > a { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.footer-brand img { width: 62px; height: 62px; border-radius: 50%; }
.footer-brand span { display: grid; line-height: 1.15; }
.footer-brand b { font-size: 1.25rem; }
.footer-brand small { margin-top: 5px; color: #bcb9b3; }
.footer-brand p { max-width: 330px; color: #aaa8a3; }
.footer-column h2 { margin: 4px 0 17px; color: var(--gold); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-column ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-column a { color: #dedbd5; text-decoration: none; font-size: 0.88rem; }
.footer-column a:hover { color: var(--gold); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 21px; border-top: 1px solid rgba(255,255,255,0.13); color: #8f8d89; font-size: 0.75rem; }
.footer-bottom p { margin: 0; }

/* Blocks */
.wp-block-button__link { border-radius: 999px; background: var(--ink); color: var(--white); }
.wp-block-separator { border-color: var(--line); }
.wp-block-pullquote { border-block: 4px solid var(--coral); }

/* Responsive */
@media (max-width: 1060px) {
	.hero-grid { grid-template-columns: minmax(0, 1fr) minmax(350px, 0.82fr); gap: 25px; }
	.hero-disc { width: 330px; }
	.latest-grid > .post-card { grid-column: span 4; }
	.latest-grid > .latest-lead { grid-column: span 8; }
	.latest-grid > .post-card:nth-child(2),
	.latest-grid > .post-card:nth-child(3) { grid-column: span 4; }
	.post-grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.article-layout { grid-template-columns: 180px minmax(0, var(--reading)); gap: 34px; }
	.footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
	.footer-menu-column { grid-column: 2; }
}

@media (max-width: 860px) {
	.admin-bar .site-header { top: 46px; }
	.utility-links { display: none; }
	.utility-inner { justify-content: center; }
	.header-main { min-height: 70px; }
	.site-branding .custom-logo,
	.brand-fallback img { height: 49px; }
	.header-controls > .search-form { display: none; }
	.menu-toggle { display: none; }
	.js .menu-toggle { display: inline-flex; }
	.nav-wrap { display: block; }
	.js .site-header .nav-wrap { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 120px); overflow-y: auto; background: var(--paper); box-shadow: var(--shadow); }
	.js .site-header[data-menu-open] .nav-wrap { display: block; }
	.primary-navigation { padding-block: 10px 18px; }
	.primary-menu { display: grid; gap: 2px; }
	.primary-menu > li { display: block; }
	.primary-menu a { min-height: 44px; padding-inline: 10px; }
	.primary-menu .menu-tools { margin-left: 0; }
	.primary-menu .menu-tools > a,
	.primary-menu > li:last-child > a { display: inline-flex; margin: 7px 0; padding-inline: 16px; }
	.primary-menu .sub-menu { position: static; min-width: 0; padding: 0 0 0 16px; border: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
	.hero-grid { grid-template-columns: 1fr; padding-top: 58px; }
	.hero-copy { position: relative; z-index: 3; }
	.hero-copy h1 { max-width: 750px; }
	.hero-visual { min-height: 410px; margin-top: 15px; }
	.tool-grid { grid-template-columns: 1fr; }
	.latest-grid > .post-card,
	.latest-grid > .post-card:nth-child(2),
	.latest-grid > .post-card:nth-child(3),
	.latest-grid > .latest-lead { grid-column: span 6; grid-row: auto; }
	.latest-grid > .latest-lead { grid-column: 1 / -1; }
	.topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-grid { grid-template-columns: 1fr; gap: 35px; }
	.article-layout { grid-template-columns: minmax(0, var(--reading)); padding-top: 35px; }
	.article-aside { order: -1; }
	.toc { position: static; }
	.toc details { padding: 14px 16px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 12px; background: var(--white); }
	.tool-layout.has-toc { grid-template-columns: 1fr; gap: 28px; }
	.footer-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-brand { grid-column: 1 / -1; }
	.footer-menu-column { grid-column: auto; }
}

@media (max-width: 620px) {
	.site-container { width: min(calc(100% - 28px), var(--container)); }
	.utility-inner { min-height: 31px; }
	.utility-inner p { font-size: 0.69rem; }
	.header-main { gap: 12px; }
	.site-branding { flex-basis: 200px; }
	.site-branding .custom-logo,
	.brand-fallback img { max-width: 205px; height: auto; max-height: 50px; }
	.menu-toggle > span:last-child { display: none; }
	.menu-toggle { width: 44px; justify-content: center; padding: 8px; }
	.section-shell { padding-block: 58px; }
	.section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
	.hero-grid { min-height: 0; padding-block: 49px 58px; }
	.hero-copy h1 { margin-top: 13px; font-size: clamp(3.05rem, 16vw, 4.2rem); }
	.hero-copy > p { font-size: 1.05rem; }
	.hero-actions { display: grid; }
	.hero-proof { gap: 8px 15px; }
	.hero-visual { min-height: 340px; }
	.hero-disc { width: 270px; border-width: 5px; box-shadow: 11px 11px 0 var(--ink); }
	.hero-disc span { font-size: 5rem; }
	.floating-note { min-width: 132px; padding: 9px 10px; gap: 8px; }
	.floating-note > span { width: 34px; height: 34px; font-size: 1.1rem; }
	.note-name { left: -4px; top: 12px; }
	.note-era { right: -2px; top: 78px; }
	.note-phrase { right: 5px; bottom: 8px; }
	.tool-card { grid-template-columns: 52px 1fr auto; min-height: 105px; padding: 15px; box-shadow: 4px 4px 0 var(--ink); }
	.tool-glyph { width: 52px; height: 52px; font-size: 1.55rem; }
	.tool-card small { font-size: 0.77rem; }
	.latest-grid { grid-template-columns: 1fr; }
	.latest-grid > .post-card,
	.latest-grid > .post-card:nth-child(2),
	.latest-grid > .post-card:nth-child(3),
	.latest-grid > .latest-lead { grid-column: auto; }
	.post-card-featured .post-card-body { padding: 20px; }
	.post-card-featured .post-card-title { font-size: 1.5rem; }
	.topic-grid,
	.post-grid-three { grid-template-columns: 1fr; }
	.archive-hero-inner,
	.page-header-inner { min-height: 280px; grid-template-columns: 1fr; gap: 25px; padding-block: 38px 46px; }
	.archive-glyph,
	.page-glyph { width: 100px; height: 100px; font-size: 3.25rem; box-shadow: 6px 6px 0 var(--ink); }
	.archive-hero h1,
	.article-header h1,
	.page-header h1 { font-size: clamp(2.5rem, 12vw, 3.8rem); }
	.article-header-inner { padding-block: 38px 46px; }
	.breadcrumbs [aria-current="page"] { max-width: 180px; }
	.article-hero-image { width: 100%; margin-top: 0; }
	.article-hero-image img { border-radius: 0; box-shadow: none; }
	.article-layout { width: min(calc(100% - 28px), var(--reading)); padding-block: 34px 60px; }
	.entry-content { font-size: 1.02rem; line-height: 1.72; }
	.entry-content blockquote { padding: 19px 19px 19px 22px; }
	.author-box { grid-template-columns: 64px 1fr; padding: 20px; }
	.author-initials-large { width: 64px; height: 64px; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-brand,
	.footer-menu-column { grid-column: auto; }
	.footer-bottom { align-items: flex-start; flex-direction: column; }
	.comment-content { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
	.site-header,
	.site-footer,
	.article-aside,
	.share-tools,
	.related-posts,
	.comments-shell { display: none !important; }
	body { background: #fff; color: #000; font-size: 11pt; }
	.article-header { background: #fff; border: 0; }
	.article-layout { display: block; width: 100%; padding: 0; }
	.entry-content a { color: #000; }
}
