/* MetOcean Consult — site styles. No scripts, no external fonts. */

:root {
  --navy: #002E41;
  --blue: #1A5F80;
  --sky: #AACCFF;
  --tint: #EAF1FB;
  --rule: #CBD8E6;
  --text: #2B3338;
  --muted: #5F6B73;
  --bg: #FFFFFF;
  --wrap: 72rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.75 Verdana, Geneva, "DejaVu Sans", sans-serif;
}

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

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

h1, h2, h3 { color: var(--navy); font-weight: normal; line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
p { margin: 0 0 1rem; }

ul.ticks { padding-left: 1.2rem; margin: 0 0 1rem; }
ul.ticks li::marker { color: var(--blue); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; }

/* ---------- header ---------- */

.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 6rem; }
.brand img { width: 220px; }

.nav { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.nav > li { position: relative; }
.nav a { display: block; padding: .6rem .9rem; color: var(--navy); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--sky); }
.nav .sub { display: none; position: absolute; right: 0; top: 100%; z-index: 5; min-width: 15rem;
  margin: 0; padding: .4rem 0; list-style: none; background: var(--bg); border: 1px solid var(--rule); }
.nav .sub a { padding: .45rem 1rem; }
.nav .sub a:hover, .nav .sub a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--sky); }
.nav > li:hover .sub, .nav > li:focus-within .sub { display: block; }

.menu { display: none; }

@media (max-width: 760px) {
  .top .wrap { min-height: 4.5rem; flex-wrap: wrap; }
  .brand img { width: 170px; }
  .top nav { display: none; }
  .menu { display: block; }
  .menu summary { cursor: pointer; list-style: none; padding: .5rem .8rem; border: 1px solid var(--rule); color: var(--navy); }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: var(--tint); }
  .menu-list { position: absolute; left: 0; right: 0; z-index: 5; margin: 0; padding: .5rem 1.5rem 1rem;
    list-style: none; background: var(--bg); border-bottom: 1px solid var(--rule); }
  .menu-list a { display: block; padding: .55rem 0; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--tint); }
  .menu-list .in { padding-left: 1.25rem; }
}

/* ---------- home ---------- */

.hero { margin: 0; background: var(--tint); }
.hero img { width: 100%; max-width: 1400px; margin: 0 auto; }
.hero figcaption { max-width: var(--wrap); margin: 0 auto; padding: .4rem 1.5rem; font-size: .8rem; color: var(--muted); }

.intro { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; padding: 3rem 0 1rem; }
.intro .lead { font-size: 1.15rem; line-height: 1.7; color: var(--navy); }
.intro aside { border-left: 3px solid var(--sky); padding-left: 1.5rem; align-self: start; }
.intro aside p { margin-bottom: .5rem; }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.three h2 { margin-top: 1rem; font-size: 1.2rem; }

.band { background: var(--tint); padding: 1px 0 3rem; margin-top: 3rem; }

.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.service { display: grid; grid-template-columns: 9rem 1fr; gap: 1.25rem; background: var(--bg); padding: 1.25rem; border: 1px solid var(--rule); }
.service img { width: 9rem; height: 9rem; object-fit: cover; }
.service h3 { margin: 0 0 .4rem; }
.service p { font-size: .9rem; line-height: 1.65; margin-bottom: .5rem; }

.work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.work figure { margin: 0; }
.work img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--rule); }
.work figcaption { margin-top: .5rem; font-size: .85rem; color: var(--muted); }

.talk { padding: 3rem 0 1rem; max-width: 46rem; }

@media (max-width: 900px) {
  .intro, .three, .services, .work { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
  .service { grid-template-columns: 1fr; }
  .service img { width: 100%; height: 10rem; }
}

/* ---------- service pages ---------- */

.page { display: grid; grid-template-columns: 14rem 1fr; gap: 3.5rem; padding-block: 3rem; }
.side ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); position: sticky; top: 7.5rem; }
.side a { display: block; padding: .6rem 0 .6rem .75rem; border-bottom: 1px solid var(--rule); color: var(--navy); text-decoration: none; font-size: .9rem; }
.side a:hover { background: var(--tint); }
.side a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--blue); color: var(--blue); }

.lead { font-size: 1.1rem; color: var(--navy); }

.part { display: grid; grid-template-columns: 1fr 20rem; gap: 2.5rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.part > div > h2:first-child { margin-top: 0; }
.part figure, .figs figure { margin: 0; }
.part figcaption, .figs figcaption { margin-top: .5rem; font-size: .82rem; line-height: 1.5; color: var(--muted); }
.part img, .figs img { border: 1px solid var(--rule); }

.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }

.toc { columns: 2; padding-left: 1.2rem; }

@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2rem; }
  .side { order: 2; }
  .part { grid-template-columns: 1fr; gap: 1.25rem; }
  .part figure { max-width: 26rem; }
}

/* ---------- contact, text pages ---------- */

.contact { font-size: 1.2rem; line-height: 2; margin: 1.5rem 0 2rem; }
.contact a { color: var(--navy); }
.text { max-width: 46rem; padding-block: 3rem; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 1.5rem 0 2rem; font-size: .85rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.foot a { color: var(--muted); }
.foot p { margin: 0; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .top nav, .menu, .side { display: none; } }

/* ---------- services page (one page, sections) ---------- */

.sec { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--navy); scroll-margin-top: 7.5rem; }
.sec > h2 { margin-top: 0; font-size: 1.6rem; }
.part > div > h3:first-child { margin-top: 0; font-size: 1.15rem; }
.part > div:only-child { grid-column: 1 / -1; max-width: 46rem; }
.stack { display: grid; gap: 1.25rem; align-content: start; }

.service--talk { grid-template-columns: 1fr; background: var(--navy); border-color: var(--navy); color: #fff; }
.service--talk h3 { color: #fff; }
.service--talk a { color: var(--sky); }

@media (max-width: 900px) {
  .side { order: 0; }
  .side ul { position: static; columns: 2; column-gap: 1.5rem; border-top: 0; }
  .side li { break-inside: avoid; }
}
@media (max-width: 480px) { .side ul { columns: 1; } }

/* sticky header: keep jump targets clear of it */
#services, #main { scroll-margin-top: 7.5rem; }
.service--talk { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .sec, #services, #main { scroll-margin-top: 5.5rem; }
  .menu-list { max-height: calc(100vh - 5rem); overflow-y: auto; }
}

/* ---------- services overview: tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 2.5rem; margin-top: 2.5rem; }
.tile { display: grid; grid-template-columns: 10rem 1fr; gap: 1.25rem; align-items: start; }
.tile__img { display: block; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--rule); background: var(--bg); }
.tile__img img { width: 100%; height: 100%; object-fit: cover; }
.tile__img--type { display: flex; align-items: flex-end; padding: .9rem; background: var(--navy); border-color: var(--navy);
  color: var(--sky); text-decoration: none; font-size: .78rem; line-height: 1.5; }
.tile h2, .tile h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.tile h2 a, .tile h3 a { color: var(--blue); text-decoration: none; }
.tile h2 a:hover, .tile h3 a:hover { text-decoration: underline; }
.tile p { font-size: .9rem; line-height: 1.65; margin-bottom: .6rem; }
.tools { list-style: none; margin: 0; padding: 0; font-style: italic; font-size: .88rem; line-height: 1.6; color: var(--muted); }

.tiles--small { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.tile--small { grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 1rem; background: var(--bg); border: 1px solid var(--rule); }
.tile--small h3 { font-size: 1rem; margin-bottom: .3rem; }
.tile--small p { font-size: .84rem; line-height: 1.55; margin: 0; }
.tile--small .tile__img--type span { display: none; }
.tiles--small .service--talk { grid-column: auto; padding: 1rem 1.25rem; }
.tiles--small .service--talk p { font-size: .88rem; margin-bottom: .4rem; }

/* figure still to be supplied */
.ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 1rem;
  border: 2px dashed var(--rule); background: var(--tint); color: var(--muted); font-size: .85rem; text-align: center; }

.next { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted); }
.side a.ov { font-weight: bold; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr; gap: 2rem; }
  .tiles--small { grid-template-columns: repeat(2, 1fr); }
  .side ul { display: flex; flex-wrap: wrap; gap: .4rem; columns: auto; border-top: 0; }
  .side a { padding: .3rem .65rem; border: 1px solid var(--rule); font-size: .82rem; }
  .side a[aria-current="page"] { box-shadow: none; background: var(--navy); border-color: var(--navy); color: #fff; }
}
@media (max-width: 560px) {
  .tiles--small { grid-template-columns: 1fr; }
  .tile { grid-template-columns: 6.5rem 1fr; gap: 1rem; }
}

/* training: the teaser line of each book/course */
.part .teaser { color: var(--navy); font-size: 1.05rem; }

/* home: one photo under each of the three columns, aligned at the bottom */
.three > section { display: flex; flex-direction: column; }
.three > section > img { margin-top: auto; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.three > section > p:last-of-type { margin-bottom: 1.25rem; }
