/* Bainbridge Ferry Schedule. Hand-written replacement for the GeneratePress theme, TablePress and
   Easy Table of Contents styles the WordPress site used; values match the old site. */

:root {
  --contrast: #222222;
  --base-2: #f7f8f9;
  --base-3: #ffffff;
  --accent: #1e73be;
  --table-text: #111;
  --table-head: #d9edf7;
  --table-stripe: #f9f9f9;
  --table-border: #ddd;
}

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

html, body, h1, h2, h3, h4, p, ol, ul, li, figure { margin: 0; padding: 0; border: 0; }

body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 17px;
  line-height: 1.5;
  color: var(--contrast);
  background-color: var(--base-2);
}

a { color: var(--accent); text-decoration: underline; }
a:hover, a:focus, a:active { color: var(--contrast); }

img { height: auto; max-width: 100%; }

h1, h2, h3, h4 { font-weight: 400; margin-bottom: 20px; }
h1 { font-size: 42px; line-height: 1.2em; }
h2 { font-size: 35px; line-height: 1.2em; }
h3 { font-size: 29px; line-height: 1.2em; }
h4 { font-size: 24px; }

p { margin-bottom: 1.5em; }
ol, ul { margin: 0 0 1.5em 3em; }
ol { list-style: decimal; }
hr { height: 1px; margin: 40px 0; border: 0; background-color: rgba(0, 0, 0, 0.1); }

.screen-reader-text, .skip-link {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); border: 0;
}
.skip-link:focus {
  clip: auto !important; clip-path: none;
  width: auto; height: auto; left: 5px; top: 5px; z-index: 100000;
  display: block; padding: 15px 23px 14px;
  background-color: #f1f1f1; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  color: #21759b; font-size: 0.875rem; font-weight: 700; line-height: normal; text-decoration: none;
}

.container { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Header: title on the left, menu on the right */

.site-header { background-color: var(--base-3); }
.header-bar { display: flex; flex-wrap: wrap; align-items: center; padding: 20px 40px; }
.site-title { margin: 0; font-size: 25px; font-weight: 700; line-height: 1.2em; }
.site-title a { color: var(--contrast); text-decoration: none; }

.main-nav { margin-left: auto; background-color: var(--base-3); }
.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 0 20px;
  font-size: 15px; line-height: 60px;
  color: var(--contrast); text-decoration: none;
}
.main-nav a:hover, .main-nav a:focus, .main-nav a[aria-current="page"] { color: var(--accent); }

.menu-toggle {
  display: none;
  margin: 0 0 0 auto; padding: 0 20px; border: 0;
  background-color: rgba(0, 0, 0, 0.02); color: var(--contrast);
  font: inherit; font-size: 15px; line-height: 60px; cursor: pointer;
}
.menu-toggle svg { width: 1em; height: 1em; position: relative; top: 0.125em; fill: currentColor; }
.menu-toggle .icon-close { display: none; }

/* Page layout */

.site-main { margin-top: 20px; margin-bottom: 20px; overflow-wrap: break-word; }
.page-content { background-color: var(--base-3); padding: 40px; }
.page-content h1 { margin-bottom: 0; }
.page-content h1 + * { margin-top: 2em; }
.entry-content > p:last-child { margin-bottom: 0; }

.wp-caption { max-width: 100%; margin-bottom: 1.5em; position: relative; }
.wp-caption img { position: relative; vertical-align: bottom; }
.wp-caption figcaption { padding-top: 5px; font-size: 75%; opacity: 0.8; }

/* Table of contents (formerly Easy Table of Contents). The checkbox collapses the list. */

.toc {
  display: table;
  position: relative;
  margin-bottom: 1em;
  padding: 10px 20px 10px 10px;
  background: #f9f9f9;
  border: 1px solid #aaa;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.toc .toc-title { display: inline; margin: 0; font-size: 120%; font-weight: 500; line-height: 1.45; }
.toc-toggle { position: relative; cursor: pointer; }
.toc-icon {
  float: right; position: relative; left: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 35px; height: 32px;
  border: 1px solid #999191; border-radius: 5px;
  font-size: 16px;
}
.toc-icon svg { fill: #999; color: #999; }
.toc input { position: absolute; left: -999em; }
.toc input:checked + nav { display: none; }
.toc ul, .toc li { margin: 0; padding: 0; list-style: none; line-height: 1.6; overflow: hidden; }
.toc ul { counter-reset: item; }
.toc ul ul { margin-left: 1.5em; }
.toc li { font-size: 95%; font-weight: 500; }
.toc ul ul li { font-size: 90%; }
.toc a { display: inline-flex; color: #444; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc a::before {
  content: counters(item, ".", decimal) ". ";
  display: inline-block; flex: none; float: left;
  margin-right: 0.2em;
  counter-increment: item;
}

/* Tables (formerly TablePress default styles) */

.tablepress {
  width: 100%;
  margin: 0 auto 1rem;
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
}
.tablepress th, .tablepress td {
  padding: 0.5rem;
  border: none;
  color: var(--table-text);
  text-align: left;
  vertical-align: top;
}
.tablepress thead th, .tablepress tfoot th {
  background-color: var(--table-head);
  font-weight: 700;
  vertical-align: middle;
  word-break: normal;
}
.tablepress tbody td, .tablepress tfoot th { border-top: 1px solid var(--table-border); }
.tablepress tbody tr:nth-child(2n) td { background-color: var(--table-stripe); }
/* On the tickets page each table was followed by an empty paragraph, which set the gap below it. */
p + .tablepress { margin-bottom: 1.5em; }

/* Footer */

.site-footer { background-color: var(--base-3); }
.footer-links { padding: 40px; }
.footer-links ul { margin: 0; padding: 0; }
.footer-links li { list-style: none; margin-bottom: 0.5em; }
.footer-links li:last-child { margin-bottom: 0; }
.site-info { padding: 20px 40px; font-size: 15px; text-align: center; }

/* Mobile: the menu toggle wraps under the title and opens the menu as a full-width list */

@media (max-width: 768px) {
  .header-bar { padding: 20px 30px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; flex-basis: 100%; }
  .main-nav.toggled { display: block; margin-top: 1.5em; background-color: rgba(0, 0, 0, 0.02); }
  .main-nav ul { display: block; }
  .site-header.menu-open .icon-bars { display: none; }
  .site-header.menu-open .icon-close { display: inline; }
  .page-content { padding: 30px; }
  .footer-links { padding: 30px; }
  .site-info { padding: 20px 30px; }
}
