/* 55°Nord – modernized stylesheet.
   Recreates the original stylesheet.css/printer.css design (see _baseline/DESIGN.md).
   Mobile-first: single column < 700px, fluid two columns 700–839px,
   the original fixed 800px panel from 840px. */

:root {
  --page-bg: #666666;
  --panel: #ffffff;
  --panel-border: #999999;
  --text: #000000;
  --accent: #666666;
  --link-hover: #0b4cce;
  --font-body: Verdana, Geneva, Arial, Helvetica, sans-serif;
  /* "Agency FB" where installed; otherwise the closest condensed system font. */
  --font-display: "Agency FB", "Bahnschrift Condensed", "Avenir Next Condensed",
    "Roboto Condensed", "Arial Narrow", sans-serif-condensed, var(--font-body);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: 0.75rem/1.4 var(--font-body);
}

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

/* ---------- Links ---------- */

a:link,
a:visited {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

/* Links inside running text get a faint underline so they are not identified by hover alone. */
.content a:not(.logob a, .logoc a, .routemap a, .gallery a, .viewer a, .plain) {
  text-decoration: underline;
  text-decoration-color: #b3b3b3;
  text-underline-offset: 0.15em;
}

.content a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: bold;
}

.skip-link:focus {
  top: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Panel and regions (mobile first) ---------- */

.site {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  min-height: 100vh;
}

.site-image img {
  display: block;
  margin: 0 auto;
}

.site-image--banner img {
  width: 100%;
}

.site-menus {
  padding: 16px 16px 4px;
  font-family: var(--font-display);
  font-stretch: condensed;
  text-align: center;
}

.menu,
.submenu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
}

.menu a {
  display: inline-block;
  padding: 4px 0;
  font-size: 1rem;
  font-weight: bold;
}

.menu-logo {
  flex-basis: 100%;
}

.menu .menu-logo a {
  padding: 0;
}

.logoa {
  font-family: var(--font-display);
  font-size: 1.6667rem;
  font-weight: bold;
  color: var(--accent);
}

.submenu {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
}

.submenu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 12px;
}

.submenu a {
  display: inline-block;
  padding: 4px 0;
  font-size: 0.875rem;
}

.content {
  padding: 20px 16px 28px;
}

.content:focus {
  outline: none;
}

/* ---------- Typography inside content ---------- */

.content h1,
.content h2 {
  margin: 0 0 1em;
  font-weight: bold;
}

.size-h2 {
  font-size: 1.5em;
}

.size-h3 {
  font-size: 1.17em;
}

.content h2.size-h3 {
  margin: 1em 0;
}

/* Dated travel-log entries and crew names: originally <b><i>, one line of body text. */
.content h2.entry {
  margin: 0;
  font-size: 1em;
  font-style: italic;
}

.bullet {
  vertical-align: -1px;
}

.bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}

.logob {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent);
}

.logoc {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.center {
  text-align: center;
}

.specs {
  border-collapse: collapse;
}

.specs th,
.specs td {
  padding: 0;
  font-weight: normal;
  text-align: left;
  vertical-align: top;
}

.specs th {
  min-width: 95px;
  padding-right: 8px;
}

/* ---------- Front page news ---------- */

.news {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.news li + li {
  margin-top: 1.2em;
}

/* ---------- Route map (12 slices that highlight on hover/focus) ---------- */

.routemap {
  display: flex;
  max-width: 380px;
}

.routemap a {
  position: relative;
  flex: var(--w) 1 0;
  min-width: 0;
}

.routemap img {
  display: block;
  width: 100%;
  height: auto;
}

.routemap .routemap-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.routemap a:hover .routemap-hover,
.routemap a:focus-visible .routemap-hover {
  opacity: 1;
}

.routemap a:focus-visible {
  outline-offset: 0;
  z-index: 1;
}

/* ---------- Gallery: no-JavaScript fallback (plain thumbnail grid) ---------- */

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}

.gallery-list img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--accent);
}

.gallery.is-enhanced .gallery-list {
  display: none;
}

/* ---------- Gallery viewer (replaces Flash SimpleViewer) ---------- */

.viewer {
  margin: 0 0 1.5em;
}

.viewer button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.viewer-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.viewer-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 72px));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.viewer-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  background: #eeeeee;
  aspect-ratio: 1;
  overflow: hidden;
}

.viewer-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}

.viewer-thumb:hover img,
.viewer-thumb[aria-current="true"] img {
  opacity: 1;
}

.viewer-thumb[aria-current="true"] {
  border-color: var(--accent);
}

.viewer-thumb.is-broken img {
  display: none;
}

.viewer-thumb.is-broken::after {
  content: attr(data-number);
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--accent);
}

.viewer-page,
.viewer-nav {
  min-width: 32px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 1.75rem !important;
  line-height: 1;
  color: var(--accent) !important;
}

.viewer-page:hover,
.viewer-nav:hover {
  color: var(--link-hover) !important;
}

.viewer-page:disabled {
  visibility: hidden;
}

.viewer-stage {
  margin: 0;
  text-align: center;
}

.viewer-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 160px;
  touch-action: pan-y;
}

.viewer-open {
  display: inline-block;
  line-height: 0;
}

.viewer-image {
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  border: 2px solid var(--accent);
  cursor: zoom-in;
}

.viewer-image[hidden] {
  display: none;
}

.viewer-error {
  flex: 1;
  margin: 0;
  padding: 40px 12px;
  border: 2px dashed #cccccc;
  color: var(--accent);
}

.viewer-caption {
  min-height: 1.4em;
  margin: 8px 0 2px;
}

.viewer-counter {
  margin: 0;
  color: var(--accent);
}

/* ---------- Large view (native <dialog>) ---------- */

.lightbox {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-body);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 56px 8px 16px;
  touch-action: pan-y;
}

.lightbox figure {
  margin: 0;
  text-align: center;
}

.lightbox img {
  display: block;
  margin: 0 auto;
  width: min(calc(var(--w, 448) * 1.5px), 94vw, calc((100vh - 150px) * var(--ratio, 1.333)));
  height: auto;
  max-width: none;
  border: 2px solid var(--accent);
  background: #222222;
}

.lightbox figcaption {
  max-width: 60ch;
  margin: 10px auto 0;
  font-size: 0.875rem;
}

.lightbox-counter {
  margin: 4px 0 0;
  color: #cccccc;
}

.lightbox-error {
  padding: 40px 16px;
  border: 2px dashed #888888;
}

.lightbox-error a {
  color: #ffffff;
  text-decoration: underline;
}

.lightbox button {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font: bold 1.75rem/1 var(--font-body);
  cursor: pointer;
}

.lightbox button:hover {
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-close {
  top: 8px;
  right: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

/* ---------- Tablet: fluid two columns ---------- */

@media (min-width: 700px) {
  .site {
    display: grid;
    grid-template-columns: 314px minmax(0, 1fr);
    grid-template-rows: 228px auto;
    grid-template-areas:
      "image content"
      "menus content";
    min-height: 100vh;
  }

  .page-home .site {
    grid-template-areas:
      "image image"
      "menus content";
  }

  .site-image {
    grid-area: image;
  }

  .site-image img {
    width: 314px;
    height: 228px;
    max-width: none;
    margin: 0;
  }

  .site-image--banner {
    overflow: hidden;
  }

  .site-image--banner img {
    width: 800px;
    height: 228px;
  }

  .site-menus {
    grid-area: menus;
    position: relative;
    min-height: 308px;
    padding: 36px 0 0;
    text-align: right;
  }

  .menu {
    display: block;
    width: 100px;
    margin-left: 55px;
  }

  .menu a {
    padding: 0;
    line-height: 19px;
  }

  .menu .menu-logo a {
    line-height: 31px;
  }

  .submenu {
    position: absolute;
    top: 84px;
    left: 184px;
    width: 130px;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .submenu ul {
    display: block;
  }

  .submenu a {
    padding: 0;
    font-size: 0.75rem;
    line-height: 14px;
  }

  .content {
    grid-area: content;
    padding: 25px 20px 20px 25px;
  }

  .page-home .content {
    padding: 36px 30px 30px;
  }
}

/* ---------- Desktop: the original fixed 800px panel ---------- */

@media (min-width: 840px) {
  .site {
    width: 804px;
    min-height: 0;
    margin: 50px auto 8px;
    border: 2px solid var(--panel-border);
    grid-template-columns: 314px 486px;
    grid-template-rows: 228px minmax(308px, auto);
  }

  .viewer-image {
    max-height: 300px;
  }

  /* Content scrolls inside a 486×500 box, as in the original. */
  .content {
    height: 500px;
    overflow: auto;
    align-self: start;
  }

  .page-home .content {
    height: auto;
    overflow: visible;
  }
}

/* ---------- Print (replaces printer.css) ---------- */

@media print {
  body {
    background: none;
  }

  .site {
    display: block;
    width: auto;
    margin: 0;
    border: 0;
  }

  .site-image,
  .site-menus,
  .skip-link,
  .viewer-strip,
  .viewer-nav {
    display: none !important;
  }

  .content {
    height: auto !important;
    overflow: visible !important;
    padding: 0 0 0 20px;
  }

  .page-home .content {
    display: none;
  }

  .logoa,
  .logob,
  .logoc {
    color: #ff0000;
  }
}
