/*
Theme Name: Fort Langley
Theme URI: https://fortlangley.beer/
Description: Standalone theme for fortlangley.beer — a garrison ledger for Canadian online casino reviews.
Version: 1.0
Author: Fort Langley
Text Domain: fortlangley
*/

/*
  fortlangley.beer — "Fort Langley" design.
  Palette: warm timber browns and dark ink on a parchment ground, with a
  gold/tan accent for borders, active states, and the "watch" motifs.
  Body ink (#33251a) and muted ink (#36281c) both meet 4.5:1+ against the
  paper ground (#f7f3e8). No external fonts — system stack only.
  Structural idea: the Palisade Grid — an asymmetric CSS Grid where every
  third tile is a tall "watchtower" spanning two rows, while the rest are
  compact "picket" tiles. Single/page templates carry one "Sentry Note"
  callout near the top, marked by a top border and a CSS clip-path corner
  flag.
*/

:root {
  --flg-paper: #f7f3e8;
  --flg-paper-d: #efe6d6;
  --flg-card: #fffdf7;
  --flg-ink: #261a11;
  --flg-body: #33251a;
  --flg-muted: #36281c;
  --flg-rule: #d9c8a8;
  --flg-timber: #3d2613;
  --flg-timber-d: #2e1c0e;
  --flg-gold: #c9932f;
  --flg-gold-d: #a67c2e;
  --flg-link: #362708;
  --flg-link-h: #2e2005;
  --flg-cream: #f2eadb;
  --flg-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --flg-shell: 1160px;
  --flg-measure: 68ch;
  --flg-gap: 1.5rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--flg-paper);
  color: var(--flg-body);
  font-family: var(--flg-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
#page, .flg-shell { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--flg-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--flg-link-h); }
a:focus-visible { outline: 2px solid var(--flg-gold); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--flg-ink); font-weight: 800; line-height: 1.32; margin: 0 0 .6rem; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.35rem; margin: 0 0 1.1em; }
li { margin-bottom: .35rem; }
strong, b { color: var(--flg-ink); }
hr { border: 0; border-top: 1px solid var(--flg-rule); margin: 2.5rem 0; }

.flg-shell {
  max-width: var(--flg-shell);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.flg-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--flg-timber-d); color: #fff; padding: .75rem 1.25rem; z-index: 20;
}
.flg-skip:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.flg-head { background: var(--flg-timber); border-bottom: 3px solid var(--flg-gold); }
.flg-head__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding: .85rem 1.25rem;
}
.flg-head__brand { min-width: 0; }
.flg-head__title, .flg-head__title a { color: var(--flg-cream); font-size: 1.375rem; font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
.flg-head__title a:hover { color: #fff; }
.flg-head__logo img { max-height: 56px; width: auto; }

.flg-navburger {
  display: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; margin: 0;
  background: transparent; border: 1px solid rgba(242,234,219,.25); border-radius: 6px;
  color: var(--flg-cream); cursor: pointer;
}
.flg-navburger__bars {
  width: 22px; height: 2px; background: currentColor; position: relative; display: inline-block;
}
.flg-navburger__bars::before, .flg-navburger__bars::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor;
}
.flg-navburger__bars::before { top: -7px; }
.flg-navburger__bars::after { top: 7px; }
.flg-navburger__text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.flg-nav__list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.flg-nav__list a {
  display: inline-block; padding: .9rem .95rem; min-height: 48px;
  color: var(--flg-cream); text-decoration: none; font-weight: 600; font-size: .9375rem;
  border-bottom: 3px solid transparent;
}
.flg-nav__list a:hover, .flg-nav__list a[aria-current="page"] {
  color: #fff; border-bottom-color: var(--flg-gold);
}
@media (max-width: 40rem) {
  .flg-navburger { display: inline-flex; }
  .flg-nav {
    flex-basis: 100%; max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .flg-nav.is-open { max-height: 24rem; }
  .flg-nav__list { flex-direction: column; padding: .5rem 0; }
  .flg-nav__list li { margin: 0; }
  .flg-nav__list a { display: block; padding: .95rem .25rem; border-bottom: 1px solid rgba(242,234,219,.12); }
}

/* ---------- Lede (home/archive/search/404/author header) ---------- */
.flg-lede { max-width: var(--flg-measure); margin: 2.5rem auto 1.5rem; padding: 0 .25rem; }
.flg-lede__title { font-size: 2rem; line-height: 1.35; }
.flg-lede__standfirst { font-size: 1.1875rem; line-height: 1.55; color: var(--flg-body); }
.flg-lede__search { margin-top: 1rem; }
.flg-lede__back { margin-top: 1rem; }
.flg-lede__updated { color: var(--flg-muted); font-size: .875rem; line-height: 1.4; margin-top: .75rem; }

/* ---------- Eyebrow ---------- */
.flg-eyebrow {
  display: inline-block; color: var(--flg-link); background: var(--flg-paper-d);
  font-weight: 700; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 4px; text-decoration: none; margin-bottom: .5rem;
}
.flg-eyebrow:hover { color: var(--flg-link-h); }

/* ---------- Palisade Grid ---------- */
.flg-palisade {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
  margin: 1.5rem 0 2.5rem; max-width: var(--flg-shell);
}
@media (min-width: 42rem) {
  .flg-palisade {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(160px, auto);
    gap: var(--flg-gap);
    /* Backfill any gap a spanning tile leaves behind. */
    grid-auto-flow: dense;
  }
  /* A watchtower needs a partner column to pair with; when it is the last tile
     there is none, and the span opens a full two-row hole beside it. */
  .flg-tile:nth-of-type(3n+1):not(:last-of-type) { grid-row: span 2; }
}
.flg-tile {
  background: var(--flg-card); border: 1px solid var(--flg-rule);
  overflow: hidden; box-shadow: 0 1px 2px rgba(38,26,17,.06);
  transition: box-shadow .18s ease, transform .18s ease;
  display: flex; flex-direction: column; height: 100%;
}
.flg-tile:hover { box-shadow: 0 10px 22px rgba(38,26,17,.12); transform: translateY(-2px); }
.flg-tile__figure { margin: 0; }
.flg-tile__figure img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.flg-tile__figure figcaption { padding: .4rem .9rem; background: var(--flg-timber); color: var(--flg-cream); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.flg-tile__body { padding: 1.1rem 1.25rem 1.35rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.flg-tile__body h2 { font-size: 1.125rem; line-height: 1.32; margin: 0; order: 1; }
.flg-tile__body h2 a { color: var(--flg-ink); text-decoration: none; }
.flg-tile__body h2 a:hover { color: var(--flg-link); text-decoration: underline; }
.flg-tile__body time { color: var(--flg-muted); font-size: .875rem; line-height: 1.4; order: 2; }
.flg-tile__body .flg-tile__excerpt { font-size: .9375rem; line-height: 1.5; margin: 0; order: 3; }

/* A watchtower is twice as tall but carries the same amount of copy, so the
   card used to end in a large blank. Give the leftover height to the image. */
@media (min-width: 42rem) {
  .flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__figure { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  /* The link, not the img, is the figure's flex item — grow that or the extra
     height just becomes white space under the photo. */
  .flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__figure > a { flex: 1 1 auto; min-height: 220px; display: block; }
  .flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__figure img { aspect-ratio: auto; height: 100%; width: 100%; object-fit: cover; }
  .flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__body { flex: 0 0 auto; }
}

/* Watchtower tiles: larger type and padding at every breakpoint */
.flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__body { padding: 1.5rem 1.65rem 1.75rem; }
.flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__body h2 { font-size: 1.5rem; }
.flg-tile:nth-of-type(3n+1):not(:last-of-type) .flg-tile__excerpt { font-size: 1rem; line-height: 1.55; }
.flg-empty { color: var(--flg-muted); margin: 2rem 0; }

/* ---------- Article / Page ---------- */
.flg-piece { margin: 1.5rem auto 3rem; }
.flg-piece__head { max-width: var(--flg-shell); margin: 0 auto; padding: 0 .25rem; }
.flg-piece__title { font-size: 2.0625rem; line-height: 1.35; margin-bottom: .6rem; }
.flg-piece__meta { color: var(--flg-muted); font-size: .875rem; line-height: 1.4; margin-bottom: 1.5rem; }
.flg-piece__dot { margin: 0 .35rem; }
.flg-piece__figure { max-width: var(--flg-shell); margin: 0 auto 2rem; overflow: hidden; }
.flg-piece__figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.flg-piece__main { max-width: var(--flg-measure); margin: 0 auto; padding: 0 .25rem; }
.flg-piece--page .flg-piece__main { margin-top: 1.5rem; }
.flg-piece__body { font-size: 1.0625rem; line-height: 1.7; }
.flg-piece__body h2 { font-size: 1.5rem; margin-top: 2.2em; }
.flg-piece__body h3 { font-size: 1.1875rem; margin-top: 1.8em; }
.flg-piece__body table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .9375rem; }
.flg-piece__body th, .flg-piece__body td { padding: .625rem .75rem; border: 1px solid var(--flg-rule); text-align: left; }
.flg-piece__body th { background: var(--flg-timber); color: var(--flg-cream); font-weight: 700; }
.flg-piece__body tr:nth-child(even) td { background: var(--flg-paper-d); }
.flg-piece__body blockquote {
  margin: 1.5rem 0; padding: 1rem 1.5rem; border-left: 4px solid var(--flg-gold);
  background: var(--flg-paper-d); border-radius: 0 8px 8px 0; color: var(--flg-body);
}
.flg-piece__body code { background: var(--flg-paper-d); border: 1px solid var(--flg-rule); border-radius: 4px; padding: .1em .35em; font-size: .875em; }

/* Sentry Note — top callout with corner flag */
.flg-sentry {
  position: relative;
  max-width: var(--flg-measure); margin: 0 auto 2rem; padding: 0 .25rem;
}
.flg-sentry__box {
  position: relative;
  border: 1px solid var(--flg-gold); border-top: 4px solid var(--flg-gold);
  background: var(--flg-paper-d); padding: 1.25rem 1.5rem;
}
.flg-sentry__box::before {
  content: ""; position: absolute; top: -4px; right: 1.5rem;
  width: 22px; height: 22px; background: var(--flg-gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.flg-sentry p { margin: 0; color: var(--flg-body); font-size: 1.0625rem; line-height: 1.55; font-weight: 600; }

/* Author bio card */
.flg-bio {
  display: flex; gap: 1rem; align-items: flex-start; margin: 2.5rem 0 1rem;
  padding: 1.25rem; background: var(--flg-card); border: 1px solid var(--flg-rule);
}
.flg-bio__portrait { flex: 0 0 80px; }
.flg-bio__portrait img { display: block; width: 80px; height: 80px; aspect-ratio: 1 / 1; object-fit: cover; flex-shrink: 0; }
.flg-bio__name { margin: 0 0 .2rem; font-weight: 700; }
.flg-bio__name a { color: var(--flg-ink); text-decoration: none; }
.flg-bio__role { margin: 0 0 .4rem; color: var(--flg-link); font-size: .875rem; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.flg-bio__text { margin: 0 0 .5rem; color: var(--flg-body); font-size: .9375rem; line-height: 1.5; }
.flg-bio__more a { font-size: .875rem; font-weight: 700; }

/* Prev/next */
.flg-adjacent {
  max-width: var(--flg-measure); margin: 0 auto 3rem; padding: 0 .25rem;
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 40rem) { .flg-adjacent { grid-template-columns: 1fr 1fr; } }
.flg-adjacent__item {
  display: block; border: 1px solid var(--flg-rule); border-radius: 8px; padding: 1rem 1.1rem;
  text-decoration: none; color: var(--flg-body);
}
.flg-adjacent__item--next { text-align: right; }
.flg-adjacent__label { display: block; font-size: .875rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .08em; color: var(--flg-muted); margin-bottom: .3rem; }
.flg-adjacent__title { display: block; font-weight: 700; color: var(--flg-ink); }
.flg-adjacent__item:hover .flg-adjacent__title { color: var(--flg-link); text-decoration: underline; }

/* ---------- Search form ---------- */
.flg-searchform__label { display: block; font-size: .875rem; line-height: 1.4; margin-bottom: .4rem; color: var(--flg-body); }
.flg-searchform__row { display: flex; gap: .5rem; max-width: 30rem; }
.flg-searchform__input {
  flex: 1 1 auto; padding: .7rem .85rem; border: 1px solid var(--flg-rule); border-radius: 6px;
  font-size: 1rem; min-height: 48px; background: var(--flg-card); color: var(--flg-body);
}
.flg-searchform__button {
  background: var(--flg-link); color: #fff; border: 0; border-radius: 6px; padding: .7rem 1.2rem;
  font-weight: 700; min-height: 48px; cursor: pointer;
}
.flg-searchform__button:hover { background: var(--flg-link-h); }

/* ---------- Footer ---------- */
.flg-foot { background: var(--flg-timber); color: var(--flg-cream); margin-top: 3rem; }
.flg-foot__grid {
  display: grid; grid-template-columns: 1fr; gap: 2rem;
  padding: 3rem 1.25rem 2rem; list-style: none; margin: 0;
}
@media (min-width: 48rem) { .flg-foot__grid { grid-template-columns: repeat(3, 1fr); } }
.flg-foot__head { color: #fff; font-size: 1rem; line-height: 1.32; margin-bottom: .75rem; }
.flg-foot__col p { color: var(--flg-cream); font-size: .9375rem; line-height: 1.5; }
.flg-foot__list { list-style: none; margin: 0; padding: 0; }
.flg-foot__list li { margin-bottom: .45rem; }
.flg-foot__list a { color: var(--flg-cream); text-decoration: none; font-size: .9375rem; line-height: 1.5; }
.flg-foot__list a:hover { color: #fff; text-decoration: underline; }
.flg-foot__age {
  border-top: 1px solid rgba(242,234,219,.15); padding: 1.25rem;
  font-size: .875rem; line-height: 1.5; color: var(--flg-cream);
}
.flg-foot__base {
  border-top: 1px solid rgba(242,234,219,.15); padding: 1.25rem;
  font-size: .875rem; line-height: 1.5; color: var(--flg-cream);
}

/* ---------- Utility ---------- */
.flg-piece__body, .flg-tile__excerpt, .flg-lede__standfirst { overflow-wrap: break-word; word-break: break-word; }
