/*
Theme Name: TKD Tournament
Description: A full-width theme for a taekwondo tournament registration site: logo header, big poster, registration boxes for athletes, coaches, referees and volunteers, alliance championships, and a sponsor logo wall.
Version: 1.0.7
Requires at least: 6.0
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: tkd-tournament
*/

:root {
	--ink: #0E1116;
	--ink-2: #1B212B;
	--paper: #F4F5F7;
	--white: #FFFFFF;
	--line: #D9DDE3;
	--muted: #4A5260;
	--muted-dark: #D5DAE2;
	--red: #C8102E;
	--red-dark: #A50D26;
	--blue: #0B4DA2;
	--gold: #F2C230;
	--display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
	--body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--gutter: clamp(16px, 4vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: #08397A; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input, select, textarea, button { font: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 1.02; margin: 0; overflow-wrap: anywhere; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tk-skip { position: absolute; left: -9999px; top: 0; background: var(--white); color: var(--ink); padding: 12px 16px; z-index: 100; }
.tk-skip:focus { left: 8px; top: 8px; }
.tk-wrap { max-width: 1440px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.tk-wrap--narrow { max-width: 920px; }

/* Buttons */
.tk-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 1.5px solid transparent; border-radius: 4px; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer; }
.tk-btn--block { width: 100%; min-height: 52px; font-size: 18px; }
.tk-btn--accent { background: var(--red); color: var(--white); }
.tk-btn--accent:hover { background: var(--red-dark); color: var(--white); }
.tk-btn--dark { background: var(--ink); color: var(--white); }
.tk-btn--dark:hover { background: var(--ink-2); color: var(--white); }
.tk-btn--off { background: #E6E9EE; color: var(--muted); cursor: default; }

/* Header */
.tk-header { background: var(--ink); color: var(--white); }
.tk-top { background-color: var(--ink); background-size: cover; background-position: center; }
.tk-top__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 20px; padding-bottom: 20px; }
.tk-brand { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tk-brand .custom-logo-link { display: block; flex: none; }
.tk-brand .custom-logo { display: block; max-height: 92px; width: auto; }
.tk-brand__name { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.4vw, 46px); line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; color: var(--white); text-decoration: none; }
.tk-brand__name:hover { color: var(--white); }
.tk-brand__when { margin-top: 8px; color: var(--gold); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px; }
.tk-top__cta { min-height: 52px; font-size: 18px; }

/* Banner header: picture left, title logo in the middle, picture right, on a blue-to-purple band */
.tk-banner { background-color: #3A4391; background-image: linear-gradient(180deg, #3A4391 0%, #69487A 100%); background-size: cover; background-position: center; overflow: hidden; }
.tk-banner__in { max-width: 1560px; margin: 0 auto; height: clamp(120px, 11.5vw, 176px); display: flex; align-items: stretch; justify-content: space-between; }
.tk-banner__in img { display: block; height: 100%; width: auto; max-width: none; }
.tk-banner__logo { display: block; flex: none; }
.tk-banner__logo img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%); }
.tk-banner__side { flex: none; }
.tk-banner__side--left { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 80%, transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 80%, transparent 100%); }
.tk-banner__side--right { margin-right: 2%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); }
@media (max-width: 900px) {
	.tk-banner__in { height: auto; justify-content: center; }
	.tk-banner__in .tk-banner__side { display: none; }
	.tk-banner__logo { flex: 0 1 560px; min-width: 0; }
	.tk-banner__in .tk-banner__logo img { width: 100%; height: auto; }
}

.tk-navbar { background: var(--red); }
.tk-navbar .tk-wrap { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 0 24px; }
.tk-navbar__row { display: contents; }
.tk-navbar__cta { order: 2; flex: none; min-height: 40px; margin: 6px 0; white-space: nowrap; }
.tk-nav { order: 1; flex: 1 1 auto; min-width: 0; }
.tk-menu { list-style: none; margin: 0 -13px; padding: 0; display: flex; flex-wrap: wrap; }
.tk-menu a { display: flex; align-items: center; min-height: 52px; padding: 0 13px; color: var(--white); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: 0.05em; text-transform: uppercase; }
.tk-menu a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
.tk-menu .current-menu-item > a, .tk-menu .current_page_item > a { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; text-decoration-thickness: 3px; }
.tk-navtoggle { display: none; background: transparent; color: var(--white); border: 0; min-height: 52px; padding: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; }

@media (max-width: 1020px) {
	.tk-navtoggle { display: inline-flex; align-items: center; gap: 10px; }
	.tk-navtoggle::before { content: ''; width: 22px; height: 14px; border-top: 3px solid currentColor; border-bottom: 3px solid currentColor; }
	.tk-navbar .tk-wrap { flex-wrap: wrap; }
	.tk-nav { display: none; padding-bottom: 12px; order: 3; flex: 1 1 100%; width: 100%; }
	.tk-nav.is-open { display: block; }
	.tk-menu { flex-direction: column; margin: 0; }
	.tk-menu a { padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.3); }
}

/* Poster: always fills the full width of the window, edge to edge, and grows with the window. Nothing shows behind it. */
.tk-poster { line-height: 0; }
.tk-poster img { display: block; width: 100%; height: auto; }
.tk-poster a { display: block; }

/* Key facts strip */
.tk-strip { background: var(--ink-2); color: var(--white); }
.tk-strip__in { display: flex; flex-wrap: wrap; gap: 0; }
.tk-strip__item { flex: 1 1 240px; padding: 22px 0; padding-right: 24px; }
.tk-strip__label { font-weight: 600; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.tk-strip__value { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; text-transform: uppercase; margin-top: 4px; }

/* Page header */
.tk-pagehead { background: var(--ink-2); color: var(--white); padding: clamp(36px, 5vw, 72px) 0; }
.tk-pagehead__title { font-size: clamp(40px, 6vw, 80px); line-height: 0.95; }
.tk-pagehead__sub { margin: 14px 0 0; color: var(--muted-dark); font-size: 19px; max-width: 680px; }

/* Sections */
.tk-section { padding: clamp(48px, 6vw, 88px) 0; }
.tk-section--white { background: var(--white); }
.tk-section--dark { background: var(--ink); color: var(--white); }
.tk-h2 { font-size: clamp(36px, 4.6vw, 64px); }
.tk-h2::after { content: ''; display: block; width: 72px; height: 6px; background: var(--red); margin-top: 14px; }
.tk-lead { margin: 18px 0 0; font-size: 19px; color: var(--muted); }
.tk-section--dark .tk-lead { color: var(--muted-dark); }
.tk-note { background: #FFF6D6; border: 1px solid #E5C64A; color: var(--ink); padding: 12px 16px; font-size: 15px; margin: 20px 0 0; }

.tk-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
@media (max-width: 1020px) { .tk-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .tk-grid4 { grid-template-columns: minmax(0, 1fr); } .tk-grid4--logos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Registration boxes */
.tk-reg { background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; }
.tk-reg__img { background: var(--ink-2); line-height: 0; }
.tk-reg__img img { display: block; width: 100%; aspect-ratio: 10 / 7; object-fit: cover; }
.tk-reg__body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.tk-reg__body p { margin: 0; color: var(--muted); }
.tk-reg__body .tk-btn { margin-top: auto; }
.tk-reg__title { font-size: 32px; }

/* Alliance championships */
.tk-ally { position: relative; display: block; background: var(--ink-2); color: var(--white); text-decoration: none; overflow: hidden; border: 2px solid transparent; }
.tk-ally img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.tk-ally__name { display: block; padding: 14px 16px; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.05; text-transform: uppercase; }
a.tk-ally:hover { border-color: var(--gold); color: var(--white); }
a.tk-ally .tk-ally__name::after { content: ' \2197'; color: var(--gold); }

/* Sponsor logos */
.tk-logo { display: flex; align-items: center; justify-content: center; min-height: 150px; padding: 24px; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tk-logo img { display: block; max-width: 100%; max-height: 100px; width: auto; height: auto; object-fit: contain; }
a.tk-logo:hover { border-color: var(--ink); }
.tk-logo__text { font-family: var(--display); font-weight: 700; font-size: 24px; text-transform: uppercase; text-align: center; }
.tk-logo--empty { border: 2px dashed #8A93A1; background: var(--paper); color: var(--muted); }

/* Two-column pages */
.tk-split { display: flex; flex-wrap: wrap; gap: 48px; }
.tk-split__col { flex: 1 1 380px; min-width: 0; }
@media (max-width: 860px) { .tk-split--form .tk-split__col:last-child { order: -1; } }

.tk-facts { margin: 0 0 28px; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.tk-facts dt { font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; color: var(--muted); padding-top: 3px; }
.tk-facts dd { margin: 0; }
.tk-map iframe { display: block; width: 100%; height: 420px; border: 1px solid var(--line); margin-bottom: 20px; }

/* Form */
.tk-form { background: var(--white); border: 1px solid var(--line); padding: clamp(22px, 4vw, 40px); }
.tk-form__row { display: flex; flex-wrap: wrap; gap: 0 18px; }
.tk-form__row .tk-field { flex: 1 1 200px; min-width: 0; }
.tk-field { margin: 0 0 18px; }
.tk-field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.tk-field input, .tk-field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #8A93A1; border-radius: 4px; background: var(--white); color: var(--ink); }
.tk-field textarea { resize: vertical; }
.tk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tk-alert { padding: 14px 16px; font-weight: 600; }
.tk-alert--ok { background: #E3F4EA; color: #14532D; }
.tk-alert--err { background: #FBE5E8; color: #7A0A1C; }

/* Editor content */
.tk-content > * { max-width: 860px; }
.tk-content > .alignwide, .tk-content > .wp-block-table { max-width: 100%; }
.tk-content--gap { margin-top: 48px; }
.tk-content h2 { font-size: clamp(30px, 3.6vw, 44px); margin: 44px 0 16px; }
.tk-content > h2:first-child { margin-top: 0; }
.tk-content h3 { font-size: 26px; margin: 28px 0 10px; }
.tk-content .wp-block-table { margin: 0 0 24px; overflow-x: auto; }
.tk-content table { width: 100%; border-collapse: collapse; }
.tk-content th { background: var(--ink); color: var(--white); text-align: left; font-weight: 600; }
.tk-content th, .tk-content td { padding: 14px 18px; border: 1px solid var(--line); vertical-align: top; }
.tk-content tbody tr:nth-child(even) { background: var(--paper); }
.tk-content .wp-block-file { padding: 14px 18px; border: 1px solid var(--line); }
.tk-feature { margin: 0 0 32px; }
.tk-feature img { display: block; width: 100%; }

.tk-post { padding: 22px 0; border-top: 1px solid var(--line); }
.tk-post__date { font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }
.tk-post__title { font-size: 32px; margin: 6px 0 8px; }
.tk-post__title a { color: var(--ink); text-decoration: none; }
.tk-post__title a:hover { text-decoration: underline; }
.tk-pager ul { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tk-pager a, .tk-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; min-height: 46px; padding: 0 12px; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 600; }
.tk-pager .current { background: var(--ink); color: var(--white); }

/* Footer */
.tk-belts { display: flex; height: 14px; }
.tk-belts span { flex: 1; }
.tk-belts span:nth-child(1) { background: #FFFFFF; }
.tk-belts span:nth-child(2) { background: #F2C230; }
.tk-belts span:nth-child(3) { background: #1F8A4C; }
.tk-belts span:nth-child(4) { background: #0B4DA2; }
.tk-belts span:nth-child(5) { background: #C8102E; }
.tk-belts span:nth-child(6) { background: #0E1116; }
.tk-footer { background: var(--ink); color: #A9B1BD; font-size: 16px; }
.tk-footer a { color: var(--muted-dark); }
.tk-footer__in { display: flex; flex-wrap: wrap; gap: 28px 72px; padding-top: 44px; padding-bottom: 32px; }
.tk-footer__col { min-width: 180px; }
.tk-footer__col p { margin: 0; }
.tk-footer__name { font-family: var(--display); font-weight: 700; font-size: 26px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--white); margin-bottom: 6px; }
.tk-footer__head { font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; color: var(--white); margin-bottom: 6px; }
.tk-footer__copy { border-top: 1px solid #2A313C; padding: 18px 0 26px; font-size: 15px; }
