/* Divefolio website: one stylesheet, no JavaScript, no third-party request.
   Fonts are self-hosted (SIL Open Font Licence 1.1, licence files next to them in fonts/). */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-VF.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-VF.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #faf9f5;
  --card: #ffffff;
  --border: #e7e5e4;
  --chip: #f5f5f4;
  --navy: #0f2942;
  --heading: #071828;
  --text: #1e293b;
  --body: #475569;
  --muted: #64748b;
  --link: #0369a1;
  --focus: #0284c7;
  --todo-bg: #fef3c7;
  --todo-text: #78350f;
  --todo-border: #d97706;
  --note-bg: #f5f5f0;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071828;
    --card: #0f2942;
    --border: #1f3b58;
    --chip: #12324f;
    --navy: #e2e8f0;
    --heading: #f8fafc;
    --text: #f1f5f9;
    --body: #cbd5e1;
    --muted: #94a3b8;
    --link: #7dd3fc;
    --focus: #7dd3fc;
    --todo-bg: #422006;
    --todo-text: #fde68a;
    --todo-border: #b45309;
    --note-bg: #0b2038;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute;
  left: 16px;
  top: -4rem;
  background: var(--navy);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 8px; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--heading);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand img { width: 40px; height: 40px; display: block; }
/* Phone: brand + language on the first row, navigation below; wide: one row */
.nav-row { display: contents; }
.brand { order: 1; }
.lang-switch { order: 2; }
.site-nav { order: 3; flex-basis: 100%; }
@media (min-width: 40.01rem) {
  .site-nav { order: 2; flex-basis: auto; }
  .lang-switch { order: 3; }
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a,
.lang-switch a {
  display: inline-block;
  padding: 0.5rem 0.62rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  min-height: 44px;
  line-height: 1.7;
}
.site-nav a:hover,
.lang-switch a:hover { background: var(--chip); }
.site-nav a[aria-current="page"] { background: var(--chip); color: var(--heading); font-weight: 700; }
.lang-switch a { border: 1px solid var(--border); }

/* Content */
main { padding-top: 2rem; padding-bottom: 3rem; }

h1, h2, h3 { color: var(--heading); font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.1rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.5rem; margin: 2.4rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.4rem; }
p, ul, ol, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
strong { color: var(--text); }
code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 0.9em;
  background: var(--chip);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.lead { font-size: 1.15rem; color: var(--text); max-width: 38rem; }
.meta { color: var(--muted); font-size: 0.92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 1rem;
}
.card > :last-child { margin-bottom: 0; }
.card h3:first-child { margin-top: 0; }

.notice {
  background: var(--note-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 1.5rem 0;
  color: var(--text);
}
.notice p:last-child { margin-bottom: 0; }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 1rem 0 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards .card { height: 100%; margin: 0; }
.cards h3 { font-size: 1.1rem; margin: 0 0 0.3rem; }
.cards p { font-size: 0.97rem; }

/* Placeholders the owner must fill (see README.md) */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border: 1px dashed var(--todo-border);
  border-radius: 6px;
  padding: 0.05em 0.4em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.store { margin: 1.25rem 0 0; }

/* Screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.shots li { margin: 0; }
.shots figure { margin: 0; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--chip);
}
.shots figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; line-height: 1.4; }

/* Tables: stacked on a phone */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table caption { text-align: left; color: var(--muted); font-size: 0.92rem; padding-bottom: 0.5rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table thead th { color: var(--heading); font-weight: 700; background: var(--chip); }
.table tbody th { color: var(--heading); font-weight: 700; }
.table td { overflow-wrap: anywhere; }

@media (max-width: 40rem) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table, .table caption, .table tbody, .table tr, .table th, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 6px 0;
  }
  .table th, .table td { border-bottom: 0; padding: 6px 14px; }
  .table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
  }
  .table tbody th { font-size: 1.05rem; padding-top: 10px; }
}

@media (min-width: 40.01rem) {
  h1 { font-size: 2.6rem; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .shots { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 20px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2.5rem; font-size: 0.92rem; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-footer a { color: var(--link); }
.site-footer p { margin: 0 0 0.5rem; }

@media print {
  .site-nav, .lang-switch, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* Home: logo beside the title */
.hero { display: flex; align-items: center; gap: 1rem; margin: 0 0 0.75rem; }
.hero img { width: 72px; height: 72px; flex: none; }
.hero h1 { margin: 0; }
@media (min-width: 40.01rem) { .hero img { width: 88px; height: 88px; } }

/* Screenshots: a tap opens the full-size view (CSS :target); a tap anywhere but the arrows closes it; ← → and Échap in assets/lightbox.js */
.shot-open { display: block; border-radius: 14px; cursor: zoom-in; }
.shot-open:hover img, .shot-open:focus-visible img { border-color: var(--link); }
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(7, 24, 40, 0.92);
  align-items: center;
  justify-content: center;
  padding: 16px 52px;
}
.lightbox:target { display: flex; }
.lightbox-close { position: absolute; inset: 0; padding: 16px 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; cursor: zoom-out; text-decoration: none; }
.lightbox-close img { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); max-width: 100%; width: auto; height: auto; border-radius: 18px; display: block; }
.lightbox-caption { color: #faf9f5; font-size: 0.95rem; text-align: center; }
.lightbox-prev, .lightbox-next {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf9f5;
  background: rgba(250, 249, 245, 0.14);
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(250, 249, 245, 0.28); }
