/* ... EJP.dev Custom Overrides ... */

:root {
  --maincolor: #b50000;
  --bordercl: #b50000;
  --callouctcolor: #8aa67b;
  --hovercolor: #b50000;
  --darkMaincolor: darkseagreen;
  --leftbordercolor: #cac9c9;
  --fontcolor: #555555;
  --bracketdark: #3c3c3c;

  /* New design tokens */
  --bg: #faf9f7;
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --fg-faint: #a0a0a0;
  --accent: #b50000;
  --accent-glow: rgba(181, 0, 0, 0.06);
  --border: #e2e0dc;
  --surface: #f0efec;
}

html {
  font-family: 'Fira Sans', sans-serif;
  line-height: 1.6;
  background: var(--bg);
  min-height: 100%;
}

body {
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
}

/* ... HEADER / LOGO ... */
header {
  padding: 1.5rem 0;
  margin: 0 0 2.5rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 2.5em;
}

header .main {
  font-size: 3.0rem;
  font-weight: normal;
  font-family: 'Zilla Slab', serif;
}

header .main a {
  border-bottom: 0px;
}

header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header nav a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  border-bottom: none;
  color: var(--fg-muted);
  transition: color 0.15s;
}

#dark-mode-toggle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-left: 1rem;
  cursor: pointer;
  transition: color 0.15s;
}

#dark-mode-toggle:hover {
  color: var(--accent);
}

header nav a:hover {
  background: none;
  color: var(--accent);
  border-bottom: none;
}

/* ... HEADINGS ... */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 1em;
}

/* ... LINKS (general) ... */
a {
/*  border-bottom: 2px solid var(--maincolor); */
border-bottom: 0.2rem solid var(--maincolor);
}

a:hover {
  border-bottom: 2px solid var(--accent);
}

/* ... FEATURED POST ... */
.featured-post {
  margin-bottom: 2.5rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}

.featured-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.featured-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.4rem 0;
}

.featured-title::before {
  content: none;
}

.featured-title::after {
  content: none;
}

.featured-title a {
  color: var(--fg);
  border-bottom: none;
  transition: color 0.15s;
}

.featured-title a:hover {
  color: var(--accent);
  background: none;
}

.featured-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--fg-faint);
  margin-bottom: 1rem;
  letter-spacing: -0.3px;
}

.featured-meta time {
  font-family: inherit;
  color: inherit;
  margin-left: 0;
}

.featured-excerpt {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin: 0;
}

.featured-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ... POST LIST HEADER ... */
.post-list-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-faint);
  margin-bottom: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ... POST LIST ITEMS ... */
.post-item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.post-item:hover {
  background: var(--accent-glow);
  margin: 0 -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: 2px;
}

.post-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}

.post-item-title {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}

.post-item-title::before {
  content: none;
}

.post-item-title a {
  color: var(--fg);
  border-bottom: none;
  transition: color 0.15s;
}

.post-item-title a:hover {
  color: var(--accent);
  background: none;
}

.post-item-date {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--fg-faint);
  white-space: nowrap;
  letter-spacing: -0.3px;
  margin-left: 0;
}

.post-item-desc {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0.2rem 0 0 0;
}

.post-item-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

/* ... SHARED ELEMENTS ... */
.read-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-faint);
  letter-spacing: -0.3px;
}

.tag-pill {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--fg-muted);
  text-decoration: none;
  border: 1px solid var(--border) !important;
  padding: 1px 6px;
  border-radius: 2px;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.tag-pill:hover {
  border-color: var(--accent) !important;
  color: var(--accent);
  background: var(--accent-glow);
}

.draft-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0px 4px;
  border-radius: 2px;
  font-weight: 600;
  background: none;
  margin-left: 4px;
}

/* ... PAGINATION ... */
.pagination {
  margin-top: 1.75rem;
  padding-top: 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-weight: normal;
  margin-left: 0;
  text-align: center;
}

.pagination a {
  font-size: 0.8rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.85rem;
  border-radius: 2px;
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: none;
}

/* ... FOOTER ... */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.25rem 0;
  font-family: 'Share Tech Mono', monospace;
}

.footer-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: var(--fg-faint);
}

.compiled {
  font-family: 'Share Tech Mono', monospace;
  color: var(--fg-faint);
  letter-spacing: -0.5px;
  padding-left: 0;
  padding-bottom: 0;
}

/* ... TITLE (used on post pages) ... */
.title {
  color: #565656;
  letter-spacing: .03rem;
}

article .title {
  margin-bottom: .6em;
}

/* ... DESCRIPTION (used on post pages) ... */
.description {
  font-family: 'Fira Sans', sans-serif;
  padding-top: 20px;
  margin-bottom: 20px;
  margin-left: 10px;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: .05rem;
}

/* ... META (used on post pages) ... */
time {
  letter-spacing: -1px;
  font-family: 'Share Tech Mono', monospace;
  margin-left: 13px;
  color: #545353;
}

.meta {
  font-family: 'Share Tech Mono', monospace;
  padding-left: 7px;
  padding-bottom: 30px;
  letter-spacing: -1px;
}

/* ... READMORE (used on older templates if needed) ... */
.readmore {
  margin-left: 20px;
  margin-top: 10px;
  padding-bottom: 2px;
  font-family: 'Fira Sans', sans-serif;
}

/* ... OLD LIST ITEM (keep for non-homepage list pages) ... */
.list-item {
  border-bottom: 0.1rem dotted var(--bordercl);
  padding-bottom: 20px;
}

.post {
  margin-bottom: .4em;
}

/* ... NAV/PREV-NEXT (bottom of post) ... */
.prevnext {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Share Tech Mono', monospace;
  font-weight: normal;
  margin: 2.5rem 0 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.prevnext .prevpost {
  margin: 0;
}

.prevnext .nextpost {
  margin: 0;
}

.prevnext a {
  border-bottom: none;
}

.prevnext a:hover {
  border-bottom: none;
}


/* ... NAV/PREV-NEXT (compact, top of post) ... */
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.post-nav-compact {
  display: flex;
  gap: 0.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
}

.post-nav-compact a + a::before {
  content: '|';
  color: var(--fg-faint, #a0a0a0);
  margin-right: 0.5rem;
  pointer-events: none;
}

.post-nav-compact a {
  color: var(--fg-faint, #a0a0a0);
  border-bottom: none;
  transition: color 0.15s;
}

.post-nav-compact a:hover {
  color: var(--accent, #b50000);
  background: none;
}

/* ... TOC ... */
.toc {
  padding: 40px 60px;
  margin-bottom: 15px;
}

/* ... TAGS (on post pages, keep existing style) ... */
.tags a {
  border-bottom: 2px solid var(--maincolor);
}

.tags li::before {
  padding-left: 10px;
}

/* ... UL override ... */
ul {
  padding-left: 3ch;
}

/* ... PHOTO GRID ... */
.page-heading {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.page-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-faint, #a0a0a0);
  letter-spacing: 0.05em;
  margin-bottom: 1.75rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--border, #e2e0dc);
  background: var(--surface, #f0efec);
  transition: transform 0.15s, box-shadow 0.15s;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.photo-card a {
  border: none !important;
  text-decoration: none;
  color: inherit;
  display: block;
}

.photo-card a:hover {
  background: none;
  color: inherit;
}

.photo-thumb {
  position: relative;
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border: none;
}

.photo-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.55rem;
  background: rgba(0,0,0,0.65);
  color: #e0e0e0;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.03em;
}

.photo-card-info {
  padding: 0.6rem 0.75rem;
}

.photo-card-title {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg, #1a1a1a);
  line-height: 1.35;
  margin: 0;
}

.photo-card-date {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--fg-faint, #a0a0a0);
  margin-top: 0.2rem;
  letter-spacing: -0.3px;
}

/* ... ANIMATIONS ... */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.featured-post {
  animation: fadeUp 0.35s ease-out;
}

.post-item {
  animation: fadeUp 0.3s ease-out both;
}

.post-item:nth-child(1) { animation-delay: 0.03s; }
.post-item:nth-child(2) { animation-delay: 0.06s; }
.post-item:nth-child(3) { animation-delay: 0.09s; }
.post-item:nth-child(4) { animation-delay: 0.12s; }
.post-item:nth-child(5) { animation-delay: 0.15s; }

/* ... RESPONSIVE ... */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
  }

  .featured-post {
    padding: 1.25rem;
  }

  .post-item-top {
    flex-direction: column;
    gap: 0;
  }

  .post-item-date {
    order: -1;
    margin-bottom: 0.1rem;
  }

  .footer-info {
    flex-direction: column;
    gap: 0.25rem;
  }

  .compiled {
    padding-left: 0;
  }
}