/* PiraeusFerries editorial style system (project-level)
   Tokens live in :root. Dark mode overrides them automatically.
   Components: site header, hero, article, TOC, tables, guide cards, pager, footer. */

:root {
  color-scheme: light dark;

  --color-ink: #102331;
  --color-body: #1a2b34;
  --color-lede: #2b414c;
  --color-muted: #5b6b73;
  --color-faint: #9aaab2;
  --color-bg: #ffffff;
  --color-surface: #fbfdfe;
  --color-footer: #fafcfd;
  --color-accent: #0a6179;
  --color-accent-hover: #074b5e;
  --color-accent-soft: #e9f7fa;
  --color-accent-soft-hover: #d7eef4;
  --color-selection: #cdeef4;
  --color-sand: #f6efe2;
  --color-panel: #f3f8fb;
  --color-border: #d6e1e7;
  --color-code-bg: #eef3f6;
  --color-code-ink: #11303c;
  --color-quote-ink: #06333f;
  --color-warning: #8a5300;
  --color-warning-bg: #fff8ec;
  --color-warning-border: #f0d2a2;
  --color-hero-from: #eef8fb;
  --color-hero-to: #fff7ed;
  --color-header-bg: rgba(255, 255, 255, 0.92);

  --radius: 12px;
  --radius-sm: 8px;
  --focus: #0a6179;
  --shadow: 0 10px 30px rgba(10, 44, 60, 0.06);
  --max-shell: 1160px;
  --max-article: 780px;
  --space: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-ink: #eef6f9;
    --color-body: #d5e3e9;
    --color-lede: #bfd3dc;
    --color-muted: #9bb2bc;
    --color-faint: #6f8792;
    --color-bg: #0e1a21;
    --color-surface: #13242d;
    --color-footer: #101f27;
    --color-accent: #6fd0e4;
    --color-accent-hover: #a6e6f2;
    --color-accent-soft: #123441;
    --color-accent-soft-hover: #184553;
    --color-selection: #235666;
    --color-sand: #2a2417;
    --color-panel: #142932;
    --color-border: #27434e;
    --color-code-bg: #1a2e38;
    --color-code-ink: #d5ecf3;
    --color-quote-ink: #d8f1f7;
    --color-warning: #f0bd6a;
    --color-warning-bg: #2a2214;
    --color-warning-border: #5a4524;
    --color-hero-from: #13303b;
    --color-hero-to: #2a2214;
    --color-header-bg: rgba(14, 26, 33, 0.92);
    --focus: #6fd0e4;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

::selection { background: var(--color-selection); color: var(--color-ink); }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  color: var(--color-body);
  background: var(--color-bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
a:hover { color: var(--color-accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

img, table, figure { max-width: 100%; }

.site-shell { max-width: var(--max-shell); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.site-header__inner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; min-height: 64px; flex-wrap: wrap; }
.brand { color: var(--color-ink); font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--color-accent); }
.top-nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.top-nav a { color: var(--color-muted); text-decoration: none; padding: .45rem .75rem; border-radius: 999px; font-size: .93rem; }
.top-nav a:hover { color: var(--color-ink); background: var(--color-panel); }

.site-main { max-width: var(--max-article); margin: 0 auto; padding: clamp(1.4rem, 3vw, 2.4rem) 20px 5rem; }

/* Breadcrumbs */
.breadcrumbs { margin: 0 0 1rem; color: var(--color-muted); font-size: .86rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .35rem; color: var(--color-faint); }
.breadcrumbs a { color: var(--color-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--color-ink); font-weight: 600; }

/* Hero: used on the homepage, guides index and every guide */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--color-accent) 14%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, var(--color-hero-from) 0%, var(--color-hero-to) 80%);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: clamp(1.3rem, 3.5vw, 2.4rem);
  margin: 0 0 2rem;
  box-shadow: var(--shadow);
}
.hero__eyebrow {
  margin: 0 0 .6rem;
  color: var(--color-accent);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.hero h1 { margin: 0 0 .8rem; color: var(--color-ink); font-size: clamp(1.9rem, 4vw, 2.8rem); }
.hero .lede,
.hero__lede { color: var(--color-lede); font-size: clamp(1.02rem, 1rem + .3vw, 1.14rem); line-height: 1.6; max-width: 62ch; margin: 0 0 .4rem; }
.hero .article-meta { margin: .4rem 0 1rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.3rem 0 0; }

.btn {
  display: inline-block;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--color-accent-hover); color: #ffffff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--color-accent); border: 1px solid var(--color-accent); }
.btn--ghost:hover { background: var(--color-accent-soft); color: var(--color-accent-hover); }

.article > h1:first-child { margin-top: 0; }

/* Article meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .9rem;
  margin: .15rem 0 .8rem;
  color: var(--color-muted);
  font-size: .88rem;
}
.article-meta__read::before { content: "·"; margin-right: .9rem; color: var(--color-faint); }
.article-meta__category {
  margin-left: auto;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: 999px;
  padding: .18rem .6rem;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.article-meta__category:hover { background: var(--color-accent-soft-hover); color: var(--color-accent-hover); }

/* Table of contents */
.toc {
  margin: 1.3rem 0 1.9rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.toc__title {
  margin-bottom: .5rem;
  color: var(--color-muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.toc ol { columns: 2; column-gap: 1.8rem; margin: 0; padding-left: 1.15rem; }
.toc li { break-inside: avoid; margin: .22rem 0; font-size: .93rem; line-height: 1.45; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Typography */
h1, h2, h3 { color: var(--color-ink); text-wrap: balance; scroll-margin-top: 5.5rem; }
h1 { font-size: clamp(1.85rem, 3.1vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; }
h2 {
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem);
  line-height: 1.25;
  margin: 2.3rem 0 .8rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--color-border);
}
h3 { font-size: clamp(1.06rem, 1rem + .25vw, 1.18rem); line-height: 1.35; margin: 1.65rem 0 .55rem; }

p { margin: 0 0 1rem; text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 2rem 0; }
ul, ol { margin: .35rem 0 1.1rem; padding-left: 1.35rem; }
li { margin: .3rem 0; }
li > p { margin: 0 0 .45rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 560px; border-collapse: collapse; margin: 0; font-size: .95rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
th { background: var(--color-panel); color: var(--color-ink); font-weight: 700; }
tr:nth-child(even) td { background: var(--color-surface); }
tr:last-child td { border-bottom: none; }

/* Quotes, code and callouts */
blockquote {
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
  margin: 1.4rem 0;
  padding: 14px 18px;
  color: var(--color-quote-ink);
}
blockquote p:last-child { margin-bottom: 0; }

code { background: var(--color-code-bg); color: var(--color-code-ink); padding: .12rem .35rem; border-radius: 4px; font-size: .9em; }
pre code { display: block; padding: 1rem; overflow-x: auto; line-height: 1.5; }

.callout-warning {
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 1.2rem 0;
}
.checklist { list-style: none; padding-left: 0; }
.checklist li::before { content: "☐"; color: var(--color-accent); margin-right: .55rem; }

/* Pager */
.pager {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  background: var(--color-footer);
  padding: 2.5rem 20px;
  margin-top: 3rem;
  font-size: .9rem;
}
.site-footer .site-shell { display: grid; gap: .4rem; }

/* Guide cards (guides index) */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .75rem; margin: 1rem 0 2rem; }
.guide-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--color-panel);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.guide-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.guide-card strong { display: block; color: var(--color-ink); line-height: 1.35; }
.guide-card small { display: block; color: var(--color-muted); margin-top: .35rem; line-height: 1.5; }
.guide-section { margin: 2.2rem 0 0; }
.guide-section h2 { margin-top: 0; }
.guide-section[id] { scroll-margin-top: 5.5rem; }

/* Accessibility */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 20px; top: 18px; background: var(--color-accent); color: #ffffff; padding: 8px 12px; border-radius: 6px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header__inner { align-items: flex-start; }
  .hero { border-radius: 14px; }
  table { font-size: .88rem; }
  .breadcrumbs { font-size: .8rem; }
  .breadcrumbs ol { gap: .2rem; }
  .breadcrumbs li:last-child { flex-basis: 100%; margin-top: .15rem; }
  .article-meta__category { margin-left: 0; }
  .toc ol { columns: 1; }
  .site-main { padding-left: 16px; padding-right: 16px; }
}

/* Print: readable on paper, no navigation chrome */
@media print {
  :root { color-scheme: light; }
  body { background: #ffffff; color: #000000; font-size: 11pt; }
  .site-header, .site-footer, .pager, .breadcrumbs, .toc, .hero__actions, .skip-link { display: none !important; }
  .hero { box-shadow: none; background: none; border: 0; padding: 0; }
  a { color: #000000; text-decoration: underline; }
  h2 { break-after: avoid; }
  .table-wrap { border: 0; overflow: visible; }
  table { min-width: 0; font-size: 9.5pt; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Photo under the hero */
.hero-photo { margin: 1.4rem 0 1.6rem; }
.hero-photo img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-accent-soft); }
