/*
Theme Name: Cosmetic Decoder
Description: Bilingual (EN/KO) block theme for the Cosmetic Decoder tools. Works with the Cosmetic Decoder Core plugin.
Version: 0.3.2
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: cosmetic-check
*/

:root {
	--cc-bg: #f7f5f0;
	--cc-surface: #ffffff;
	--cc-ink: #17201c;
	--cc-muted: #5b6661;
	--cc-line: #e3dfd6;
	--cc-accent: #1e6b52;
	--cc-accent-soft: #e6f0eb;
	--cc-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Header ---------------------------------------------------------------- */
.cc-site-header { border-bottom: 1px solid var(--cc-line); background: rgba(247, 245, 240, .92); backdrop-filter: saturate(1.2) blur(8px); position: sticky; top: 0; z-index: 20; }
.cc-header { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.cc-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cc-ink); font-weight: 700; letter-spacing: -.01em; font-size: 18px; flex: none; }
.cc-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--cc-ink); position: relative; flex: none; }
.cc-mark::after { content: ""; position: absolute; left: 5px; right: 5px; top: 5px; height: 4px; border-radius: 2px; background: #8fd3b8; box-shadow: 0 7px 0 #fff; }

/* Tool switcher: the three main tools, always one tap away. */
.cc-switch { display: flex; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--cc-line); border-radius: 13px; margin-left: 8px; }
.cc-switch a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 11px; border-radius: 9px; color: var(--cc-muted); text-decoration: none; font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.cc-switch a:hover { color: var(--cc-ink); background: #f3f1ec; }
.cc-switch a[aria-current] { background: var(--cc-ink); color: #fff; }
.cc-switch-icon { display: inline-flex; width: 18px; height: 18px; }
.cc-switch-icon svg, .cc-hub-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.cc-nav { display: flex; gap: 2px; margin-left: auto; }
.cc-nav a, .cc-menu-panel a { color: var(--cc-muted); text-decoration: none; font-size: 14.5px; padding: 8px 11px; border-radius: 8px; }
.cc-nav a:hover, .cc-nav a[aria-current="page"] { color: var(--cc-ink); background: rgba(23, 32, 28, .05); }
.cc-lang { font-size: 14px; font-weight: 600; color: var(--cc-ink); text-decoration: none; border: 1px solid var(--cc-line); border-radius: 999px; padding: 6px 14px; background: #fff; flex: none; }
.cc-lang:hover { border-color: var(--cc-ink); }
.cc-menu { display: none; }
.cc-menu summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--cc-line); background: #fff; }
.cc-menu summary::-webkit-details-marker { display: none; }
.cc-menu-panel { position: absolute; right: 16px; left: 16px; top: 60px; background: #fff; border: 1px solid var(--cc-line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; box-shadow: 0 18px 40px -20px rgba(0,0,0,.25); z-index: 30; }
.cc-menu-panel a { padding: 12px; color: var(--cc-ink); }
@media (max-width: 1080px) {
	.cc-nav { display: none; }
	.cc-lang { margin-left: auto; }
	.cc-menu { display: block; }
	.cc-header { gap: 10px; }
}
@media (max-width: 760px) {
	.cc-header { flex-wrap: wrap; row-gap: 8px; padding-bottom: 10px; min-height: 0; padding-top: 10px; }
	.cc-switch { order: 10; width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cc-switch a { justify-content: center; padding: 0 6px; font-size: 13px; gap: 5px; }
	.cc-switch-icon { width: 16px; height: 16px; }
	.cc-menu-panel { top: 108px; }
}
@media (max-width: 380px) {
	.cc-switch-icon { display: none; }
}
/* On the home page the hub's own tabs sit right below, so phones don't need a second row of tabs. */
@media (max-width: 760px) {
	.cc-has-hub .cc-switch { display: none; }
	.cc-has-hub .cc-header { padding-bottom: 0; min-height: 60px; flex-wrap: nowrap; padding-top: 0; }
	.cc-has-hub .cc-menu-panel { top: 56px; }
}

/* Content --------------------------------------------------------------- */
/* Editorial layout: text column on the left (readable line length), tools/tables/cards use the full width. */
.cc-main .wp-block-post-content > h1,
.cc-main .wp-block-post-content > h2,
.cc-main .wp-block-post-content > h3,
.cc-main .wp-block-post-content > p,
.cc-main .wp-block-post-content > ul,
.cc-main .wp-block-post-content > ol { max-width: 760px; margin-left: 0 !important; margin-right: auto !important; }
.cc-main .wp-block-post-content > h2 { max-width: none; }
.cc-main h1.wp-block-heading { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.06; letter-spacing: -.03em; margin-top: clamp(32px, 6vw, 72px); margin-bottom: 18px; max-width: 18ch; }
.cc-lang-ko .cc-main h1.wp-block-heading { letter-spacing: -.035em; line-height: 1.18; max-width: 20ch; word-break: keep-all; }
.cc-lang-ko .cc-main { word-break: keep-all; }
.cc-main .cc-lede { font-size: clamp(18px, 2.1vw, 21px); line-height: 1.55; color: var(--cc-muted); max-width: 60ch; }
.cc-main h2.wp-block-heading { margin-top: 3.2rem; padding-top: 1.6rem; border-top: 1px solid var(--cc-line); }
.cc-main h3.wp-block-heading { margin-top: 2rem; }
.cc-main .cc-note { font-size: 14px; color: var(--cc-muted); border-left: 3px solid var(--cc-line); padding-left: 14px; }
.cc-main code { font-family: var(--cc-mono); font-size: .92em; background: #fff; border: 1px solid var(--cc-line); border-radius: 5px; padding: 1px 6px; letter-spacing: .06em; }
.cc-main .wp-block-table { margin: 1.25rem 0 1.5rem; overflow-x: auto; }
.cc-main .wp-block-table table { border-collapse: collapse; width: 100%; font-size: 15px; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--cc-line); }
.cc-main .wp-block-table.is-style-regular table, .cc-main .wp-block-table table.has-fixed-layout { table-layout: auto; }
.cc-main .wp-block-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--cc-muted); background: #fbfaf7; border: 0; border-bottom: 1px solid var(--cc-line); padding: 12px 14px; }
.cc-main .wp-block-table td { border: 0; border-bottom: 1px solid var(--cc-line); padding: 12px 14px; vertical-align: top; }
.cc-main .wp-block-table tr:last-child td { border-bottom: 0; }
.cc-main .wp-block-table thead { border: 0; }
.cc-main ul.wp-block-list li, .cc-main ol.wp-block-list li { margin-bottom: .5em; }
@media (max-width: 700px) {
	.cc-main .wp-block-table table { min-width: 560px; }
}

/* Cards ----------------------------------------------------------------- */
.cc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 2rem 0 1rem; }
.cc-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: #fff; border: 1px solid var(--cc-line); border-radius: 14px; text-decoration: none; color: var(--cc-ink); transition: border-color .15s ease, transform .15s ease; }
.cc-card:hover { border-color: var(--cc-ink); transform: translateY(-2px); }
.cc-card-num { font-family: var(--cc-mono); font-size: 12px; color: var(--cc-accent); letter-spacing: .1em; }
.cc-card-title { font-weight: 700; font-size: 17px; line-height: 1.3; }
.cc-card-desc { font-size: 14px; color: var(--cc-muted); line-height: 1.5; flex: 1; }
.cc-card-go { font-size: 14px; font-weight: 600; color: var(--cc-accent); }
@media (max-width: 1000px) { .cc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cc-cards { grid-template-columns: 1fr; } }

/* Footer ---------------------------------------------------------------- */
.cc-site-footer { border-top: 1px solid var(--cc-line); margin-top: 5rem; background: #f0ede6; }
.cc-footer { padding: 40px 0 28px; }
.cc-footer-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cc-footer-tag { color: var(--cc-muted); font-size: 14px; margin: 10px 0 0; }
.cc-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; align-content: flex-start; }
.cc-footer-nav a { color: var(--cc-ink); text-decoration: none; font-size: 14px; }
.cc-footer-nav a:hover { text-decoration: underline; }
.cc-footer-note { font-size: 13px; color: var(--cc-muted); max-width: 72ch; margin: 28px 0 8px; line-height: 1.6; }
.cc-footer-copy { font-size: 12px; color: var(--cc-muted); margin: 0; }
