/* EOTE Theme - Easy On The Eyes
 * Color Palette:
 * - Iced Lavender: #C5C8D9 (primary text)
 * - Blueberry Soda: #868EA6 (secondary text)
 * - Da Blues: #535D73 (muted text/borders)
 * - Imperial Primer: #212E40 (secondary background)
 * - Kuroi Black: #0F151E (primary background)
 */

:root {
  color-scheme: dark;
  --iced-lavender: #C5C8D9;
  --blueberry-soda: #868EA6;
  --da-blues: #535D73;
  --imperial-primer: #212E40;
  --kuroi-black: #0F151E;
  --font-title: 'Handjet', sans-serif;
  --font-brand-title: 'Bitcount Single', monospace;
  
  --bg-primary: var(--kuroi-black);
  --bg-secondary: var(--imperial-primer);
  --text-primary: var(--iced-lavender);
  --text-secondary: var(--blueberry-soda);
  --text-muted: var(--da-blues);
  --border-color: var(--da-blues);
  --link-color: var(--iced-lavender);
  --link-hover: var(--blueberry-soda);
}

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

body {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  padding: 6rem 1rem 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Content Lists */
article section ul,
article section ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

article section ul li,
article section ol li {
  margin-bottom: 0.5rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--imperial-primer);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 3px 12px 0 rgba(197, 200, 217, 0.12), 0 1px 4px 0 rgba(197, 200, 217, 0.08);
}

.site-nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  font-weight: 700;
}

.brand-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--imperial-primer);
  border: 1px solid var(--blueberry-soda);
  color: var(--iced-lavender);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-logo-img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  vertical-align: middle;
}

/* --- Brand Title Alignment Fix --- */
.brand-title {
  font-family: var(--font-brand-title);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 60px;
  min-height: 60px;
  vertical-align: middle;
  padding-top: 12px;
}

.post-title,
.section-header,
.recommended-title,
.timeline-text h3,
.timeline-text h4 {
  font-family: var(--font-title);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  padding: 0.25rem 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: var(--font-title);
  font-size: 20px;
}

.site-nav a:hover {
  color: var(--text-primary);
  background-color: var(--imperial-primer);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--text-primary);
  background-color: var(--kuroi-black);
  text-decoration: none;
}

.content-card h1 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.content-card h1 .icon {
  opacity: 0.72;
}

.content-card h1 .icon svg {
  width: 0.95em;
  height: 0.95em;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

/* Main Content */
main {
  max-width: 800px;
  margin: 0 auto;
  min-height: 60vh;
}

article {
  margin-bottom: 3rem;
}

.content-card {
  background-color: var(--imperial-primer);
  border: 1px solid var(--da-blues);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 3px 12px 0 rgba(197, 200, 217, 0.12), 0 1px 4px 0 rgba(197, 200, 217, 0.08);
}

.content-card-inner-dark > section {
  background-color: var(--bg-primary);
  border: 1px solid var(--da-blues);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 0.75rem;
}

/* Ensure images in posts do not exceed section width */
.content-card > section img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

article .post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

article .post-title {
  margin-top: 0;
}

article hr {
  border: none;
  border-top: 1px solid var(--da-blues);
  margin: 1.5rem 0;
}

/* Home Page */
.home-body {
  margin-bottom: 0;
}

.featured-card {
  display: block;
  background-color: var(--kuroi-black);
  border: 1px solid var(--da-blues);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.featured-card:hover {
  border-color: var(--blueberry-soda);
  text-decoration: none;
}

.featured-card .post-title,
.featured-title {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.post-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.card-divider {
  border: none;
  border-top: 1px solid var(--da-blues);
  margin: 0.85rem 0;
}

.post-excerpt {
  color: var(--text-secondary);
  margin: 0;
}

.section-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.section-header span {
  display: inline-block;
}

/* Home Columns */
.home-columns {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.col-latest {
  flex: 0 0 70%;
  min-width: 0;
}

.col-recommended {
  flex: 0 0 calc(30% - 1.25rem);
  min-width: 0;
}

.recommended-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recommended-item {
  border: 1px solid var(--da-blues);
  border-radius: 8px;
  background-color: var(--kuroi-black);
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease;
}

.recommended-item:last-child {
  margin-bottom: 0;
}

.recommended-item:hover {
  border-color: var(--blueberry-soda);
}

.recommended-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  color: inherit;
  text-decoration: none;
}

.recommended-link:hover {
  text-decoration: none;
}

.recommended-title {
  display: block;
  font-weight: 400;
  font-size: 1.0em;
  color: var(--text-primary);
}

.recommended-desc {
  display: block;
  font-size: 0.90rem;
  color: var(--text-muted);
  margin: 0;
}

/* Tag Cloud Card Styles (migrated from tag-cloud.css) */
.tag-cloud-card {
  border: 1px solid var(--da-blues);
  border-radius: 10px;
  background-color: var(--kuroi-black);
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud-item {
  margin: 0;
}

.tag-link {
  color: var(--iced-lavender);
  font-family: var(--font-title);
  font-size: 1em;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.tag-link:hover {
  color: var(--blueberry-soda);
}

.tag-count {
  color: var(--blueberry-soda);
  font-size: 0.92em;
  margin-left: 0.2em;
}

/* Timeline Styles
 *
 * Connector line positioning math — must stay in sync with --timeline-avatar-size:
 *
 *   --timeline-line-x: card padding + half the avatar width
 *     → centers the vertical connector line on the avatar column
 *
 *   --timeline-line-center-y: card padding + avatar top offset + half avatar height
 *     → aligns the ::before dot to the vertical center of the avatar circle
 *
 * If you change --timeline-avatar-size, the line and dot will shift automatically
 * because both vars derive from it. Do NOT hardcode pixel values in ::before/::after.
 */
.timeline {
  --timeline-gap: 1.5rem;
  --timeline-card-pad: 1.25rem;
  --timeline-avatar-size: 80px;
  --timeline-avatar-offset: 6px;
  --timeline-line-x: calc(var(--timeline-card-pad) + (var(--timeline-avatar-size) / 2));
  --timeline-line-center-y: calc(var(--timeline-card-pad) + var(--timeline-avatar-offset) + (var(--timeline-avatar-size) / 2));
  position: relative;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0;
}

.timeline-item {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item:not(:first-child)::before,
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: var(--timeline-line-x);
  width: 3px;
  background-image: linear-gradient(to bottom, var(--da-blues) 50%, transparent 50%);
  background-size: 3px 12px;
  background-repeat: repeat-y;
  z-index: 1;
}

.timeline-item:not(:first-child)::before {
  top: calc(-1 * var(--timeline-gap));
  height: calc(var(--timeline-line-center-y) + var(--timeline-gap));
}

.timeline-item:not(:last-child)::after {
  top: var(--timeline-line-center-y);
  height: calc(100% - var(--timeline-line-center-y) + var(--timeline-gap));
}

.timeline-img {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--imperial-primer);
  box-shadow: 0 0 0 2px var(--da-blues);
  background: var(--imperial-primer);
  z-index: 2;
  flex: 0 0 80px;
  margin-top: 6px;
}

.timeline-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-end-badge {
  position: absolute;
  left: var(--timeline-line-x);
  top: calc(var(--timeline-card-pad) + var(--timeline-avatar-offset) + var(--timeline-avatar-size) - 0.4rem);
  transform: translateX(-50%);
  z-index: 3;
  background: var(--da-blues);
  color: var(--iced-lavender);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.38rem 0.62rem;
  border-radius: 8px;
  border: 1px solid var(--imperial-primer);
  white-space: nowrap;
}

.timeline-content {
  width: 100%;
  position: relative;
  z-index: 2;
}

.timeline-item.content-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--da-blues);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.timeline-item.content-card:last-child {
  margin-bottom: 0;
}

.timeline-text h3 {
  color: var(--iced-lavender);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.timeline-text h4 {
  color: var(--blueberry-soda);
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.timeline-date {
  color: var(--da-blues);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.timeline-text p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* List Pages */
.post-list {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

.post-list-item {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--da-blues);
  border-radius: 10px;
  background-color: var(--kuroi-black);
}

.post-list-item:last-child {
  margin-bottom: 0;
}

.post-list-item .post-title {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.post-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card-link:hover {
  text-decoration: none;
}

.post-list-item:hover,
.post-list-item:focus-within {
  border-color: var(--blueberry-soda);
}

.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--iced-lavender);
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.pagination .newer,
.pagination .older {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--da-blues);
  border-radius: 6px;
  background-color: var(--kuroi-black);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pagination .newer:hover,
.pagination .older:hover {
  border-color: var(--blueberry-soda);
  color: var(--blueberry-soda);
  text-decoration: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

th, td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--da-blues);
  text-align: left;
}

th {
  background-color: var(--imperial-primer);
  color: var(--text-primary);
  font-weight: 600;
}

tr:nth-child(even) td {
  background-color: rgba(33, 46, 64, 0.4);
}

td {
  color: var(--text-secondary);
}

/* Code Blocks */
code {
  font-family: "Courier New", Courier, monospace;
  background-color: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--iced-lavender);
}

pre {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  padding: 0;
  background-color: transparent;
}

/* Hugo Syntax Highlighting Override */
.highlight {
  margin-bottom: 1rem;
}

.highlight pre {
  background-color: var(--imperial-primer) !important;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  border: 1px solid var(--da-blues);
}

.highlight pre code {
  background-color: transparent !important;
  color: var(--iced-lavender) !important;
}

.highlight pre code span {
  color: var(--iced-lavender) !important;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--blueberry-soda);
  background-color: var(--imperial-primer);
  padding: 1rem 1rem 1rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--iced-lavender);
  font-style: italic;
  border-radius: 0 5px 5px 0;
  overflow: auto;
}

blockquote p {
  color: var(--iced-lavender);
  margin-bottom: 0.5rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer .social-links {
  margin-bottom: 1rem;
}

footer .social-links a {
  display: inline-block;
  color: var(--text-secondary);
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.5rem;
}

footer .social-links a:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
  text-decoration: none;
}

footer .social-links svg {
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 0 0.75rem;
  }
  .site-header {
    position: sticky;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0.2rem;
    padding-bottom: 0.2rem;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
  main {
    padding-top: 1.0rem;
  }
  .site-nav-wrap {
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
  }
  .brand-area {
    width: 100%;
    text-align: center;
  }
  .site-nav {
    width: 100%;
    text-align: center;
  }
  .site-nav a {
    margin: 0 0.35rem;
  }
  .home-columns {
    flex-direction: column;
  }
  .col-latest,
  .col-recommended {
    flex: none;
    width: 100%;
  }
  .brand-title {
    font-size: 2rem;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  .timeline {
    --timeline-avatar-size: 64px;
    --timeline-avatar-offset: 2px;
    padding-left: 0;
  }
  .timeline-img {
    width: 64px;
    height: 64px;
    border-width: 3px;
    flex: 0 0 64px;
    margin-top: 2px;
  }
  .timeline-text h3 {
    font-size: 1.2rem;
  }
  .timeline-text h4 {
    font-size: 1rem;
  }
}

