/* Kunstagenda – Monospace / Typewriter hybrid
   Inspired by AasenGaare / The Monospace Web + Monotyper Manifesto
   Small web for kunst i Romerike og Akershus */

/* Self-hosted IBM Plex Mono (kun nødvendige vekter) */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f5f0;
  --paper: #fdfcf8;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #2a2a2a;
  --accent: #1a1a1a;
  --link: #1a1a1a;
  --footer: #666;
  --char-width: 0.6em;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 1.5rem 1rem 3rem;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  text-align: left;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

h1, h2, h3 {
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  color: var(--text);
}

h1 {
  font-size: 1.85rem;
  margin: 2rem 0 1.25rem;
  text-align: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  display: inline-block;
}

h2 {
  font-size: 1.25rem;
  margin-top: 0;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.3rem;
}

.intro {
  max-width: 38rem;
  margin: 0 auto 1.75rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
  text-align: center;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.quick-links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border: 1.5px solid var(--border);
  background: var(--paper);
  transition: background 0.15s, color 0.15s;
}

.quick-links a:hover {
  background: var(--text);
  color: var(--paper);
}

.hero-img {
  display: block;
  margin: 0.5rem auto 0.5rem;
  max-width: min(92%, 720px);
  width: auto;
  max-height: 50vh;
  height: auto;
  border: 2px solid var(--border);
  cursor: pointer;
  background: #e8e4dc;
}

.hero-hint {
  margin: 0.4rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  font-style: normal;
}

.a4 {
  width: 100%;
  max-width: 42rem;
  background: var(--paper);
  border: 2px solid var(--border);
  padding: 2rem 1.75rem 2.5rem;
  text-align: left;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
}

.typewriter {
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.typewriter a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Article prev / next */
.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 42rem;
  margin: 1.75rem 0 2.5rem;
  padding: 0 0.25rem;
  font-size: 0.88rem;
}

.article-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--border);
  background: var(--paper);
  transition: background 0.15s, color 0.15s;
}

.article-nav a:hover {
  background: var(--text);
  color: var(--paper);
}

.article-nav .nav-empty {
  visibility: hidden;
  pointer-events: none;
}

/* Kopier lenke */
.copy-link-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 42rem;
  margin: 1.5rem 0 2.5rem;
}

.copy-link {
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--paper);
  border: 1.5px solid #999;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy-link:hover {
  color: var(--text);
  border-color: var(--border);
}

.copy-link:disabled {
  color: var(--text);
  border-color: var(--border);
  cursor: default;
}

/* ===== Footer ===== */
footer {
  margin-top: auto;
  padding: 2rem 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--footer);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  border-top: 1px solid #ccc;
  max-width: 42rem;
}

/* Hamburger – skjult på desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--paper);
  border: 1.5px solid var(--border);
  cursor: pointer;
}

.menu-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
}

.icon-row {
  display: flex;
  gap: 0.9rem 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--muted);
  min-width: 4rem;
  position: relative;
  padding-top: 0.1rem;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
}

.nav-item:hover .nav-label {
  color: var(--text);
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
  transition: opacity 0.15s;
}

.nav-item:hover .icon {
  opacity: 0.85;
}

.nav-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  line-height: 1.15;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
  display: block;
  width: 100%;
}

.icon-row a.active .nav-label {
  color: var(--text);
  border-bottom-color: var(--text);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--footer);
  letter-spacing: 0.03em;
}

/* ===== Mobil fullskjerm-meny ===== */
.mobile-menu {
  display: none;
}

.mobile-menu:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
  line-height: 1;
  background: var(--paper);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 16rem;
}

.mobile-menu-nav .menu-link,
.mobile-menu-nav a {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid var(--border);
  background: var(--paper);
  transition: background 0.15s, color 0.15s;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
  background: var(--text);
  color: var(--paper);
}

/* ===== Archive list ===== */
.archive-list {
  white-space: normal;
}

.archive-list .year {
  font-weight: 600;
  font-size: 1rem;
  margin: 0.25rem 0 1rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.archive-list .entry {
  display: flex;
  gap: 1.1rem;
  margin-bottom: 0.55rem;
  line-height: 1.5;
  font-size: 0.9rem;
  align-items: baseline;
}

.archive-list .date {
  flex-shrink: 0;
  width: 6.2rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.archive-list .entry a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.archive-list .entry a:hover {
  border-bottom-color: var(--text);
}

.archive-list .archive-rss {
  margin-top: 1.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid #ddd;
  font-size: 0.85rem;
  color: var(--muted);
}

.archive-list .archive-rss a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #999;
}

.archive-list .archive-rss a:hover {
  border-bottom-color: var(--text);
}

/* Mobile */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.6rem 2rem;
  }

  h1 {
    font-size: 1.5rem;
    margin: 1.25rem 0 1rem;
  }

  .a4 {
    padding: 1.4rem 1rem 1.8rem;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
  }

  .typewriter {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .quick-links a {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
  }

  footer {
    padding: 1.75rem 0.5rem 1.25rem;
  }

  /* Skjul ikon-rad, vis hamburger */
  .icon-row {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .archive-list .entry {
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
  }

  .archive-list .date {
    width: auto;
    font-size: 0.8rem;
  }

  .article-nav {
    font-size: 0.82rem;
    margin-bottom: 2rem;
  }

  .copy-link-wrap {
    margin-bottom: 2rem;
  }
}
