:root {
  --black: #111111;
  --text: #101010;
  --muted: #555555;
  --gold: #e3c374;
  --red: #d2262d;
  --red-dark: #b01c22;
  --gray: #e4e4e4;
  --page: #f4f4f4;
  --white: #ffffff;
  --font: "Nunito Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-day: "Anton", Impact, "Arial Narrow", sans-serif;
  --wrap: 1024px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-weight: 300; font-size: 1.1rem; line-height: 1.6; color: var(--text); background: var(--white); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 300; line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(920px, 100% - 32px); }
.section { padding-block: 32px; }
hr.gold { border: 0; height: 2px; background: var(--gold); margin: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Header: black band, centered title, thin rule, centered menu */
.site-header { background: var(--black); color: #fff; text-align: center; position: relative; z-index: 20; }
.site-header .wrap { padding-block: 26px 0; }
.brand { text-decoration: none; display: block; }
.brand .title { display: block; font-size: clamp(1.7rem, 4.2vw, 2.7rem); font-weight: 300; letter-spacing: .01em; }
.brand .motto { display: block; font-size: 1.05rem; margin-top: 10px; }
.nav { margin-top: 22px; border-top: 1px solid rgba(255, 255, 255, .55); }
.nav ul { display: flex; justify-content: space-evenly; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 14px 8px; text-decoration: none; font-size: 1rem; }
.nav a:hover { color: var(--gold); }
.nav a[aria-current="page"] { color: var(--gold); }
.nav-toggle { display: none; margin: 18px auto 0; background: none; border: 1px solid rgba(255, 255, 255, .55); color: inherit; padding: 8px 20px; font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; margin-top: 14px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 12px 8px; }
  .site-header .wrap { padding-bottom: 20px; }
}

/* Intro over the belts photo: dark text on a soft white panel so it stays readable */
.hero { position: relative; isolation: isolate; padding-block: 56px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.panel { background: rgba(255, 255, 255, .88); padding: 28px 32px; font-size: 1.3rem; line-height: 1.55; max-width: 940px; margin-inline: auto; }
.panel p:last-child { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 192px; margin-top: 26px; }
.btn { display: inline-block; min-width: 220px; text-align: center; padding: 12px 26px; font: 400 1.05rem var(--font); letter-spacing: .04em; text-decoration: none; border: 2px solid transparent; }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-dark); }
.btn.outline { border-color: #333; color: #222; }
.btn.outline:hover { background: #333; color: #fff; }
@media (max-width: 600px) { .panel { padding: 20px; font-size: 1.1rem; } .hero { padding-block: 28px; } }

/* Page heading with logos and gold rule */
.pagehead { padding-top: 26px; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 6px; }
.headrow h1 { flex: 1; text-align: center; font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0; }
.logo { height: 80px; width: auto; flex: none; }
.headrow .logo:last-child { height: 80px; }
.lead { text-align: center; margin: 22px 0 0; color: var(--muted); }
@media (max-width: 520px) { .logo { height: 44px; } }

/* Day cards (as on the old site) */
.daygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 8px; align-items: start; }
.daycard { background: #fff; padding: 20px 20px 16px; min-width: 0; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.daycard h3 { font-family: var(--font-day); font-weight: 400; font-size: 1.6rem; letter-spacing: .04em; color: #333; padding-bottom: 6px; border-bottom: 2px solid var(--gold); margin-bottom: 14px; }
.daycard ul { margin: 0 0 16px; padding-left: 1.1em; font-size: .95rem; line-height: 1.5; }
.daycard li { margin-bottom: 8px; }
.daycard li b { font-weight: 600; }
.daycard li span { color: var(--muted); }
.daycard img { width: 100%; height: auto; aspect-ratio: 480 / 330; object-fit: cover; }
.daycard .belts { color: var(--muted); font-size: .95rem; margin: -6px 0 12px; }
.daycard ul.times { list-style: none; padding: 0; }
.daycard ul.times li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #ddd; padding: 6px 0; margin: 0; }
.daycard ul.times li span { color: var(--text); text-align: right; white-space: nowrap; }
.note { text-align: center; margin: 28px 0 0; font-size: 1rem; color: var(--muted); }
.classcard img { margin-bottom: 16px; aspect-ratio: 540 / 510; object-fit: cover; }
.classcard ul.times { margin-bottom: 0; }
@media (max-width: 900px) { .daygrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .daygrid { grid-template-columns: 1fr; gap: 20px; } }

/* Shihan bio */
.shihan h2 { font-size: 1.9rem; text-align: center; margin-bottom: 18px; }
.shihan ul { padding-left: 1.2em; font-size: 1rem; }
.shihan li { margin-bottom: 12px; }

/* Free class + contact */
.free { padding-block: 32px 40px; text-align: center; }
.free h2 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); margin: 30px 0 14px; }
.addr { font-size: 1.05rem; letter-spacing: .02em; margin-bottom: 22px; }
.addr a { text-decoration: none; }
.addr a:hover { text-decoration: underline; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; }
.cbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 16px; text-decoration: none; font-size: 1.25rem; letter-spacing: .08em; }
.cbtn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cbtn span { line-height: 1.2; overflow-wrap: anywhere; }
.cbtn.gray { background: var(--gray); color: #333; }
.cbtn.gray:hover { background: #d6d6d6; }
.cbtn.red { background: var(--red); color: #fff; }
.cbtn.red:hover { background: var(--red-dark); }
@media (max-width: 560px) { .contact-row { grid-template-columns: 1fr; } .cbtn { font-size: 1.05rem; } }

/* Instructors */
.people { display: grid; gap: 32px; }
.person { display: grid; grid-template-columns: 240px 1fr; gap: 24px; background: #fff; padding: 20px; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.person img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 15%; background: var(--gray); }
.person:first-child img { object-position: 50% 45%; }  /* Carl Hultin's source photo is a tight headshot */
.person h3 { font-family: var(--font-day); font-weight: 400; font-size: 1.6rem; letter-spacing: .03em; color: #333; padding-bottom: 6px; border-bottom: 2px solid var(--gold); }
.person ul { margin: 0; padding-left: 1.1em; font-size: 1rem; }
.person li { margin-bottom: 4px; }
@media (min-width: 561px) and (max-width: 760px) { .person { grid-template-columns: 200px 1fr; } }
@media (max-width: 560px) { .person { grid-template-columns: 1fr; } .person img { max-width: 280px; } }

/* Chips */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 8px; }
.chip { border: 1px solid #333; background: transparent; color: #222; padding: 6px 16px; font: 400 .95rem var(--font); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--gray); }
.chip[aria-pressed="true"] { background: #222; color: #fff; }

/* Carousel */
.carousel { position: relative; }
.carousel.wide { width: 90vw; margin-inline: auto; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #222; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 5 / 2; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.car-btn { position: absolute; top: calc(50% - 23px); width: 46px; height: 46px; border: 0; background: rgba(17, 17, 17, .7); color: #fff; font-size: 1.6rem; cursor: pointer; }
.car-btn:hover { background: var(--red); }
.car-btn.prev { left: 0; }
.car-btn.next { right: 0; }
.car-count { text-align: center; color: var(--muted); font-size: .9rem; margin: 4px 0 0; }

/* News */
.year-group { margin-top: 36px; }
.year-group h2 { font-family: var(--font-day); font-weight: 400; font-size: 1.8rem; letter-spacing: .04em; color: #333; padding-bottom: 6px; border-bottom: 2px solid var(--gold); }
.year-group.hide { display: none; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { display: grid; grid-template-columns: 70px 1fr 240px; gap: 20px; padding: 20px 0; border-bottom: 1px solid #ddd; align-items: start; }
.news-body { min-width: 0; }
.news-photo { padding: 0; border: 0; background: var(--gray); cursor: zoom-in; display: block; }
.news-photo img { width: 100%; height: auto; aspect-ratio: 480 / 354; object-fit: cover; }
.news-item.hide { display: none; }
.news-item time { font-weight: 600; font-size: .95rem; color: var(--muted); }
.news-item h3 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 600; }
.news-item p { margin: 8px 0 0; font-size: 1rem; }
.tag { display: inline-block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding: 2px 8px; background: #333; color: #fff; margin-right: 8px; vertical-align: 2px; }
.tag.promotion { background: var(--red); }
.tag.training { background: #2f5d50; }
.tag.event { background: #6a5a8e; }
.medals { display: inline-flex; gap: 12px; font-size: .9rem; font-weight: 600; }
.medals span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; }
.medals .g::before { background: #d4a72c; }
.medals .s::before { background: #a5a8ad; }
.medals .b::before { background: #b06a3b; }
@media (max-width: 760px) { .news-item { grid-template-columns: 60px 1fr; } .news-photo { grid-column: 2; max-width: 360px; } }
@media (max-width: 560px) { .news-item { grid-template-columns: 1fr; gap: 8px; } .news-photo { grid-column: auto; } }

/* Media */
.shihan h2, .section > .wrap > h2 { font-weight: 300; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 10, 12, .92); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; }
.lightbox .x { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 2.2rem; cursor: pointer; }

/* Calendar */
.cal-frame { background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); padding: 10px; }
.cal-frame img { width: 100%; height: auto; margin-inline: auto; }
.section > .wrap > h2 { text-align: center; }

/* Footer */
.site-footer { background: var(--black); color: rgba(255, 255, 255, .8); padding-block: 28px; font-size: .92rem; text-align: center; }
.site-footer p { margin: 0 0 12px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.social { display: flex; justify-content: center; gap: 56px; margin: 18px 0; }
.social a { display: block; width: 40px; height: 40px; }
.social a:hover { opacity: .8; }
.social img { width: 40px; height: 40px; }
.copy { font-size: .8rem; color: rgba(255, 255, 255, .5); }

/* Gallery */
.masonry { columns: 3 240px; column-gap: 12px; }
.masonry button { display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0; background: var(--gray); cursor: zoom-in; break-inside: avoid; }
.masonry img { width: 100%; height: auto; }

/* Kata videos */
.kata-card video, .kata-card iframe { display: block; width: 100%; aspect-ratio: 16 / 9; background: #111; border: 0; }
.yt-play { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #111; cursor: pointer; }
.yt-play img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .9; }
.yt-play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; transform: translate(-50%, -50%); border-radius: 12px; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.yt-play:hover::after { background-color: var(--red-dark); }

/* Belt tests */
.test-box { display: grid; gap: 8px; max-width: 420px; margin: 0 auto; background: #fff; padding: 24px; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.test-box label { font-weight: 600; font-size: .95rem; margin-top: 6px; }
.test-box select, .test-box input[type="password"], .test-box input[type="text"] { font: 400 1.05rem var(--font); padding: 10px 12px; border: 1px solid #999; background: #fff; color: var(--text); width: 100%; }
.test-box .check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 0; }
.test-box .btn { margin-top: 10px; min-width: 0; }
.test-box .btn:disabled { opacity: .6; cursor: wait; }
#test-msg { margin: 4px 0 0; min-height: 1.5em; font-size: .95rem; }
#test-msg.error { color: var(--red-dark); }
.test-result { margin-top: 32px; text-align: center; }
.test-result h3 { font-family: var(--font-day); font-weight: 400; font-size: 1.8rem; color: #333; }
.test-result .actions { margin: 0 0 18px; gap: 12px 24px; }
.test-frame { width: 100%; height: 80vh; border: 1px solid #ccc; background: #fff; }
