/*
Theme Name:   Compare Child
Description:  Child theme for Kadence. Adds the site's color tokens, typography and the article components (disclosure box, comparison table, quick picks, "who should skip it" box, FAQ, price-checked note).
Author:       Read Before Japan
Template:     kadence
Version:      0.1.0
Requires at least: 6.6
Requires PHP: 8.3
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  compare-child
*/

/* ==========================================================================
   1. Tokens
   Kadence の「Global Palette」にも同じ値を入れる（site/design.md 3章）。
   Light only. Dark mode is out of scope for v0.1 (see design.md).
   ========================================================================== */
:root {
	--cmpc-text: #1F2933;          /* 14.76:1 on white */
	--cmpc-text-muted: #52606D;    /*  6.46:1 on white */
	--cmpc-bg: #FFFFFF;
	--cmpc-surface: #F5F7FA;       /* boxes, cards */
	--cmpc-surface-strong: #E4E9EF;/* table header */
	--cmpc-primary: #1D4E89;       /* links, buttons: 8.39:1 */
	--cmpc-primary-hover: #163C69; /* 11.14:1 */
	--cmpc-accent: #0F766E;        /* check marks, small labels: 5.47:1 */
	--cmpc-disclosure-bg: #EEF4FB;
	--cmpc-caution-bg: #FFF7E6;
	--cmpc-caution-border: #B45309;/* 5.02:1 */
	--cmpc-caution-text: #8A4B08;  /* 6.37:1 on caution bg */
	--cmpc-verified-bg: #E7F5EE;
	--cmpc-verified-text: #0F5132; /* 8.33:1 */
	--cmpc-border: #CBD2D9;        /* decorative lines only */
	--cmpc-border-strong: #7B8794; /* form fields, 3.66:1 */
	--cmpc-focus: #C2410C;         /* 5.18:1 on white */

	--cmpc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--cmpc-radius: 8px;
	--cmpc-space-1: 0.5rem;
	--cmpc-space-2: 1rem;
	--cmpc-space-3: 1.5rem;
	--cmpc-space-4: 2.5rem;
	--cmpc-content-width: 46rem;   /* about 736px: comfortable line length */
}

/* ==========================================================================
   2. Base
   ========================================================================== */
body {
	background: var(--cmpc-bg);
	color: var(--cmpc-text);
	font-family: var(--cmpc-font);
	font-size: 1.125rem;  /* 18px */
	line-height: 1.7;
}

.entry-content a:not(.wp-block-button__link) {
	color: var(--cmpc-primary);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
.entry-content a:not(.wp-block-button__link):hover {
	color: var(--cmpc-primary-hover);
}

:focus-visible {
	outline: 3px solid var(--cmpc-focus);
	outline-offset: 2px;
}

.entry-content h2 { margin-top: var(--cmpc-space-4); }
.entry-content h3 { margin-top: var(--cmpc-space-3); }

img { max-width: 100%; height: auto; }

/* ==========================================================================
   3. Buttons (affiliate CTA)
   Calm, not "salesy": solid primary, no animation, no countdowns.
   ========================================================================== */
.wp-block-button.cmpc-aff-btn .wp-block-button__link {
	background: var(--cmpc-primary);
	color: #FFFFFF;
	border-radius: var(--cmpc-radius);
	padding: 0.7em 1.2em;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	min-height: 44px; /* touch target */
}
.wp-block-button.cmpc-aff-btn .wp-block-button__link:hover {
	background: var(--cmpc-primary-hover);
}

/* ==========================================================================
   4. Disclosure box
   Placed right after the H1 / before the first affiliate link.
   Never collapsed; same text size as body text (FTC "clear and conspicuous").
   ========================================================================== */
.cmpc-disclosure {
	background: var(--cmpc-disclosure-bg);
	border-left: 4px solid var(--cmpc-primary);
	border-radius: 0 var(--cmpc-radius) var(--cmpc-radius) 0;
	padding: var(--cmpc-space-2) var(--cmpc-space-3);
	margin: var(--cmpc-space-2) 0 var(--cmpc-space-3);
	font-size: 1em;           /* do not shrink */
	color: var(--cmpc-text);  /* do not use a pale grey */
}
.cmpc-disclosure p { margin: 0; }
.cmpc-disclosure p + p { margin-top: var(--cmpc-space-1); }

/* ==========================================================================
   5. Comparison table
   Horizontal scroll on small screens. Block class: cmpc-compare-table.
   functions.php adds tabindex/role/aria-label so keyboard users can scroll.
   ========================================================================== */
.wp-block-table.cmpc-compare-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: var(--cmpc-space-3) 0;
	border: 1px solid var(--cmpc-border);
	border-radius: var(--cmpc-radius);
}
.wp-block-table.cmpc-compare-table table {
	border-collapse: collapse;
	width: 100%;
	min-width: 40rem;          /* forces scroll instead of squashed columns */
	font-size: 0.9375rem;      /* 15px */
	line-height: 1.5;
}
.wp-block-table.cmpc-compare-table th,
.wp-block-table.cmpc-compare-table td {
	border: 1px solid var(--cmpc-border);
	padding: 0.6em 0.75em;
	text-align: left;
	vertical-align: top;
}
.wp-block-table.cmpc-compare-table thead th {
	background: var(--cmpc-surface-strong);
	font-weight: 700;
	position: sticky;
	top: 0;
}
/* First column = row label, stays visible while scrolling sideways */
.wp-block-table.cmpc-compare-table tbody th,
.wp-block-table.cmpc-compare-table td:first-child {
	position: sticky;
	left: 0;
	background: var(--cmpc-surface);
	font-weight: 600;
	min-width: 9rem;
}
.wp-block-table.cmpc-compare-table figcaption {
	font-size: 0.875rem;
	color: var(--cmpc-text-muted);
	padding: 0.5em 0.75em;
	text-align: left;
}
.cmpc-scroll-hint {
	font-size: 0.875rem;
	color: var(--cmpc-text-muted);
	margin-bottom: 0.25rem;
}
@media (min-width: 60rem) {
	.cmpc-scroll-hint { display: none; }
}

/* ==========================================================================
   6. Quick picks cards
   ========================================================================== */
.cmpc-quick-picks {
	gap: var(--cmpc-space-2);
	margin: var(--cmpc-space-3) 0;
}
.cmpc-quick-picks .wp-block-column {
	background: var(--cmpc-surface);
	border: 1px solid var(--cmpc-border);
	border-radius: var(--cmpc-radius);
	padding: var(--cmpc-space-2);
	display: flex;
	flex-direction: column;
}
.cmpc-quick-picks .cmpc-pick-label {
	color: var(--cmpc-accent);
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0 0 0.25rem;
}
.cmpc-quick-picks h3 {
	font-size: 1.125rem;
	margin: 0 0 var(--cmpc-space-1);
}
.cmpc-quick-picks p { font-size: 1rem; }
.cmpc-quick-picks .wp-block-buttons { margin-top: auto; }

/* ==========================================================================
   7. "Who should skip it" caution box
   Text label + border, so the meaning does not depend on color alone.
   ========================================================================== */
.cmpc-caution {
	background: var(--cmpc-caution-bg);
	border: 1px solid var(--cmpc-caution-border);
	border-left-width: 4px;
	border-radius: var(--cmpc-radius);
	padding: var(--cmpc-space-2) var(--cmpc-space-3);
	margin: var(--cmpc-space-3) 0;
}
.cmpc-caution .cmpc-caution-title {
	color: var(--cmpc-caution-text);
	font-weight: 700;
	margin: 0 0 var(--cmpc-space-1);
}
.cmpc-caution ul { margin: 0; padding-left: 1.25em; }

/* ==========================================================================
   8. FAQ (visible headings + answers; no accordion, no FAQPage schema)
   ========================================================================== */
.cmpc-faq h3 {
	font-size: 1.125rem;
	margin: var(--cmpc-space-3) 0 var(--cmpc-space-1);
}
.cmpc-faq h3 + p { margin-top: 0; }

/* ==========================================================================
   9. Price-checked note
   ========================================================================== */
.cmpc-price-checked {
	display: block;
	background: var(--cmpc-verified-bg);
	color: var(--cmpc-verified-text);
	border-radius: var(--cmpc-radius);
	padding: 0.6em 0.9em;
	font-size: 0.9375rem;
	margin: var(--cmpc-space-2) 0;
}
.cmpc-price-checked strong { font-weight: 700; }

/* ==========================================================================
   10. Legal page skeleton
   ========================================================================== */
.cmpc-last-updated {
	color: var(--cmpc-text-muted);
	font-size: 0.9375rem;
}

/* ==========================================================================
   11. Footer legal links (Kadence footer navigation)
   ========================================================================== */
.site-footer a { text-decoration: underline; }

/* ==========================================================================
   12. Forms (WPForms Lite / any form)
   ========================================================================== */
.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content textarea {
	border: 1px solid var(--cmpc-border-strong);
	border-radius: 6px;
	font-size: 1rem; /* avoids iOS zoom */
}

/* ==========================================================================
   13. Small screens
   ========================================================================== */
@media (max-width: 37.5rem) {
	body { font-size: 1.0625rem; } /* 17px */
	.cmpc-disclosure,
	.cmpc-caution { padding: var(--cmpc-space-2); }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}
