/* ==========================================================================
   THE FOURTH QUARTER TAVERN — theme.css
   Flat, shared-border bento language on near-black. Zero radius, zero gaps:
   panels sit edge-to-edge and share 1px hairlines. Red #c8232c + gold accents,
   ultra-condensed uppercase display type, crest watermark in media slots.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Oswald:wght@400;500;600;700&family=Barlow+Semi+Condensed:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Permanent+Marker&display=swap');

/* ---- Tokens ---- */
:root {
  --brand-name: "The Fourth Quarter Tavern";
  --brand-name-1: "The Fourth Quarter";
  --brand-name-2: "Tavern";

  /* Neutral-cool near-black ground. The red/gold/cream marks supply all the
     warmth; the surfaces stay hue-neutral so nothing reads brown. */
  --color-bg: #0a0b0d;
  --color-surface: #14161a;
  --color-surface-alt: #1a1d22;
  --color-ink: #efe9df;
  --color-ink-muted: #a2988e;
  --color-brand: #c8232c;
  --color-on-brand: #ffffff;
  --color-accent: #f0b43c;
  --color-border: #272b31;
  --color-link: #f0b43c;

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --font-accent: "Oswald", "Arial Narrow", sans-serif;

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-pill: 0;
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.45);
  --shadow-md: 0 2px 0 rgba(0, 0, 0, 0.55);

  --container-max: 1240px;
  --section-pad: 72px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
  margin: 0;
  color: var(--color-ink);
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-ink); }

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

::selection { background: var(--color-brand); color: var(--color-on-brand); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Sections ---- */
.section { padding: var(--section-pad) 0; }

.section-alt {
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-head { max-width: 640px; margin-bottom: 36px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  background: var(--color-brand);
}

.section-title { font-size: clamp(28px, 4vw, 42px); }

.section-sub {
  color: var(--color-ink-muted);
  font-size: 17px;
  margin: 12px 0 0;
}

/* ---- Header ----
   No accent strip above the bar: the page opens on the ground colour, as the
   mockup does. The header reads as chrome through its bottom hairline alone. */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 10;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 78px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-ink);
}
.brand:hover { color: var(--color-ink); }

.brand-mark {
  width: 58px;
  height: 58px;
  flex: none;
  background: url("../../assets/img/the-fourth-quarter/brand-crest.svg") center / contain no-repeat;
}

.brand-name {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 1;
}
.brand-name::before {
  content: var(--brand-name-1);
  display: block;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--color-ink);
}
.brand-name::after {
  content: var(--brand-name-2);
  display: block;
  margin-top: 4px;
  font-family: var(--font-accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.52em;
  color: var(--color-brand);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  position: relative;
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  padding: 10px 12px 12px;
}
.nav-link:hover { color: var(--color-ink); }
/* Active tab reads red, and its rule is drawn inside the padding so it never
   runs wider than the word itself. */
.nav-link.is-active { color: var(--color-brand); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  /* trim the trailing letter-space so the rule ends with the last glyph */
  right: calc(12px + 0.14em);
  bottom: 6px;
  height: 2px;
  background: var(--color-brand);
}

.nav-cta { margin-left: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  padding: 15px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
  border-color: var(--color-brand);
}
.btn-primary:hover { background: #a71c24; border-color: #a71c24; color: var(--color-on-brand); }

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink-muted);
}
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn-small { padding: 11px 18px; font-size: 12px; }

/* ---- Cards & media ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-media { border-bottom: 1px solid var(--color-border); }
.card-media .media-ph { border: 0; }

.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-title { font-size: 20px; letter-spacing: 0.03em; }

.card-text { margin: 0; color: var(--color-ink-muted); font-size: 15px; line-height: 1.55; }

.card-link {
  margin-top: auto;
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.card-link::after { content: " \203A"; color: var(--color-brand); }
.card-link:hover { color: var(--color-ink); }

/* CSS-painted media slot: floodlit gradient + ghosted crest watermark */
.media-ph {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(200, 35, 44, 0.34) 0%, rgba(14, 16, 19, 0.72) 46%, rgba(240, 180, 60, 0.16) 100%),
    url("../../assets/img/the-fourth-quarter/brand-crest.svg") center / 40% no-repeat,
    repeating-linear-gradient(90deg, rgba(239, 233, 223, 0.045) 0 1px, transparent 1px 56px),
    linear-gradient(180deg, #1f232a, #0e1013);
  aspect-ratio: 16 / 9;
}
.media-ph--wide { aspect-ratio: 16 / 9; }
.media-ph--square { aspect-ratio: 1 / 1; }
.media-ph--tall { aspect-ratio: 3 / 4; }

/* ---- Footer ---- */
.site-footer {
  margin-top: var(--section-pad);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 36px;
  padding-bottom: 32px;
}

.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.footer-about .brand { margin-bottom: 8px; }
.footer-about .brand-mark { width: 84px; height: 84px; }

.footer-heading {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 8px;
}

.footer-link {
  color: var(--color-ink-muted);
  font-size: 15px;
  padding: 2px 0;
}
.footer-link:hover { color: var(--color-ink); }

.footer-tagline { color: var(--color-ink-muted); font-size: 15px; margin: 0; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  padding-top: 22px;
  padding-bottom: 26px;
  color: var(--color-ink-muted);
  font-size: 13px;
  font-family: var(--font-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   Dashboard — one contiguous bento shell: sidebar and stacked panels all
   share hairlines, nothing floats.
   ========================================================================== */

.page-dashboard .dash-layout { margin-top: 48px; }

.dash-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.dash-sidebar {
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
}

.dash-nav { display: flex; flex-direction: column; position: sticky; top: 0; }

.dash-nav-link {
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid transparent;
}
.dash-nav-link:hover { color: var(--color-ink); background: var(--color-surface); }
.dash-nav-link.is-active {
  color: var(--color-ink);
  background: var(--color-surface-alt);
  border-left-color: var(--color-brand);
}

.dash-main { display: flex; flex-direction: column; min-width: 0; }

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 30px 32px;
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(120deg, rgba(200, 35, 44, 0.12), transparent 55%),
    var(--color-surface);
}

.page-title { font-size: clamp(26px, 3vw, 36px); }

.page-sub { color: var(--color-ink-muted); margin: 8px 0 0; font-size: 16px; }

/* Shared-border stat row: 1px gaps expose the hairline background */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.stat {
  background: var(--color-surface);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--color-ink);
}

.stat-label {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin-top: 6px;
}

.stat-delta { font-size: 13px; font-weight: 600; color: var(--color-ink-muted); }
.stat-delta.is-up { color: var(--color-accent); }
.stat-delta.is-down { color: var(--color-brand); }
.stat-delta.is-info { color: var(--color-ink-muted); }

/* Panels stack flush; hairline between comes from border-bottom */
.panel { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.dash-main > .panel:last-child { border-bottom: 0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.panel-title { font-size: 19px; letter-spacing: 0.05em; }

.panel-body { padding: 24px 32px 30px; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }

.table th {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  color: var(--color-accent);
  padding: 10px 14px;
  border-bottom: 2px solid var(--color-brand);
  background: var(--color-bg);
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink);
}

.table tbody tr:hover td { background: var(--color-surface-alt); }

/* Badges */
.badge {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-ink-muted);
  background: var(--color-bg);
}
.badge.is-success { color: #6fd08a; border-color: rgba(111, 208, 138, 0.45); }
.badge.is-warning { color: var(--color-accent); border-color: rgba(240, 180, 60, 0.5); }
.badge.is-info { color: #7fb6e0; border-color: rgba(127, 182, 224, 0.45); }

/* Activity */
.activity-list { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}
.activity-item:last-child { border-bottom: 0; }

.activity-time {
  margin-left: auto;
  flex: none;
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

/* Forms */
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }

.form-label {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.form-input,
.form-select {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-ink);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
}
.form-input::placeholder { color: var(--color-ink-muted); }
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}

.form-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-accent) 50%),
    linear-gradient(135deg, var(--color-accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.profile-form { max-width: 460px; }
.form-actions { margin-bottom: 0; }

/* ==========================================================================
   Blog post
   ========================================================================== */

.page-post .post { margin-top: 56px; }

.post { max-width: 820px; margin-left: auto; margin-right: auto; }

.post-header { margin-bottom: 32px; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.tag {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid rgba(240, 180, 60, 0.5);
  padding: 5px 12px;
}
.tag:hover { color: var(--color-ink); border-color: var(--color-ink); }

.post-title { font-size: clamp(34px, 5vw, 54px); }

.post-excerpt {
  font-size: 19px;
  color: var(--color-ink-muted);
  margin: 18px 0 0;
  line-height: 1.5;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}
.post-meta .avatar { width: 34px; height: 34px; font-size: 13px; }
.post-meta-author { color: var(--color-ink); }
.post-meta-sep { color: var(--color-brand); }

.post-hero { margin: 0 0 40px; }
.post-hero .media-ph { aspect-ratio: 21 / 9; }

/* Prose */
.prose { font-size: 17px; line-height: 1.75; color: var(--color-ink); }

.prose p { margin: 0 0 1.4em; }

.prose h2 {
  font-size: 27px;
  margin: 1.9em 0 0.7em;
  padding-left: 16px;
  border-left: 4px solid var(--color-brand);
}

.prose h3 { font-size: 20px; margin: 1.6em 0 0.6em; color: var(--color-accent); }

.prose a { color: var(--color-link); border-bottom: 1px solid rgba(240, 180, 60, 0.4); }
.prose a:hover { color: var(--color-ink); border-bottom-color: var(--color-ink); }

.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 24px; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--color-brand); font-weight: 700; }

.prose blockquote {
  margin: 1.8em 0;
  padding: 20px 26px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  font-family: var(--font-display);
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.35;
}
.prose blockquote p { margin: 0; }

.prose figure { margin: 1.8em 0; }
.prose figcaption {
  margin-top: 10px;
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.prose code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--color-accent);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 2px 7px;
}

.prose pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 1.8em 0;
}
.prose pre code { background: none; border: 0; padding: 0; color: var(--color-ink); }

.prose table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: 15px; }
.prose th {
  font-family: var(--font-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  color: var(--color-accent);
  background: var(--color-bg);
  padding: 10px 14px;
  border-bottom: 2px solid var(--color-brand);
}
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.prose tbody tr:hover td { background: var(--color-surface-alt); }

.prose hr {
  border: 0;
  height: 3px;
  margin: 2.4em 0;
  background: linear-gradient(90deg, var(--color-brand) 0 64px, var(--color-border) 64px);
}

/* Author card */
.author-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand);
  padding: 24px 26px;
  margin-top: 48px;
}
.author-card .avatar { width: 52px; height: 52px; font-size: 19px; }

.author-card-name {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.author-card-bio { margin: 8px 0 0; color: var(--color-ink-muted); font-size: 15px; }

/* Related posts: shared-border trio */
.related-posts .related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}
.related-grid .card { border: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .related-posts .related-grid { grid-template-columns: 1fr; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .dash-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .dash-nav-link { border-left: 0; border-bottom: 3px solid transparent; }
  .dash-nav-link.is-active { border-left: 0; border-bottom-color: var(--color-brand); }
}

@media (max-width: 640px) {
  :root { --section-pad: 52px; }
  .site-header-inner { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; }
  .stat-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .dash-header, .panel-head { padding-left: 20px; padding-right: 20px; }
  .panel-body { padding: 20px; }
  .activity-time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
