/* ================================================================
   BAUHAUS DESIGN SYSTEM
   Inspired by the Staatliches Bauhaus school (1919–1933)
   Primary triad: Red · Blue · Yellow  |  Black & White structure
   Fonts: Oswald (headings) · Inter (body)
   ================================================================ */

:root {
  --red:        #E8312A;
  --blue:       #003F8C;
  --yellow:     #F5C518;
  --black:      #1A1A1A;
  --white:      #FFFFFF;
  --off-white:  #F8F7F4;
  --gray-light: #F0EFEC;
  --gray-mid:   #D8D6D0;
  --gray-text:  #666460;

  --font-heading: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --border:       2px solid var(--black);
}

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

body {
  font-family: var(--font-body) !important;
  color: var(--black) !important;
  background: var(--off-white) !important;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Site Header — BLACK with tricolor stripe ──────────── */
.site-header {
  background: var(--black) !important;
  border-top: none !important;
  border-bottom: none !important;
  padding: 16px 0 0 !important;
  min-height: unset !important;
}

/* The red · blue · yellow bar under the header */
.site-header::after {
  content: '';
  display: block;
  height: 5px;
  margin-top: 16px;
  background: linear-gradient(
    to right,
    var(--red)    0% 33.33%,
    var(--blue)   33.33% 66.66%,
    var(--yellow) 66.66% 100%
  );
}

.site-title,
.site-title:visited {
  font-family: var(--font-heading) !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase !important;
  color: var(--white) !important;
  text-decoration: none !important;
  line-height: 1 !important;
}

/* Red dot after title — Bauhaus period */
.site-title::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 7px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.site-nav .page-link {
  font-family: var(--font-body) !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.13em !important;
  color: rgba(255,255,255,0.7) !important;
  text-decoration: none !important;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav .page-link:hover {
  color: var(--yellow) !important;
  border-bottom-color: var(--yellow) !important;
  text-decoration: none !important;
}

/* ── Home Hero ─────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 52px 0 44px;
  border-bottom: var(--border);
  margin-bottom: 52px;
}

.hero-text {}

.hero-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray-text);
  margin: 0 0 12px;
}

.home-title {
  font-family: var(--font-heading) !important;
  font-size: clamp(2.2rem, 5vw, 3.6rem) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  line-height: 1.05 !important;
  color: var(--black) !important;
  margin: 0 0 14px !important;
}

.home-subtitle {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-text);
  margin: 0;
  font-weight: 300;
}

/* Bauhaus geometric block — primary color square */
.hero-geo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.geo-red    { background: var(--red); }
.geo-blue   { background: var(--blue); }
.geo-yellow { background: var(--yellow); }
.geo-black  { background: var(--black); }

/* ── Folder Sections (accordion) ──────────────────────── */
.folder-section {
  margin-bottom: 4px;
}

details.folder-section > summary {
  list-style: none;
  cursor: pointer;
}

details.folder-section > summary::-webkit-details-marker { display: none; }
details.folder-section > summary::marker { display: none; }

.folder-header {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: var(--border);
  transition: background 0.15s;
  user-select: none;
}

.folder-header:hover { background: var(--gray-light); }

/* The thick colored stripe on the left */
.folder-stripe {
  width: 8px;
  flex-shrink: 0;
}

.folder-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  flex: 1;
}

.folder-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--black);
  flex: 1;
}

.folder-count {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-text);
  white-space: nowrap;
}

.folder-chevron {
  font-size: 0.9rem;
  color: var(--gray-text);
  transition: transform 0.25s ease;
  line-height: 1;
  padding-left: 8px;
}

details[open] .folder-chevron { transform: rotate(180deg); }

/* Category color assignments */
.folder-blue    .folder-stripe { background: var(--blue); }
.folder-red      .folder-stripe { background: var(--red); }
.folder-yellow         .folder-stripe { background: var(--yellow); }
.folder-black       .folder-stripe { background: var(--black); }

/* ── Card Grid (inside open folder) ───────────────────── */
.folder-content {
  padding: 20px 0 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
}

/* ── Post Card ─────────────────────────────────────────── */
.post-card {
  background: var(--white);
  border: var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit !important;
}

.post-card:hover {
  transform: translate(-4px, -4px);
  text-decoration: none !important;
}

/* Hover shadow color per category */
.folder-blue .post-card:hover { box-shadow: 6px 6px 0 var(--blue); }
.folder-red   .post-card:hover { box-shadow: 6px 6px 0 var(--red); }
.folder-yellow      .post-card:hover { box-shadow: 6px 6px 0 var(--yellow); }
.folder-black    .post-card:hover { box-shadow: 6px 6px 0 var(--black); }

/* ── Thumbnail ─────────────────────────────────────────── */
.card-thumb {
  width: 100%;
  height: 175px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.3s ease;
}

.post-card:hover .card-thumb img { transform: scale(1.05); }

/* Colored bar under thumbnail */
.card-thumb-bar {
  height: 4px;
  width: 100%;
}

.folder-blue .card-thumb-bar { background: var(--blue); }
.folder-red   .card-thumb-bar { background: var(--red); }
.folder-yellow      .card-thumb-bar { background: var(--yellow); }
.folder-black    .card-thumb-bar { background: var(--black); }

/* Placeholder when no image */
.card-thumb-placeholder {
  width: 100%;
  height: 8px;
}

.folder-blue .card-thumb-placeholder { background: var(--blue); }
.folder-red   .card-thumb-placeholder { background: var(--red); }
.folder-yellow      .card-thumb-placeholder { background: var(--yellow); }
.folder-black    .card-thumb-placeholder { background: var(--black); }

/* ── Card Body ─────────────────────────────────────────── */
.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-family: var(--font-heading) !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: var(--black) !important;
  text-decoration: none !important;
  display: block;
  margin-bottom: 8px;
}

.card-title:hover { color: var(--red) !important; }

.card-meta {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-text);
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 0.85rem;
  color: var(--gray-text);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

/* ── Post Article Page ─────────────────────────────────── */
.post {
  max-width: 800px;
}

.post-header {
  border-left: 6px solid var(--red) !important;
  padding-left: 24px !important;
  margin-bottom: 40px !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

.post-title {
  font-family: var(--font-heading) !important;
  font-size: clamp(1.8rem, 4vw, 2.8rem) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  line-height: 1.1 !important;
  color: var(--black) !important;
  margin-bottom: 10px !important;
}

.post-meta {
  font-family: var(--font-body) !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: var(--gray-text) !important;
}

.post-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  background: var(--yellow);
  color: var(--black);
  vertical-align: middle;
}

/* ── Post Content ──────────────────────────────────────── */
.post-content { font-size: 1rem; line-height: 1.8; }

.post-content h2 {
  font-family: var(--font-heading) !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-top: 48px !important;
  margin-bottom: 12px !important;
  padding-bottom: 6px;
  border-bottom: 4px solid var(--yellow) !important;
  color: var(--black) !important;
}

.post-content h3 {
  font-family: var(--font-heading) !important;
  font-size: 1.15rem !important;
  font-weight: 500 !important;
  color: var(--blue) !important;
  margin-top: 32px !important;
  margin-bottom: 6px !important;
}

.post-content h4 {
  font-family: var(--font-heading) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--gray-text) !important;
  margin-top: 24px !important;
}

.post-content a {
  color: var(--red) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.post-content a:hover { color: var(--blue) !important; }

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 28px auto;
  border: var(--border);
}

.post-content blockquote {
  border-left: 5px solid var(--blue) !important;
  background: var(--gray-light) !important;
  margin: 28px 0 !important;
  padding: 16px 22px !important;
  color: var(--gray-text) !important;
  font-style: italic;
}

.post-content blockquote p { margin: 0 !important; }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 24px 0;
  border: var(--border);
}

.post-content th {
  font-family: var(--font-heading) !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  background: var(--black) !important;
  color: var(--white) !important;
  padding: 10px 14px !important;
  text-align: left !important;
  border: none !important;
}

.post-content td {
  padding: 9px 14px !important;
  border-bottom: 1px solid var(--gray-mid) !important;
}

.post-content tr:nth-child(even) td { background: var(--gray-light) !important; }

.post-content code {
  font-size: 0.875em;
  background: var(--gray-light) !important;
  border: 1px solid var(--gray-mid) !important;
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--black) !important;
}

.post-content pre {
  border-left: 5px solid var(--blue) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  overflow-x: auto;
  margin: 24px 0 !important;
  background: transparent !important;
}

/* Let highlight.js CDN theme control all colors — only enforce font size */
.post-content pre code.hljs {
  border: none !important;
  border-radius: 0 !important;
  font-size: 0.875em !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace !important;
  line-height: 1.6 !important;
}

hr {
  border: none !important;
  border-top: 1px solid var(--gray-mid) !important;
  margin: 40px 0 !important;
}

/* ── Share Links ───────────────────────────────────────── */
.share-links {
  margin: 0 0 32px !important;
  padding: 14px 0 !important;
  border-top: 1px solid var(--gray-mid) !important;
  border-bottom: 1px solid var(--gray-mid) !important;
}

/* ── Post Navigation ───────────────────────────────────── */
.post_navi {
  display: flex !important;
  border-top: var(--border) !important;
  margin-top: 56px !important;
  background: var(--white);
}

.post_navi-label {
  font-family: var(--font-body);
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.14em !important;
  opacity: 0.45;
}

.post_navi .post_navi-item {
  padding: 20px 2.4em !important;
  width: 50% !important;
  position: relative !important;
  color: var(--black) !important;
  text-decoration: none !important;
  transition: background 0.15s;
}

.post_navi .post_navi-item:hover { background: var(--gray-light) !important; }

.post_navi .nav_prev {
  text-align: left !important;
  border-right: var(--border) !important;
}

.post_navi .nav_next { text-align: right !important; }
.post_navi .nav_prev .post_navi-arrow { left: 8px !important; }
.post_navi .nav_next .post_navi-arrow { right: 8px !important; }

.post_navi .post_navi-arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 1.7em !important;
  opacity: 0.25;
  color: var(--red);
}

/* ── Archive Page ──────────────────────────────────────── */
.archive-group { margin-bottom: 40px; }

.archive-group h3 {
  font-family: var(--font-heading) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.18em !important;
  color: var(--white) !important;
  background: var(--black);
  padding: 6px 14px !important;
  display: inline-block;
  margin: 0 0 2px !important;
}

.archive-group ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: var(--border);
  border-top: none;
}

.archive-group li {
  display: flex !important;
  align-items: baseline !important;
  gap: 16px !important;
  padding: 11px 16px !important;
  border-bottom: 1px solid var(--gray-mid) !important;
  font-size: 0.93rem !important;
}

.archive-group li:last-child { border-bottom: none !important; }

.archive-group li a {
  color: var(--black) !important;
  text-decoration: none !important;
  font-weight: 500;
}

.archive-group li a:hover { color: var(--red) !important; }

/* ── Site Footer ───────────────────────────────────────── */
.site-footer {
  border-top: 5px solid var(--black) !important;
  background: var(--black) !important;
  color: rgba(255,255,255,0.5) !important;
  padding: 30px 0 !important;
  font-size: 0.82rem !important;
}

.site-footer a { color: var(--yellow) !important; text-decoration: none !important; }
.site-footer a:hover { text-decoration: underline !important; }

.footer-heading {
  font-family: var(--font-heading) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  color: var(--white) !important;
  margin-bottom: 8px !important;
}

/* ── Page titles (About, Archive) ──────────────────────── */
.page-heading,
h1.post-title {
  font-family: var(--font-heading) !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--black) !important;
  border-bottom: 5px solid var(--red) !important;
  padding-bottom: 10px !important;
  margin-bottom: 32px !important;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-geo { display: none; }
  .home-hero { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .post_navi .post_navi-item { padding: 14px 1.8em !important; }
  .post-title { font-size: 1.6rem !important; }
}
