/* Anacortes Ferry Schedule. Hand-written replacement for the GeneratePress theme and WordPress block
   styles the WordPress site used; values match the old site. */

:root {
  --contrast: #222222;
  --base-2: #f7f8f9;
  --base-3: #ffffff;
  --accent: #1e73be;
  --table-stripe: #f0f0f0;
}

*, *::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);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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); }
sub, sup { position: relative; height: 0; font-size: 75%; line-height: 0; vertical-align: baseline; }
sup { bottom: 1ex; }
sub { top: 0.5ex; }

.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; }

/* Images and tables (formerly WordPress image and striped table blocks) */

.image img { vertical-align: bottom; }
.image figcaption { margin: 0.5em 0 1em; font-size: 13px; text-align: center; }

.table { overflow-x: auto; border-bottom: 1px solid var(--table-stripe); }
.table table {
  width: 100%;
  margin: 0 0 1.5em;
  table-layout: fixed;
  border-collapse: collapse;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.1);
  border-width: 1px 0 0 1px;
}
.table thead { border-bottom: 3px solid; }
.table th, .table td {
  padding: 0.5em;
  border: 1px solid transparent;
  text-align: left;
  word-break: break-word;
}
.table tbody tr:nth-child(odd) { background-color: var(--table-stripe); }
.table .center th, .table .center td { text-align: center; }

/* Footer */

.site-footer { background-color: var(--base-3); }
.footer-links { padding: 40px; }
.footer-links p { margin: 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; }
}

/* Data from Washington State Ferries: status line, alerts, next ferry, day view, season tables, FAQs */

.data-status { margin-bottom: 1.5em; }
.data-status .updated { font-size: 0.85em; color: #555; margin-bottom: 0; }
.stale-banner { background: #fff4e5; border: 1px solid #f0a020; border-radius: 4px; padding: 0.6em 0.9em; margin-bottom: 0.8em; }
.alerts { margin-bottom: 0.8em; }
.alert { background: #fdecea; border: 1px solid #e57373; border-radius: 4px; padding: 0.5em 0.9em; margin-bottom: 0.5em; }
.alert summary { cursor: pointer; font-weight: 600; }
.alert p { margin: 0.6em 0 0; }
.alert .alert-meta { font-size: 0.85em; color: #555; }

.next-ferry {
  margin-bottom: 1.5em; padding: 16px 20px;
  background: linear-gradient(135deg, #f2f9fe, #e3f2fc);
  border: 1px solid #b9dcf4; border-left: 6px solid #0a94e4; border-radius: 10px;
}
.trip-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 0.8em; margin-bottom: 1em; }
.trip-picker .pick { display: flex; align-items: center; gap: 0.4em; }
.trip-picker label, .day-picker label { font-weight: 600; }
.trip-picker select, .day-picker select { font: inherit; padding: 0.2em 0.4em; }
.trip-picker button {
  padding: 0.25em 0.6em; border: 1px solid #b9dcf4; border-radius: 4px;
  background: var(--base-3); font: inherit; font-size: 1.1em; line-height: 1; cursor: pointer;
}
.next-message { margin-bottom: 0.8em; font-weight: 600; }
.next-ferry .table { border-bottom: 0; }
.next-ferry .table table { margin-bottom: 0; background-color: var(--base-3); }

.table small { display: block; font-size: 0.8em; opacity: 0.8; }
.table td.live { font-size: 0.85em; }
.table tbody tr.departed { opacity: 0.45; }
.table tbody tr.closest-row { color: var(--base-3); font-weight: 700; background-color: #0a94e4; }
.table tfoot td { font-size: 0.85em; }
.table-notes { margin: 0 0 0 1.5em; }
.table .day-table, .table .next-trips-table { table-layout: auto; }
.day-table th, .day-table td, .season-table th, .season-table td, .next-trips-table th, .next-trips-table td { word-break: normal; }
.day-table { min-width: 760px; }
.season-table { min-width: 560px; }
.day-table td:first-child, .season-table td:first-child { min-width: 7em; }
.day-table td:not(:first-child):not(.live), .season-table td:not(:first-child), .next-trips-table td:nth-child(2) { white-space: nowrap; }
.day-table td.live { min-width: 12em; }

@media (max-width: 768px) {
  .next-ferry { padding: 12px; }
  .next-trips-table th, .next-trips-table td { padding: 0.4em 0.3em; font-size: 15px; }
}

/* FAQ accordion; <details name="faq"> keeps one answer open at a time */

.faq { margin-bottom: 10px; background-color: var(--base-3); border: 1px solid #d2d2d2; border-radius: 2px; }
.faq summary { display: flex; align-items: center; padding: 10px; color: #313131; 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: #313131; }
.faq .icon-minus, .faq[open] .icon-plus { display: none; }
.faq[open] .icon-minus { display: block; }
.faq .answer { margin: 10px; }
.faq .answer p { margin: 0; color: #313131; }

.fares-asof { font-size: 0.9em; }
.table tr.fare-category th { background-color: var(--base-2); }
.table figcaption { margin: 0.5em 0 1em; font-size: 13px; text-align: center; }
.vessel { margin-bottom: 2em; }
