/* ==========================================================================
   Keels & Kingdoms — the site-wide navigation (app/views/partials/site-nav.php)
   --------------------------------------------------------------------------
   The main site's mega menu, carried onto this host so the bar is the same on
   both. The main site is built in Webflow, where these are the classes of the
   "CT Navbar" component; the values below are that component's, by hand. By
   day it is the main site's parchment and ink; at night (the skin at the end
   of this file) it takes the main site's night colours, so the bar matches
   whichever host the visitor is on. Both hosts share one theme choice.

   Every rule is scoped to .ct-nav and written to outrank this site's bare
   `a` rule (gold, underlined), which would otherwise reach every link here.
   ========================================================================== */

.ct-nav {
  --nav-ink: #2A2118;
  --nav-ink-soft: #3B2E20;
  --nav-ink-faint: #5A4A36;
  --nav-red: #8C2F1B;
  --nav-paper: #EDE0C4;
  --nav-paper-light: #F6EEDB;
  --nav-plate: #EFE3C8;
  /* Rules and fills that are ink by day. The night skin below redefines
     these and the colours above; nothing else changes between the two. */
  --nav-line: #2A2118;
  --nav-hair: rgba(42, 33, 24, 0.3);
  --nav-hair-strong: rgba(42, 33, 24, 0.35);
  --nav-dots: rgba(42, 33, 24, 0.45);
  --nav-btn: #2A2118;
  --nav-btn-text: #F3E8CF;
  --nav-btn-hover: #8C2F1B;
  --nav-btn-hover-text: #F3E8CF;
  --nav-lift: rgba(42, 33, 24, 0.25);
  --nav-drop: rgba(20, 14, 8, 0.4);
  --nav-texture: url(../img/site-nav/parchment.jpg);
  --nav-sans: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
  --nav-display: "Libre Caslon Display", Georgia, serif;
  --nav-text: "Libre Caslon Text", Georgia, serif;
  /* The name beside the wheel: the masthead's own face, as on the main site
     (Webflow's "Logo font" variable). layout.php already loads it. */
  --nav-logo: "IM Fell English SC", Georgia, serif;
  position: relative; z-index: 60;
  background: var(--nav-paper) var(--nav-texture) 0 0 / 900px 900px;
  color: var(--nav-ink); font-family: var(--nav-sans); font-size: 17px; line-height: 1.5;
  color-scheme: light;
}
.ct-nav a { color: inherit; text-decoration: none; border-bottom: 0; }
.ct-nav a:hover { color: inherit; border-bottom-color: transparent; }
.ct-nav a:focus-visible { outline: 2px solid var(--nav-red); outline-offset: 3px; }
.ct-nav img { max-width: 100%; }

/* ------------------------------------------------------------------ the bar */
.ct-nav .ct-navrow {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 24px;
  max-width: 1320px; min-height: 88px; margin: 0 auto; padding: 0 40px;
}
.ct-nav .ct-navgroup-left,
.ct-nav .ct-navgroup-right { display: flex; align-items: center; gap: 34px; }
.ct-nav .ct-navgroup-left { justify-self: start; }
.ct-nav .ct-navgroup-right { justify-self: end; }
.ct-nav .ct-navtop,
.ct-nav .ct-navplain {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--nav-ink); border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ct-nav .ct-navtop::after {
  content: ""; width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform 0.2s;
}
.ct-nav .ct-navtop:hover,
.ct-nav .ct-navplain:hover,
.ct-nav .ct-navtop.is-open { color: var(--nav-red); border-bottom-color: var(--nav-red); }
.ct-nav .ct-navtop.is-open::after { transform: rotate(225deg); margin-top: 3px; }
.ct-nav .ct-brand { display: flex; align-items: center; gap: 14px; color: var(--nav-ink); }
.ct-nav .ct-brand-wheel { width: 44px; height: 46px; }
.ct-nav .ct-brand-name { font-family: var(--nav-logo); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; }
.ct-nav .ct-btn,
.ct-nav .ct-btn-sm,
.ct-nav .ct-menu-btn {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  background: var(--nav-btn); border: 1px solid var(--nav-btn); color: var(--nav-btn-text);
  font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.ct-nav .ct-btn { min-height: 54px; padding: 0 32px; font-size: 15px; }
.ct-nav .ct-btn:hover,
.ct-nav .ct-btn-sm:hover,
.ct-nav .ct-menu-btn:hover { background: var(--nav-btn-hover); border-color: var(--nav-btn-hover); color: var(--nav-btn-hover-text); }
.ct-nav .ct-menu-btn { display: none; justify-self: end; }
.ct-nav .ct-rule { height: 3px; border-top: 1px solid var(--nav-line); border-bottom: 1px solid var(--nav-line); }
.ct-nav .ct-link {
  display: flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--nav-ink); border-bottom: 1px solid var(--nav-line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ct-nav .ct-link:hover { color: var(--nav-red); border-bottom-color: var(--nav-red); }

/* The day/night toggle (assets/js/theme.js). In the bar it is a square the
   height of the buttons, showing the disc only; the label is there for screen
   readers. In the collapsed menu it is a row of its own (below). */
.ct-nav .ct-theme-toggle {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  width: 44px; height: 44px; margin: 0 0 0 -16px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--nav-line); border-radius: 0; color: var(--nav-ink);
  font: inherit; transition: color 0.2s ease, border-color 0.2s ease;
}
.ct-nav .ct-theme-toggle:hover { color: var(--nav-red); border-color: var(--nav-red); }
.ct-nav .ct-theme-toggle:focus-visible { outline: 2px solid var(--nav-red); outline-offset: 3px; }
.ct-nav .ct-theme-disc {
  display: block; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.ct-nav .ct-navgroup-right .ct-theme-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.ct-nav .ct-nav-mobile-theme { display: none; border-top: 1px solid var(--nav-hair); }

/* --------------------------------------------------------------- the panels */
@keyframes ct-drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ct-nav .ct-mega {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--nav-paper-light) var(--nav-texture) 0 0 / 900px 900px;
  background-blend-mode: soft-light;
  border-bottom: 1px solid var(--nav-line);
  box-shadow: 0 3px 0 var(--nav-paper-light), 0 4px 0 var(--nav-line), 0 34px 60px var(--nav-drop);
}
.ct-nav .ct-mega-title { display: none; }
.ct-nav .ct-mega-game,
.ct-nav .ct-mega-ships,
.ct-nav .ct-mega-roadmap,
.ct-nav .ct-mega-crew {
  display: grid; gap: 24px 32px; align-items: start;
  max-width: 1240px; margin: 0 auto; padding: 40px 40px 46px;
}
.ct-nav .ct-mega-game { grid-template-columns: 1fr 1fr 1fr 1fr 300px; }
.ct-nav .ct-mega-ships { grid-template-columns: 1.2fr 1fr; gap: 28px 56px; }
.ct-nav .ct-mega-roadmap { grid-template-columns: 1fr 1fr 1fr; }
.ct-nav .ct-mega-crew { grid-template-columns: 1fr 1fr 300px; }
.ct-nav .ct-mega-block {
  display: flex; flex-direction: column; gap: 8px; padding-top: 16px;
  border-top: 2px solid var(--nav-line); color: var(--nav-ink); transition: border-color 0.2s ease;
}
.ct-nav .ct-mega-block:hover { border-top-color: var(--nav-red); }
.ct-nav .ct-mega-block-title { font-family: var(--nav-text); font-weight: 700; font-size: 20px; line-height: 1.2; transition: color 0.2s ease; }
.ct-nav .ct-mega-block:hover .ct-mega-block-title { color: var(--nav-red); }
.ct-nav .ct-mega-block-desc { font-size: 15px; line-height: 1.5; color: var(--nav-ink-soft); }
.ct-nav .ct-mega-plate { padding: 8px; background: var(--nav-plate); border: 1px solid var(--nav-line); }
.ct-nav .ct-mega-plate-img { display: block; width: 100%; height: 176px; object-fit: cover; object-position: 50% 85%; }
.ct-nav .ct-mega-col,
.ct-nav .ct-mega-col-ruled { display: flex; flex-direction: column; gap: 20px; }
.ct-nav .ct-mega-col-ruled { padding-left: 56px; border-left: 1px solid var(--nav-hair); }
.ct-nav .ct-mega-eyebrow { font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0.22em; text-transform: uppercase; color: var(--nav-red); }
.ct-nav .ct-mega-lead { margin-top: -10px; font-family: var(--nav-display); font-size: 28px; line-height: 1.15; }
.ct-nav .ct-ship-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.ct-nav .ct-ship-plate {
  display: flex; flex-direction: column; background: var(--nav-plate); border: 1px solid var(--nav-line); color: var(--nav-ink);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.ct-nav .ct-ship-plate:hover { border-bottom-color: var(--nav-line); box-shadow: 0 14px 28px var(--nav-lift); transform: translateY(-2px); }
.ct-nav .ct-ship-pic { display: flex; align-items: flex-end; justify-content: center; height: 164px; padding: 14px 18px 6px; }
.ct-nav .ct-ship-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ct-nav .ct-ship-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 18px 14px; border-top: 1px solid var(--nav-hair-strong); }
.ct-nav .ct-ship-name { font-family: var(--nav-text); font-weight: 700; font-size: 18px; line-height: 1.2; }
.ct-nav .ct-ship-meta,
.ct-nav .ct-class-label { font-size: 12px; line-height: 1.3; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nav-ink-faint); }
.ct-nav .ct-class-label { font-weight: 700; }
.ct-nav .ct-class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.ct-nav .ct-class { display: flex; flex-direction: column; gap: 3px; }
.ct-nav .ct-class-names { font-size: 15px; line-height: 1.4; }
.ct-nav .ct-mega-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.ct-nav .ct-wiki-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.ct-nav .ct-wlink {
  display: flex; align-items: baseline; gap: 12px; min-height: 40px; padding: 9px 0;
  border-bottom: 1px dotted var(--nav-dots); font-size: 16px; line-height: 1.3; color: var(--nav-ink);
  transition: color 0.2s ease;
}
.ct-nav .ct-wlink:hover { color: var(--nav-red); border-bottom-color: var(--nav-dots); }
.ct-nav .ct-wnum { flex: none; width: 22px; font-family: var(--nav-text); font-style: italic; font-size: 14px; color: var(--nav-red); }
.ct-nav .ct-nav-mobile-cta { display: none; padding: 16px 20px 22px; border-top: 1px solid var(--nav-hair); }

@media (min-width: 992px) {
  .ct-nav .ct-mega.is-open { display: block; animation: ct-drop 0.28s ease both; }
}

/* ---------------------------------------------------- tablet and phone: one
   Menu button; the four panels become an accordion under the bar. */
@media (max-width: 991px) {
  .ct-nav .ct-navrow { grid-template-columns: 1fr auto; padding: 0 20px; }
  .ct-nav .ct-navgroup-left,
  .ct-nav .ct-navgroup-right { display: none; }
  .ct-nav .ct-menu-btn { display: flex; }
  .ct-nav .ct-brand-name { font-size: 24px; }
  .ct-nav .ct-mega { position: static; box-shadow: none; border-bottom: 0; }
  .ct-nav.is-open .ct-mega { display: block; }
  .ct-nav.is-open .ct-nav-mobile-cta { display: block; }
  .ct-nav .ct-mega-title {
    display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 20px;
    font-family: var(--nav-display); font-size: 24px; line-height: 1; color: var(--nav-ink);
    border-top: 1px solid var(--nav-hair);
  }
  .ct-nav .ct-mega-title::after {
    content: ""; width: 9px; height: 9px;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg); transition: transform 0.2s;
  }
  .ct-nav .ct-mega.is-open .ct-mega-title { color: var(--nav-red); }
  .ct-nav .ct-mega.is-open .ct-mega-title::after { transform: rotate(225deg); }
  .ct-nav .ct-mega-body { display: none; }
  .ct-nav .ct-mega.is-open .ct-mega-body { display: block; }
  .ct-nav .ct-mega-game,
  .ct-nav .ct-mega-ships,
  .ct-nav .ct-mega-roadmap,
  .ct-nav .ct-mega-crew { grid-template-columns: 1fr; padding: 4px 20px 24px; }
  .ct-nav .ct-mega-col-ruled { padding-left: 0; border-left: 0; }
  .ct-nav .ct-mega-plate { display: none; }
  .ct-nav .ct-mega-lead { font-size: 22px; }
  .ct-nav .ct-nav-mobile-cta .ct-btn { width: 100%; }
}
@media (max-width: 479px) {
  .ct-nav .ct-wiki-grid { grid-template-columns: 1fr; }
  .ct-nav .ct-ship-pic { height: 110px; }
  /* Phone: the bar closes up, as the Webflow navbar does at its Mobile breakpoint. */
  .ct-nav .ct-navrow { padding: 0 16px; }
  .ct-nav .ct-brand { gap: 10px; }
  .ct-nav .ct-brand-wheel { width: 36px; height: 38px; }
  .ct-nav .ct-brand-name { font-size: 21px; }
}
/* The toggle as a row of the collapsed menu, set like the panel titles. */
@media (max-width: 991px) {
  .ct-nav.is-open .ct-nav-mobile-theme { display: block; }
  .ct-nav .ct-nav-mobile-theme .ct-theme-toggle {
    flex-direction: row-reverse; justify-content: space-between;
    width: 100%; height: auto; min-height: 60px; margin: 0; padding: 0 20px; border: 0;
    font-family: var(--nav-display); font-size: 24px; line-height: 1; text-align: left;
  }
  .ct-nav .ct-nav-mobile-theme .ct-theme-toggle:focus-visible { outline-offset: -4px; }
}
/* Small laptops, 992 to 1279px: at its full spacing the bar is wider than
   the screen there, so it closes up. The same values as the Webflow navbar,
   whose base styles are these and whose 1280px breakpoint is the roomy set. */
@media (min-width: 992px) and (max-width: 1279px) {
  .ct-nav .ct-navrow { column-gap: 14px; padding: 0 24px; }
  .ct-nav .ct-navgroup-left,
  .ct-nav .ct-navgroup-right { gap: 18px; }
  .ct-nav .ct-navtop,
  .ct-nav .ct-navplain { font-size: 13px; letter-spacing: 0.12em; }
  .ct-nav .ct-navgroup-right .ct-btn-sm { padding: 0 16px; font-size: 12px; letter-spacing: 0.12em; }
  .ct-nav .ct-brand { gap: 10px; }
  .ct-nav .ct-brand-wheel { width: 38px; height: 40px; }
  .ct-nav .ct-brand-name { font-size: 24px; }
  .ct-nav .ct-theme-toggle { margin-left: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-nav .ct-mega.is-open { animation: none; }
}

/* ------------------------------------------------------------ night skin
   data-om-theme="dark" on <html> (assets/js/theme.js). The main site's night
   theme uses the same values. Day is everything above, unchanged. */
[data-om-theme="dark"] .ct-nav {
  --nav-ink: #F3E8CF;
  --nav-ink-soft: #DCD6C6;
  --nav-ink-faint: #A79E8B;
  --nav-red: #D5AE62;
  --nav-paper: #0E1B2A;
  --nav-paper-light: #16202C;
  --nav-plate: #1B2836;
  --nav-line: rgba(243, 232, 207, 0.4);
  --nav-hair: rgba(243, 232, 207, 0.25);
  --nav-hair-strong: rgba(243, 232, 207, 0.3);
  --nav-dots: rgba(243, 232, 207, 0.35);
  --nav-btn: #D5AE62;
  --nav-btn-text: #16202C;
  --nav-btn-hover: #F0D49A;
  --nav-btn-hover-text: #16202C;
  --nav-lift: rgba(0, 0, 0, 0.45);
  --nav-drop: rgba(0, 0, 0, 0.55);
  --nav-texture: none;
  color-scheme: dark;
}
[data-om-theme="dark"] .ct-nav .ct-mega { background-blend-mode: normal; }
/* The wheel is dark ink on transparent: at night, a cream silhouette. */
[data-om-theme="dark"] .ct-nav .ct-brand-wheel { filter: brightness(0) invert(0.92) sepia(0.25); }
@media print {
  .ct-nav { display: none; }
}
