/* ==========================================================
   KrooKroo — สไตล์การ์ตูนน่ารักสำหรับ ครูครู.com
   ========================================================== */

:root {
	--kk-navy: var(--wp--preset--color--navy, #1E2A4A);
	--kk-border: 3px solid var(--kk-navy);
	--kk-shadow: 5px 5px 0 var(--kk-navy);
	--kk-shadow-lg: 8px 8px 0 var(--kk-navy);
	--kk-radius: 28px;
	--kk-radius-lg: 40px;
}

body {
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

:where(a, button, input, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--grape);
	outline-offset: 3px;
	border-radius: 8px;
}

img { border-radius: 16px; }

/* ---------- Top bar ---------- */
.kk-topbar {
	background: var(--kk-navy);
	color: #fff;
	font-size: 0.9rem;
	text-align: center;
}
.kk-topbar p { margin: 0; }
.kk-topbar a { color: var(--wp--preset--color--sun); font-weight: 600; }

/* ---------- Header ---------- */
.kk-header { position: relative; z-index: 20; }
.kk-header .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--kk-navy);
}
.kk-header .wp-block-site-title a::before {
	content: "";
	flex: none;
	width: 52px;
	height: 52px;
	border-radius: 16px;
	background: var(--wp--preset--color--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3l4 4L8 20l-5 1 1-5z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E") center / 28px no-repeat;
	box-shadow: 4px 4px 0 var(--kk-navy);
	transform: rotate(-6deg);
	transition: transform .25s ease;
}
.kk-header .wp-block-site-title a:hover::before { transform: rotate(6deg) scale(1.05); }
.kk-header .wp-block-site-title a::after {
	content: ".com";
	color: var(--wp--preset--color--coral);
	margin-left: -0.7rem;
}
/* ถ้าชื่อเว็บมี .com อยู่แล้ว ให้ลบบรรทัด ::after ด้านบน หรือเพิ่มคลาส kk-no-dotcom ให้บล็อก Site Title */
.kk-header .kk-no-dotcom a::after { content: none; }

.kk-nav .wp-block-navigation-item__content {
	padding: 0.55rem 1rem;
	border-radius: 999px;
	transition: background .2s ease;
}
.kk-nav .wp-block-navigation-item__content:hover,
.kk-nav .current-menu-item > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--grape-soft);
	color: var(--kk-navy);
}
.kk-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--sun-soft);
	padding: 2rem;
}
.kk-nav .wp-block-navigation__responsive-container-open {
	width: 46px; height: 46px;
	border: 2px solid var(--kk-navy);
	border-radius: 999px;
	display: flex; align-items: center; justify-content: center;
	background: #fff;
}

/* ---------- Hero ---------- */
.kk-hero {
	position: relative;
	overflow: hidden;
	border: var(--kk-border);
	border-radius: var(--kk-radius-lg);
	box-shadow: var(--kk-shadow-lg);
}
.kk-hero::before,
.kk-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}
.kk-hero::before { width: 220px; height: 220px; right: -60px; top: -70px; background: rgba(255,255,255,.35); }
.kk-hero::after { width: 120px; height: 120px; left: 42%; bottom: -50px; background: rgba(255,255,255,.3); }
.kk-hero > * { position: relative; z-index: 1; }
.kk-badge {
	display: inline-block;
	background: #fff;
	border: 2px solid var(--kk-navy);
	border-radius: 999px;
	padding: 0.25rem 1rem;
	font-weight: 600;
	font-size: 0.95rem;
}
.kk-hero mark,
.kk-highlight {
	background: #fff;
	color: inherit;
	padding: 0 0.6rem;
	border-radius: 16px;
	display: inline-block;
	transform: rotate(-2deg);
}
.kk-hero-art img {
	border-radius: 0;
	animation: kk-float 6s ease-in-out infinite;
}
@keyframes kk-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
	.kk-hero-art img { animation: none; }
}

/* ---------- Search ---------- */
.kk-search .wp-block-search__inside-wrapper {
	background: #fff;
	border: var(--kk-border) !important;
	border-radius: 999px;
	padding: 6px !important;
	max-width: 580px;
}
.kk-search .wp-block-search__input {
	border: 0;
	background: transparent;
	font-family: inherit;
	font-size: 1.05rem;
	padding: 0.6rem 1.1rem;
	color: var(--kk-navy);
	min-width: 0;
}
.kk-search .wp-block-search__input:focus { outline: none; }
.kk-search .wp-block-search__button {
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--coral);
	color: var(--kk-navy);
	font-family: var(--wp--preset--font-family--mali);
	font-weight: 700;
	font-size: 1.1rem;
	padding: 0.6rem 1.6rem;
	cursor: pointer;
}
.kk-search .wp-block-search__button:hover { background: var(--wp--preset--color--sun); }
.kk-popular a { text-decoration: underline; text-underline-offset: 3px; margin-right: 0.6rem; }

/* ---------- Section heading row ---------- */
.kk-section-head h2 { margin: 0; }
.kk-section-head .kk-more a { font-weight: 600; text-decoration: none; }
.kk-section-head .kk-more a::after { content: " ›"; }

/* ---------- Category tiles ---------- */
.kk-cat {
	position: relative;
	border: var(--kk-border);
	border-radius: var(--kk-radius);
	box-shadow: 4px 4px 0 var(--kk-navy);
	padding: 1.5rem 1.25rem !important;
	transition: transform .2s ease, box-shadow .2s ease;
}
.kk-cat:hover { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--kk-navy); }
.kk-cat::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	border-radius: 18px;
	background-color: var(--kk-cat-accent, var(--wp--preset--color--sun));
	background-position: center;
	background-repeat: no-repeat;
	background-size: 28px;
	margin-bottom: 0.9rem;
}
.kk-cat h3 { margin: 0 0 0.25rem; font-size: 1.3rem; }
.kk-cat h3 a { text-decoration: none; }
.kk-cat h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--kk-radius); }
.kk-cat p { margin: 0; font-size: 0.95rem; line-height: 1.5; }

.kk-cat--book    { background: var(--wp--preset--color--coral-soft); --kk-cat-accent: var(--wp--preset--color--coral); }
.kk-cat--sheet   { background: var(--wp--preset--color--sun-soft);   --kk-cat-accent: var(--wp--preset--color--sun); }
.kk-cat--admin   { background: var(--wp--preset--color--mint-soft);  --kk-cat-accent: var(--wp--preset--color--mint); }
.kk-cat--kid     { background: var(--wp--preset--color--grape-soft); --kk-cat-accent: var(--wp--preset--color--lavender); }
.kk-cat--star    { background: var(--wp--preset--color--leaf-soft);  --kk-cat-accent: var(--wp--preset--color--leaf); }
.kk-cat--news    { background: var(--wp--preset--color--orange-soft);--kk-cat-accent: var(--wp--preset--color--orange); }

.kk-cat--book::before  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z'/%3E%3Cpath d='M8 7h7'/%3E%3C/svg%3E"); }
.kk-cat--sheet::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E"); }
.kk-cat--admin::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18v13H3z'/%3E%3Cpath d='M8 7V4h8v3'/%3E%3Cpath d='M3 12h18'/%3E%3C/svg%3E"); }
.kk-cat--kid::before   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M5 21c1-4 4-6 7-6s6 2 7 6'/%3E%3C/svg%3E"); }
.kk-cat--star::before  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6L20 9.3l-4 4 1 5.7-5-2.8-5 2.8 1-5.7-4-4 5.4-.7z'/%3E%3C/svg%3E"); }
.kk-cat--news::before  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H8l-4 4z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E"); }

/* ---------- Post cards ---------- */
.kk-post-grid { gap: 1.75rem !important; }
.kk-post-card {
	height: 100%;
	background: #fff;
	border: var(--kk-border);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .2s ease, box-shadow .2s ease;
}
.kk-post-card:hover { transform: translate(-2px, -3px); box-shadow: 8px 9px 0 var(--kk-navy); }
.kk-post-card .wp-block-post-featured-image {
	margin: 0;
	border-bottom: var(--kk-border);
}
.kk-post-card .wp-block-post-featured-image img { border-radius: 0; }
/* ไม่มีภาพหน้าปก → แสดงแถบสีแทน */
.kk-post-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 16 / 9;
	border-bottom: var(--kk-border);
	background:
		radial-gradient(circle at 80% 30%, rgba(255,255,255,.6) 0 18%, transparent 19%),
		radial-gradient(circle at 20% 75%, rgba(255,255,255,.45) 0 12%, transparent 13%),
		var(--kk-card-tint, var(--wp--preset--color--sun-soft));
}
.kk-post-grid > li:nth-child(6n+2) { --kk-card-tint: var(--wp--preset--color--grape-soft); }
.kk-post-grid > li:nth-child(6n+3) { --kk-card-tint: var(--wp--preset--color--mint-soft); }
.kk-post-grid > li:nth-child(6n+4) { --kk-card-tint: var(--wp--preset--color--leaf-soft); }
.kk-post-grid > li:nth-child(6n+5) { --kk-card-tint: var(--wp--preset--color--orange-soft); }
.kk-post-grid > li:nth-child(6n+6) { --kk-card-tint: var(--wp--preset--color--coral-soft); }

.kk-post-card__body { flex: 1; display: flex; flex-direction: column; }
.kk-post-card .wp-block-post-title { font-size: 1.3rem; line-height: 1.45; margin: 0; }
.kk-post-card .wp-block-post-excerpt { margin: 0; color: var(--wp--preset--color--muted); font-size: 0.97rem; line-height: 1.65; }
.kk-post-card .wp-block-post-excerpt__excerpt { margin: 0; }
.kk-post-card__foot { margin-top: auto; font-size: 0.9rem; color: var(--wp--preset--color--muted); }
.kk-post-card__foot a { font-weight: 600; text-decoration: none; }

/* ---------- Category pills ---------- */
.is-style-kk-pills a,
.kk-pills a {
	display: inline-block;
	background: var(--wp--preset--color--sun);
	border: 2px solid var(--kk-navy);
	border-radius: 999px;
	padding: 0.15rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.6;
	text-decoration: none;
	margin: 0 0.25rem 0.25rem 0;
}
.is-style-kk-pills .wp-block-post-terms__separator,
.kk-pills .wp-block-post-terms__separator { display: none; }
/* สีตามหมวด (อิงจาก slug ของหมวดหมู่) */
.is-style-kk-pills a[href*="/teaching-media"], .kk-pills a[href*="/teaching-media"] { background: var(--wp--preset--color--coral); }
.is-style-kk-pills a[href*="/worksheet"],      .kk-pills a[href*="/worksheet"]      { background: var(--wp--preset--color--sun); }
.is-style-kk-pills a[href*="/admin"],          .kk-pills a[href*="/admin"]          { background: var(--wp--preset--color--mint); }
.is-style-kk-pills a[href*="/early-childhood"],.kk-pills a[href*="/early-childhood"]{ background: var(--wp--preset--color--lavender); }
.is-style-kk-pills a[href*="/teaching-tips"],  .kk-pills a[href*="/teaching-tips"]  { background: var(--wp--preset--color--leaf); }
.is-style-kk-pills a[href*="/teacher-news"],   .kk-pills a[href*="/teacher-news"]   { background: var(--wp--preset--color--orange); }

/* ---------- Group block styles ---------- */
.is-style-kk-card {
	background: #fff;
	border: var(--kk-border);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
	padding: clamp(1.25rem, 3vw, 1.75rem);
}
.is-style-kk-panel {
	border: var(--kk-border);
	border-radius: var(--kk-radius-lg);
	box-shadow: var(--kk-shadow-lg);
	padding: clamp(1.5rem, 5vw, 3rem);
}
.is-style-kk-tip {
	position: relative;
	background: var(--wp--preset--color--mint-soft);
	border: 3px dashed var(--kk-navy);
	border-radius: 24px;
	padding: 1.25rem 1.5rem 1.25rem 4.2rem !important;
}
.is-style-kk-tip::before {
	content: "";
	position: absolute;
	left: 1.2rem;
	top: 1.3rem;
	width: 32px;
	height: 32px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4'/%3E%3Cpath d='M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.is-style-kk-tip > :first-child { margin-top: 0; }
.is-style-kk-tip > :last-child { margin-bottom: 0; }

/* ---------- Button block styles ---------- */
.wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.wp-block-button__link:hover { transform: translate(-1px, -2px); box-shadow: 3px 4px 0 var(--kk-navy); }
.is-style-kk-sun .wp-block-button__link     { background: var(--wp--preset--color--sun); color: var(--kk-navy); }
.is-style-kk-coral .wp-block-button__link   { background: var(--wp--preset--color--coral); color: var(--kk-navy); }
.is-style-kk-outline .wp-block-button__link { background: #fff; color: var(--kk-navy); }
.is-style-kk-line .wp-block-button__link    { background: #06C755; color: #0B2A16; }
.is-style-kk-sun .wp-block-button__link:hover,
.is-style-kk-coral .wp-block-button__link:hover,
.is-style-kk-outline .wp-block-button__link:hover,
.is-style-kk-line .wp-block-button__link:hover { color: var(--kk-navy); }

/* ---------- Image style ---------- */
.is-style-kk-cartoon img,
.wp-block-post-featured-image.is-style-kk-cartoon img {
	border: var(--kk-border);
	border-radius: var(--kk-radius);
	box-shadow: var(--kk-shadow);
}

/* ---------- Download band ---------- */
.kk-band { color: #fff; }
.kk-band h2, .kk-band p { color: #fff; }
.kk-file {
	background: #fff;
	color: var(--kk-navy);
	border: var(--kk-border);
	border-radius: 20px;
	padding: 0.9rem 1.2rem !important;
	transition: transform .15s ease;
}
.kk-file:hover { transform: translateX(4px); }
.kk-file p { margin: 0; color: var(--kk-navy); font-weight: 600; }
.kk-file a { text-decoration: none; color: var(--kk-navy); }
.kk-file .kk-filetype {
	background: var(--wp--preset--color--sun);
	border-radius: 999px;
	padding: 0.15rem 0.8rem;
	font-size: 0.85rem;
}

/* ---------- Newsletter ---------- */
.kk-newsletter {
	border: 3px dashed var(--kk-navy);
	border-radius: var(--kk-radius-lg);
}

/* ---------- Footer ---------- */
.kk-footer {
	border-radius: 48px 48px 0 0;
	color: #D5DBEC;
}
.kk-footer a { color: #fff; text-decoration: none; }
.kk-footer a:hover { color: var(--wp--preset--color--sun); text-decoration: underline; }
.kk-footer h3 { color: var(--wp--preset--color--sun); font-size: 1.2rem; margin-bottom: 0.5rem; }
.kk-footer ul { list-style: none; padding: 0; margin: 0; }
.kk-footer li { margin: 0.4rem 0; }
.kk-footer .wp-block-site-title a { color: #fff; }
.kk-footer .wp-block-site-title a::after { content: ".com"; color: var(--wp--preset--color--sun); }
.kk-footer .kk-no-dotcom a::after { content: none; }
.kk-footer__bottom { border-top: 1px solid #3A4870; font-size: 0.9rem; }

/* ---------- Single post ---------- */
.kk-single-head .wp-block-post-title { margin: 0; }
.kk-meta { color: var(--wp--preset--color--muted); font-size: 0.95rem; }
.kk-meta .wp-block-post-author { align-items: center; }
.kk-meta .wp-block-post-author__avatar img { border: 2px solid var(--kk-navy); border-radius: 999px; }
.kk-meta .wp-block-post-author__name { color: var(--kk-navy); font-weight: 600; }
.kk-cover img {
	border: var(--kk-border);
	border-radius: 32px;
	box-shadow: 6px 6px 0 var(--kk-navy);
}
.kk-content { font-size: 1.125rem; line-height: 1.9; }
.kk-content h2 { margin-top: 2.5rem; font-size: 1.9rem; }
.kk-content h2::before {
	content: "";
	display: inline-block;
	width: 14px; height: 14px;
	margin-right: 0.6rem;
	border-radius: 50%;
	background: var(--wp--preset--color--coral);
	border: 2px solid var(--kk-navy);
	vertical-align: 0.2em;
}
.kk-content h3 { margin-top: 2rem; }
.kk-content ul li::marker { color: var(--wp--preset--color--grape); }
.kk-content blockquote {
	background: var(--wp--preset--color--sun-soft);
	border: var(--kk-border);
	border-radius: 24px;
	padding: 1.25rem 1.5rem;
	margin-left: 0;
	margin-right: 0;
	font-family: var(--wp--preset--font-family--mali);
}
.kk-content table { border-collapse: collapse; width: 100%; }
.kk-content th, .kk-content td { border: 2px solid var(--kk-navy); padding: 0.6rem 0.8rem; }
.kk-content th { background: var(--wp--preset--color--grape-soft); }
.kk-content .wp-block-table { overflow-x: auto; }

/* กล่องดาวน์โหลดในบทความ */
.kk-download { color: #fff; }
.kk-download h3, .kk-download p { color: #fff; margin: 0; }
.kk-download .wp-block-file { margin: 0; }

/* แชร์ */
.kk-share {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	margin: 2rem 0;
}
.kk-share__label { font-weight: 600; }
.kk-share__btn {
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--kk-navy);
	background: #fff;
	border: 2px solid var(--kk-navy);
	border-radius: 999px;
	padding: 0.45rem 1.1rem;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.5;
}
.kk-share__btn:hover { background: var(--wp--preset--color--sun); color: var(--kk-navy); }
.kk-share__btn--line:hover { background: #06C755; }

/* ---------- Sidebar ---------- */
.kk-side-box h3 { margin-top: 0; font-size: 1.35rem; }
.kk-side-box .wp-block-categories {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.kk-side-box .wp-block-categories a {
	display: flex;
	justify-content: space-between;
	padding: 0.55rem 0.9rem;
	border-radius: 14px;
	background: var(--wp--preset--color--sun-soft);
	font-weight: 600;
	text-decoration: none;
}
.kk-side-box .wp-block-categories a::after { content: "›"; }
.kk-side-box .wp-block-categories li:nth-child(5n+1) a { background: var(--wp--preset--color--coral-soft); }
.kk-side-box .wp-block-categories li:nth-child(5n+2) a { background: var(--wp--preset--color--sun-soft); }
.kk-side-box .wp-block-categories li:nth-child(5n+3) a { background: var(--wp--preset--color--mint-soft); }
.kk-side-box .wp-block-categories li:nth-child(5n+4) a { background: var(--wp--preset--color--grape-soft); }
.kk-side-box .wp-block-categories li:nth-child(5n+5) a { background: var(--wp--preset--color--leaf-soft); }
.kk-side-box .wp-block-latest-posts { padding: 0; margin: 0; }
.kk-side-box .wp-block-latest-posts li {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1rem;
}
.kk-side-box .wp-block-latest-posts__featured-image { flex: none; margin: 0 !important; }
.kk-side-box .wp-block-latest-posts__featured-image img {
	width: 64px; height: 64px; object-fit: cover;
	border: 2px solid var(--kk-navy);
	border-radius: 16px;
}
.kk-side-box .wp-block-latest-posts__post-title { font-weight: 600; line-height: 1.5; text-decoration: none; }
.kk-ad {
	border: 3px dashed var(--kk-navy);
	border-radius: var(--kk-radius);
	min-height: 250px;
	color: var(--wp--preset--color--muted);
}

/* ---------- Pagination ---------- */
.wp-block-query-pagination { gap: 0.5rem; }
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 0.9rem;
	border: 2px solid var(--kk-navy);
	border-radius: 999px;
	background: #fff;
	text-decoration: none;
	font-weight: 600;
}
.wp-block-query-pagination .page-numbers.current { background: var(--kk-navy); color: #fff; }
.wp-block-query-pagination a:hover { background: var(--wp--preset--color--sun); }

/* ---------- Archive header ---------- */
.kk-archive-head .wp-block-query-title { margin: 0; }
.kk-archive-head .wp-block-term-description p { margin: 0.5rem 0 0; }

/* ---------- Comments ---------- */
.kk-comments .comment-body,
.kk-comments .wp-block-comment-template li > div {
	background: #fff;
	border: 2px solid var(--kk-navy);
	border-radius: 20px;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
}
.kk-comments textarea,
.kk-comments input[type="text"],
.kk-comments input[type="email"],
.kk-comments input[type="url"] {
	width: 100%;
	border: 2px solid var(--kk-navy);
	border-radius: 16px;
	padding: 0.7rem 1rem;
	font-family: inherit;
	font-size: 1rem;
	background: #fff;
	box-sizing: border-box;
}
.kk-comments .form-submit input[type="submit"],
.kk-comments .wp-block-post-comments-form input[type="submit"] {
	background: var(--kk-navy);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 0.75rem 1.6rem;
	font-family: var(--wp--preset--font-family--mali);
	font-weight: 700;
	font-size: 1.05rem;
	cursor: pointer;
}

/* ---------- 404 ---------- */
.kk-404-num {
	font-family: var(--wp--preset--font-family--mali);
	font-size: clamp(6rem, 20vw, 11rem) !important;
	line-height: 1 !important;
	color: var(--wp--preset--color--coral);
	-webkit-text-stroke: 3px var(--kk-navy);
	text-shadow: 6px 6px 0 var(--kk-navy);
	margin: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.kk-hero { border-radius: 28px; box-shadow: var(--kk-shadow); }
	.is-style-kk-panel { border-radius: 28px; box-shadow: var(--kk-shadow); }
	.kk-header .wp-block-site-title a::before { width: 44px; height: 44px; background-size: 24px; }
	.kk-hero-art { max-width: 320px; margin: 0 auto; }
	.kk-footer { border-radius: 32px 32px 0 0; }
}

/* ---------- AdSense ---------- */
.kk-ad-slot {
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
	text-align: center;
	clear: both;
	max-width: 100%;
	overflow: hidden;
}
.kk-ad-slot__label {
	display: block;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--muted);
	margin-bottom: 0.35rem;
}
/* จองพื้นที่ไว้ก่อน ลดการกระตุกของหน้า (CLS) */
.kk-ad-slot--header,
.kk-ad-slot--home_mid,
.kk-ad-slot--archive_top,
.kk-ad-slot--footer { min-height: 120px; }
.kk-ad-slot--in_article,
.kk-ad-slot--after_content { min-height: 280px; }
.kk-ad-slot--sidebar { min-height: 280px; margin: 0; }
.kk-ad-slot--header { margin-top: 0.5rem; }
.kk-ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.kk-ad-slot--preview .kk-ad-slot__preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: inherit;
	height: 100%;
	padding: 1.5rem 1rem;
	border: 3px dashed var(--kk-navy);
	border-radius: 20px;
	background: repeating-linear-gradient(45deg, #fff 0 12px, var(--wp--preset--color--sun-soft) 12px 24px);
	font-weight: 600;
	box-sizing: border-box;
}
.kk-ad-slot--preview .kk-ad-slot__preview small { font-weight: 400; color: var(--wp--preset--color--muted); }

/* ---------- รายการไฟล์ [kk_downloads] ---------- */
.kk-files { display: flex; flex-direction: column; gap: 0.75rem; }
a.kk-file {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.5;
}
a.kk-file:hover { color: var(--kk-navy); }
.kk-file__title { min-width: 0; }
a.kk-file .kk-filetype { flex: none; white-space: nowrap; }
