:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", sans-serif;
  --heading-color: #EADBC8; 
  --link-color: #CD6A43;
  --blockquote-color: #2D2224;
}

body {
  background-color: #121111;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/bg_diamond.png');
  background-position: top;
  font-size: 16px;
  /* Removed MS Gothic, added Hiragino Sans, Yu Gothic, and Meiryo */
  font-family: Verdana, Tahoma, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", sans-serif;
  margin: 0;
}

/* ==========================================================================
   GLOBAL TYPOGRAPHY & ELEMENTS
   ========================================================================== */

h1, h2, h3, h4, h5 {
  font-family: var(--font-main);
  color: var(--heading-color);
}

p {
  line-height: 1.5em;
  letter-spacing: 0.03em;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 700;
}

a:hover { 
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 2px dotted #a69f95;
  opacity: 0.5;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  width: 100%; /* Suggested Dead Code */
}

li {
   line-height: 1.4em;
   margin-bottom: 0.2em;
   letter-spacing: 0.03em;
}

li ul {
   margin-top: 0.2em;
   margin-bottom: 0.3em;
}

ul, ol {
  position: relative; /* Suggested Dead Code */
}

::selection {
  background-color: #EADBC8;
  color: #121111;
}

/* ==========================================================================
   INLINE HIGHLIGHTS & CODE BLOCKS
   ========================================================================== */

mark {
  background-color: rgba(205, 106, 67, 0.22);
  color: #EADBC8;
  padding-left: 0.23em;
  padding-right: 0.1em;   
  padding-top: 0.1em;
  padding-bottom: 1px;
  border-radius: 2px;
}

code {
  font-family: monospace, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", sans-serif;
  font-size: 0.82em;
  font-weight: 600;
  color: #EADBC8;
  background-color: #251F1F;
  border: 1px solid #4A3E3F;
  border-bottom: 2px solid #161212;
  border-radius: 3px;
  display: inline-block;
  white-space: nowrap; 
  padding: 0.1em 0.45em;
  margin: 0 0.15em;
  line-height: 1.2em;
  vertical-align: 0.08em;
  text-indent: 0;
  transition: all 0.1s ease-in-out;
}

code:hover {
  background-color: #2D2626;
  border-color: var(--link-color);
}

.bouten {
  -webkit-text-emphasis-style: filled dot;
  text-emphasis-style: filled dot;
  -webkit-text-emphasis-position: over;
  text-emphasis-position: over;
}

sup.footnote-ref {
  font-size: 0.75em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.1em;
}

sup.footnote-ref a {
  text-decoration: none;
}

sup.footnote-ref a:hover {
  text-decoration: underline;
}

.footnotes {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px dashed #363232;
  font-size: 0.85em;
  color: #A69F95; 
}

.footnote-backref {
  text-decoration: none;
  font-family: monospace;
  margin-left: 0.5em;
  color: var(--link-color);
}

hr.footnotes-sep {
  display: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.right { float: right; margin-left: 1em; }
.left { float: left; margin-right: 1em; }
.center { display: block; margin-right: auto; margin-left: auto; text-align: center; }
.caption { margin-top: 0; font-size: 0.9em; font-style: italic; color: #A69F95; }

@media only screen and (min-width: 600px) {
  .small {
    max-width: 60%;
    height: auto;
  }
}

/* ==========================================================================
   MAIN STRUCTURE & CONTAINERS
   ========================================================================== */

#container {
  margin: 1.2em auto;
  width: 90%;
  max-width: 700px;
  background-color: #232020;
  color: #E5E0D8;
  border: 4px double #4A3E3F;
  position: relative;
  overflow: hidden;
  transition: max-width 0.2s ease-in-out;
}

#container.container-wide {
  max-width: 800px;
}

#content {
  padding: 10px 5%;
  position: relative;
}

#post-nav {
  text-align: center;
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px dashed #363232;
  margin-bottom: 1em;
}

#post-nav a {
  font-family: var(--font-main);
  font-size: 0.9em;
  font-weight: 500;
  color: #A69F95;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

#post-nav a:hover {
  color: var(--link-color);
  text-decoration: none;
}

.global-footer {
  text-align: center;
  font-family: var(--font-main);
  font-size: 0.75em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #57524E;
  margin-top: 2em;
  margin-bottom: 2.5em;
}

.global-footer a {
  color: #A69F95;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

.global-footer a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

#topBtn {
  display: none;
  position: fixed; 
  bottom: 20px;
  right: 30px;
  z-index: 900;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  border: 3px solid #CD6A43;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 1px 1px 0px 0px #3D292B, 2px 2px 0px 0px #3D292B, 3px 3px 0px 0px #3D292B, 4px 4px 0px 0px #3D292B, 5px 5px 0px 0px #3D292B;
  color: #EADBC8;
  background-color: #232020;
  cursor: pointer;
  padding: 0.25em 0.5em;
  font-size: 16px;
  font-family: "Open Sans", sans-serif;
}
#topBtn:active {
  box-shadow: 0px 0px 0px 0px;
  transform: translate(2px, 2px);
}

/* ==========================================================================
   BLOG POST LIST & DASHBOARD
   ========================================================================== */

ul.blog-posts {
  list-style-type: none;
  padding: 0;
  margin: 1.2em 0 1.2em 0;
}

ul.blog-posts li {
  display: flex;
  flex-direction: column;
  padding: 0.8em 0;
  margin-bottom: 0;
}

ul.blog-posts li:not(.hidden-post):has(~ li:not(.hidden-post)) {
  border-bottom: 1px dashed #363232;
}

.post-meta-group {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-bottom: 0.3em;
}

.post-month {
  font-family: monospace, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", sans-serif;
  font-size: 0.9em;
  color: #A69F95;
  flex-shrink: 0;
  width: 2.5em;
  text-align: right;
}

.post-journal {
  font-size: 0.75em;
  font-weight: 700;
  color: #E5E0D8;
  background-color: #2D2626;
  border: 1px solid #4A3E3F;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  letter-spacing: 1px;
  line-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.post-title-link {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 1.15em;
  letter-spacing: -0.02em;
  line-height: 1.3em;
  color: #BC6C4C;
}

.post-metadata {
  text-align: right;
  line-height: 1.3em;
  margin-top: 0.5em;
  margin-bottom: 2em;
  color: #A69F95;
}

.hidden-post { display: none !important; }
.hidden-year { display: none !important; }

@media only screen and (min-width: 600px) {
  ul.blog-posts li {
    flex-direction: row;
    align-items: center;
    gap: 1em;
  }
  
  .post-meta-group {
    margin-bottom: 0;
    width: 13em;
    flex-shrink: 0;
    min-width: 0;
  }
}

/* ==========================================================================
   DASHBOARD FILTER BUTTONS
   ========================================================================== */

.brand-filter-wrapper {
  display: flex;
  flex-wrap: wrap;         
  gap: 0.8em 1.4em;          
  margin-top: 0.4em;      
  margin-bottom: 1.4em;
}

.brand-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: monospace, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", sans-serif;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #A69F95;          
  border-bottom: 2px solid #363232;
  padding-bottom: 3px;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.brand-btn:hover {
  color: var(--heading-color);
  border-bottom-color: var(--heading-color);
}

.brand-btn.active {
  color: #121111;                          
  background-color: var(--heading-color);    
  border-bottom-color: var(--heading-color);
  padding-left: 0.6em;                     
  padding-right: 0.6em;
  border-radius: 2px;
}

.journal-filter-wrapper {
  display: flex;
  flex-wrap: wrap;         
  gap: 0.5em;              
  margin-top: 0.4em;      
  margin-bottom: 2.5em;      
}

.journal-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;    
  font-size: 0.72em;
  font-weight: 700;
  color: #E5E0D8;
  background-color: #2D2626; 
  border: 1px solid #4A3E3F; 
  padding: 0.25em 0.6em;
  border-radius: 3px;
  letter-spacing: 1px;
  line-height: 1.2em;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.journal-btn:hover {
  border-color: var(--link-color);
  color: #EADBC8; 
}

.journal-btn.active {
  color: #121111;                      
  background-color: var(--link-color); 
  border-color: var(--link-color);
}

/* ==========================================================================
   ARCHIVE DASHBOARD HEADER
   ========================================================================== */

.archive-header {
  padding-top: 2em;
  padding-bottom: 1em;
  text-align: center;
}

.archive-title {
  font-size: 2.1em;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--heading-color);
}

@media only screen and (min-width: 600px) {
  .archive-title {
    font-size: 3.4em;
  }
}

.archive-disclaimer {
  margin-top: 1.5em;
  margin-bottom: 2.5em; 
  padding: 1.5em 1.8em;
  font-size: 0.85em;
  line-height: 1.6em;
  color: #C8BEB3; 
  background-color: #171515;
  border: 1px solid #4A3E3F;
  border-radius: 4px;
}

.archive-disclaimer p {
  margin-top: 0;
  margin-bottom: 1.2em;
  text-align: justify;
}

.archive-disclaimer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   ARTICLE META & NAVIGATION
   ========================================================================== */

.back-link-container {
  padding-top: 1em;
  margin-bottom: 2em;
}

.back-link-top {
  font-family: var(--font-main);
  font-size: 0.9em;
  font-weight: 400;
  color: #A69F95;
  transition: color 0.2s ease;
}

.back-link-top:hover {
  color: var(--link-color);
  text-decoration: none;
}

.article-meta-card {
  font-family: inherit;
  font-size: 0.9em;
  background-color: #1e1b1b;
  border: 1px solid #362e2f;
  padding: 0.4em 1.2em;
  margin-top: 1.5em;
  margin-bottom: 2.5em;
}

.meta-row {
  display: flex;
  align-items: baseline;
  padding: 0.6em 0;
  border-bottom: 1px dashed #2d2626;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  width: 150px;
  flex-shrink: 0;
  font-weight: bold;
  color: var(--link-color);
  font-size: 1em;
  letter-spacing: 0.08em;
  padding-right: 2em;
  line-height: 1;
}

.meta-value {
  color: #d6cfc4;
  font-size: 1em;
  line-height: 1.4em;
}

.meta-value ul {
  margin: 0;
  padding-left: 1.2em;
  list-style-type: disc;
}

.meta-value li {
  margin-bottom: 0.2em;
  line-height: 1.4em;
}

.meta-value li:last-child {
  margin-bottom: 0;
}

@media only screen and (max-width: 599px) {
  .meta-row {
    flex-direction: column;
    align-items: flex-start; 
    gap: 0.4em;
  }
  
  .meta-label {
    padding-right: 0;
  }
}

/* ==========================================================================
   INTERVIEW TRANSCRIPTION LAYOUT
   ========================================================================== */

.interview-layout {
  line-height: 1.75em;
  font-size: 16px;
  --name-width: 3.2em; 
  --name-gutter: 1.0em;
  --total-indent: calc(var(--name-width) + var(--name-gutter));
  --right-cushion: 0em;
}

.interview-layout.names-1 { --name-width: 1.2em; --right-cushion: 1em; }
.interview-layout.names-2 { --name-width: 2.2em; --right-cushion: 1em; }
.interview-layout.names-3 { --name-width: 3.2em; --right-cushion: 2em; }
.interview-layout.names-4 { --name-width: 4.2em; --right-cushion: 3em; }
.interview-layout.names-5 { --name-width: 5.2em; --right-cushion: 4em; }
.interview-layout.names-6 { --name-width: 6.2em; --right-cushion: 5em; }

.interview-layout h3 {
  background-color: #2D2626;  
  border-left: 4px solid var(--link-color); 
  padding: 0.8em 1em;
  margin-top: 1.4em;
  margin-bottom: 1.2em;
  font-size: 1.1em;
  line-height: 1.6em;
}

.interview-layout h4, .prose-layout h4 {
  font-size: 1.1em;
  display: inline-block;
  background-color: #2D2626;
  padding: 0.3em 0.8em;
  margin-top: 0em;
  margin-bottom: 0.6em;
  border-radius: 2px;
}

.interview-layout blockquote {
  box-sizing: border-box;
  background-color: #282424;
  border: 1px solid #362E2F;
  padding: 1.2em 1.5em;
  width: 88%;
  margin: 1.5em auto 1.5em; 
  font-size: 0.95em;
  line-height: 1.7em;
  color: #D6CFC4;
}

.interview-layout blockquote p {
  margin-top: 0;
  margin-bottom: 0.8em;
  text-align: justify;
  text-justify: inter-ideograph;
  padding-left: 0 !important;
  text-indent: 0 !important;
}

.interview-layout blockquote p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------
   0. GENERAL PROSE / INTRO TEXT IN INTERVIEWS
   ------------------------------------------ */
.interview-layout p {
  margin-top: 0;
  margin-bottom: 1.0em;
  padding-left: 0;
  text-indent: 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ------------------------------------------
   1. DYNAMIC SPEAKER FORMAT
   ------------------------------------------ */
.interview-layout p:has(> strong:first-child):not(.interviewer-line) {
  padding-left: var(--total-indent);  
  text-indent: calc(var(--total-indent) * -1); 
  padding-right: var(--right-cushion);
}

.interview-layout p strong:first-child {
  color: var(--heading-color); 
  display: inline-block;
  width: var(--name-width);         
  margin-right: var(--name-gutter);
  text-indent: 0;          
  vertical-align: top;     
  text-align: right;
  white-space: nowrap;
}

/* ------------------------------------------
   1.5 JOINT SPEAKER MODIFIER (MARGIN BLEED)
   ------------------------------------------ */
.interview-layout p.joint-speaker strong:first-child {
  width: 6.2em;
  margin-left: calc(var(--name-width) - 6.2em); 
}

/* ------------------------------------------
   2. CASUAL INTERVIEWER LINES
   ------------------------------------------ */
.interview-layout p.interviewer-line {
  color: #A69F95;
  padding-left: var(--total-indent);
  text-indent: 0;
  padding-right: var(--right-cushion);
  margin-top: 1.0em;    
  margin-bottom: 1.0em; 
}

.interview-layout p.interviewer-line strong:first-child {
  display: none;
}

.interview-layout p.interview-note {
  background-color: #1b1818;
  border: 1px solid #312b2c;
  border-radius: 3px;
  padding-left: 1.2em;
  padding-right: 1.2em;
  width: 82%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0.8em;
  padding-bottom: 0.8em;
  margin-top: 0;
  margin-bottom: 1.0em;
  font-size: 0.9em;
  color: #CFC9BC;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FOR INTERVIEWS
   ========================================================================== */
@media only screen and (max-width: 599px) {
  .interview-layout p:has(> strong:first-child):not(.interviewer-line) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
    margin-bottom: 1.5em; 
  }

  .interview-layout p:not(.interviewer-line) strong:first-child {
    display: block !important;
    width: auto !important;
    text-align: left !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 0.3em;
  }

  .interview-layout p.interviewer-line {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
  }
  
  .interview-layout p.interviewer-line strong:first-child {
    display: none !important;
  }
}

/* ==========================================================================
   LONG-FORM PROSE & ESSAY LAYOUT
   ========================================================================== */

.prose-layout {
  font-size: 16px;
}

.prose-layout p {
  line-height: 1.7em; 
  margin-top: 0;
  margin-bottom: 0.8em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.prose-layout h2 {
  font-size: 1.3em;
  border-bottom: 1px solid #363232;
  padding-bottom: 0.3em;
  margin-top: 1.5em;
  margin-bottom: 1em;
  color: var(--heading-color);
}

.prose-layout blockquote {
  background-color: var(--blockquote-color);
  border-left: 3px solid #5A4A42;
  margin: 1.5em 0;
  padding: 1em 1.2em;
  color: #CFC9BC;
  font-size: 0.95em;
  line-height: 1.7em;
}

.prose-layout blockquote p:last-child {
  margin-bottom: 0;
}

.prose-layout .prose-callout {
  box-sizing: border-box;
  background-color: #282424;
  border: 1px solid #362E2F;
  padding: 1.2em 1.5em;
  width: 88%;
  margin: 2em auto; 
  font-size: 0.95em;
  line-height: 1.7em;
  color: #D6CFC4;
}

.prose-layout .prose-callout p {
  margin-top: 0;
  margin-bottom: 0.8em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.prose-layout .prose-callout p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   MOBILE FULL-BLEED OPTIMIZATIONS (FIXED CROSSOVER BUG)
   Triggers at 599px so it perfectly hands off to the 600px desktop grid
   ========================================================================== */
@media only screen and (max-width: 599px) {
  
  body {
    background-color: #121111;
    background-image: none;
  }

  #container, 
  #container.container-wide {
    margin: 0;
    width: 100%;
    max-width: 100%;
    border: none;
  }

  #content {
    padding: 1.5em 1.2em 1.2em; 
  }

  #content *:last-child {
    margin-bottom: 0;
  }

  .archive-title {
    font-size: 2.1em;
    letter-spacing: 0.05em;
  }
  
  .journal-filter-wrapper {
    margin-bottom: 1.8em;
  }

  .global-footer {
    margin-top: 0;
    padding: 1.2em 1.2em 1em; 
    background-color: #121111;
  }

  .global-footer a {
    display: block;
    margin-top: 0.4em;
  }
}