@font-face {
  font-family: "Baskerville";
  src: url("../fonts/Baskerville.ttc") format("truetype");
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --bg:          #453980;
  --surface:     #010101;
  --header-bar:  #405caa;
  --text:        #ffffff;
  --muted:       #ffffff;
  --link:        #f3ea00;
  --link-vis:    #5bba4d;
  --border:      #9ca7ae;
  --radius:      3px;
}

/* ── Body & strip background ── */
body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg);
  background-image: url("../img/strip-evoldir.png");
  background-repeat: repeat-x;
  background-position: top center;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
}

a           { color: var(--link); text-decoration: none; }
a:visited   { color: var(--link-vis); }
a:hover     { text-decoration: underline; color: #ffffff; }

/* ── Site wrapper ── */
.site-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ── Banner ── */
.site-banner {
  display: block;
  width: 100%;
  background: transparent;
  position: relative;
  z-index: 0;
  line-height: 0;
}

.site-banner__graphic img {
  width: 100%;
  display: block;
  object-fit: contain;
  padding-left: 100px;
}

.site-banner__logo {
  position: absolute;
  left: -10px;
  /* Aligned with the ESEB logo; the image has about 6px of transparent space below the text. */
  bottom: 74px;
  line-height: 0;
  z-index: 2;
  width: 25vw;
  max-width: 240px;
}

.site-banner__eseb {
  position: absolute;
  right: 0;
  bottom: 80px;
  line-height: 0;
  z-index: 20;
  width: 300px;
}

.site-banner__eseb img {
  width: 100%;
  height: auto;
  display: block;
}

.site-banner__logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Horizontal nav ── */
.site-nav {
  background: transparent;
  padding: 4px 0 0;
  position: relative;
  z-index: 10;
  margin-top: -75px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 3px;
  padding: 0;
  margin: 0;
}

.site-nav li {
  flex: 1;
}

.site-nav li a {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: .88rem;
  font-weight: bold;
  white-space: nowrap;
  text-decoration: none;
  color: var(--link);
  background: var(--header-bar);
  border: 3px solid #5bba4d;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 -7px 0 0 #010101;
  text-align: center;
  align-items: center;
}

.site-nav li a .nav-label {
  padding: 3px 8px 4px;
  line-height: 1.2;
}

.site-nav li a .nav-label--icon {
  padding: 4px 8px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav li a .nav-stripe {
  display: none;
}

.site-nav li a:hover,
.site-nav li a.active {
  background: #010101;
  color: var(--link);
  text-decoration: none;
  border-color: #5bba4d;
}

.site-nav > .site-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.site-nav__secondary li a {
  font-size: 1rem;
}

/* On the home page these headings already sit directly below the menu. */
.page-home .site-nav__secondary {
  display: none;
}

.page-home .content-section {
  scroll-margin-top: 40px;
}

/* ── Page body ── */
.page-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0;
  position: relative;
  z-index: 10;
}

/* ── Content section ── */
.content-section {
  background: var(--surface);
  border: 3px solid #5bba4d;
  border-radius: 2px;
  overflow: hidden;
}

.content-section__header {
  background: var(--header-bar);
  padding: 5px 10px 5px;
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: bold;
  color: var(--link);
  line-height: 1.2;
  border-bottom: 4px solid #010101;
}

.content-section__header-stripe {
  display: none;
}

.content-section__body {
  padding: 8px 10px;
}

/* ── Post item ── */
.post-item {
  border-bottom: 1px solid #453980;
  padding: 6px 0;
  font-size: .82rem;
}

.post-item:last-child { border-bottom: none; }

.post-item a {
  color: var(--link);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.post-item .post-meta {
  color: var(--muted);
  font-size: .75rem;
}

.post-item .post-excerpt {
  color: #ffffff;
  margin-top: 2px;
  text-align: justify;
}

.post-item .post-excerpt a,
.post-item .post-excerpt a:visited {
  color: #ffffff !important;
  text-decoration: underline !important;
  font-weight: normal !important;
  display: inline;
  margin: 0;
}

.post-item .post-excerpt a:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

.post-item .post-excerpt p,
.post-item .post-excerpt br {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* placeholder empty state */
.empty-state {
  color: var(--muted);
  font-size: .82rem;
  padding: 10px 0;
  font-style: italic;
}

/* ── Form pages ── */
.page-body--single {
  grid-template-columns: 1fr;
}

.content-section__header h1 {
  font: inherit;
  color: inherit;
}

.form-page {
  font-size: .9rem;
  padding: 12px 14px 16px;
}

.form-page p {
  margin-bottom: 8px;
}

.form-intro {
  color: var(--muted);
}

.form-page .field {
  margin-top: 14px;
}

.form-page label {
  display: block;
  color: var(--link);
  font-weight: 700;
  margin-bottom: 4px;
}

.form-page .req {
  color: #ff6b6b;
}

.form-page input[type="text"],
.form-page input[type="email"],
.form-page input[type="search"],
.form-page select,
.form-page textarea {
  width: 100%;
  background: #453980;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 6px 8px;
}

.form-page textarea {
  display: block;
  resize: vertical;
}

.form-page input:focus,
.form-page select:focus,
.form-page textarea:focus {
  outline: 2px solid #5bba4d;
  outline-offset: 0;
  border-color: #5bba4d;
}

.form-page .help {
  color: var(--muted);
  font-size: .8rem;
  margin: 4px 0 0;
}

.form-page .field-error {
  color: #ff9c9c;
  font-size: .82rem;
  font-weight: 700;
  margin: 4px 0 0;
}

.form-page .field--error input,
.form-page .field--error select,
.form-page .field--error textarea {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 1px #ff6b6b;
}

.form-note {
  background: #405caa;
  border-left: 4px solid #5bba4d;
  color: var(--text);
  font-size: .82rem;
  margin-bottom: 6px;
  padding: 6px 10px;
}

.form-note strong {
  color: var(--link);
}

.form-note p:last-child {
  margin-bottom: 0;
}

.form-note--message {
  font-size: .9rem;
  margin: 4px 0 12px;
  padding: 10px 12px;
}

.form-note--success {
  background: #010101;
  border-left-color: #5bba4d;
}

.form-note--error {
  background: #2a0000;
  border-left-color: #ff6b6b;
}

.form-note code {
  color: var(--link);
  font-family: Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
}

.form-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.form-page .btn,
.form-page .btn:visited {
  background: var(--header-bar);
  border: 3px solid #5bba4d;
  border-radius: 2px;
  box-shadow: inset 0 -7px 0 0 #010101;
  color: var(--link);
  cursor: pointer;
  display: inline-block;
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: .95rem;
  font-weight: bold;
  line-height: 1.2;
  padding: 4px 18px 6px;
  text-decoration: none;
}

.form-page .btn:hover {
  background: #010101;
  border-color: #5bba4d;
  color: var(--link);
  text-decoration: none;
}

/* ── Browse posts ── */
.page-body--browse {
  --post-row-height: 32.3px;
  grid-template-columns: minmax(0, 1fr);
}

.content-section__header h2 {
  font: inherit;
  color: inherit;
}

.post-list-panel__header {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.post-count {
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  font-weight: normal;
  white-space: nowrap;
}

.post-list {
  max-height: calc(5 * var(--post-row-height));
  overflow-y: auto;
  position: relative;
}

.post-list ul {
  list-style: none;
}

.post-list--archive {
  max-height: calc(20 * var(--post-row-height));
}

.post-list::-webkit-scrollbar {
  width: 17px;
}

.post-list::-webkit-scrollbar-track {
  background: #fff;
  border: 1px solid #010101;
}

.post-list::-webkit-scrollbar-thumb {
  background: #9ca7ae;
  border: 1px solid #010101;
  min-height: 22px;
}

.post-list::-webkit-scrollbar-button:vertical {
  background-color: #9ca7ae;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: block;
  height: 16px;
}

.post-list::-webkit-scrollbar-button:vertical:start:decrement {
  background-image: url("../img/scroll-arrow-up.png");
}

.post-list::-webkit-scrollbar-button:vertical:end:increment {
  background-image: url("../img/scroll-arrow-down.png");
}

.post-list::-webkit-scrollbar-button:vertical:start:increment,
.post-list::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
}

/* Firefox only supports colours. Chrome ignores ::-webkit-scrollbar if scrollbar-color is set. */
@supports not selector(::-webkit-scrollbar) {
  .post-list {
    scrollbar-color: #9ca7ae #fff;
  }
}

.archive-year {
  background: #010101;
  color: var(--link);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 10px 3px;
  position: sticky;
  top: 0;
}

.post-list__item {
  align-items: baseline;
  border-bottom: 1px solid #453980;
  display: flex;
  font-size: .8rem;
  gap: 10px;
  justify-content: space-between;
  padding: 6px 10px;
}

.post-list__item a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.post-list__item.is-selected {
  background: #405caa;
  border-left: 3px solid #5bba4d;
  padding-left: 7px;
}

.post-list__item.is-selected a {
  color: var(--link);
  font-weight: 700;
}

.post-list__date {
  color: var(--muted);
  flex-shrink: 0;
  font-size: .72rem;
}

.page-browse .site-nav {
  scroll-margin-top: 6px;
}

/* Leaves the menu and the list above the post in view after following "Next post". */
.post-detail-panel {
  scroll-margin-top: 293px;
}

.post-detail__back {
  display: none;
}

.post-detail__end {
  border-top: 1px solid #453980;
  display: flex;
  flex-wrap: wrap;
  font-size: .9rem;
  gap: 8px 16px;
  margin-top: 14px;
  padding-top: 10px;
}

.post-detail__end a {
  padding: 4px 0;
}

.post-detail__end a + a {
  margin-left: auto;
}

.scroll-top {
  display: none;
}

#page-content {
  scroll-margin-top: 6px;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .post-detail__top {
    display: none;
  }

  .scroll-top.is-visible {
    border: 2px solid #5bba4d;
    border-radius: 2px;
    bottom: max(14px, env(safe-area-inset-bottom));
    display: block;
    line-height: 0;
    position: fixed;
    right: 12px;
    z-index: 30;
  }

  .scroll-top img {
    display: block;
    height: 36px;
    width: 44px;
  }
}

.post-detail__meta {
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 10px;
}

.post-detail__body {
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.post-detail__body a {
  text-decoration: underline;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .page-body--browse.is-detail .post-list-panel {
    display: none;
  }

  .post-list {
    max-height: none;
    overflow-y: visible;
  }

  .post-list__item {
    font-size: .95rem;
    padding: 9px 10px;
  }

  .post-detail__back {
    display: inline-block;
    font-size: .9rem;
    margin-bottom: 10px;
    padding: 4px 0;
  }

  .post-detail__body {
    font-size: 1rem;
  }

  .post-detail-panel {
    scroll-margin-top: 0;
  }
}

/* ── Search ── */
.search-form {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-form__query {
  flex: 3 1 260px;
  min-width: 0;
}

.search-form__category {
  flex: 1 1 170px;
  min-width: 0;
}

.search-form + .help {
  margin-top: 8px;
}

.form-page code {
  color: var(--link);
  font-family: Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
}

.search-results {
  list-style: none;
}

.search-result {
  border-bottom: 1px solid #453980;
  padding: 10px 0;
}

.search-result:first-child {
  padding-top: 2px;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result__title {
  font-size: .92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.search-result__meta {
  color: var(--muted);
  font-size: .74rem;
  margin: 2px 0 4px;
}

.search-result__snippet {
  color: #ffffff;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.search-result mark {
  background: #f3ea00;
  border-radius: 2px;
  color: #010101;
  padding: 0 2px;
}

.search-pages {
  align-items: center;
  border-top: 1px solid #453980;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .85rem;
  gap: 16px;
  justify-content: center;
  margin-top: 6px;
  padding-top: 10px;
}

/* ── Text pages ── */
.page-text {
  font-size: .9rem;
  line-height: 1.6;
  padding: 12px 16px 18px;
}

.page-text h2 {
  border-bottom: 1px solid #453980;
  color: var(--link);
  font-size: 1rem;
  margin: 18px 0 8px;
  padding-bottom: 3px;
}

.page-text h2:first-child {
  margin-top: 4px;
}

.page-text h3 {
  color: var(--link);
  font-size: .92rem;
  margin: 14px 0 6px;
}

.page-text p {
  margin-bottom: 8px;
}

.page-text ul,
.page-text ol {
  list-style-position: outside;
  margin: 0 0 8px;
  padding-left: 24px;
}

.page-text ul {
  list-style-type: disc;
}

.page-text ol {
  list-style-type: decimal;
}

.page-text li {
  margin-bottom: 5px;
}

.page-text a,
.page-text a:visited {
  color: var(--link);
  text-decoration: underline;
}

.page-text code {
  color: var(--link);
  font-family: Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
}

/* ── Subscription pages ── */
.preview-banner {
  background: #010101;
  border: 3px solid #f3ea00;
  border-radius: 2px;
  font-size: .82rem;
  margin-top: 10px;
  padding: 8px 10px;
}

.preview-banner strong {
  color: var(--link);
}

.preview-banner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  list-style: none;
  margin-top: 4px;
}

.preview-banner a,
.preview-banner a:visited {
  color: var(--link);
  text-decoration: underline;
}

.preview-banner a.is-current {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.page-subscribe .card {
  background: var(--surface);
  border: 3px solid #5bba4d;
  border-radius: 2px;
  font-size: .9rem;
  margin: 10px 0;
  padding: 14px;
}

.page-subscribe .card h1 {
  background: var(--header-bar);
  border-bottom: 4px solid #010101;
  color: var(--link);
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.2;
  margin: -14px -14px 12px;
  padding: 5px 10px;
}

.page-subscribe .card--centered {
  text-align: left;
}

.page-subscribe .card h2 {
  color: var(--link);
  font-size: 1rem;
  margin-bottom: 6px;
}

.page-subscribe .card p {
  margin-bottom: 8px;
}

.page-subscribe .card hr {
  border: none;
  border-top: 1px solid #453980;
  margin: 16px 0;
}

.page-subscribe .card a:not(.btn),
.page-subscribe .card a:not(.btn):visited {
  color: var(--link);
  text-decoration: underline;
}

.page-subscribe .icon-ok {
  display: none;
}

.page-subscribe .notice {
  background: #405caa;
  border-left: 4px solid #5bba4d;
  font-size: .85rem;
  margin: 4px 0 12px;
  padding: 8px 12px;
}

.page-subscribe .notice strong {
  color: var(--link);
}

.page-subscribe .notice--error {
  background: #2a0000;
  border-left-color: #ff6b6b;
}

.page-subscribe .field {
  margin-top: 14px;
}

.page-subscribe .field label {
  color: var(--link);
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-subscribe .req {
  color: #ff6b6b;
}

.page-subscribe .field input {
  background: #453980;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 6px 8px;
  width: 100%;
}

.page-subscribe .field input:focus {
  border-color: #5bba4d;
  outline: 2px solid #5bba4d;
}

.page-subscribe .field input::placeholder {
  color: #ffffff;
  opacity: .65;
}

.page-subscribe .field-error {
  color: #ff9c9c;
  font-size: .82rem;
  font-weight: 700;
  margin: 4px 0 0;
}

.page-subscribe .help,
.page-subscribe .fine-print {
  font-size: .8rem;
}

.page-subscribe .fine-print {
  margin: 14px 0 0;
}

.page-subscribe fieldset {
  border: 1px solid #5bba4d;
  margin-top: 16px;
  padding: 8px 12px 10px;
}

.page-subscribe legend {
  color: var(--link);
  font-weight: 700;
  padding: 0 6px;
}

.page-subscribe .legend-hint {
  color: var(--text);
  font-weight: normal;
}

.page-subscribe .checkbox-row {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.page-subscribe .checkbox-row input {
  accent-color: #5bba4d;
  cursor: pointer;
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.page-subscribe .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.page-subscribe .btn,
.page-subscribe .btn:visited {
  background: var(--header-bar);
  border: 3px solid #5bba4d;
  border-radius: 2px;
  box-shadow: inset 0 -7px 0 0 #010101;
  color: var(--link);
  cursor: pointer;
  display: inline-block;
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: .95rem;
  font-weight: bold;
  line-height: 1.2;
  padding: 4px 18px 6px;
  text-decoration: none;
}

.page-subscribe .btn:hover {
  background: #010101;
  color: var(--link);
  text-decoration: none;
}

.page-subscribe .btn--danger,
.page-subscribe .btn--danger:visited {
  border-color: #ff6b6b;
}

@media (hover: none) and (pointer: coarse) {
  .page-subscribe .field input {
    font-size: 16px;
  }
}

/* ── Footer ── */
.site-footer {
  background: transparent;
  border-top: none;
  padding: 10px 12px;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.site-footer__logo {
  display: block;
  line-height: 0;
  margin: 0 auto 8px;
  width: 95px;
}

.site-footer__logo img {
  display: block;
  height: auto;
  width: 100%;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  font-family: "Baskerville", "Baskerville Old Face", "Garamond", Georgia, serif;
  font-size: .88rem;
  font-weight: bold;
  color: var(--link);
  text-decoration: none;
}

.site-footer .footer-links a:hover {
  color: var(--link);
  text-decoration: none;
}

.site-footer .footer-eseb {
  color: var(--muted);
  font-size: .72rem;
  margin-top: 3px;
}

.site-footer .footer-eseb a {
  color: var(--muted);
  text-decoration: underline;
}

.site-footer .footer-eseb a:hover {
  color: #ffffff;
}

/* ── Mobile / touch devices ── */
@media (hover: none) and (pointer: coarse) {
  .site-banner__logo {
    bottom: 6px;
  }

  .site-banner__logo img {
    width: 40vw;
    max-width: 480px;
  }

  .site-nav {
    padding: 4px 4px 4px;
    margin-top: 0;
  }

  .site-nav > .site-wrap {
    gap: 4px;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .site-nav .site-nav__secondary,
  .page-home .site-nav .site-nav__secondary {
    display: flex;
    order: -1;
  }

  .page-home .content-section {
    scroll-margin-top: 6px;
  }

  .site-nav li {
    display: block;
  }

  .site-nav li a {
    display: flex;
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
  }

  .site-nav li a .nav-label {
    padding: 6px 12px 5px;
    width: 100%;
    text-align: center;
  }

  .page-body {
    grid-template-columns: 1fr;
  }

  .form-page input[type="text"],
  .form-page input[type="email"],
  .form-page input[type="search"],
  .form-page select,
  .form-page textarea {
    font-size: 16px;
  }

  .site-banner__eseb {
    width: 120px;
    bottom: 10px;
    right: 0;
  }
}
