/* ============================================================
   bluewaterboats — nautical editorial design
   ============================================================ */

:root {
  --bg: #f4efe4;
  --bg-2: #efe8d8;
  --surface: #fffdf8;
  --fg: #1b2a31;
  --muted: #6c7882;
  --accent: #0f5e72;          /* deep teal */
  --accent-2: #b0814a;        /* brass */
  --line: #ddd3bf;
  --line-strong: #c8bca2;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(20, 45, 60, .10);
  --shadow-hover: 0 16px 44px rgba(20, 45, 60, .16);
}

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

body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 80px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.68;
  color: var(--fg);
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(15, 94, 114, .07), transparent 60%),
    radial-gradient(720px 480px at 0% 0%, rgba(176, 129, 74, .08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ---- header ------------------------------------------------------------ */
header { position: relative; padding-top: 18px; }
header nav { text-align: center; }
.logo { margin: 10px auto 2px; }
.logo img {
  height: 150px; width: auto; max-width: 100%;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.logo a:hover img { transform: scale(1.03); }

@media (max-width: 720px) {
  .logo img { height: 112px; }
}

/* search */
.search-form {
  display: inline-flex; align-items: stretch; margin: 14px auto 6px;
  width: min(520px, 92%);
  box-shadow: var(--shadow);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
input.search {
  flex: 1; min-width: 0; height: 50px; padding: 0 20px;
  font: 16px/1 var(--font-ui); color: var(--fg);
  background: var(--surface); border: none; border-radius: 0;
}
input.search::placeholder { color: var(--muted); }
button.submit {
  width: 56px; height: 50px; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0; transition: filter .2s, background .2s;
}
button.submit svg { width: 19px; height: 19px; }
button.submit:hover { filter: brightness(1.08); }
input:focus, button:focus, select:focus { outline: none; }

/* ---- fleet filter / sort toolbar --------------------------------------- */
.fleet-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 22px;
  margin: 30px 0 4px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.fc-group { display: flex; flex-direction: column; gap: 5px; }
.fc-group label {
  font-family: var(--font-ui); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.fleet-controls select {
  font: 15px/1.2 var(--font-ui); color: var(--fg);
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 9px 12px; cursor: pointer; max-width: 240px;
}
.fleet-controls select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fc-count {
  margin-left: auto; align-self: center; font-family: var(--font-display);
  font-size: 18px; color: var(--accent);
}
.fc-reset {
  align-self: center; font-family: var(--font-ui); font-size: 13px;
  color: var(--muted); text-decoration: underline;
}

/* ---- boat tiles -> cards (home + similar) ------------------------------ */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px; margin: 34px 0; text-align: left;
}
.item-container {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; position: relative;
  box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
}
.item-container:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.item-container .img { padding: 18px 18px 6px; }
.item-container .img a { display: grid; place-items: center; aspect-ratio: 4 / 3; }
.item-container img.thumb { width: auto; max-height: 150px; max-width: 100%; }
.item-container .txt { padding: 6px 18px 18px; text-align: center; }
.item-container .txt a {
  font-family: var(--font-display); font-size: 18px; color: var(--fg); line-height: 1.2;
}
.item-container:hover .txt a { color: var(--accent); }
.item-container .facts {
  margin-top: 6px; font-family: var(--font-ui); font-size: 12px;
  letter-spacing: .04em; color: var(--muted);
}

/* ---- boat article ------------------------------------------------------ */
.boat { max-width: 820px; margin: 28px auto 0; }
/* Show the whole boat: photo at natural aspect (never cropped), capped height, centered.
   Portrait/vertical heroes get a taller cap so they're appropriately prominent. */
.boat-hero { margin: 10px 0 6px; text-align: center; }
.boat-hero img {
  display: inline-block; max-width: 100%; max-height: 500px; width: auto; height: auto;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); background: var(--surface); cursor: zoom-in;
}
.boat-hero.is-portrait img { max-height: 660px; }
.boat > center {
  display: block; text-align: center; color: var(--muted);
  font-family: var(--font-ui); font-size: 15px; margin-top: -6px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.7rem); line-height: 1.02;
  text-align: center; color: var(--fg); letter-spacing: -.02em;
  margin: 10px 0 4px;
}
h2 {
  font-family: var(--font-display); color: var(--fg);
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.1;
  margin: 52px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); letter-spacing: -.01em;
}
.boat p { margin: 0 0 1.1em; }
.boat section { position: relative; }
blockquote {
  border-left: 3px solid var(--accent); margin: 1.4em 0; padding: .2em 1.2em;
  color: var(--muted); font-style: italic; font-size: 1.05em;
}
img.section-image {
  float: right; width: 46%; min-width: 260px; margin: 6px 0 18px 26px;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* brass first-letter drop cap on the overview */
.boat > section:first-of-type > div > p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 600; float: left;
  font-size: 3.4em; line-height: .78; padding: 6px 10px 0 0; color: var(--accent);
}

/* ---- specifications table ---------------------------------------------- */
.spec-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table th {
  text-align: left; width: 42%; padding: 11px 18px; vertical-align: top;
  font-family: var(--font-ui); font-weight: 500; font-size: 14px;
  color: var(--muted); letter-spacing: .02em; background: rgba(0,0,0,.015);
}
.spec-table td { padding: 11px 18px; font-weight: 500; }
.spec-table .spec-derived th { color: var(--accent); }
.spec-table .spec-derived td { color: var(--accent); }

/* ---- links / references ------------------------------------------------ */
ul.references { list-style: none; margin: 0; padding: 0; }
ul.references li {
  position: relative; padding-left: 1.4em; margin: 0 0 .7em; line-height: 1.55;
}
ul.references li::before {
  content: "»"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 600;
}
ul.references a { color: var(--accent); text-decoration: none; }
ul.references a:hover { text-decoration: underline; }

/* ---- gallery ----------------------------------------------------------- */
.masonry { column-count: 3; column-gap: 16px; margin-top: 8px; }
.galleryItem {
  display: inline-block; width: 100%; margin: 0 0 16px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  break-inside: avoid; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.galleryItem:hover { transform: scale(1.02); box-shadow: var(--shadow-hover); }
.galleryItem img { display: block; width: 100%; height: auto; }

/* ---- search results ---------------------------------------------------- */
.search-results { max-width: 760px; margin: 24px auto; }
h2.search-results {
  font-family: var(--font-display); text-align: center; border: none; color: var(--fg);
}
.search-results .result {
  display: flex; align-items: center; gap: 18px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 12px; box-shadow: var(--shadow); transition: border-color .2s, transform .2s;
}
.search-results .result:hover { border-color: var(--accent); transform: translateX(4px); }
.search-results .result img { width: 110px; }
.search-results .result a:last-child { font-family: var(--font-display); font-size: 20px; color: var(--fg); }

/* ---- footer ------------------------------------------------------------ */
footer { margin-top: 80px; color: var(--muted); font-family: var(--font-ui); }
footer hr { border: none; border-top: 1px solid var(--line); }

/* ---- lightbox / theater mode ------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 16, 18, .93); padding: 5vh 5vw;
}
.lightbox[hidden] { display: none; }
.lb-img {
  max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain;
  border-radius: 6px; box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: none;
  cursor: pointer; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; line-height: 1;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .3); }
.lb-close { top: 18px; right: 22px; width: 44px; height: 44px; font-size: 26px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 34px; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff;
  font-family: var(--font-ui); font-size: 13px; letter-spacing: .05em;
  background: rgba(0, 0, 0, .45); padding: 5px 13px; border-radius: 999px;
}
@media (max-width: 640px) {
  .lb-prev, .lb-next { width: 42px; height: 42px; font-size: 26px; }
}

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  body { padding: 0 16px 60px; font-size: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .masonry { column-count: 2; }
  img.section-image { float: none; width: 100%; min-width: 0; margin: 12px 0; display: block; }
}
