/* ============================================================
   CADENZA ARTHOUSE — style.css
   Palette: off-white #F6F2EB · near-black #111111
   Accent:  bronze #A07840 · rule-dark #222222
   Type:    Bebas Neue (display) · Libre Baskerville (body) · IBM Plex Mono (meta)
   ============================================================ */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: #F6F2EB;
  color: #111111;
  font-family: 'Libre Baskerville', Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }


/* ── MASTHEAD ──────────────────────────────────────────────── */
.masthead {
  background-color: #F6F2EB;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.masthead-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* thin rule above flag */
.masthead-top-rule {
  border-top: 1px solid #111111;
  margin-top: 18px;
}

/* ── Flag row ── */
.masthead-flag {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 0 12px;
  gap: 16px;
}

.masthead-flag-left,
.masthead-flag-right {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.masthead-flag-right { align-items: flex-end; text-align: right; }

.masthead-dot { color: #A07840; }

/* ── Center: logo + wordmark ── */
.masthead-flag-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.masthead-logo-link { display: block; }

.masthead-logo {
  height: 56px;
  width: auto;
  /* logo is black on white — works on off-white */
}

.masthead-wordmark { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.masthead-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  line-height: 1;
  color: #111111;
  text-transform: uppercase;
}

/* link inside h1 on all.html */
.masthead-title a { color: inherit; }
.masthead-title a:hover { color: #A07840; transition: color 0.2s; }

.masthead-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A07840;
}

/* ── Double rule ── */
.masthead-rule-double {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0;
}

.rule-thick { border-top: 3px solid #111111; }
.rule-thin  { border-top: 1px solid #111111; }

/* ── Nav ── */
.masthead-nav {
  display: flex;
  justify-content: center;
  gap: 36px;
  padding: 10px 0;
}

.masthead-nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #111111;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.masthead-nav a:hover        { border-bottom-color: #A07840; color: #A07840; }
.masthead-nav a.active       { border-bottom-color: #111111; }
.masthead-nav a.nav-dim      { color: #888; }
.masthead-nav a.nav-dim:hover{ color: #A07840; border-bottom-color: #A07840; }

/* thin rule below nav */
.masthead-bottom-rule { border-top: 1px solid #CCBFA8; margin-bottom: 0; }


/* ── MAIN LAYOUT ──────────────────────────────────────────── */
main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}


/* ── SECTION LABEL BAR ────────────────────────────────────── */
.section-label-bar {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #111111;
}

.section-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: #111111;
}

.section-label-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #A07840;
}


/* ── CARDS GRID ───────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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


/* ── CARD ─────────────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #DDD5C8;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* skeleton */
.card.skeleton {
  height: 340px;
  background: linear-gradient(90deg, #EDE9E1 25%, #E4DFD6 50%, #EDE9E1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  opacity: 1;
  border: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* card image */
.card-image-link { display: block; }

.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #DDD5C8;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image img { transform: scale(1.03); }

.card-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #A07840;
  color: #F6F2EB;
  padding: 3px 8px;
}

/* card body */
.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #888;
  text-transform: uppercase;
}

.card-body h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111111;
}

.card-body h2 a:hover { color: #A07840; transition: color 0.2s; }

.card-body p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #444;
  flex: 1;
}

.read-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #A07840;
  margin-top: auto;
  transition: letter-spacing 0.2s;
}

.read-link:hover { letter-spacing: 0.16em; }


/* ── CTA BUTTON ───────────────────────────────────────────── */
.all-articles-cta {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #111111;
  border: 1.5px solid #111111;
  padding: 12px 28px;
  transition: background 0.2s, color 0.2s;
}

.cta-button:hover {
  background: #111111;
  color: #F6F2EB;
}


/* ── ALL ARTICLES PAGE ────────────────────────────────────── */
.all-page main { padding-top: 40px; }

.all-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.all-header { margin-bottom: 28px; }

.all-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #888;
  margin-top: 8px;
}

/* search */
.search-bar {
  margin-bottom: 32px;
}

.search-bar input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #CCBFA8;
  padding: 10px 0;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  color: #111111;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-bottom-color: #A07840; }
.search-bar input::placeholder { color: #AAA; font-style: italic; }

/* list items */
.list-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #DDD5C8;
  opacity: 0;
  animation: fadeUp 0.35s ease forwards;
  transition: background 0.15s;
}

.list-item:hover { background: rgba(160, 120, 64, 0.04); }

.list-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: #A07840;
  padding-top: 4px;
  letter-spacing: 0.05em;
}

.list-body h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111111;
  margin-bottom: 4px;
}

.list-item:hover .list-body h3 { color: #A07840; transition: color 0.2s; }

.list-body p {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.5;
}

.list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 90px;
  text-align: right;
}

.list-right time,
.list-right .folder-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: #888;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.list-arrow {
  font-size: 0.85rem;
  color: #CCBFA8;
  transition: color 0.2s, transform 0.2s;
}

.list-item:hover .list-arrow {
  color: #A07840;
  transform: translateX(3px);
}

/* skeleton for list */
.list-skeleton {
  height: 72px;
  background: linear-gradient(90deg, #EDE9E1 25%, #E4DFD6 50%, #EDE9E1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 1px;
}

/* no results / error */
.no-results,
.error-state {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #888;
  padding: 32px 0;
  letter-spacing: 0.05em;
}

.error-detail {
  font-size: 0.72rem;
  margin-top: 8px;
  color: #AAA;
}


/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  background-color: #111111;
  color: #F6F2EB;
  margin-top: 0;
}

.footer-rule {
  height: 3px;
  background: #A07840;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  height: 32px;
  width: auto;
  /* invert so black logo shows on dark background */
  filter: invert(1);
  opacity: 0.85;
}

.footer-wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: #F6F2EB;
}

.footer-mission {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.82rem;
  font-style: italic;
  color: #CCBFA8;
  max-width: 480px;
  line-height: 1.6;
}

.footer-legal {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: #666;
  text-transform: uppercase;
}


/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .masthead-flag {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .masthead-flag-left,
  .masthead-flag-right {
    display: none;  /* hide on mobile — keeps header clean */
  }
  .masthead-title { font-size: 1.8rem; }
  .masthead-nav   { gap: 20px; flex-wrap: wrap; }

  .list-item {
    grid-template-columns: 28px 1fr;
  }
  .list-right { display: none; }
}

@media (max-width: 480px) {
  .masthead-logo { height: 40px; }
  .masthead-nav a { font-size: 0.65rem; gap: 12px; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card, .list-item { animation: none; opacity: 1; }
  .card.skeleton, .list-skeleton { animation: none; }
}
