/* Tegeltjeshumor-blokken. Kleuren via theme.json-variabelen met fallback. */
.th-studio, .th-grid-block, .th-detail, .th-remove, .th-ad {
	--th-ink: var(--wp--preset--color--ink, #17385a);
	--th-blue: var(--wp--preset--color--blue, #184e83);
	--th-accent: var(--wp--preset--color--accent, #ee815c);
	--th-cream: var(--wp--preset--color--cream, #f9f5ed);
	--th-muted: var(--wp--preset--color--muted, #6d7984);
	--th-line: var(--wp--preset--color--line, #e7e3da);
	--th-serif: var(--wp--preset--font-family--fraunces, 'Fraunces', Georgia, serif);
	box-sizing: border-box;
}
.th-studio *, .th-grid-block *, .th-detail *, .th-remove * { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Knoppen */
.th-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 14px 19px; font: inherit; font-weight: 800; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.th-btn:hover { transform: translateY(-2px); }
.th-btn:disabled { opacity: .7; cursor: progress; transform: none; }
.th-btn--primary { background: var(--th-accent); color: #fff; }
.th-btn--primary:hover { background: #e2704a; color: #fff; }
.th-btn--outline { border: 1px solid #ccdae5; color: var(--th-blue); background: #fff; }
.th-link { background: none; border: 0; padding: 0; color: var(--th-blue); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.th-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #b6684d; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; text-decoration: none; }
.th-eyebrow::before { content: ''; background: var(--th-accent); width: 19px; height: 2px; }
.th-pill { background: #e9f4ec; color: #47815c; padding: 7px 10px; border-radius: 99px; font-weight: 800; font-size: 11px; white-space: nowrap; }
.th-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Tegel (live preview) */
.th-stage { background: #eaf1f6; border-radius: 14px; padding: 22px; display: grid; place-items: center; min-height: 287px; }
.th-tile { --th-text-scale: 1; aspect-ratio: 1; background: #fff; position: relative; display: grid; place-items: center; align-content: center; text-align: center; padding: 26px; box-shadow: 0 10px 20px #1c47731a, 0 3px 2px #2b497322; overflow: hidden; width: 100%; max-width: 255px; transform: rotate(-2deg); transition: .2s; container-type: inline-size; }
.th-tile::before { content: ''; position: absolute; inset: 8px; border: 3px double currentColor; pointer-events: none; }
.th-tile::after { content: '❧'; font-size: 28px; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); line-height: 1; }
.th-tile__corner { position: absolute; color: inherit; font-size: 22px; line-height: 1; }
.th-tile__corner--tl { top: 10px; left: 13px; }
.th-tile__corner--tr { top: 10px; right: 13px; transform: scaleX(-1); }
.th-tile__corner--bl { bottom: 10px; left: 13px; transform: scaleY(-1); }
.th-tile__corner--br { bottom: 10px; right: 13px; transform: scale(-1); }
.th-tile__text { font-family: Georgia, serif; font-size: calc(clamp(13px, 8cqi, 24px) * var(--th-text-scale)); margin-bottom: 14px !important; line-height: 1.25; font-weight: bold; max-width: 90%; margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.th-tile__author { font-family: Georgia, serif; font-size: 11px; margin-top: 8px; opacity: .85; }
.th-tile__author:empty { display: none; }
/* Teksttegels in overzicht en detail */
.th-item__stage .th-tile { max-width: 220px; padding: 20px; }
.th-item__stage .th-tile__corner { font-size: clamp(11px, 8cqi, 20px); }
.th-item__stage .th-tile::after { font-size: clamp(14px, 10cqi, 26px); bottom: 10px; }
.th-item:nth-child(3n) .th-item__stage .th-tile { transform: rotate(1.5deg); }
.th-tile--large { max-width: 520px; padding: clamp(28px, 7%, 48px); box-shadow: 0 24px 50px #1c477326, 0 3px 2px #2b497322; }
.th-tile--large::before { inset: clamp(8px, 2.5%, 16px); border-width: 5px; }
.th-tile--large::after { font-size: clamp(28px, 9cqi, 52px); bottom: clamp(14px, 4%, 26px); }
.th-tile--large .th-tile__corner { font-size: clamp(22px, 7cqi, 40px); }
.th-tile--large .th-tile__corner--tl, .th-tile--large .th-tile__corner--tr { top: clamp(10px, 3%, 22px); }
.th-tile--large .th-tile__corner--bl, .th-tile--large .th-tile__corner--br { bottom: clamp(10px, 3%, 22px); }
.th-tile--large .th-tile__corner--tl, .th-tile--large .th-tile__corner--bl { left: clamp(13px, 3.5%, 26px); }
.th-tile--large .th-tile__corner--tr, .th-tile--large .th-tile__corner--br { right: clamp(13px, 3.5%, 26px); }
.th-tile--large .th-tile__author { font-size: clamp(12px, 3.5cqi, 20px); }
.th-tile--large .th-tile__text { font-size: calc(clamp(18px, 9cqi, 48px) * var(--th-text-scale)); }
.th-tile--navy { color: #205c96; }
.th-tile--terracotta { color: #b4644b; }
.th-tile--green { color: #54806b; }
.th-tile--dark { color: #fff; background: #1e4f7e; }
.th-tile--dark::before { border-color: #d8eaf9; }

/* Studio */
.th-studio { background: #fff; border-radius: 21px; padding: 23px; box-shadow: 0 24px 70px rgba(34,59,78,.10); border: 1px solid #f0ece5; color: var(--th-ink); position: relative; }
.th-studio__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.th-studio__top strong { font-size: 17px; }
.th-studio__content { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; margin: 0; }
.th-editor { display: flex; flex-direction: column; gap: 9px; }
.th-editor label, .th-editor__label { font-size: 12px; font-weight: 800; }
.th-optional { font-weight: 500; color: var(--th-muted); }
.th-editor textarea, .th-editor input[type="text"], .th-editor select { width: 100%; border: 1px solid #dfe5e9; border-radius: 9px; padding: 10px; font: inherit; font-size: 13px; outline-color: #729fca; background: #fff; color: inherit; }
.th-editor textarea { resize: vertical; min-height: 92px; }
.th-editor__count { color: #82909b; text-align: right; font-size: 11px; margin-top: -4px; }
.th-swatches { display: flex; gap: 8px; margin-bottom: 4px; }
.th-swatch { width: 29px; height: 29px; border-radius: 50%; border: 3px solid #fff; outline: 1px solid #ddd; cursor: pointer; padding: 0; }
.th-swatch.is-active { outline: 2px solid var(--th-blue); }
.th-editor .th-btn { width: 100%; font-size: 13px; padding: 13px 8px; margin-top: auto; }
.th-editor__note { font-size: 11px; color: var(--th-muted); margin: 0; text-align: center; }
.th-editor__error { font-size: 12px; color: #b4373c; background: #fdeeee; border-radius: 8px; padding: 8px 10px; margin: 0; }
.th-studio__result { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; align-items: center; }
.th-studio__result-stage .th-tile { max-width: 255px; }
.th-studio__result-body { display: flex; flex-direction: column; gap: 12px; }
.th-studio__result-title { font-size: 18px; }
.th-studio__result-actions { display: flex; flex-direction: column; gap: 8px; }

/* Overzicht */
.th-filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 29px; }
.th-chip { background: #fff; border: 1px solid #e2e4e2; border-radius: 30px; padding: 10px 18px; font: inherit; font-size: 13px; font-weight: 800; color: #496276; cursor: pointer; }
.th-chip.is-active, .th-chip:hover { background: var(--th-blue); color: #fff; border-color: var(--th-blue); }
.th-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; transition: opacity .2s; }
.th-grid-block.is-loading .th-grid { opacity: .5; }
.th-grid__empty { grid-column: 1 / -1; color: var(--th-muted); text-align: center; padding: 40px 0; }
.th-grid__ad { grid-column: 1 / -1; }
.th-item { background: #fff; border: 1px solid #ede9e3; border-radius: 15px; padding: 14px; transition: .15s; color: var(--th-ink); min-width: 0; }
.th-item:hover { transform: translateY(-3px); box-shadow: 0 10px 24px #23496b12; }
.th-item__link { display: block; }
.th-item__stage { display: grid; place-items: center; background: #eaf1f6; border-radius: 12px; padding: 16px; }
.th-item__stage img { display: block; width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; object-fit: cover; transform: rotate(-2deg); box-shadow: 0 10px 20px #1c47731a, 0 3px 2px #2b497322; background: #fff; }
.th-item:nth-child(3n) .th-item__stage img { transform: rotate(1.5deg); }
.th-item__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 12px; }
.th-item__meta > div { min-width: 0; }
.th-item__meta strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-item__meta small { display: block; color: #8b939b; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-like { background: #f5f7f8; border: 0; border-radius: 18px; padding: 8px 10px; color: #667c8e; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; flex: none; }
.th-like.is-liked { color: #cf5b67; background: #ffedf0; }
.th-center { display: flex; justify-content: center; margin-top: 30px; }
.th-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 34px; font-weight: 800; font-size: 14px; }
.th-pagination .page-numbers { display: inline-block; min-width: 40px; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--th-line); color: var(--th-blue); text-align: center; text-decoration: none; }
.th-pagination .page-numbers.current { background: var(--th-blue); color: #fff; border-color: var(--th-blue); }
.th-pagination .dots { border: 0; background: none; }

/* Detail */
.th-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; color: var(--th-ink); }
.th-detail__stage { background: #eaf1f6; border-radius: 21px; padding: clamp(20px, 5vw, 56px); display: grid; place-items: center; }
.th-detail__stage img { width: 100%; max-width: 520px; height: auto; transform: rotate(-2deg); box-shadow: 0 24px 50px #1c477326, 0 3px 2px #2b497322; background: #fff; }
.th-detail__title { font-family: var(--th-serif); font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -1.3px; margin: 14px 0 10px; overflow-wrap: anywhere; }
.th-detail__meta { color: var(--th-muted); font-size: 14px; margin: 0 0 24px; }
.th-detail__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.th-detail__actions .th-like { padding: 13px 16px; font-size: 14px; border-radius: 11px; }
.th-share { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 22px 0; font-size: 14px; font-weight: 700; }
.th-share span { color: var(--th-muted); font-weight: 500; }
.th-share a { color: var(--th-blue); }
.th-detail__nav { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--th-line); padding-top: 18px; font-weight: 800; font-size: 14px; }
.th-detail__nav a { color: var(--th-blue); text-decoration: none; }
.th-detail__remove { font-size: 13px; color: var(--th-muted); margin-top: 22px; }
.th-detail__remove a { color: var(--th-blue); font-weight: 700; }
.th-detail__ad { margin-top: 28px; }

/* Advertenties: ruimte reserveren voorkomt verspringende pagina's (CLS). */
.th-ad { display: block; margin: 0 auto; text-align: center; max-width: 100%; overflow: hidden; }
.th-ad__label { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #9aa3aa; margin-bottom: 6px; }
.th-ad__slot { display: flex; align-items: center; justify-content: center; margin: 0 auto; max-width: 100%; }
.th-ad--leaderboard .th-ad__slot, .th-ad--footer .th-ad__slot, .th-ad--grid_inline .th-ad__slot { min-height: 90px; max-width: 970px; }
.th-ad--content_wide .th-ad__slot { min-height: 90px; max-width: 970px; }
.th-ad--rectangle .th-ad__slot { min-height: 250px; max-width: 300px; }
.th-ad--placeholder .th-ad__slot { background: repeating-linear-gradient(45deg, #f3efe6, #f3efe6 10px, #efeadf 10px, #efeadf 20px); border: 1px dashed #d8d1c3; border-radius: 10px; color: #8b8577; font-size: 13px; font-weight: 700; padding: 12px; flex-direction: column; }
@media (max-width: 650px) {
	.th-ad--leaderboard .th-ad__slot, .th-ad--footer .th-ad__slot, .th-ad--grid_inline .th-ad__slot, .th-ad--content_wide .th-ad__slot { min-height: 100px; }
}

/* Formulieren */
.th-remove { max-width: 640px; color: var(--th-ink); }
.th-form { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid #f0ece5; border-radius: 21px; padding: 26px; box-shadow: 0 24px 70px rgba(34,59,78,.07); }
.th-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.th-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.th-field label { font-size: 13px; font-weight: 800; }
.th-field small { color: var(--th-muted); font-size: 12px; }
.th-field input, .th-field select, .th-field textarea { width: 100%; border: 1px solid #dfe5e9; border-radius: 9px; padding: 11px 12px; font: inherit; font-size: 14px; background: #fff; color: inherit; outline-color: #729fca; }
.th-form .th-btn { align-self: flex-start; }
.th-form__note { font-size: 12px; color: var(--th-muted); margin: 0; }
.th-remove__tile { display: flex; gap: 16px; align-items: center; background: var(--th-cream); border-radius: 14px; padding: 12px; }
.th-remove__tile img { border-radius: 8px; flex: none; }
.th-remove__tile div { display: flex; flex-direction: column; gap: 4px; }
.th-remove__tile a { color: var(--th-blue); font-size: 13px; font-weight: 700; }
.th-notice { border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.th-notice p { margin: 6px 0 0; }
.th-notice--success { background: #e9f4ec; color: #2f6343; }
.th-notice--error { background: #fdeeee; color: #9b2c31; }

.th-toast { position: fixed; bottom: 24px; right: 24px; background: #163e64; color: #fff; border-radius: 12px; padding: 14px 18px; opacity: 0; transform: translateY(20px); transition: .25s; pointer-events: none; z-index: 9999; font-size: 13px; }
.th-toast.is-visible { opacity: 1; transform: none; }
.th-editor-placeholder { border: 1px dashed #c9c2b4; border-radius: 14px; padding: 24px; background: #fffdf8; }

@media (max-width: 920px) {
	.th-studio__content, .th-studio__result { grid-template-columns: 1fr; }
	.th-stage { min-height: 220px; }
	.th-studio .th-tile { max-width: 220px; }
	.th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.th-detail { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 650px) {
	.th-studio { padding: 15px; }
	.th-studio__content { grid-template-columns: 1fr 1fr; gap: 12px; }
	.th-stage { padding: 10px; min-height: 200px; }
	.th-studio .th-tile { max-width: 180px; padding: 18px; }
	.th-tile__corner { font-size: 14px; }
	.th-tile::after { font-size: 18px; bottom: 10px; }
	.th-grid { gap: 10px; }
	.th-item { padding: 9px; }
	.th-item__stage { padding: 10px; }
	.th-item__meta strong { font-size: 11px; }
	.th-item__meta { font-size: 10px; flex-wrap: wrap; }
	.th-form { padding: 18px; }
	.th-form__row { grid-template-columns: 1fr; }
	.th-studio__result { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
	.th-studio__content { grid-template-columns: 1fr; }
	.th-studio .th-tile { max-width: 230px; }
	.th-stage { min-height: 250px; }
}
