/* =============================================================
   Mt. Brighton Ski Patrol – PmWiki Bootstrap Skin  (mbsp.css)
   Layout mirrors the Adapt skin structure; styled for MBSP.
   Requires: Bootstrap 5.3, Font Awesome 6, Barlow (Google Fonts)
   ============================================================= */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --sp-red:       #C8102E;
  --sp-red-dark:  #9B0B22;
  --sp-red-light: #E8192F;
  --sp-white:     #FFFFFF;
  --sp-offwhite:  #F5F5F5;
  --sp-gray:      #6C757D;
  --sp-mid:       #DEE2E6;
  --sp-dark:      #1A1A1A;
  --menu-width:   190px;       /* sidebar width — matches Adapt's 175px + a touch more */
}

/* ── BASE ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #333;
  background: var(--sp-offwhite);
  margin: 0; padding: 0;
}

a:link    { color: var(--sp-red); text-decoration: none; }
a:visited { color: var(--sp-red-dark); text-decoration: none; }
a:hover   { color: var(--sp-red-light); text-decoration: underline; }
a:active  { color: var(--sp-red-dark); }

/* Monospaced */
pre, code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.87rem;
}

/* Headings */
h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
     font-size: 1.95rem; text-transform: uppercase; letter-spacing: 0.03em;
     line-height: 1.1em; }
h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
     font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.03em;
     margin: 1.1em 0 0.6em; line-height: 1.1em;
     padding-bottom: 0.2em; border-bottom: 2px solid var(--sp-mid); }
h3 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
     font-size: 1.2rem; text-transform: uppercase;
     margin: 1.1em 0 0.6em; line-height: 1.1em; }
h4, h5, h6 { font-family: 'Barlow', sans-serif; font-weight: 600;
              margin: 1em 0 0.5em; line-height: 1.1em; }

/* Lists */
ol { list-style-type: decimal; }
ol ol { list-style-type: upper-alpha; }
ol ol ol { list-style-type: lower-roman; }
ul ul ul { list-style-type: disc; }

/* Responsive images */
.content img { max-width: 100%; height: auto; border-radius: 4px; }

/* Misc PmWiki wikistyles */
mark          { background-color: #fff9c6; }
.box          { font-size: 95%; padding: 0.1em; border: 1px solid #ccc; }
.codebox      { font-family: 'Courier New',Courier,monospace; font-size: 95%;
                padding: 0.2em; border: 1px solid #ccc; }
.highlight    { background-color: #fff9c6; }
.underline    { border-bottom: 1px dotted #999; }
.nomobile     { display: none; }
.lfloat, .rfloat { max-width: 50%; margin-bottom: 2px; }

/* ── LAYOUT: mirrors Adapt's #layout / #menu / #main ───────── */
/* Transition for push-menu open/close */
#layout, #menu, .menu-link {
  -webkit-transition: all 0.2s ease-out;
          transition: all 0.2s ease-out;
}

/* Collapsed (mobile default): sidebar hidden off-screen left */
#layout { position: relative; padding-left: 0; }
#layout.active               { position: relative; left: var(--menu-width); }
#layout.active #menu         { left: var(--menu-width); width: var(--menu-width); }
#layout.active .menu-link    { left: var(--menu-width); }

/* ── SIDEBAR (#menu) ────────────────────────────────────────── */
#menu {
  margin-left: calc(-1 * var(--menu-width));
  width: var(--menu-width);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #1a1a1a;
  border-right: 1px solid #333;
}

/* All links inside the sidebar */
#menu a {
  color: #e0e0e0;
  border: none;
  padding: 0.45em 0 0.45em 0.75em;
  font-size: 0.875rem;
  display: block;
  text-decoration: none;
}
#menu a:hover, #menu a:focus {
  color: #fff;
  background: #2a2a2a;
  text-decoration: none;
}

/* PmWiki renders sidebar lists; style them to look like Adapt's pure-menu */
.sidebar-wiki ul { list-style: none; margin: 0; padding: 0 0 0.3em 0; }
.sidebar-wiki li {
  background: #202020;
  border-bottom: 1px dotted #555;
}
.sidebar-wiki li a {
  color: #e0e0e0;
  padding: 0.45em 0.5em 0.45em 0.75em;
  display: block;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.sidebar-wiki li a:hover, .sidebar-wiki li a:focus {
  background: #2a2a2a;
  border-left-color: var(--sp-red-light);
  color: #fff;
}
/* PmWiki renders the current page link as <strong> in sidebars */
.sidebar-wiki li strong,
.sidebar-wiki li strong a {
  display: block;
  padding: 0.45em 0.5em 0.45em 0.75em;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  border-left: 3px solid var(--sp-red);
  background: #2d0a10;
}

/* Section headings in the sidebar wiki page (!! Heading markup) */
.sidebar-wiki h2, .sidebar-wiki h3, 
#menu .sidehead {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #aaa;
  background: #181818;
  border: none;
  border-bottom: 1px solid #404040;
  padding: 0.5em 0.5em 0.4em 0.75em;
  margin: 0;
}
.sidebar-wiki h1, 
#menu .sidehead {
  text-transform: uppercase;
  color: #aaa;
  background: #181818;
  border: none;
  border-bottom: 1px solid #404040;
  padding: 0.5em 0.5em 0.4em 0.75em;
  margin: 0;
}
.sidebar-wiki h2 a, .sidebar-wiki h3 a,
#menu .sidehead a { color: #aaa; padding: 0; font-size: 100%; }
.sidebar-wiki h2 a:hover, .sidebar-wiki h3 a:hover { color: #ccc; }

/* Sidebar search (mobile — hidden on desktop) */
#menu .sidesearch {
  background: #202020;
  padding: 0.5em 0.4em;
  border-bottom: 1px dotted #555;
}
#menu .sidesearch input.inputbox {
  width: 94%; margin-left: 3%;
  background: #181818; color: #aaa;
  border: 1px dotted #555; border-radius: 3px;
  font-size: 0.82rem; padding: 4px 6px;
  font-family: 'Barlow', sans-serif;
}
#menu .sidesearch input.inputbox::placeholder { color: #666; }
#menu .createlink { display: none; }

/* ── HAMBURGER BUTTON (.menu-link) ─────────────────────────── */
.menu-link {
  position: fixed;
  display: block;     /* visible on small screens */
  top: 0; left: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1001;
  width: 2.2em;
  height: auto;
  padding: 2.0em 1.5em;
  border-radius: 0 0 4px 0;
  text-decoration: none;
}
.menu-link:hover, .menu-link:focus { background: #222; text-decoration: none; }
/* Three-bar hamburger icon */
.menu-link span { position: relative; display: block;
  background: #fff; width: 100%; height: 0.2em; }
.menu-link span::before, .menu-link span::after {
  content: " "; position: absolute;
  background: #fff; width: 100%; height: 0.2em;
}
.menu-link span::before { margin-top: -0.6em; }
.menu-link span::after  { margin-top:  0.6em; }

/* ── HEADER (#site-header) ──────────────────────────────────── */
#site-header {
  position: relative;
  background-image: url('https://www.mtbrightonskipatrol.com/images/Banner1.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
/* Dark overlay for readability */
#site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.40) 55%,
    rgba(0,0,0,0.18) 100%
  );
  pointer-events: none;
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px 12px 56px; /* 56px left = room for hamburger button */
  min-height: 90px;
}

/* Logo (graphic) */
#wikilogo {
  /* no extra wrapper needed — inline in .header-inner */
}
#wikilogo img {
  height: 68px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
  display: block;
}
#wikilogo a, #wikilogo a:visited { border: none; text-decoration: none; }

/* Logo (text fallback) */
#wikilogotxt { flex: 1; }
#wikilogotxt a, #wikilogotxt a:visited {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  text-decoration: none;
}

/* Site title text block (when logo image is shown) */
.site-title-block { flex: 1; min-width: 0; }
.site-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.05em;
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.65);
}
.site-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin: 4px 0 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Tagline (set via $AdaptWikiTagline / $MbspWikiTagline) */
#tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
  margin: 4px 0 0;
  letter-spacing: 0.06em;
}

/* Desktop search bar in header */
#wikihead {
  flex-shrink: 0;
}
#wikihead form { display: none; margin: 0; } /* hidden on mobile; shown on desktop */
#wikihead form a { color: rgba(255,255,255,0.8); font-size: 0.82rem; }
#wikihead form a:hover { color: #fff; text-decoration: underline; }
#wikihead .headnav { font-size: 0.82rem; color: rgba(255,255,255,0.75); margin-right: 4px; }

#wikihead input.inputbox {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px 0 0 4px;
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  padding: 5px 10px;
  width: 140px;
  outline: none;
}
#wikihead input.inputbox::placeholder { color: rgba(255,255,255,0.55); }
#wikihead input.inputbox:focus { background: rgba(255,255,255,0.25); }

#wikihead input.inputbutton {
  background: var(--sp-red);
  border: 1px solid var(--sp-red-dark);
  border-radius: 0 4px 4px 0;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.14s;
}
#wikihead input.inputbutton:hover { background: var(--sp-red-dark); }

/* ── PAGE ACTIONS BAR ───────────────────────────────────────── */
/* Rendered from (Group|Site).PageActions wiki page */
#wikicmds {
  text-align: center;
  font-size: 0.82rem;
  white-space: nowrap;
  padding: 4px 8px 3px;
  border-bottom: 1px dotted #ccc;
  background: var(--sp-white);
}
#wikicmds ul { list-style: none; margin: 0; padding: 0; }
#wikicmds li { display: inline; margin: 0 5px; }
#wikicmds li a { color: #555; text-decoration: none; border: none; }
#wikicmds li a:hover { text-decoration: underline; color: var(--sp-red); }
#wikicmds li a.createlink { display: none; }

/* ── PAGE TITLE ─────────────────────────────────────────────── */
.title {
  margin: 0 auto;
  padding: 0.7em 1.5em 0.4em;
  max-width: 840px;
  border-bottom: 3px solid var(--sp-red);
}
.title h1.pagetitle {
  margin: 0.2em 0;
  font-size: 2rem;
  font-weight: 800;
  text-align: left;
  line-height: 1.1em;
  color: var(--sp-dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pagegroup {
  margin: 0.4em 0 0;
  float: left;
  color: #888;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  clear: both;
}
.pagegroup a { color: var(--sp-gray); }
.pagegroup a:hover { color: var(--sp-red); }

/* ── CONTENT AREA ───────────────────────────────────────────── */
.content {
  margin: 0 auto;
  padding: 1em 1.5em 3em;
  max-width: 840px;
  line-height: 1.7em;
  background: var(--sp-white);
  min-height: 60vh;
}

.content h2 { border-bottom: 2px solid var(--sp-mid); padding-bottom: 0.2em; }
.content a:link    { color: var(--sp-red); }
.content a:visited { color: var(--sp-red-dark); }
.content a:hover   { color: var(--sp-red-light); text-decoration: underline; }
.content a:active  { color: var(--sp-red-dark); }

.content blockquote {
  border-left: 4px solid var(--sp-red);
  background: #FFF5F6;
  padding: 8px 16px;
  margin: 12px 0;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: #555;
}
.content pre {
  background: #f0f0f0;
  border: 1px solid var(--sp-mid);
  border-radius: 4px;
  padding: 12px 16px;
  overflow-x: auto;
}
.content code {
  background: #f0f0f0;
  border: 1px solid var(--sp-mid);
  border-radius: 3px;
  padding: 1px 5px;
}
.content pre code { padding: 0; border: none; background: none; }

.content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 1em; }
.content th {
  background: var(--sp-red); color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 12px; text-align: left;
}
.content td { padding: 7px 12px; border-bottom: 1px solid var(--sp-mid); }
.content tr:nth-child(even) td { background: #FAFAFA; }
.content tr:hover td { background: #FFF5F6; }
.content hr { border: none; border-top: 1px solid var(--sp-mid); margin: 1.5em 0; opacity: 1; }

/* Edit form */
#wikiedit form { margin: 0; width: 100%; line-height: 1.1em; }
#wikiedit textarea { margin: 0; width: 99.5%; height: 22em; font-family: 'Courier New', monospace; font-size: 0.87rem; }
#wikiedit input[type=text] { margin: 2px; width: 99.5%; }
h2.wikiaction { margin: 0; }
.wikimessage { margin: 3px 0; font-style: italic; color: #000;
  background: #ffffcc; padding: 3px; border-radius: 3px; }
.searchbox { margin-right: 2px; max-width: 95.5%; }

/* ── SITE FOOTER ────────────────────────────────────────────── */
#wikifoot {
  font-size: 0.8rem;
  text-align: center;
  padding: 1.8em 1em 1em;
  background: var(--sp-white);
  border-top: 1px solid var(--sp-mid);
}
.footnav a, .footnav a:visited {
  font-weight: normal; text-decoration: none;
  color: #555; margin: 0 0.25em;
}
.footnav a:hover { text-decoration: underline; color: var(--sp-red); }
.lastmod { color: #999; margin-top: 4px; }
#poweredby { font-size: 0.75rem; color: #bbb; text-align: center; padding: 0.5em 0 1em; }
#poweredby a, #poweredby a:visited { color: #bbb; border-bottom: 1px dotted #ddd; text-decoration: none; }
#poweredby a:hover { color: var(--sp-red); border-bottom-color: var(--sp-red); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Desktop: sidebar always visible, hamburger hidden */
@media (min-width: 64em) {
  #layout { padding-left: var(--menu-width); left: 0; }
  #menu   { left: var(--menu-width); }

  .menu-link { position: fixed; left: var(--menu-width); display: none; }
  #layout.active .menu-link { left: var(--menu-width); }

  #menu .sidesearch { display: none; }   /* search is in the header on desktop */
  #wikihead form { display: flex; align-items: center; gap: 4px; }

  .lfloat, .rfloat { max-width: 100%; margin-bottom: 0; }
  .nomobile  { display: initial; }
  .onlymobile { display: none; }
}

/* Print */
@media print {
  #menu, .menu-link, #wikihead { display: none; }
  .content, .title { margin-left: 0; }
  #poweredby, #wikicmds, .footnav { display: none; }
}
