@import url('/static/css/fonts.css');

/* ─── Design tokens (§7 CLAUDE.md) ─── */
:root {
  --paper:    #efefef;
  --card:     #ffffff;
  --peach:    #fcebdc;
  --peachln:  #f5d3b3;
  --ink:      #3f4347;
  --ink2:     #4c5256;
  --mut:      #83878b;
  --line:     #e3e1db;
  --orange:   #ED7D31;
  --orangedk: #c75e22;
}

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

html { font-size: 16px; }

body {
  font-family: 'PT Sans', Arial, sans-serif;
  background: var(--paper);
  color: var(--ink2);
  min-height: 100vh;
}

a { color: inherit; }

/* ─── Background tracks layer ─── */
.bg-tracks {
  position: fixed;
  inset: 0;
  background-image: url('/static/img/bg-tracks.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

/* ─── Page wrapper ─── */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

/* ─── Site header ─── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.site-header__left { flex: 1; }

.site-header__supra {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: .55rem;
}

.site-header__title {
  font-family: 'PT Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.15;
  color: var(--ink);
}

.site-header__title .kw {
  background: var(--peach);
  padding: 0 .18em;
}

.site-header__sub {
  margin-top: .5rem;
  font-size: .88rem;
  color: var(--mut);
  line-height: 1.4;
}

.site-header__logo {
  width: 84px;
  flex-shrink: 0;
  margin-top: .15rem;
}

.site-header__logo img {
  width: 100%;
  display: block;
}

/* ─── Intro block ─── */
.intro {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .9rem 1.1rem;
  margin-bottom: 1.75rem;
}

.intro__bullet {
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: var(--orange);
  border-radius: 2px;      /* ~0.6mm */
  margin-top: .2em;
}

.intro__text {
  font-size: .85rem;
  color: var(--ink2);
  line-height: 1.6;
}

/* ─── Print CTA ─── */
.print-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.print-cta__btn {
  white-space: nowrap;
}

.print-cta__hint {
  font-size: .78rem;
  color: var(--mut);
}

@media (max-width: 500px) {
  .print-cta { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ─── Three-column grid ─── */
.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 800px) {
  .columns { grid-template-columns: 1fr; }
}

/* ─── Column / section ─── */
.col__heading {
  font-family: 'PT Sans', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink);
  margin-bottom: .9rem;
  padding-bottom: .45rem;
  border-bottom: 2px solid var(--orange);
  line-height: 1.3;
}

.col__heading .kw {
  background: var(--peach);
  padding: 0 .2em;
}

/* ─── Card (link) ─── */
.card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .8rem .9rem;
  margin-bottom: .65rem;
  min-height: 6.5rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.09);
  border-color: var(--peachln);
}

.card--key {
  background: var(--peach);
  border-color: var(--peachln);
}

.card__title {
  font-family: 'PT Sans', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--orange);
  margin-bottom: .35rem;
  line-height: 1.3;
}

.card__teaser {
  font-size: .8rem;
  color: var(--ink2);
  line-height: 1.55;
}

/* ─── Article page ─── */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
  margin-bottom: 1.25rem;
  letter-spacing: .02em;
}

.article-back:hover { text-decoration: underline; }

.article-header { margin-bottom: 1.25rem; }

.article-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: .4rem;
}

.article-title {
  font-family: 'PT Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--orange);
  line-height: 1.2;
  margin-bottom: .4rem;
}

.article-meta {
  font-size: .78rem;
  color: var(--mut);
}

/* Article body (Markdown output) */
.article-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.5rem 1.75rem;
  max-width: 720px;
  margin-bottom: 1.75rem;
  line-height: 1.75;
  color: var(--ink2);
  font-size: .93rem;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: 'PT Sans', sans-serif;
  font-weight: 700;
  color: var(--ink);
  margin: 1.3em 0 .5em;
  line-height: 1.25;
}
.article-body h1 { font-size: 1.15rem; }
.article-body h2 { font-size: 1rem; }
.article-body h3 { font-size: .93rem; }

.article-body p { margin-bottom: .8em; }
.article-body p:last-child { margin-bottom: 0; }

/* Orange square bullets */
.article-body ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: .9em;
}

.article-body ul li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: .35em;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .52em;
  width: .52em;
  height: .52em;
  background: var(--orange);
  border-radius: 2px;   /* ~0.6mm */
}

.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: .9em;
}

.article-body ol li { margin-bottom: .3em; }

.article-body strong { color: var(--ink); }

.article-body a {
  color: var(--orange);
  text-decoration: underline;
}

.article-body blockquote {
  border-left: 3px solid var(--peachln);
  padding-left: 1rem;
  color: var(--mut);
  margin: .8em 0;
}

.article-body code {
  background: var(--paper);
  padding: .1em .35em;
  border-radius: 2px;
  font-size: .88em;
}

.article-body pre {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .8rem 1rem;
  overflow-x: auto;
  margin-bottom: .9em;
}

.article-body img {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  width: auto;
  display: block;
  margin: .8em auto;
}

.article-body a[href^="/dl/"] {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .4em .85em;
  color: var(--ink2);
  font-size: .84rem;
  text-decoration: none;
  margin: .5em 0;
  transition: border-color .15s, color .15s;
}

.article-body a[href^="/dl/"]:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.article-body a[href^="/dl/"]::before {
  content: '\21E9';
  font-size: 1em;
  color: var(--orange);
}

/* QR block */
.article-qr {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
}

.article-qr__img {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px;
  background: #fff;
  display: block;
}

.article-qr__label {
  margin-top: .3rem;
  font-size: .76rem;
  color: var(--mut);
  line-height: 1.5;
}

/* ─── Site footer ─── */
.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .76rem;
  color: var(--mut);
}

.site-footer__about a {
  color: var(--ink2);
  text-decoration: none;
  font-weight: 700;
}
.site-footer__about a:hover { color: var(--orange); text-decoration: underline; }

.site-footer__sep { color: var(--line); }

.site-footer__admin a {
  color: var(--mut);
  text-decoration: none;
}
.site-footer__admin a:hover { color: var(--ink2); text-decoration: underline; }

/* ─── About page ─── */
.about-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.about-title {
  font-family: 'PT Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink);
  line-height: 1.15;
  margin-top: .4rem;
}

.about-body {
  max-width: 720px;
}

.about-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
}

.about-section__head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .7rem;
}

.about-sq {
  display: inline-block;
  width: .65rem;
  height: .65rem;
  min-width: .65rem;
  background: var(--orange);
  border-radius: 2px;
}

.about-section__title {
  font-family: 'PT Sans', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink);
  line-height: 1.2;
}

.about-section p {
  font-size: .9rem;
  color: var(--ink2);
  line-height: 1.7;
  margin-bottom: .5rem;
}
.about-section p:last-child { margin-bottom: 0; }

.about-contact {
  margin-top: .6rem;
  font-size: .88rem;
  color: var(--ink2);
  line-height: 1.9;
}

.about-placeholder {
  color: var(--mut);
  border-bottom: 1px dashed var(--mut);
  letter-spacing: .05em;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN — Stage 3
   ═══════════════════════════════════════════════════════════ */

/* Auth pages (login / password change) */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding-top: 4rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 400px;
}

.auth-card__title {
  font-family: 'PT Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
  margin-bottom: 1.2rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--orange);
}

.auth-card__hint {
  font-size: .84rem;
  color: var(--mut);
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* Admin top bar */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--orange);
}

.admin-header__title {
  font-family: 'PT Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink);
}

.admin-header__actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Section block on dashboard */
.admin-section { margin-bottom: 1.75rem; }

.admin-section__title {
  font-family: 'PT Sans', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink);
  margin-bottom: .65rem;
}

.admin-articles { display: flex; flex-direction: column; gap: .45rem; }

.admin-article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .6rem .9rem;
}

.admin-article--key {
  background: var(--peach);
  border-color: var(--peachln);
}

.admin-article__info { flex: 1; min-width: 0; }

.admin-article__title {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-article__meta {
  font-size: .74rem;
  color: var(--mut);
  margin-top: .15rem;
}

/* Edit article page */
.admin-edit-header { margin-bottom: 1.2rem; }

.admin-edit-title {
  font-family: 'PT Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--orange);
  margin-bottom: .3rem;
  line-height: 1.2;
}

/* Form elements */
.field { margin-bottom: 1.1rem; }

.field__label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .35rem;
}

.field__input,
.field__textarea {
  display: block;
  width: 100%;
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .5rem .7rem;
  font-family: 'PT Sans', sans-serif;
  font-size: .88rem;
  color: var(--ink2);
  outline: none;
  transition: border-color .15s;
}

.field__input:focus,
.field__textarea:focus { border-color: var(--orange); }

.field__textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 80px;
  font-family: monospace;
  font-size: .83rem;
}

.field__textarea--short { min-height: 58px; }

.field__hint {
  margin-top: .3rem;
  font-size: .76rem;
  color: var(--mut);
}

.field-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: .48rem 1.1rem;
  border-radius: 3px;
  font-family: 'PT Sans', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.3;
  transition: background .13s, color .13s, border-color .13s;
  white-space: nowrap;
}

.btn--primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn--primary:hover { background: var(--orangedk); border-color: var(--orangedk); }

.btn--secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--orange); color: var(--orange); }

.btn--ghost { background: transparent; color: var(--mut); border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink2); }

.btn--edit {
  background: transparent;
  color: var(--orange);
  border-color: var(--peachln);
  font-size: .76rem;
  padding: .28rem .7rem;
}
.btn--edit:hover { background: var(--peach); }

/* Alerts */
.alert {
  padding: .6rem .9rem;
  border-radius: 3px;
  font-size: .84rem;
  margin-bottom: .85rem;
  max-width: 720px;
  line-height: 1.5;
}
.alert--error { background: #fde8e8; border: 1px solid #f5b4b4; color: #7a1a1a; }
.alert--success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1a5c1e; }
