/*
Theme Name: BOK 2026
Description: Backwoods Orienteering Klub theme. A child theme of Twenty Twenty-Five that keeps the classic BOK look: green title, brown quick-link bar, rotating banner, collapsible side menu, latest news and next events.
Author: Backwoods Orienteering Klub
Template: twentytwentyfive
Version: 1.1.0
Requires at least: 6.7
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: bok2026
*/

/* ---------- Header ---------- */
.bok-header { padding-top: 18px; padding-bottom: 18px; }
.bok-header .bok-brand { gap: 16px; }
.bok-header .bok-logo img { width: 60px; height: auto; display: block; }
.bok-header .wp-block-site-title { font-family: var(--wp--preset--font-family--bok-serif); font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; line-height: 1.1; margin: 0; }
.bok-header .wp-block-site-title a { color: var(--wp--preset--color--bok-green); text-decoration: none; }
.bok-header .wp-block-site-tagline { font-size: 17px; margin: 4px 0 0; }

/* ---------- Quick-link bar (Appearance → Menus → "Top bar") ---------- */
.bok-site-header > * { margin-block: 0 !important; }
.bok-header { max-width: 1248px; margin: 0 auto !important; padding: 18px 24px; box-sizing: border-box; }
.bok-quickbar { background: var(--wp--preset--color--bok-brown); border-top: 3px solid var(--wp--preset--color--bok-gold); }
.bok-quickbar-inner { max-width: 1248px; margin: 0 auto; padding: 10px 24px; box-sizing: border-box; }
.bok-quickbar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bok-quickbar-list a { display: inline-block; padding: 8px 13px; border-radius: 8px; background: var(--wp--preset--color--bok-brown-light); color: #fff; font-weight: 600; font-size: 15px; line-height: 1.4; text-decoration: none; }
.bok-quickbar-list a:hover, .bok-quickbar-list a:focus,
.bok-quickbar-list .current-menu-item > a { background: var(--wp--preset--color--bok-gold); color: var(--wp--preset--color--bok-ink); }

/* ---------- Buttons ---------- */
.wp-block-button .wp-block-button__link { border-radius: 999px; font-weight: 700; padding: 12px 22px; }
.wp-block-button.is-style-bok-gold .wp-block-button__link { background: var(--wp--preset--color--bok-gold); color: var(--wp--preset--color--bok-ink); }
.wp-block-button.is-style-bok-brown .wp-block-button__link { background: var(--wp--preset--color--bok-brown-light); color: #fff; }
.wp-block-button.is-style-bok-green .wp-block-button__link { background: var(--wp--preset--color--bok-green); color: #fff; }
.wp-block-button.is-style-bok-outline .wp-block-button__link { background: #fff; color: var(--wp--preset--color--bok-brown); border: 1px solid var(--wp--preset--color--bok-brown-light); }

/* ---------- Banner / slider (Dashboard → Banner Slides) ---------- */
.bok-banner { background: var(--wp--preset--color--bok-lime); border-bottom: 1px solid var(--wp--preset--color--bok-line); padding-top: 28px; padding-bottom: 18px; }
.bok-banner-inner { max-width: 1248px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.bok-slide { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; min-height: 266px; }
.bok-slide .bok-photo { flex: 0 0 auto; margin: 0; max-width: 100%; }
.bok-slide-text { flex: 1 1 360px; min-width: 0; }
.bok-slide-text > * { margin-top: 0; }
.bok-slide-text h2 { font-family: var(--wp--preset--font-family--bok-serif); font-size: 30px; color: var(--wp--preset--color--bok-green-dark); margin: 8px 0 10px; }
.bok-banner .bok-photo img { width: 360px; max-width: 100%; height: 250px; object-fit: cover; border: 8px solid #fff; box-shadow: 0 6px 14px rgba(40,50,20,.25); box-sizing: content-box; display: block; }
.bok-eyebrow { font-size: 13px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--bok-brown); margin: 0; }
.bok-slide-title { font-family: var(--wp--preset--font-family--bok-serif); font-size: 30px; color: var(--wp--preset--color--bok-green-dark); margin: 8px 0 10px; }
.bok-banner p { font-size: 18px; line-height: 1.55; }
.bok-slider-ready .bok-slide:not(.is-active) { display: none; }
.bok-slider-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.bok-slider-controls button { cursor: pointer; }
.bok-slider-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #8fb85a; background: #fff; color: var(--wp--preset--color--bok-green); font-size: 22px; line-height: 1; }
.bok-slider-dot { width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid var(--wp--preset--color--bok-green); background: #fff; }
.bok-slider-dot[aria-current="true"] { background: var(--wp--preset--color--bok-green); }

/* ---------- Main 3-column area ---------- */
.bok-main { padding-top: 32px; padding-bottom: 48px; }
.bok-main > .wp-block-columns { gap: 32px; }
.bok-panel { background: var(--wp--preset--color--bok-lime-light); border: 1px solid #a9cc72; border-radius: 12px; padding: 14px 18px; }
.bok-panel-warm { background: #fff6e2; border: 1px solid #e9c07a; border-radius: 12px; padding: 16px 18px; }
.bok-panel h2, .bok-panel-warm h2 { font-family: var(--wp--preset--font-family--bok-serif); font-size: 22px; margin: 0 0 8px; }

/* Collapsible side menu */
.bok-menu .wp-block-details { border-bottom: 1px solid #cfe3a8; padding: 8px 0; margin: 0; }
.bok-menu .wp-block-details:last-child { border-bottom: 0; }
.bok-menu summary { font-weight: 700; font-size: 16px; color: var(--wp--preset--color--bok-green-dark); cursor: pointer; }
.bok-menu ul { margin: 8px 0 4px; padding-left: 22px; font-size: 15px; line-height: 1.5; }
.bok-menu li { margin-bottom: 6px; }

/* Latest news */
.bok-news .wp-block-post { padding: 20px 0; border-bottom: 1px solid #e3ead6; margin: 0; }
.bok-date { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--bok-orange); }
.bok-news-title { font-family: var(--wp--preset--font-family--bok-serif); font-size: 26px; line-height: 1.25; margin: 6px 0 8px; }
.bok-news .wp-block-post-content { font-size: 17px; line-height: 1.6; }

/* Next events */
.bok-next .wp-block-post { padding: 10px 0; border-bottom: 1px solid #cfe3a8; margin: 0; }
.bok-next .wp-block-post:last-child { border-bottom: 0; }
.bok-next .wp-block-post-title { font-size: 16px; font-weight: 700; margin: 0; font-family: inherit; }
.bok-next .wp-block-post-excerpt { font-size: 14px; line-height: 1.5; margin: 4px 0 0; }

/* Footer */
.bok-footer { background: var(--wp--preset--color--bok-lime); border-top: 1px solid var(--wp--preset--color--bok-line); padding: 22px 24px; text-align: center; font-size: 15px; }
.bok-footer p { margin: 0; }

/* Phones */
@media (max-width: 781px) {
  .bok-banner .bok-photo img { width: calc(100% - 16px); height: 200px; }
  .bok-header .bok-register { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }

/* On phones, show the news first, then next events, then the side menu */
@media (max-width: 781px) {
  .bok-main .bok-col-news { order: 1; }
  .bok-main .bok-col-events { order: 2; }
  .bok-main .bok-col-menu { order: 3; }
}

/* Remove the default gaps between the header, banner, content and footer */
.wp-site-blocks > * + * { margin-block-start: 0; }
.bok-quickbar { margin-block-start: 0 !important; }
.bok-header .bok-logo { flex-shrink: 0; margin: 0; }

.bok-news .wp-block-post-excerpt { font-size: 17px; line-height: 1.6; margin: 0; }
.bok-news .wp-block-post-excerpt__more-link { font-weight: 600; }

/* Post, page and archive pages: menu on the left, content on the right */
.bok-col-content > :first-child { margin-top: 0; }
.bok-page-title { font-family: var(--wp--preset--font-family--bok-serif); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.2; margin: 4px 0 20px; }
.bok-col-content .wp-block-post-content > * { max-width: 100%; }
.bok-post-terms { font-size: 15px; margin-top: 28px; border-top: 1px solid #e3ead6; padding-top: 14px; }
.bok-post-nav { font-size: 15px; margin-top: 10px; }
@media (max-width: 781px) {
  .bok-main .bok-col-content { order: 1; }
}


/* Embedded calendars, maps and videos never wider than the page */
.wp-block-post-content iframe { max-width: 100%; }

/* ARDF page: the intro sits in a full-width light-green band above the menu and news */
.bok-ardf-banner { padding-top: 24px; padding-bottom: 28px; }
.bok-ardf-intro { font-size: 18px; line-height: 1.5; }
.bok-ardf-intro > * { margin-top: 0; margin-bottom: 10px; }
.bok-ardf-intro h1, .bok-ardf-intro h2 { font-size: clamp(26px, 3vw, 32px); line-height: 1.2; }
.bok-ardf-intro h3 { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.25; font-weight: 400; }
.bok-ardf-intro h4, .bok-ardf-intro h5, .bok-ardf-intro h6 { font-size: 18px; line-height: 1.5; font-weight: 400; }

/* ---------- Tables in posts and pages (results from SI-Droid / timing software) ----------
   Ported from the old BOK theme so results look the same. Wide tables (split times)
   scroll sideways inside the content area instead of squeezing.
   The schedule table (#mi-table-id) keeps its own plugin styles. */
.wp-block-post-content table:not(#mi-table-id) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.35;
  margin: 0 0 1.2em;
}
.wp-block-post-content table:not(#mi-table-id) td,
.wp-block-post-content table:not(#mi-table-id) th {
  border: 1px solid #000;
  padding: 2px 5px;
  white-space: nowrap;
  vertical-align: top;
}
.wp-block-post-content table:not(#mi-table-id) thead {
  background-color: #7eafcf;
  color: #000;
  font-size: 19px;
  font-weight: bold;
  text-align: center;
  vertical-align: top;
}
.wp-block-post-content table:not(#mi-table-id) thead td:first-child { text-align: left; }
.wp-block-post-content table:not(#mi-table-id) tr:nth-child(even) { background-color: #ddd; }
.wp-block-post-content .time, .wp-block-post-content .penalty,
.wp-block-post-content .c_tt, .wp-block-post-content .c_ta,
.wp-block-post-content .c_ct, .wp-block-post-content .c_ca { text-align: right; }
.wp-block-post-content .head1, .wp-block-post-content .pos, .wp-block-post-content .name,
.wp-block-post-content .club, .wp-block-post-content .time, .wp-block-post-content .pos1 { font-weight: bold; }
.wp-block-post-content .codes2, .wp-block-post-content .rr2a, .wp-block-post-content .rr3a { background-color: #ffffe0; }
.wp-block-post-content .head1, .wp-block-post-content .head2 { background-color: #7eafcf; }
.wp-block-post-content .c_ts, .wp-block-post-content .c_cs { padding-left: 10px; }
.wp-block-post-content .rr1a { background-color: #ddd; }
.wp-block-post-content .rrEa { background-color: #f8e0f1; font-style: italic; }
.wp-block-post-content .rIdeal { font-style: italic; }
/* Older results posted as preformatted text */
.wp-block-post-content .cls-section { background: lightgray; text-align: center; clear: both; }
.wp-block-post-content .cls-item { clear: left; }
.wp-block-post-content div.cls-item > pre { border: 1px solid gray; margin: 1px; overflow-x: auto; }
.wp-block-post-content pre { font-size: 13px; overflow-x: auto; }

/* Side menu: a top-level item with no links under it */
.bok-menu-single { margin: 0; padding: 8px 0; border-bottom: 1px solid #cfe3a8; font-weight: 700; font-size: 16px; }
.bok-menu summary { padding: 0; }
.bok-menu a[aria-current="page"] { font-weight: 700; text-decoration: none; }
