/* Ocean Solutions: shared styles for every page (public pages, members area, sign-in pages).
   Follows the Ocean Vital Signs Network site (ovsn.whoi.edu): Tide Sans for text, Montserrat for the
   main menu, Red Hat Display as the fallback, navy headings, WHOI blues, light pages.
   All fonts are served from this site. */

@font-face {
  font-family: "Red Hat Display";
  src: url("/assets/fonts/RedHatDisplay-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/assets/fonts/RedHatDisplay-latin-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

/* Tide Sans by Kyle Wayne Benson (Fontspring web font licence, 10,000 pageviews/month across all sites using it).
   The typeface used on ovsn.whoi.edu. Licence and full download: Brown-Web/Fonts/TideSans. */

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-300LilKahuna-webfont.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-300LilKahunaItalic-webfont.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-400LilDude-webfont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-400LilDudeItalic-webfont.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-500Dudette-webfont.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-500DudetteItalic-webfont.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-600Bunny-webfont.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-600BunnyItalic-webfont.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-700Mondo-webfont.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TideSans";
  src: url("/assets/fonts/tidesans/TideSans-700MondoItalic-webfont.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Montserrat (SIL Open Font License): used for the main menu, as on ovsn.whoi.edu. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat/Montserrat-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #041e42;
  --blue: #0069b1;
  --blue-dark: #00548e;
  --blue-2: #2b7bb9;
  --cyan: #00a9e0;
  --teal: #00b7bd;
  --text: #000000;
  --muted: #555b63;
  --line: #e1e4e8;
  --field-line: #b8bcc2;
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --err-bg: #fdecec;
  --err: #8a1f1f;
  --note-bg: #e6f4fa;
  --note: #0b4a6b;
  --font: "TideSans", "Red Hat Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-menu: "Montserrat", "TideSans", "Red Hat Display", Helvetica, Arial, sans-serif;
  --radius: 6px;
  --wrap: 1100px;
  --gutter: 20px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
b, strong { font-weight: 600; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

h1, h2, h3, h4 { color: var(--navy); font-weight: 500; line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: clamp(1.9rem, 5.6vw, 3rem); font-weight: 400; letter-spacing: normal; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); font-weight: 400; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 16px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-right)); }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; color: var(--navy); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; color: #fff; text-decoration: none; padding: 10px 0; line-height: 1.15; }
.brand:hover { color: #fff; }
.brand-name { font-size: 1.3rem; font-weight: 500; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-list a, .nav-list .nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius);
  color: #fff; text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav-list a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--cyan); border-radius: 0; }
.nav-account[hidden] { display: none !important; }
.nav-account .avatar { width: 30px; height: 30px; font-size: 0.75rem; }

@media (max-width: 760px) {
  .nav-button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; cursor: pointer;
    color: #fff; font-weight: 500; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius);
  }
  .nav-button::before { content: ""; width: 18px; height: 12px; background:
      linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat, linear-gradient(#fff, #fff) 0 5px / 100% 2px no-repeat,
      linear-gradient(#fff, #fff) 0 10px / 100% 2px no-repeat; }
  .nav-toggle:focus-visible + .nav-button { outline: 3px solid var(--cyan); outline-offset: 2px; }
  .site-nav { flex-basis: 100%; }
  .nav-list { display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 12px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
  .nav-toggle:checked ~ .site-nav .nav-list { display: flex; }
  .nav-list a, .nav-list .nav-item { min-height: 48px; font-size: 1rem; }
  .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--cyan); }
}

/* ---------------------------------------------------------------- hero (landing page) */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, var(--navy) 0%, #06315f 55%, var(--blue) 100%);
  padding: clamp(56px, 12vw, 120px) 0 clamp(96px, 16vw, 160px);
}
.hero h1 { color: #fff; max-width: 14ch; }
.hero .eyebrow { color: var(--cyan); }
.hero .lead { color: #fff; font-size: clamp(1rem, 2.2vw, 1.1rem); font-weight: 300; max-width: 42em; }
.hero p { color: rgba(255, 255, 255, 0.85); max-width: 40em; }
.hero a:not(.btn) { color: #fff; }
.hero .waves { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; pointer-events: none; }
.hero .waves svg { display: block; width: 200%; height: 100%; animation: drift 24s linear infinite; }
.hero .waves path { fill: rgba(255, 255, 255, 0.12); }
.hero .waves svg + svg { position: absolute; bottom: 0; animation-duration: 36s; animation-direction: reverse; }
.hero .waves svg + svg path { fill: var(--bg); }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hero .waves svg { animation: none; } }

.eyebrow { margin: 0 0 12px; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.lead { font-size: 1.05rem; font-weight: 300; }

/* ---------------------------------------------------------------- buttons */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border-radius: var(--radius); border: 1px solid var(--blue); background: var(--blue); color: #fff;
  font: inherit; font-weight: 500; font-size: 15px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.btn:hover, button:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.secondary, button.secondary { background: transparent; color: var(--blue); }
.btn.secondary:hover, button.secondary:hover { background: var(--note-bg); color: var(--blue-dark); }
.btn.light { background: #fff; border-color: #fff; color: var(--navy); }
.btn.light:hover { background: #e8f6fc; border-color: #e8f6fc; color: var(--navy); }
.btn.outline-light { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.btn.outline-light:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn.danger, button.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.danger:hover, button.danger:hover { background: var(--err-bg); }
.btn.block, button.block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 480px) { .actions .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- page sections */
main { flex: 1 0 auto; }
.section { padding: clamp(40px, 7vw, 72px) 0; }
.section.alt { background: var(--bg-alt); }
.page-main { padding: clamp(28px, 6vw, 56px) 0 clamp(40px, 8vw, 72px); }
.prose { max-width: 46em; }
.prose h2 { margin-top: 36px; font-size: 1.35rem; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin: 0 0 10px; }
.meta { color: var(--muted); font-size: 0.95rem; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: 22px; }
.tile h3 { margin-bottom: 8px; }
.tile p { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------- cards and forms */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 5vw, 32px); box-shadow: 0 1px 2px rgba(4, 30, 66, 0.06); }
.auth-main { padding: clamp(24px, 6vw, 56px) 0 clamp(40px, 8vw, 72px); }
.auth-main .card { max-width: 460px; margin: 0 auto; }
.auth-main .card.wide { max-width: var(--wrap); }
.card h1 { font-size: clamp(1.5rem, 4.6vw, 1.85rem); }
.card .site { display: none; }
label { display: block; margin: 0 0 16px; font-size: 0.95rem; font-weight: 500; color: var(--navy); }
input[type=email], input[type=password], input[type=text], input:not([type]), input[type=file] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; min-height: 48px;
  border: 1px solid var(--field-line); border-radius: var(--radius); background: #fff; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 400;
}
input[type=file] { padding: 10px; }
input:focus { outline: 3px solid rgba(0, 169, 224, 0.45); outline-offset: 0; border-color: var(--cyan); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--text); min-height: 44px; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; }
form button[type=submit] { width: 100%; }
.hint { margin: 8px 0 18px; color: var(--muted); font-size: 0.88rem; text-align: center; }
.or { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; color: var(--muted); font-size: 0.88rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.links { margin: 18px 0 0; text-align: center; font-size: 0.95rem; }
.links a { display: inline-block; padding: 10px 6px; }
.error, .note { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 18px; font-size: 0.95rem; font-weight: 400; }
.error { background: var(--err-bg); color: var(--err); }
.note { background: var(--note-bg); color: var(--note); }
.block-section { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.block-section h2 { font-size: 1.1rem; margin: 0 0 10px; }

/* Google and Microsoft buttons */
.btn.provider { width: 100%; background: #fff; color: #1f1f1f; border-color: #747775; font-weight: 500; }
.btn.provider:hover { background: #f2f2f2; color: #1f1f1f; }
.btn.provider svg { width: 20px; height: 20px; flex: none; }

/* in-page navigation on account pages */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 20px; font-size: 0.95rem; }
.subnav a { display: inline-block; padding: 8px 0; }

/* people */
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex;
  align-items: center; justify-content: center; background: var(--blue); color: #fff; font-weight: 600; font-size: 1.4rem;
}
.avatar.small { width: 44px; height: 44px; font-size: 0.9rem; }
.who { display: flex; align-items: center; gap: 16px; margin: 0 0 22px; }
.who .email, .email { color: var(--muted); font-size: 0.9rem; word-break: break-word; }

/* member list: a table on wide screens, cards on phones */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--navy); font-weight: 600; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--note-bg); color: var(--note); font-size: 0.75rem; font-weight: 600; }
.badge.warn { background: var(--err-bg); color: var(--err); }
@media (max-width: 700px) {
  table.members thead { display: none; }
  table.members, table.members tbody, table.members tr, table.members td { display: block; width: 100%; }
  table.members tr { display: grid; grid-template-columns: 52px 1fr; column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.members td { border: 0; padding: 2px 0; }
  table.members td.photo { grid-row: span 5; }
  table.members td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; padding: 28px 0 max(28px, env(safe-area-inset-bottom)); margin-top: auto; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer a { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-block; padding: 8px 0; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* fixes after phone testing */
.nav-button { margin: 0; }
.nav-list .avatar { width: 30px; height: 30px; font-size: 0.75rem; }
.footer-links a, .subnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
@media (max-width: 760px) { .header-inner { row-gap: 0; } }
.brand { flex: 1 1 0%; min-width: 0; }
.nav-button { flex: none; }
@media (max-width: 360px) { .brand-sub { letter-spacing: 0.06em; } .brand-name { font-size: 1.15rem; } }
.header-inner { align-content: center; }

/* main menu in Montserrat, as on ovsn.whoi.edu */
.nav-list a, .nav-list .nav-item, .nav-button { font-family: var(--font-menu); font-weight: 500; font-size: 15px; }
@media (max-width: 760px) { .nav-list a, .nav-list .nav-item { font-size: 16px; } }
