/*
Theme Name: Battalion Commemoration Blog
Description: Block theme for the No. 2 Construction Battalion blog. Matches the main site: same colours, fonts, header and footer.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Author: MAIARD Web Solutions
Text Domain: battalion-blog
*/

/* Design tokens. Same values as the main site's tokens.css. */
:root {
  --bb-paper: #f4f0e8;
  --bb-parchment: #e9e2d3;
  --bb-ink: #1f1e1b;
  --bb-slate: #5a5852;
  --bb-rule: #cfc8b8;
  --bb-stone: #7e7a6f;
  --bb-brass: #8a5a12;
  --bb-brass-deep: #6b4509;
  --bb-brass-tint: #f0e2c8;
  --bb-on-brass: #f4f0e8;
  --bb-forest: #1d3f31;
  --bb-on-forest: #f4f0e8;
  --bb-on-forest-soft: #c9d9cc;
  --bb-brass-on-forest: #d4a24c;
  --bb-focus: #1f1e1b;
  color-scheme: light;
}

/* Dark follows the visitor's system setting. The main site's toggle does not carry across subdomains. */
@media (prefers-color-scheme: dark) {
  :root {
    --bb-paper: #171613;
    --bb-parchment: #211f1b;
    --bb-ink: #ede8dc;
    --bb-slate: #a9a59a;
    --bb-rule: #3a3733;
    --bb-stone: #7c786e;
    --bb-brass: #d4a24c;
    --bb-brass-deep: #e6b964;
    --bb-brass-tint: #2e2518;
    --bb-on-brass: #171613;
    --bb-forest: #17332a;
    --bb-on-forest: #ede8dc;
    --bb-focus: #ede8dc;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

:focus-visible {
  outline: 2px solid var(--bb-focus);
  outline-offset: 2px;
}

strong, b { font-weight: 600; }

/* Wrap, same widths as the main site */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) {
  .wrap { padding: 0 48px; }
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--bb-rule);
  background: var(--bb-paper);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--bb-ink);
  font-family: var(--wp--preset--font-family--display);
}
.logo-no2 {
  color: var(--bb-brass);
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}
.logo-words {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-box: trim-both cap alphabetic;
}
.logo-words span { display: block; }
.logo-words span + span { margin-top: 5px; }
.logo-descriptor {
  display: block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bb-slate);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.site-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--bb-ink);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  border-bottom-color: var(--bb-brass);
}

/* Footer: forest band */
.site-footer {
  background: var(--bb-forest);
  color: var(--bb-on-forest);
  padding: 48px 0;
  font-size: 15px;
  line-height: 22px;
  margin-block-start: 0;
}
.site-footer .wrap {
  display: grid;
  gap: 24px;
}
@media (min-width: 768px) {
  .site-footer .wrap { grid-template-columns: 1.4fr 1fr; align-items: end; }
}
.site-footer .logo { color: var(--bb-on-forest); }
.site-footer .logo-no2 { color: var(--bb-brass-on-forest); }
.site-footer .logo-descriptor { color: var(--bb-on-forest-soft); }
.site-footer a { color: var(--bb-on-forest); }
.site-footer a:hover { color: var(--bb-on-forest-soft); }
.site-footer p { color: var(--bb-on-forest-soft); margin: 0 0 8px; }
.funder { margin-top: 16px; }
.funder img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 52px;
  border-radius: 2px;
}

/* Blog list */
.post-card {
  border-top: 1px solid var(--bb-rule);
  padding-top: 24px;
}
.wp-block-post-template.is-layout-flow > li { margin-block-start: 0; }
.post-card .wp-block-post-title a { text-decoration: none; color: var(--bb-ink); }
.post-card .wp-block-post-title a:hover { color: var(--bb-brass-deep); text-decoration: underline; }
.post-meta { color: var(--bb-slate); font-size: 15px; }
.wp-block-post-featured-image img { border-radius: 2px; }

/* Page title band on archive and search */
.page-intro { border-bottom: 1px solid var(--bb-rule); }

/* Inputs */
.wp-block-search__input {
  font: inherit;
  background: var(--bb-paper);
  color: var(--bb-ink);
  border: 1px solid var(--bb-stone);
  border-radius: 4px;
  padding: 10px 12px;
}

/* Mobile */
@media (max-width: 640px) {
  .site-header .wrap { min-height: 0; gap: 8px; }
  .logo-no2 { font-size: 34px; }
  .logo-words { font-size: 13px; }
  .site-nav { width: 100%; gap: 8px 16px; }
  .site-nav a { font-size: 14px; padding: 8px 0; }
  .funder img { height: auto; width: 100%; max-width: 360px; }
}
@media (pointer: coarse) {
  .logo { min-height: 44px; }
  .site-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0; }
}

/* Layout */
.wp-site-blocks > * + * { margin-block-start: 0; }
.blog-main { padding-top: 48px; padding-bottom: 64px; }
.blog-main > * + * { margin-block-start: 16px; }
.blog-main .wp-block-post-template { margin-top: 32px; padding: 0; list-style: none; }
.blog-main .wp-block-post-template > li + li { margin-top: 32px; }
.blog-main .wp-block-site-tagline { color: var(--bb-slate); }
.blog-main .wp-block-query-pagination { margin-top: 32px; gap: 16px; }
.back-link { font-weight: 600; }
