/*
Theme Name:   Judo @ Miersch
Theme URI:    https://www.judoatmiersch.lu
Author:       Judo @ Miersch ASBL
Description:  Reproduces the look of the former Clubee site of Judo @ Miersch ASBL: blue header bar, red menu bar, alternating red and blue full-width sections, Space Grotesk headings and Source Sans Pro text. Works with the "Judo @ Miersch – Club" plugin and Polylang. Self-hosted fonts, no tracking.
Version:      2.0.0
Requires at least: 6.5
Requires PHP: 8.0
License:      GPL-2.0-or-later
Text Domain:  judoatmiersch-theme
*/

:root {
	--cb-blue: #1e4591;
	--cb-red: #c0392b;
	--cb-red-light: #d14233;
	--cb-white: #fff;
	--cb-wrap: 1168px;
	--cb-pad: 48px;
	--cb-head: "Space Grotesk", "Arial", sans-serif;
	--cb-body: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
	/* used by the club plugin */
	--jam-primary: var(--cb-blue);
	--jam-accent: var(--cb-red);
	--jam-ink: #fff;
	--jam-font-display: var(--cb-head);
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cb-red); color: #fff; font-family: var(--cb-body); font-size: 16px; line-height: 1.3; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: #fff; }
p { margin: 0 0 16px; }
h1, h2, h3, h4, h5 { font-family: var(--cb-head); font-weight: 700; color: #fff; margin: 0 0 16px; }
h1, h2 { font-size: 36px; line-height: 1.3; }
h3 { font-size: 24px; line-height: 1.58; }
h4 { font-size: 20px; line-height: 1.4; }
strong, b { font-weight: 700; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: #fff; color: var(--cb-blue); padding: 8px 12px; border-radius: 4px; }
.skip-link:focus { top: 8px; }

.wrap { width: min(100% - 40px, var(--cb-wrap)); margin-inline: auto; }
.cb-section { padding-block: var(--cb-pad); }
.cb-blue { background: var(--cb-blue); }
.cb-red { background: var(--cb-red); }
.cb-white { background: #fff; color: #000; }
.cb-title { font-size: 24px; line-height: 1.58; margin: 0 0 16px; }

/* Header ------------------------------------------------------------------ */
.cb-top { background: var(--cb-blue); }
.cb-top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 74px; }
.cb-logo { display: block; }
.cb-logo img { width: 54px; height: 26px; object-fit: cover; }
.cb-logo .cb-logo__text { font-family: var(--cb-head); font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; }
.cb-top__right { display: flex; align-items: center; gap: 12px; }

/* "Se connecter"-style outlined button, used for the language switcher */
.cb-outline, .lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 4px 16px; border: 1px solid #fff; border-radius: 8px; color: #fff; text-decoration: none; font-family: var(--cb-head); font-weight: 700; font-size: 14px; line-height: 1; background: transparent; }
.lang-switch { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.lang-switch a { padding: 4px 10px; }
.lang-switch .is-current { background: #fff; color: var(--cb-blue); }

.cb-nav { background: var(--cb-red); position: relative; z-index: 40; }
.cb-nav .wrap { display: flex; align-items: center; }
.cb-nav .menu { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 0 -4px; padding: 0; }
.cb-nav .menu > li { position: relative; }
.cb-nav .menu > li > a { position: relative; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px; color: #fff; text-decoration: none; font-size: 14px; line-height: 22px; white-space: nowrap; }
.cb-nav .menu > li.current-menu-item > a, .cb-nav .menu > li.current-menu-ancestor > a, .cb-nav .menu > li.current_page_parent > a { font-weight: 700; }
.cb-nav .menu > li.current-menu-item > a::after, .cb-nav .menu > li.current-menu-ancestor > a::after, .cb-nav .menu > li.current_page_parent > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--cb-blue); }
.cb-nav .menu-item-has-children > a::before { content: ""; order: 2; width: 5px; height: 5px; margin: -3px 0 0 4px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); opacity: .9; }
.cb-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 0; padding: 8px 0; background: var(--cb-red-light); border-radius: 0 0 8px 8px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.cb-nav li:hover > .sub-menu, .cb-nav li:focus-within > .sub-menu { display: block; }
.cb-nav .sub-menu a { display: block; padding: 8px 16px; color: #fff; text-decoration: none; font-size: 14px; }
.cb-nav .sub-menu a:hover, .cb-nav .sub-menu .current-menu-item > a { font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px 0; font: 700 14px var(--cb-body); cursor: pointer; align-items: center; gap: 8px; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: #fff; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; } .nav-toggle__bars::after { top: 6px; }

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }
	.cb-nav .wrap { flex-direction: column; align-items: stretch; }
	.cb-nav .menu { display: none; flex-direction: column; margin: 0; padding-bottom: 8px; }
	.nav-open .cb-nav .menu { display: flex; }
	.cb-nav .menu > li > a { height: 40px; }
	.cb-nav .sub-menu { display: block; position: static; box-shadow: none; background: transparent; padding: 0 0 0 16px; }
}

/* News block (home + news page) ------------------------------------------- */
.cb-news { display: grid; grid-template-columns: 580px 1fr; gap: 16px 20px; align-items: start; }
.cb-feat { position: relative; display: block; text-decoration: none; border-radius: 8px; }
.cb-feat__media { height: 333px; display: flex; align-items: center; justify-content: center; }
.cb-feat__media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.cb-feat .cb-badge { position: absolute; top: 8px; right: 8px; }
.cb-feat__title { margin: 0; padding: 16px; font-size: 24px; line-height: 1.58; }
.cb-list { display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.cb-item { display: flex; gap: 8px; text-decoration: none; min-height: 80px; }
.cb-item__thumb { flex: 0 0 102px; height: 80px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.08); }
.cb-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cb-item__body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 6px; }
.cb-item__title { font-family: var(--cb-head); font-weight: 700; font-size: 16px; line-height: 25px; }
.cb-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 2px; background: var(--cb-blue); color: #fff; font-family: var(--cb-body); font-weight: 700; font-size: 14px; line-height: 18px; }
.cb-badge svg { width: 14px; height: 14px; }
.cb-red .cb-badge, .cb-blue .cb-feat .cb-badge { background: var(--cb-blue); }
.cb-blue .cb-badge { background: var(--cb-red); }
.cb-more { display: flex; justify-content: center; margin-top: 16px; }
.cb-btn-more, .wp-block-button.is-style-outline > .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 4px 16px; border: 1px solid #fff; border-radius: 8px; background: rgba(192,57,43,.5); color: #fff; font-family: var(--cb-head); font-weight: 700; font-size: 16px; text-decoration: none; }
.cb-blue .cb-btn-more { background: rgba(30,69,145,.5); }
@media (max-width: 900px) {
	.cb-news { grid-template-columns: 1fr; }
	.cb-feat__media { height: auto; max-height: 333px; }
}

/* Post cards grid (galerie, videos, all posts) ---------------------------- */
.cb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 8px; }
.cb-card { display: block; text-decoration: none; color: #fff; }
.cb-card__media { position: relative; height: 150px; border-radius: 8px 8px 0 0; overflow: hidden; background: rgba(255,255,255,.06); }
.cb-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cb-card__body { padding: 8px 12px 0; }
.cb-card__title { font-family: var(--cb-head); font-weight: 700; font-size: 16px; line-height: 25px; margin: 8px 0 12px; }
.cb-card__date { font-size: 14px; line-height: 22px; }
@media (max-width: 760px) { .cb-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .cb-grid { grid-template-columns: 1fr; } }
.cb-empty { font-family: var(--cb-head); font-weight: 700; font-size: 18px; margin: 0; }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #fff; border-radius: 8px; color: #fff; text-decoration: none; font-weight: 700; }
.pagination .current { background: #fff; color: var(--cb-red); }

/* Single post ------------------------------------------------------------ */
.cb-post__title { font-size: 36px; line-height: 1.3; margin: 16px 0 16px; }
.cb-post__date, .cb-post__author { font-size: 14px; margin: 0 0 12px; }
.cb-post__author { margin-bottom: 24px; }
.cb-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 24px; }
.cb-gallery a { display: block; aspect-ratio: 300 / 196; overflow: hidden; background: rgba(0,0,0,.1); }
.cb-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cb-gallery a:hover img { transform: scale(1.03); }
.cb-gallery--single { grid-template-columns: minmax(0, 600px); }
.cb-gallery--single a { aspect-ratio: auto; }
.cb-gallery--single img { height: auto; }
@media (max-width: 600px) { .cb-gallery { grid-template-columns: 1fr 1fr; } }
.cb-video { position: relative; aspect-ratio: 16 / 9; max-width: 900px; margin: 0 0 24px; }
.cb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cb-prose { font-size: 16px; line-height: 1.3; }
.cb-prose a { color: #fff; }
.cb-prose img { height: auto; }

/* Lightbox */
.cb-lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.9); }
.cb-lightbox.is-open { display: flex; }
.cb-lightbox img { max-width: 92vw; max-height: 88vh; width: auto; }
.cb-lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; padding: 16px; }
.cb-lightbox .cb-lb-close { top: 8px; right: 12px; }
.cb-lightbox .cb-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.cb-lightbox .cb-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* Pages built from blocks -------------------------------------------------- */
.cb-content > *:not(.alignfull):not(.cb-full) { width: min(100% - 40px, var(--cb-wrap)); margin-inline: auto; }
.cb-content > :first-child:not(.alignfull) { margin-top: var(--cb-pad); }
.cb-content > :last-child:not(.alignfull) { margin-bottom: var(--cb-pad); }
.cb-content > .alignfull { margin: 0; width: 100%; max-width: none; }
.cb-content .wp-block-group.alignfull { padding: var(--cb-pad) max(20px, calc((100% - var(--cb-wrap)) / 2)); }
.cb-content .wp-block-group.alignfull.cb-flush { padding: 0; }
.cb-content .wp-block-group.alignfull > .wp-block-group__inner-container > :last-child,
.cb-content .wp-block-group.alignfull > :last-child { margin-bottom: 0; }
.has-cb-blue-background-color { background-color: var(--cb-blue) !important; }
.has-cb-red-background-color { background-color: var(--cb-red) !important; }
.has-cb-red-light-background-color { background-color: var(--cb-red-light) !important; }
.has-white-background-color { background-color: #fff !important; }
.has-cb-blue-color { color: var(--cb-blue) !important; }
.has-cb-red-color { color: var(--cb-red) !important; }
.has-white-color { color: #fff !important; }
.wp-block-columns { display: flex; gap: 24px 32px; margin: 0; flex-wrap: nowrap; }
.wp-block-columns.are-vertically-aligned-center, .wp-block-columns.is-v-center { align-items: center; }
.wp-block-column { flex: 1 1 0; min-width: 0; }
.wp-block-column.is-vertically-aligned-center { align-self: center; }
@media (max-width: 760px) { .wp-block-columns { flex-direction: column; } .wp-block-column { flex-basis: auto !important; } }
.wp-block-image { margin: 0 0 16px; }
.wp-block-image img { height: auto; width: 100%; }
.cb-content .alignfull.wp-block-image { margin: 0; }
.cb-content .alignfull.wp-block-image img { width: 100%; }
.has-text-align-center { text-align: center; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.wp-block-buttons.is-content-justification-center { justify-content: center; }
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: 8px; background: var(--cb-blue); color: #fff; font-family: var(--cb-head); font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid transparent; }
.cb-blue .wp-block-button__link, .has-cb-blue-background-color .wp-block-button__link { background: var(--cb-red); }
.wp-block-button__link.has-cb-red-light-background-color { border-color: rgba(255,255,255,.25); }
.wp-block-separator { border: 0; border-top: 1px solid rgba(255,255,255,.4); margin: 24px 0; }
.wp-block-embed { margin: 0 0 24px; }
.wp-block-embed__wrapper { position: relative; aspect-ratio: 16/9; }
.wp-block-embed__wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-block-gallery { display: grid !important; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin: 0 0 24px; }
.wp-block-gallery figure { margin: 0; }
.wp-block-gallery img { width: 100%; aspect-ratio: 300/196; object-fit: cover; }

/* Cover link banners (Kontakt: Instagram / Facebook) */
.wp-block-cover { position: relative; display: flex; align-items: center; justify-content: center; min-height: 198px; padding: 24px; overflow: hidden; }
.wp-block-cover__image-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.wp-block-cover__background { position: absolute; inset: 0; z-index: 1; }
.wp-block-cover__inner-container { position: relative; z-index: 2; width: 100%; text-align: center; }
.wp-block-cover h2 { margin: 0 0 8px; }

/* Icon circle used above link titles ("Liens", "Instagram", …) */
.cb-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: var(--cb-red-light); margin-bottom: 4px; }
.has-cb-blue-background-color .cb-icon { background: var(--cb-blue); }
.cb-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; }
.cb-icon-row { margin: 0 0 4px; }

/* Documents (core File block styled like the Clubee list) */
.wp-block-file { display: flex; align-items: center; gap: 16px; padding: 12px 0; margin: 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.wp-block-file::before { content: ""; flex: 0 0 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E") center / 18px no-repeat; }
.wp-block-file > a:first-child { flex: 1 1 50%; font-family: var(--cb-head); font-weight: 700; font-size: 14px; text-decoration: none; }
.wp-block-file .cb-file-date { flex: 1 1 40%; font-size: 14px; }
.wp-block-file .wp-block-file__button { flex: 0 0 auto; width: 32px; height: 32px; padding: 0; font-size: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 19h14'/%3E%3C/svg%3E") center / 20px no-repeat; border: 0; }
.wp-block-file__embed { display: none; }

/* Section variants used by the Clubee pages */
.cb-content .has-white-background-color { color: #131313; }
.cb-content .has-white-background-color h1, .cb-content .has-white-background-color h2, .cb-content .has-white-background-color h3 { color: #131313; }
.cb-content .has-white-background-color a:not(.wp-block-button__link) { color: var(--cb-blue); }
.cb-content .has-white-background-color .cb-icon { background: #ececec; }
.cb-content .has-white-background-color .cb-icon svg { stroke: #333; }
.cb-content .has-white-background-color .wp-block-button__link { background: var(--cb-blue); }
.cb-content .cb-narrow > *, .cb-content .cb-narrow > .wp-block-group__inner-container > * { max-width: 929px; }
.cb-content .cb-stack .wp-block-columns + .wp-block-columns { margin-top: 48px; }
.cb-content .cb-stack .wp-block-column:first-child .wp-block-image img { margin-inline: auto; }
.cb-content .wp-block-group.alignfull.cb-flush { padding: 0; }
.cb-content .cb-spacer { padding: 25px 0 !important; }
.cb-content .cb-sponsor-strip { padding-top: 24px; padding-bottom: 24px; }
.wp-block-cover__background.has-background-dim { opacity: .5; }
.wp-block-cover__background.has-background-dim-0 { opacity: 0; }
.wp-block-cover__background.has-background-dim-70 { opacity: .7; }
.wp-block-cover__background.has-white-background-color { background: #fff; }
.cb-content .wp-block-cover.alignfull { padding: 32px max(20px, calc((100% - var(--cb-wrap)) / 2)); }
.cb-content .wp-block-cover .wp-block-cover__inner-container { text-align: left; }
.cb-content .wp-block-cover .jam-link--center { align-items: center; }
.cb-content .wp-block-cover .jam-link--center .jam-link__title { color: #fff; }
.cb-content .wp-block-cover.alignfull h3 { color: #fff; }

/* Footer -------------------------------------------------------------- */
.cb-footer { background: var(--cb-red); padding: 32px 0 24px; font-size: 14px; }
.cb-footer__logo { display: flex; justify-content: center; margin-bottom: 24px; }
.cb-footer__logo img { width: 132px; height: 64px; object-fit: cover; }
.cb-footer hr { width: min(100% - 40px, 1144px); margin: 0 auto 16px; border: 0; border-top: 1px solid #131313; }
.cb-footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 24px; list-style: none; margin: 0 0 32px; padding: 0; }
.cb-footer__links a { color: #fff; text-decoration: none; line-height: 25px; }
.cb-footer__links a:hover { text-decoration: underline; }
.cb-footer__bottom { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }

/* 404 */
.cb-404 { text-align: center; }

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