/* FerryRiders.com. Hand-written replacement for the GeneratePress theme and the WordPress block, Easy Table
   of Contents, Schema Pro FAQ and YARPP styles the WordPress site used; values match the old site. */

:root {
  --contrast: #222222;
  --contrast-2: #575760;
  --base-2: #f7f8f9;
  --base-3: #ffffff;
  --accent: #1e73be;
  --border: rgba(0, 0, 0, 0.1);
  --stripe: #f0f0f0;
  --faq-text: #313131;
  --faq-border: #d2d2d2;
}

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

html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, figure, hr { 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);
}

button, input { font-family: inherit; font-size: 100%; margin: 0; }

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, h5, h6 { 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; }
h5 { font-size: 20px; }
h6 { font-size: 17px; }

p { margin-bottom: 1.5em; }
ol, ul { margin: 0 0 1.5em 3em; }
ol { list-style: decimal; }
li > ol, li > ul { margin-bottom: 0; margin-left: 1.5em; }
strong { font-weight: 700; }

sup { font-size: 75%; height: 0; line-height: 0; position: relative; vertical-align: baseline; bottom: 1ex; }

hr { height: 1px; margin: 40px 0; background-color: var(--border); }

table { width: 100%; margin: 0 0 1.5em; border: 1px solid var(--border); border-width: 1px 0 0 1px;
  border-collapse: separate; border-spacing: 0; }
td, th { padding: 8px; border: 1px solid var(--border); }
th { font-weight: 700; border-width: 0 1px 1px 0; }
td { border-width: 0 1px 1px 0; }

.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 and navigation. The nav sits below the centered site title; "Ferry Systems By State" opens a
   dropdown on hover (desktop) or click. */

.site-header { background-color: var(--base-3); }
.site-header .container { padding: 20px 40px; text-align: center; }
.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 { position: relative; z-index: 100; background-color: var(--base-3); }
.main-nav .container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; padding: 0 20px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
#primary-menu { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.main-nav li { position: relative; }
.main-nav a, .submenu-toggle {
  display: block; padding: 0 20px;
  font-size: 15px; line-height: 60px;
  color: var(--contrast); text-decoration: none;
}
.submenu-toggle { border: 0; background: none; cursor: pointer; padding-right: 0; }
.submenu-toggle svg {
  width: 1em; height: 1em; position: relative; top: 0.125em; fill: currentColor;
  box-sizing: content-box; padding-left: 10px; padding-right: 20px;
}
.main-nav a:hover, .main-nav a:focus, .submenu-toggle:hover, .submenu-toggle:focus,
.main-nav li:hover > .submenu-toggle, .main-nav li.current > a, .main-nav li.current > .submenu-toggle { color: var(--accent); }

.sub-menu {
  position: absolute; left: -99999px; top: auto; z-index: 99999;
  width: 200px; height: 0; overflow: hidden; opacity: 0; pointer-events: none;
  background-color: #f0f0f0; text-align: left;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
  transition: opacity 80ms linear;
}
.main-nav .sub-menu a { line-height: normal; padding: 10px 20px; font-size: 14px; }
.has-submenu:hover > .sub-menu, .has-submenu:focus-within > .sub-menu, .has-submenu.open > .sub-menu {
  left: auto; height: auto; overflow: visible; opacity: 1; pointer-events: auto; transition-delay: 150ms;
}

.menu-toggle {
  display: none;
  margin: 0; padding: 0 20px; border: 0;
  background: transparent; 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; }
.menu-toggle span { padding-left: 9px; }

/* Page layout: each article is a white box on the grey page ("separate containers") */

.site { display: flex; }
.site-main { flex: 1; min-width: 0; margin: 20px 0; overflow-wrap: break-word; }
.site-main > * { margin-bottom: 20px; }
.site-main > :last-child { margin-bottom: 0; }
.right-sidebar .site-main { margin-right: 20px; }
.sidebar { width: 30%; flex: none; }

article, .page-header, .paging-navigation { background-color: var(--base-3); padding: 40px; }
.paging-navigation { padding-top: 20px; padding-bottom: 20px; }
.page-header > :last-child { margin-bottom: 0; }

.entry-title { margin-bottom: 0; }
.entry-title a { color: var(--contrast); text-decoration: none; }
.entry-title a:hover { color: var(--contrast-2); }
.entry-meta { margin-top: 0.5em; font-size: 85%; line-height: 1.5; color: var(--contrast-2); }
.entry-content:not(:first-child), .entry-summary:not(:first-child) { margin-top: 2em; }
.entry-content > p:last-child, .entry-summary > p:last-child, .read-more-container { margin-bottom: 0; }

.featured-image, .post-image { text-align: center; }
.featured-image { line-height: 0; margin-bottom: 2em; }
.entry-header + .featured-image { margin-top: 2em; margin-bottom: 0; }
.post-image:not(:first-child) { margin-top: 2em; }

.button {
  display: inline-block; padding: 10px 20px;
  background-color: #55555e; color: #fff; text-decoration: none;
}
.button:hover, .button:focus { background-color: #3f4047; color: #fff; }

.nav-previous, .nav-next { display: none; }
.nav-links > * { padding: 0 5px; }
.nav-links > :first-child { padding-left: 0; }
.nav-links .current { font-weight: 700; }

/* Content blocks (formerly WordPress block styles) */

.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { clear: both; display: block; margin: 0 auto; }
.entry-content .alignwide { margin-left: -40px; width: calc(100% + 80px); max-width: calc(100% + 80px); }

figcaption { margin: 0.5em 0 1em; font-size: 13px; text-align: center; }
.wp-block-image img { max-width: 100%; height: auto; vertical-align: bottom; }
.wp-block-image .aligncenter, .wp-block-image .alignright, .wp-block-image .alignleft { display: table; }
.wp-block-image .aligncenter > figcaption, .wp-block-image .alignright > figcaption,
.wp-block-image .alignleft > figcaption { display: table-caption; caption-side: bottom; }
.wp-block-image .aligncenter { margin-left: auto; margin-right: auto; }
.wp-block-image .alignright { float: right; margin: 0.5em 0 0.5em 1em; }
.wp-block-image .alignleft { float: left; margin: 0.5em 1em 0.5em 0; }

.wp-block-table { overflow-x: auto; }
.wp-block-table table { min-width: 40rem; width: 100%; border-collapse: collapse; }
.wp-block-table thead { border-bottom: 3px solid; }
.wp-block-table tfoot { border-top: 3px solid; }
.wp-block-table td, .wp-block-table th { padding: 0.5em; border: 1px solid; }
.wp-block-table figcaption { margin: 0; font-size: inherit; text-align: start; }
.has-fixed-layout { table-layout: fixed; }
.has-fixed-layout td, .has-fixed-layout th { word-break: break-word; }
.is-style-stripes { border-bottom: 1px solid var(--stripe); }
.is-style-stripes tbody tr:nth-child(odd) { background-color: var(--stripe); }
.is-style-stripes td, .is-style-stripes th { border-color: transparent; }
.has-text-align-left { text-align: left; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }

.wp-block-columns { display: flex; flex-wrap: nowrap; gap: 2em; margin-bottom: 1.75em; }
.wp-block-column { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.are-vertically-aligned-top { align-items: flex-start; }
.is-vertically-aligned-top { align-self: flex-start; width: 100%; }

.wp-block-media-text { display: grid; grid-template-columns: 50% 1fr; grid-template-rows: auto; }
.wp-block-media-text.has-media-on-the-right { grid-template-columns: 1fr 50%; }
.wp-block-media-text__media { grid-column: 1; grid-row: 1; align-self: center; margin: 0; }
.wp-block-media-text__content { grid-column: 2; grid-row: 1; align-self: center; padding: 0 8%; word-break: break-word; }
.has-media-on-the-right .wp-block-media-text__media { grid-column: 2; }
.has-media-on-the-right .wp-block-media-text__content { grid-column: 1; }
.wp-block-media-text__media img { width: 100%; max-width: unset; height: auto; vertical-align: middle; }

.wp-block-group__inner-container { padding: 40px; }

.wp-block-separator { border-top: 1px solid; border-bottom: 1px solid; }

.ad { margin: 8px 0; clear: both; }

.breadcrumbs { clear: both; }

/* Terminal maps (Leaflet, see /js/map.js) */

.map { width: 100%; height: 600px; }

/* Table of contents (formerly Easy Table of Contents). Collapsed by default; the checkbox opens it. */

.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-head { display: table; width: 100%; }
.toc .toc-title { display: inline; margin: 0; font-size: 120%; font-weight: 500; line-height: 1.45; vertical-align: middle; }
.toc-toggle {
  float: right; display: flex; align-items: center;
  margin-left: 10px; padding: 1px 5px;
  font-size: 12px; line-height: 1.5; color: #444; cursor: pointer;
}
.toc-icon {
  float: right; position: relative; left: 10px;
  width: 35px; border: 1px solid #999191; border-radius: 5px;
  font-size: 16px;
}
.toc-icon-svgs { display: flex; align-items: center; justify-content: center; width: 35px; height: 30px; }
.toc-icon svg { fill: #999; color: #999; }
.toc input { position: absolute; left: -999em; }
.toc input:not(: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%; }
.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;
}

/* FAQ accordion (formerly Schema Pro FAQ block). <details name="faq"> keeps one answer open at a time. */

.faq { margin-bottom: 10px; background-color: #fff; border: 1px solid var(--faq-border); border-radius: 2px; }
.faq summary {
  display: flex; align-items: center;
  padding: 10px;
  color: var(--faq-text);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; width: 15px; height: 15px; margin-right: 10px; fill: var(--faq-text); }
.faq .icon-minus, .faq[open] .icon-plus { display: none; }
.faq[open] .icon-minus { display: block; }
.faq .answer { display: inline-block; margin: 10px; }
.faq .answer p { margin: 0; color: var(--faq-text); }

/* Related posts (formerly YARPP) */

.related-posts { margin-top: 1em; margin-bottom: 1em; }
.related-posts h3 { margin: 0; padding: 0 0 5px; font-size: 125%; font-weight: 700; text-transform: capitalize; }
.related-posts a { font-weight: 700; text-decoration: none; }

/* Footer */

.site-footer { background-color: var(--base-3); }
.site-info { padding: 20px 40px; font-size: 15px; text-align: center; }

/* Narrow screens */

@media (max-width: 781px) {
  .wp-block-columns { flex-wrap: wrap; }
  .wp-block-column { flex-basis: 100%; }
}

@media (max-width: 768px) {
  .site-header .container { padding: 20px 30px; }
  .main-nav .container { display: block; }
  .menu-toggle { display: block; }
  #primary-menu { display: none; }
  .main-nav.toggled #primary-menu { display: block; }
  .main-nav.toggled .icon-bars { display: none; }
  .main-nav.toggled .icon-close { display: inline; }
  .main-nav.toggled li { width: 100%; text-align: left; }
  .main-nav.toggled .submenu-toggle { width: 100%; text-align: left; position: relative; }
  .main-nav.toggled .submenu-toggle svg { position: absolute; right: 0; top: 0; height: 60px; padding-left: 20px; }
  .main-nav.toggled .sub-menu { display: none; position: relative; left: auto; width: 100%; height: auto; opacity: 1;
    pointer-events: auto; box-shadow: none; border-bottom: 1px solid rgba(0, 0, 0, 0.05); transition: none; }
  .main-nav.toggled .has-submenu.open > .sub-menu { display: block; }
  .main-nav.toggled .has-submenu.open .submenu-toggle svg { transform: rotate(180deg); }

  .site { flex-direction: column; }
  .right-sidebar .site-main { margin-right: 0; }
  .sidebar { width: auto; }
  article, .page-header, .paging-navigation { padding: 30px; }
  .entry-meta { font-size: inherit; }
  .wp-block-group__inner-container { padding: 30px; }
  .entry-content .alignwide { margin-left: -30px; width: calc(100% + 60px); max-width: calc(100% + 60px); }
  .alignleft, .alignright { float: none; display: block; margin-left: auto; margin-right: auto; }
  .site-info { padding: 20px 30px; }
}

@media (max-width: 600px) {
  .wp-block-media-text.is-stacked-on-mobile { grid-template-columns: 100% !important; }
  .is-stacked-on-mobile .wp-block-media-text__media { grid-column: 1; grid-row: 1; }
  .is-stacked-on-mobile .wp-block-media-text__content { grid-column: 1; grid-row: 2; }
}
