/* -------- design tokens -------- */
:root {
  --bg-color: #fafafa;
  --text-color: #1a1a1a;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

/* -------- base -------- */
html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg-color);
  color: var(--text-color);
}

body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

/* -------- header -------- */
header {
  padding: 2rem 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.logo:hover {
  text-decoration: none;
}

.logo svg {
  display: block;
}

.header-divider {
  width: 1px;
  height: 40px;
  background: var(--text-color);
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.site-title:hover {
  text-decoration: none;
}

.title-line {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-color);
  text-transform: uppercase;
  font-family: var(--font-body);
}

/* -------- header graphic -------- */
.header-graphic-container {
  width: 100%;
  margin: 0;
  padding-top: 1rem;
}

.header-graphic {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

/* -------- main content -------- */
main {
  padding: 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.main-content-columns {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  border-top: 1px solid var(--text-color);
  padding-top: 1rem;
}

.main-nav {
  padding-right: 1.5rem;
  position: relative;
}

.main-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text-color);
}

.tab-button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.6;
  padding: 0;
  margin-bottom: 0.5rem;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.tab-button:hover {
  opacity: 0.7;
  text-decoration: none;
}

.tab-button.active {
  font-weight: bold;
}

.tab-content {
  display: none;
  columns: 4;
  column-gap: 0;
  padding-left: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* Post items as direct column children */
.tab-content .post-item {
  padding: 0 1.5rem;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-color);
  text-transform: none;
  line-height: 1.6;
  break-inside: avoid;
  margin-bottom: 0.25rem;
}

/* Column dividers using column-rule */
.tab-content.active {
  column-rule: 1px solid var(--text-color);
  column-rule-width: 1px;
  column-rule-style: solid;
  column-rule-color: var(--text-color);
}

.tab-content .post-item a {
  color: var(--text-color);
  text-decoration: none;
}

.tab-content .post-item a:hover {
  text-decoration: underline;
}

.tab-content .post-item.draft {
  opacity: 0.5;
}

/* Remove old grid-based divider rules - using column-rule instead */

/* Adjust for different column counts in media queries */

/* -------- responsive main content -------- */
/* Wide: 4 columns (> 1400px) - default above, dividers already set */

/* Medium: 3 columns (1000px - 1400px) */
@media (max-width: 1400px) {
  .tab-content.active {
    columns: 3;
  }
}

/* Narrow: 2 columns (600px - 1000px) */
@media (max-width: 1000px) {
  .tab-content.active {
    columns: 2;
  }
}

/* Mobile: 1 column (< 600px) */
@media (max-width: 600px) {
  .main-content-columns {
    grid-template-columns: 1fr;
  }
  
  .main-nav {
    padding-right: 0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--text-color);
  }
  
  .main-nav::after {
    display: none;
  }
  
  .main-nav {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .tab-button {
    display: inline-block;
    width: auto;
    margin-bottom: 0;
  }
  
  .tab-content.active {
    columns: 1;
    padding-left: 0;
    column-rule: none;
  }
}

/* -------- single post layout -------- */
.single-post-layout {
  grid-template-columns: auto 1fr;
}

.post-content-area {
  padding-left: 1.5rem;
  max-width: 800px;
  font-family: var(--font-body);
}

/* -------- content pages -------- */
.content {
  margin: 1rem 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

.content p {
  margin: 1.5em 0;
}

.content ul, .content ol {
  margin-left: 0;
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.content img {
  max-width: 100%;
  height: auto;
}

article {
  margin-bottom: 2rem;
}

article h2 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
  color: var(--text-color);
  font-family: var(--font-body);
}

article h3 {
  font-family: var(--font-body);
}

article h4 {
  font-size: 1rem;
  font-weight: 400;
  margin: 0.5rem 0;
  font-family: var(--font-body);
}

article h4 a {
  color: var(--text-color);
  text-decoration: none;
}

article h4 a:hover {
  text-decoration: underline;
}

time {
  display: block;
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 0.9rem;
  opacity: 0.7;
  font-family: var(--font-body);
}

.tags {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.tags span {
  margin-right: 0.5rem;
}

/* -------- links -------- */
a {
  color: var(--text-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Links in article content should always be visible */
.content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* -------- draft posts -------- */
article.draft {
  opacity: 0.6;
}

article.draft h4 a {
  color: #666;
}
