/* ============================================
   KAJAKIEM PO WENECJI
   Giornale — Classic newspaper style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,700&display=swap');

:root {
  --primary: #1a1a1a;
  --primary-light: #555;
  --accent: #8b0000;
  --accent-light: #a03020;
  --bg: #f4efe4;
  --bg-dark: #d4ccb8;
  --bg-card: #faf6ee;
  --ink: #1a1a1a;
  --ink-light: #444;
  --ink-faint: #888;
  --red: #8b0000;
  --green: #2a6a2a;
  --amber: #8b6508;
  --font: 'Lora', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: .92rem;
  -webkit-font-smoothing: antialiased;
}

/* ── NAVIGATION ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  border-bottom: 2px solid var(--accent);
}

nav .nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

nav .nav-brand {
  font-family: var(--font);
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
  font-style: italic;
  text-decoration: none;
  padding: .75rem .4rem;
  white-space: nowrap;
  transition: color .2s;
  position: relative;
}

nav .nav-brand:hover {
  color: #fff;
}

nav .nav-links {
  display: flex;
  list-style: none;
  align-items: stretch;
  gap: 0;
}

nav .nav-links li {
  position: relative;
  display: flex;
  align-items: center;
}

nav .nav-links li:has(> a.active) {
  align-self: stretch;
}

nav .nav-links li + li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 10px;
  background: rgba(244,239,228,.08);
}

nav .nav-links li:has(> a.active) + li::before,
nav .nav-links li + li:has(> a.active)::before {
  display: none;
}

nav .nav-links a {
  display: block;
  font-family: var(--font);
  color: rgba(244,239,228,.35);
  text-decoration: none;
  padding: .8rem .6rem;
  font-size: .65rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: .03em;
  transition: color .25s, font-size .3s, padding .3s;
  position: relative;
  text-transform: uppercase;
}

nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: .6rem;
  right: .6rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}

nav .nav-links a:hover {
  color: rgba(244,239,228,.7);
}

nav .nav-links a:hover::after {
  transform: scaleX(1);
}

nav .nav-links a.active {
  color: #fff;
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -.01em;
  padding: .8rem 1rem;
  background: rgba(255,255,255,.06);
  border-bottom: 2px solid var(--accent);
}

nav .nav-links a.active::after {
  display: none;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .6rem .3rem;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--bg);
  margin: 5px 0;
  border-radius: 1px;
  transition: transform .3s ease, opacity .2s ease;
  transform-origin: center;
}

/* Hamburger → X animation */
nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── LANGUAGE SWITCHER ── */
.lang-switch {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding: 0 .4rem;
  gap: 2px;
  flex-shrink: 0;
}

.lang-switch a {
  display: block;
  font-family: var(--font);
  color: rgba(244,239,228,.35);
  text-decoration: none;
  padding: .4rem .45rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .25s;
  border-radius: 3px;
}

.lang-switch a:hover {
  color: rgba(244,239,228,.7);
}

.lang-switch a.current {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.lang-switch span {
  color: rgba(244,239,228,.15);
  font-size: .6rem;
}

@media (max-width: 700px) {
  .lang-switch {
    position: absolute;
    right: 3.2rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ── HERO (index only) ── */
.hero {
  background: var(--bg);
  color: var(--ink);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2px double var(--primary);
}

.hero h1 {
  font-family: var(--font);
  font-size: 2.8rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: .6rem;
  letter-spacing: -.01em;
  color: var(--ink);
  border: none;
  position: relative;
  z-index: 1;
}

.hero h1::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--primary);
  margin: 1rem auto 0;
}

.hero p {
  font-family: var(--font);
  font-size: .95rem;
  font-style: italic;
  color: var(--ink-light);
  max-width: 560px;
  margin: 1rem auto 0;
  font-weight: 400;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ── PAGE HEADER (inner pages) ── */
.page-header {
  background: var(--bg);
  color: var(--ink);
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 2px double var(--primary);
}

.page-header h1 {
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  border: none;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-header h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--primary);
  margin-top: .5rem;
}

/* ── LAYOUT ── */
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── TYPOGRAPHY ── */
h1 {
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.2;
}

h2 {
  font-family: var(--font);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 3rem 0 .8rem;
  color: var(--ink);
  line-height: 1.3;
  border-bottom: 1px solid var(--primary);
  padding-bottom: .3rem;
  position: relative;
}

h3 {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  margin: 2rem 0 .6rem;
  color: var(--ink);
  line-height: 1.3;
}

h4 {
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 700;
  font-style: italic;
  margin: 1.5rem 0 .4rem;
  color: var(--ink);
}

p {
  margin-bottom: 1rem;
  color: var(--ink);
}

em { color: var(--ink-light); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(139,0,0,.35);
  text-underline-offset: 2px;
  transition: color .15s;
}

a:hover {
  color: #5a0000;
  text-decoration-color: #5a0000;
}

strong {
  color: var(--ink);
  font-weight: 600;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: #f5e8e4;
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
  color: var(--ink-light);
}

/* ── TABLES ── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.2rem 0 1.8rem;
  font-size: .88rem;
  background: var(--bg-card);
  overflow: hidden;
  border: 1px solid var(--primary);
}

th, td {
  padding: .65rem .9rem;
  text-align: left;
}

th {
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: none;
}

td {
  border-bottom: 1px solid var(--bg-dark);
  font-family: var(--font);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background .15s;
}

tbody tr:hover td {
  background: #f0ebe0;
}

/* ── QUICK-START TABLE ── */
.quick-table th {
  background: var(--primary);
  color: #fff;
}

.quick-table td:last-child {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.62rem;
}

.quick-table .yes { color: var(--green); }
.quick-table .no { color: var(--red); }

/* ── CALLOUTS ── */
.callout {
  border-left: 3px solid;
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  font-size: .92rem;
  position: relative;
}

.callout-title {
  font-family: var(--font);
  font-weight: 700;
  font-style: italic;
  margin-bottom: .4rem;
  font-size: .85rem;
}

.callout.tip {
  border-color: var(--green);
  background: #edf5ee;
}
.callout.tip .callout-title { color: var(--green); }

.callout.warning {
  border-color: var(--amber);
  background: #f8f2e4;
}
.callout.warning .callout-title { color: var(--amber); }

.callout.danger {
  border-color: var(--red);
  background: #f5e8e4;
}
.callout.danger .callout-title { color: var(--red); }

.callout.info {
  border-color: var(--primary-light);
  background: #f0ebe0;
}
.callout.info .callout-title { color: var(--primary); }

.callout.success {
  border-color: var(--green);
  background: #edf5ee;
}
.callout.success .callout-title { color: var(--green); }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin: 1.8rem 0;
  border: 1px solid var(--primary);
}

.card {
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--bg-dark);
  border-right: 1px solid var(--bg-dark);
  padding: 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: background .2s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: #f0ebe0;
}

.card h3 {
  margin: 0 0 .5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
}

.card p {
  font-size: .82rem;
  color: var(--ink-light);
  margin: 0;
  line-height: 1.55;
}

/* ── ROUTE FLOW ── */
.route-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1.2rem 1.4rem;
  background: #f0ebe0;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  margin: 1.2rem 0;
  border: 1px solid var(--bg-dark);
}

.route-flow span {
  background: var(--primary);
  color: #fff;
  padding: .35rem .8rem;
  font-size: .82rem;
  letter-spacing: .02em;
}

.route-flow .arrow {
  background: none;
  color: var(--accent);
  font-size: 1.2rem;
  padding: 0;
}

/* ── LISTS ── */
ul, ol {
  margin: .6rem 0 1.2rem 0;
  padding-left: 0;
  list-style: none;
}

ul li, ol li {
  margin-bottom: .45rem;
  padding-left: 1.4rem;
  position: relative;
}

ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .7em;
  width: 4px;
  height: 4px;
  background: var(--accent);
  opacity: .7;
}

ol {
  counter-reset: ol-counter;
}

ol li {
  counter-increment: ol-counter;
}

ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: .85rem;
  color: var(--accent);
  width: auto;
  height: auto;
  background: none;
  opacity: 1;
}

/* ── DEFINITION LISTS (glossary) ── */
dl {
  margin: 1rem 0 1.5rem 0;
}

dt {
  font-weight: 700;
  font-family: var(--font);
  color: var(--accent);
  font-size: 1.05rem;
  margin-top: 1.2rem;
  padding-bottom: .2rem;
  border-bottom: 1px solid var(--border);
}

dt:first-child {
  margin-top: 0;
}

dd {
  margin: .4rem 0 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--text);
  line-height: 1.7;
}

/* ── FOOTER ── */
footer {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 2px double var(--primary);
  font-family: var(--font);
  font-size: .78rem;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
}

footer a {
  color: var(--accent);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  animation: fadeUp .5s ease-out;
}

.hero h1 {
  animation: fadeUp .6s ease-out .1s both;
}

.hero p {
  animation: fadeUp .6s ease-out .25s both;
}

.card-grid .card {
  animation: fadeUp .4s ease-out both;
}

.card-grid .card:nth-child(1) { animation-delay: .15s; }
.card-grid .card:nth-child(2) { animation-delay: .25s; }
.card-grid .card:nth-child(3) { animation-delay: .35s; }
.card-grid .card:nth-child(4) { animation-delay: .45s; }
.card-grid .card:nth-child(5) { animation-delay: .55s; }

/* ── RESPONSIVE ── */
@media (max-width: 740px) {
  .nav-toggle {
    display: block;
  }

  nav .nav-inner {
    flex-wrap: wrap;
    padding: 0 1rem;
  }

  nav .nav-brand {
    padding: .7rem .4rem;
    font-size: .95rem;
  }

  nav .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid rgba(244,239,228,.1);
    padding: .3rem 0 .6rem;
  }

  nav.open .nav-links {
    display: flex;
    animation: navSlide .25s ease;
  }

  nav .nav-links li + li::before {
    display: none;
  }

  nav .nav-links a {
    padding: .5rem .7rem;
    font-size: .7rem;
    color: rgba(244,239,228,.4);
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  nav .nav-links a.active {
    color: #fff;
    font-size: 1.05rem;
    text-transform: none;
    letter-spacing: -.01em;
    padding: .7rem .7rem;
    background: rgba(255,255,255,.05);
    border-left: 2px solid var(--accent);
    border-bottom: none;
    margin-bottom: .3rem;
    order: -1;
  }

  nav .nav-links a::after {
    left: .7rem;
    right: auto;
    width: 16px;
  }
}

@keyframes navSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2rem 1rem 1.8rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: .9rem;
  }

  .page-header {
    padding: 1.5rem 1rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .container {
    padding: 1.8rem 1rem 3.5rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.1rem; margin-top: 2.2rem; }
  h3 { font-size: 1rem; }

  table { font-size: .84rem; }
  th, td { padding: .5rem .6rem; }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.65rem; }
  .route-flow { flex-direction: column; align-items: flex-start; }
  .route-flow .arrow { transform: rotate(90deg); }
}

/* ── SELECTION ── */
::selection {
  background: var(--bg-dark);
  color: var(--ink);
}
