/*
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.3.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; }

/* ---------- 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; } }



/* 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; }



/* 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; }

/* ---------- Phones: one-line "Menu" button, then the news / page content, then Next Events ---------- */
.bok-menu-button { display: none; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid #a9cc72; border-radius: 12px; background: var(--wp--preset--color--bok-lime-light); color: var(--wp--preset--color--bok-green-dark); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; }
@media (max-width: 781px) {
  .bok-main .bok-col-menu { order: 0; }
  .bok-main .bok-col-news, .bok-main .bok-col-content { order: 1; }
  .bok-main .bok-col-events { order: 2; }
  .bok-menu-button { display: flex; }
  .bok-js .bok-menu:not(.is-open) { display: none; }
  .bok-menu-button + .bok-menu.is-open { margin-block-start: 8px; }
}

/* ---------- Sticky brown bar ----------
   The header scrolls up until only the brown bar is left, which then stays at the top.
   (assets/js/slider.js sets the offset; without JavaScript the header simply scrolls.) */
.bok-sticky-header { position: sticky; z-index: 50; }
.bok-sticky-header.is-stuck .bok-quickbar { box-shadow: 0 3px 8px rgba(40, 30, 10, .35); }
/* Top-bar items with the CSS class "hide-on-phone" (Appearance → Menus) are hidden on phones */
@media (max-width: 781px) {
  .bok-quickbar-list li.hide-on-phone { display: none; }
  .bok-quickbar-inner { padding-top: 8px; padding-bottom: 8px; }
}

/* ---------- Dropdowns in the brown bar ----------
   Nest items under a Top bar button in Appearance → Menus to make a dropdown.
   The "Event Results" button (class auto-latest-results) fills its own. */
.bok-quickbar-list > li { position: relative; display: flex; }
.bok-quickbar-list > li.menu-item-has-children > a { border-radius: 8px 0 0 8px; padding-right: 10px; }
.bok-sub-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; border: 0; border-left: 1px solid rgba(255,255,255,.25); border-radius: 0 8px 8px 0; background: var(--wp--preset--color--bok-brown-light); color: #fff; cursor: pointer; padding: 0 8px; }
.bok-sub-toggle:hover, .bok-sub-toggle:focus-visible, li.is-open > .bok-sub-toggle { background: var(--wp--preset--color--bok-gold); color: var(--wp--preset--color--bok-ink); }
li.is-open > .bok-sub-toggle svg { transform: rotate(180deg); }
.bok-quickbar-list .sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 260px; max-width: min(360px, calc(100vw - 24px)); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid #d8c7a4; border-radius: 10px; box-shadow: 0 8px 20px rgba(40,30,10,.25); }
.bok-quickbar-list .sub-menu.is-right { left: auto; right: 0; }
.bok-quickbar-list li.is-open > .sub-menu { display: block; }
@media (hover: hover) and (min-width: 782px) {
  .bok-quickbar-list > li:hover > .sub-menu { display: block; }
}
.bok-quickbar-list .sub-menu li { display: block; }
.bok-quickbar-list .sub-menu a { display: block; padding: 9px 12px; border-radius: 6px; background: none; color: var(--wp--preset--color--bok-ink); font-weight: 600; font-size: 15px; white-space: normal; }
.bok-quickbar-list .sub-menu a:hover, .bok-quickbar-list .sub-menu a:focus, .bok-quickbar-list .sub-menu .current-menu-item > a { background: var(--wp--preset--color--bok-lime-light); color: var(--wp--preset--color--bok-green-dark); }
.bok-quickbar-list .sub-menu .bok-sub-all { border-top: 1px solid #eee3cc; margin-top: 4px; padding-top: 4px; }
.bok-quickbar-list .sub-menu .bok-sub-all a { color: var(--wp--preset--color--bok-link); }

/* ---------- Banner: thin title strip instead of dots ----------
   Each slide's title (its small label) in a row; the current one is highlighted and a
   thin line fills while the slide is shown. Hovering the banner pauses it. */
.bok-slider-controls { margin-top: 18px; }
.bok-slider-tabs { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bok-slider-tabs::-webkit-scrollbar { display: none; }
.bok-slider-tab { position: relative; flex: 1 1 0; min-width: max-content; padding: 8px 10px 4px; border: 0; border-top: 3px solid rgba(47, 90, 10, .22); background: none; color: var(--wp--preset--color--bok-green-dark); font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; cursor: pointer; text-align: left; }
.bok-slider-tab:hover, .bok-slider-tab:focus-visible { border-top-color: rgba(47, 90, 10, .5); }
.bok-slider-tab[aria-current="true"] { color: var(--wp--preset--color--bok-ink); border-top-color: rgba(47, 90, 10, .45); }
.bok-slider-tab::before { content: ""; position: absolute; left: 0; top: -3px; height: 3px; width: 0; background: var(--wp--preset--color--bok-green); }
.bok-slider-tab[aria-current="true"]::before { width: 100%; }
.bok-slider-tab.is-timing::before { width: 0; animation: bok-tab-fill 7s linear forwards; }
.bok-slider-controls.is-paused .bok-slider-tab.is-timing::before { animation-play-state: paused; }
@keyframes bok-tab-fill { from { width: 0; } to { width: 100%; } }
.bok-slider-arrow { flex: 0 0 auto; width: 36px; height: 36px; font-size: 20px; }
@media (max-width: 781px) {
  .bok-slider-controls { gap: 6px; }
  .bok-slider-tab { flex: 0 0 auto; font-size: 12px; }
}

/* ---------- Schedule table (backwoodsok-schedule plugin, [[bokSchedule]]) ----------
   Same look as the old site: blue header, black borders, gray every other row.
   The plugin's own stylesheet adds the orange "Open/Regular" rows and status colors. */
.wp-block-post-content #mi-sched-id { overflow-x: auto; margin: 0 0 1.2em; }
.wp-block-post-content #mi-table-id { width: 100%; min-width: 720px; border-collapse: collapse; border-spacing: 0; font-size: 14px; line-height: 1.35; }
.wp-block-post-content #mi-table-id th,
.wp-block-post-content #mi-table-id td { border: 1px solid #000; padding: 4px 6px; vertical-align: middle; text-align: left; }
.wp-block-post-content #mi-table-id thead { background-color: #7eafcf; color: #000; font-size: 21px; font-weight: bold; }
.wp-block-post-content #mi-table-id thead th { text-align: center; }
.wp-block-post-content #mi-table-id tbody tr:nth-child(even) { background-color: #ddd; }
.wp-block-post-content #mi-table-id .mi-row-cls-regular { font-weight: bold; background-color: #fdebd0; }
.wp-block-post-content #mi-table-id tbody tr.mi-row-cls-regular:nth-child(even) { background-color: #ddd; }
.wp-block-post-content #mi-table-id .mi-td-cls-regular { color: #0000ff; }

/* The hidden "Menu" button (phones only) must not push the side menu down on computers */
.bok-menu-button + .bok-menu { margin-block-start: 0; }
