/* ============================================================
   xvarog — shared.css
   Reset · Tokens · Nav · Footer · Mobile menu
   Imported by every page. Page-specific styles live in
   css/index.css, css/about.css, css/archive.css, etc.
   ============================================================ */

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  --color-bg:        #ffffff;
  --color-text:      rgba(0, 0, 0, 0.75);
  --color-text-dark: #000000;
  --color-separator: rgba(0, 0, 0, 0.08);
  --color-border:    rgba(0, 0, 0, 0.08);
  --color-year:      #82808d;

  --font:            'Inter', sans-serif;
  --fw-normal:       400;
  --fw-semibold:     600;

  --fs-nav:          14px;
  --fs-footer:       12px;

  --logo-size:       35px;
  --nav-gap:         90px;

  --max-width:       1440px;
  --h-pad:           80px;
  --nav-height:      65px;
}

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

html { height: 100%; }

body {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  font-family: var(--font);
  font-weight: var(--fw-normal);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

a   { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Page wrapper ───────────────────────────────────────── */
/* Each page's <div class="page"> is the flex column that
   grows to push the footer to the bottom of the viewport.  */
.page {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  background: var(--color-bg);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-height);
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--h-pad);
  font-size: var(--fs-nav);
  color: var(--color-text);
}

.nav__left {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  flex: 1;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  flex: 1;
  justify-content: flex-end;
}

/* Logo — absolutely centered between left and right groups */
.nav__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--logo-size);
  height: var(--logo-size);
  flex-shrink: 0;
}

.nav__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav__left a,
.nav__right a {
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav__left a:hover,
.nav__right a:hover { opacity: 0.5; }

/* Active page link */
.nav--active {
  font-weight: var(--fw-semibold);
  color: var(--color-text-dark);
}

/* Hamburger button — hidden on desktop, shown on tablet/mobile */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ─── Mobile menu overlay ────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav a {
  font-size: 1.8rem;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.mobile-nav a:hover { opacity: 0.5; }

.mobile-nav__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  color: var(--color-text);
  line-height: 1;
}

/* ─── Separator ──────────────────────────────────────────── */
.separator {
  height: 1px;
  background: var(--color-separator);
  margin: 80px 0 0;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--h-pad) 40px;
  font-size: var(--fs-footer);
  color: var(--color-text);
  flex-wrap: wrap;
  gap: 12px;
}

.footer__item {
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.footer__item:hover { opacity: 0.6; }

/* ─── Tablet (≤ 1024px) ──────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --h-pad:      40px;
    --fs-nav:     14px;
    --nav-height: 61px;
  }

  .nav__left,
  .nav__right { display: none; }

  .nav__logo {
    position: static;
    transform: none;
  }

  .nav__hamburger { display: flex; }
  .mobile-nav     { display: flex; }

  .nav { justify-content: space-between; padding: 16px var(--h-pad); }
}

/* ─── Mobile (≤ 768px) ───────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --h-pad:      20px;
    --fs-footer:  11px;
    --nav-height: 57px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 32px;
  }

  .mobile-nav a { font-size: 1.5rem; }
}
