/* ==========================================================================
   Navitie Oy – shared stylesheet
   Mobile-first: base styles target small screens, media queries scale up.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fonts – Inter, self-hosted (fonts/, SIL OFL 1.1, see fonts/OFL.txt)
   Two subsets per weight; the browser only downloads the ones a page uses.
   Basic Latin covers Finnish (ä ö å); Latin Extended covers other accents.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --navy: #1a3a5c;          /* primary brand colour (matches logo) */
  --navy-dark: #122a43;     /* hover / pressed states */
  --navy-light: #2a5584;    /* subtle accents */
  --grey-bg: #f5f6f8;       /* alternating section background */
  --border: #e1e4ea;
  --text: #1f2933;
  --text-muted: #5b6675;
  --white: #ffffff;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(18, 42, 67, 0.08);
  --shadow-hover: 0 8px 24px rgba(18, 42, 67, 0.16);

  --container: 1200px;
  --gutter: 1rem;
  --nav-height: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.75rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--navy);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--navy);
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--navy-light);
  outline-offset: 2px;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard users can jump straight to the content */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 3rem 0;
}

.section--grey {
  background: var(--grey-bg);
}

.section__title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Short navy bar under section headings */
.section__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 0.6rem;
  background: var(--navy);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. Header & navigation (sticky)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.site-logo img {
  height: 56px;
  width: auto;
}

/* Hamburger button – only shown on small screens */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Morph bars into an "X" when the menu is open */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu: drops down below the bar */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-nav.is-open {
  display: block;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem var(--gutter) 1rem;
}

.site-nav__link {
  display: block;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.site-nav__list li:last-child .site-nav__link {
  border-bottom: 0;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--navy);
}

.site-nav__link[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--navy);
  padding-left: 0.85rem;
}

/* No-JS fallback: always show the menu inline */
.no-js .nav-toggle {
  display: none;
}
.no-js .site-nav {
  display: block;
  position: static;
  box-shadow: none;
  border: 0;
}

/* --------------------------------------------------------------------------
   5. Hero (index.html)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 4rem 0;
  text-align: center;
  color: var(--white);
  background: var(--navy) url("images/hero-hinaaja-auringonlasku.jpg") center / cover no-repeat;
}

/* Dark navy overlay keeps the white text readable */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 42, 67, 0.55) 0%, rgba(26, 58, 92, 0.75) 100%);
}

.hero__content {
  position: relative; /* sits above the overlay */
  max-width: 820px;
}

.hero__title {
  font-size: 2.5rem;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero__tagline {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 auto;
  max-width: 680px;
}

/* --------------------------------------------------------------------------
   6. Page header (sub-pages)
   -------------------------------------------------------------------------- */
.page-header {
  padding: 2.5rem 0;
  background: var(--navy);
  color: var(--white);
}

.page-header__title {
  margin: 0;
  font-size: 2rem;
  color: var(--white);
}

/* --------------------------------------------------------------------------
   7. Service cards (index.html)
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  background: var(--navy);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Shift the crop left when the subject sits near the left edge */
.card--focus-left img {
  object-position: 20% center;
}

.card:hover img {
  transform: scale(1.05);
}

/* Title overlay along the bottom of the image */
.card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 3rem 1.25rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(0deg, rgba(18, 42, 67, 0.92) 0%, rgba(18, 42, 67, 0) 100%);
}

/* --------------------------------------------------------------------------
   8. About section (index.html)
   -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.about__lead {
  font-size: 1.125rem;
  color: var(--text);
}

.fleet-summary {
  padding: 1.75rem;
  background: var(--white);
  border-radius: var(--radius);
  border-top: 4px solid var(--navy);
  box-shadow: var(--shadow);
}

.fleet-summary__title {
  font-size: 1.25rem;
}

.fleet-summary__title a {
  text-decoration: none;
}

.fleet-summary__title a:hover {
  text-decoration: underline;
}

.fleet-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fleet-summary li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fleet-summary li:last-child {
  border-bottom: 0;
}

/* Navy square bullet */
.fleet-summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 8px;
  height: 8px;
  background: var(--navy);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   9. Image galleries (kalusto.html, media.html)
   -------------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item {
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.gallery__item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Each image is a button that opens the lightbox */
.gallery__link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--grey-bg);
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.gallery__link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__caption {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   10. Video cards (media.html)
   Thumbnail is local; the YouTube player only loads after a click.
   -------------------------------------------------------------------------- */
.videos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.video {
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.video__frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video__frame img,
.video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* The whole thumbnail is the play link */
.video__link {
  position: absolute;
  inset: 0;
}

/* Round navy play button */
.video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(26, 58, 92, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.video__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--white);
}

.video__link:hover .video__play,
.video__link:focus-visible .video__play {
  background: var(--navy-dark);
  transform: translate(-50%, -50%) scale(1.08);
}

.video__caption {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   11. Lightbox (shared by galleries)
   -------------------------------------------------------------------------- */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 22, 36, 0.94);
}

.lightbox::backdrop {
  background: rgba(10, 22, 36, 0.94);
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: 4rem 1rem 2rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__caption {
  margin-top: 0.75rem;
  color: var(--white);
  font-weight: 600;
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font: 600 1.5rem/1 var(--font);
  cursor: pointer;
}

.lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev  { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* --------------------------------------------------------------------------
   12. Contact page
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.contact-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-card {
  padding: 1.5rem;
  background: var(--white);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-card__title {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  overflow-wrap: anywhere; /* long compound words must wrap on phones */
}

.contact-card__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0;
}

.contact-card__row svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--navy);
}

.contact-card a {
  font-weight: 600;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* Form */
.form {
  padding: 1.75rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form__field {
  margin-bottom: 1.25rem;
}

.form__label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.form__input {
  display: block;
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--white);
  border: 1px solid #c9ced8;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.18);
}

/* Honeypot field: off-screen for people, still present for bots */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Result notices from laheta.php – hidden until targeted by the URL hash */
.form-notice {
  display: none;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  scroll-margin-top: calc(var(--nav-height) + 1rem); /* clear the sticky header */
}

.form-notice:target {
  display: block;
}

.form-notice--ok {
  color: var(--navy-dark);
  background: #e6f0fa;
  border-left: 4px solid var(--navy);
}

.form-notice--error {
  color: #7a1c1c;
  background: #fdecec;
  border-left: 4px solid #b42318;
}

textarea.form__input {
  min-height: 160px;
  resize: vertical;
}

/* --------------------------------------------------------------------------
   13. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  font: 600 1rem/1.2 var(--font);
  color: var(--white);
  background: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2rem 0;
  background: var(--navy);
  color: var(--white);
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.85;
}

.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.site-footer__copy {
  margin: 0;
  opacity: 0.85;
}

/* Low-key "Powered by" line: smaller and more muted than the copyright */
.site-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.6;
}

.site-footer__credit img {
  height: 19px;
  width: auto;
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

/* Small tablets */
@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__title {
    font-size: 3.25rem;
  }

  .hero__tagline {
    font-size: 1.25rem;
  }
}

/* Tablets & up: show the full menu, hide the hamburger */
@media (min-width: 860px) {
  :root {
    --gutter: 1.5rem;
    --nav-height: 88px;
  }

  .site-logo img {
    height: 68px;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav,
  .no-js .site-nav {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .site-nav__list {
    display: flex;
    gap: 0.25rem;
    padding: 0;
  }

  .site-nav__link {
    position: relative;
    padding: 0.5rem 1rem;
    border-bottom: 0;
    border-radius: 6px;
  }

  .site-nav__link:hover {
    background: var(--grey-bg);
  }

  /* Active page: navy underline instead of side bar */
  .site-nav__link[aria-current="page"] {
    box-shadow: none;
    padding-left: 1rem;
  }

  .site-nav__link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.15rem;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section__title {
    font-size: 1.75rem;
  }

  .page-header {
    padding: 3.5rem 0;
  }

  .page-header__title {
    font-size: 2.5rem;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .about {
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
  }

  .videos {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact {
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
  }

  .lightbox__prev { left: 1.5rem; }
  .lightbox__next { right: 1.5rem; }
}

/* Desktops */
@media (min-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Fleet groups with four boats fit on one row */
  .gallery--four {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero {
    min-height: 78vh;
  }

  .hero__title {
    font-size: 4rem;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Keep phone numbers on one line */
.nowrap {
  white-space: nowrap;
}

.form-notice a {
  color: inherit;
}

/* Small privacy note under the send button */
.form__privacy {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
