/* --- System & Themes (Defaulting to Dark) --- */
:root {
  --bg-color: #111111;       /* Crisp ink off-black */
  --text-main: #e5e5e5;      /* Crisp white text */
  --text-muted: #909090;     /* Muted grey for index metadata */
  --border-color: #2a2a2a;   /* Soft dark lines */
  --interlude-bg: #161616;   
  
  --font-serif: "Georgia", Cambria, "Times New Roman", serif;
  --font-mono: "Courier New", Courier, monospace;
}

/* Light Theme State Override Mapping */
[data-theme="light"] {
  --bg-color: #ffffff;       /* Warm analog paper white */
  --text-main: #111111;      /* Crisp ink off-black */
  --text-muted: #666666;     /* Muted grey for index metadata */
  --border-color: #e2e1dd;   /* Soft paper creases/lines */
  --interlude-bg: #fdfdfd;   
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-serif);
  line-height: 1.6;
  padding: 5vw 2rem;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Layout Header & Sub-Nav --- */
header {
  max-width: 544px;
  margin: 0 auto 5rem auto;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.header-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand Wordmark Alignment & Theme Switch Toggle */
.brand-wordmark {
  display: flex;
  align-items: center;
  max-height: 24px; /* Caps height to keep alignment perfectly inline and compact */
}

.wordmark-asset {
  height: 40px;      /* Adjust this height scale to fine-tune your logo proportions from Figma */
  width: auto;
  display: block;
}

/* Default Theme Display State (Now Dark Mode defaults) */
.light-logo { display: none; }
.dark-logo { display: block; }

/* Light Theme Display State Override */
[data-theme="light"] .light-logo { display: block; }
[data-theme="light"] .dark-logo { display: none; }

#theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
  font-family: var(--font-mono);
  
  /* FIX: Forces the button bounding box to stay exactly the same size regardless of character shape */
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

header p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

.system-nav {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.system-nav button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  text-transform: lowercase;
  padding-bottom: 2px;
}

.system-nav button.active, .system-nav button:hover {
  color: var(--text-main);
  border-bottom: 1px solid var(--text-main);
}

#active-tag-indicator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- System Inline Back Navigation --- */
.view-back-nav {
  max-width: 544px;
  margin: -3.5rem auto 3.5rem auto; /* Sits perfectly in the negative space below the header line */
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.view-back-nav a {
  color: var(--text-muted);
  text-decoration: none;
  text-transform: lowercase;
  cursor: pointer;
  display: inline-block;
  padding: 0.25rem 0;
}

.view-back-nav a:hover {
  color: var(--text-main);
}

/* --- Single-Column Stream Container --- */
.journal-grid {
  display: flex;
  flex-direction: column;
  gap: 6rem;               
  max-width: 544px;        
  margin: 0 auto;
  width: 100%;
}

/* --- Editorial Cards --- */
.journal-card {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;             
  max-width: 100%;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-meta span.tag-link {
  text-transform: lowercase;
  margin-left: 0.5rem;
  cursor: crosshair; /* Changes cursor to a precise tracking crosshair */
  transition: color 0.1s ease;
  text-decoration: underline;
}

.card-meta span.tag-link:hover {
  color: var(--text-main);
}

/* Base Prose Layout */
.card-prose {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* --- Dynamic Post Types Treatment --- */

.quote-text {
  white-space: pre-wrap; /* 👈 This forces the browser to respect your data's \n line breaks natively */
  text-align: center;
}

/* Quote Type Formatting */
.type-quote .quote-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.type-quote .quote-source {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 1.5rem;
}

/* Link Type Formatting */
.type-link .link-anchor {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
  display: inline-block;
  margin-bottom: 1rem;
}

.type-link .link-anchor:hover {
  color: var(--text-muted);
}

/* --- Inside Text Blocks Elements --- */
.inline-interlude {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--interlude-bg);       
  padding: 1.25rem;
  border-left: 2px solid var(--text-main);
  margin: 2rem 0;
  line-height: 1.5;
}

.card-image-container {
  width: 100%;
  max-width: 100%;          
  margin: 0 0 1.5rem 0;
}

.card-image {
  width: 100%;
  height: auto;             
  display: block;
  filter: grayscale(10%) contrast(105%); 
}

/* --- Clean Media Sync Footers --- */
.inline-media-sync {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 1.25rem;
  margin-top: 1.5rem;      
  line-height: 1.4;
  text-transform: lowercase;
}

.inline-media-sync span {
  color: var(--text-main);
}

/* --- Dynamic Archive Architecture --- */
.archive-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  font-family: var(--font-mono);
}

.archive-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
  font-size: 0.85rem;
}

.archive-left a {
  color: var(--text-main);
  text-decoration: none;
  margin-left: 1.5rem;
}

.archive-left a:hover {
  text-decoration: underline;
}

.archive-date {
  color: var(--text-muted);
}

.archive-type {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Artifacts & Store UI Extensions --- */
.product-title-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

/* Minimalist Print/Apparel Buy Button Component */
.buy-button {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  border: 1px solid var(--text-main);
  padding: 0.75rem;
  color: var(--text-main);
  text-decoration: none;
  text-transform: lowercase;
  font-size: 0.85rem;
  margin-top: 1rem;
  letter-spacing: 0.05em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.buy-button:hover {
  background-color: var(--text-main);
  color: var(--bg-color);
}

/* Specific styling modifier for product layout items inside index view paths */
.archive-container [data-type="product"] {
  border-left: 1px solid var(--text-main);
  padding-left: 0.5rem;
}

/* --- Tumblr Style Text Pagination --- */
.tumblr-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 544px;
  margin: 6rem auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tumblr-pagination button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 0.5rem;
  text-transform: lowercase;
  transition: color 0.2s ease;
}

.tumblr-pagination button:hover {
  color: var(--text-main);
}

#page-indicator {
  user-select: none;
  letter-spacing: 0.05em;
}

/* --- Bespoke Selection Highlight Tweaks --- */
::selection {
  background: var(--text-main);
  color: var(--bg-color);
}
/* Webkit support */
::-webkit-selection {
  background: var(--text-main);
  color: var(--bg-color);
}

/* --- Read More Text Stream Triggers --- */
.read-more-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px solid var(--text-main);
  margin-top: 0.5rem;
  padding-bottom: 1px;
  cursor: pointer;
  text-transform: lowercase;
}

.read-more-link:hover {
  color: var(--text-muted);
  border-bottom-color: var(--text-muted);
}

/* Responsive Rules */
@media (max-width: 768px) {
  body { padding: 2rem 1.5rem; }
  header { margin-bottom: 3rem; }
  .journal-grid { gap: 4rem; }
}