/* Base styles inspired by planetscale.com/blog */
@import url('https://fonts.googleapis.com/css2?family=Inter+Mono:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #ff5f1f; /* PlanetScale orange */
  --color-secondary: #2b50ed; /* PlanetScale blue */
  --color-pink: #f364a2; /* PlanetScale pink - company category */
  --color-text: #ffffff;
  --color-text-light: #a1a1aa;
  --color-text-lighter: #71717a;
  --color-background: #000000; /* Pure black */
  --color-background-alt: #111111;
  --color-border: #222222;
  --color-hover: #222222;
  --font-sans: 'Inter Mono', 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
  --font-mono: 'Inter Mono', 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
  --spacing-base: 1rem;
  --border-radius: 0.25rem;
  --container-width: 900px;
}

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

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-background);
  font-weight: 400;
}

html {
  background-color: var(--color-background);
}

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

a:hover {
  color: var(--color-secondary);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-base);
}

/* Header styles */
header {
  padding: calc(var(--spacing-base) * 1) 0 0 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: calc(var(--spacing-base) * 0.8);
  margin-bottom: calc(var(--spacing-base) * 0.8);
}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700; /* Bold */
  font-size: 1.76rem; /* 1.41rem * 1.25 = ~1.76rem (another 25% bigger) */
  color: var(--color-text); /* White color */
  letter-spacing: -0.5px;
  text-transform: lowercase;
  margin-bottom: 0.2rem;
}

.logo:hover {
  color: var(--color-text); /* Stay white on hover */
}

.tagline {
  font-size: 0.8rem;
  color: var(--color-text-light);
  font-family: var(--font-mono);
  text-transform: lowercase;
  line-height: 1.2;
}

nav ul {
  display: flex;
  list-style: none;
  gap: calc(var(--spacing-base) * 1.5);
}

nav a {
  color: var(--color-text-light);
  font-weight: 400;
  font-size: 0.875rem;
  text-transform: lowercase;
}

nav a:hover {
  color: var(--color-secondary);
}

.rss-link, .submit-link {
  display: inline-flex;
  align-items: center;
}

.rss-link::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff5f1f'%3E%3Cpath d='M6.18,15.64A2.18,2.18,0,1,1,4,17.82,2.18,2.18,0,0,1,6.18,15.64ZM4,8.63v3.09A8.28,8.28,0,0,1,12.27,20h3.09A11.38,11.38,0,0,0,4,8.63ZM4,4V7.09A12.91,12.91,0,0,1,16.91,20H20A16,16,0,0,0,4,4Z'/%3E%3C/svg%3E");
  margin-right: 5px;
}

.submit-link::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff5f1f'%3E%3Cpath d='M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z'/%3E%3C/svg%3E");
  margin-right: 5px;
}

/* Main content */
main {
  padding: 0 0 calc(var(--spacing-base) * 2) 0;
}

/* Article list */
.articles {
  background-color: var(--color-background);
}

/* Day sections */
.day-section {
  margin-bottom: calc(var(--spacing-base) * 1.5);
}

.day-heading {
  position: relative;
  padding: calc(var(--spacing-base) * 1.5) 0 calc(var(--spacing-base) * 0.5);
  font-size: 0.8rem; /* 1rem * 0.8 = 0.8rem (20% smaller) */
  font-weight: 600;
  color: var(--color-text); /* Changed to white */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  margin-bottom: 0.5rem;
  display: inline-block;
}

.article-item {
  padding: calc(var(--spacing-base) * 0.8) 0;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.article-item:hover {
  background-color: var(--color-hover);
}

.article-meta {
  display: flex;
  align-items: center;
  margin-bottom: calc(var(--spacing-base) * 0.3);
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-family: var(--font-mono);
}

.article-source {
  color: var(--color-text); /* Changed to white */
  margin-right: calc(var(--spacing-base) * 0.75);
  /* Preserve original capitalization for source names */
}

.article-date, .article-time {
  color: var(--color-text-lighter);
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-base) * 0.3);
  line-height: 1.3;
  /* Preserve original capitalization for article titles */
}

.article-title a {
  color: var(--color-primary); /* Changed to orange */
  transition: color 0.2s ease;
}

.article-title a:hover {
  color: var(--color-secondary); /* Use PlanetScale blue color on hover */
}

.article-description {
  color: var(--color-text-light);
  margin-bottom: calc(var(--spacing-base) * 0.3);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

/* Hide images in article descriptions */
.article-description img {
  display: none;
}

.article-description iframe {
  display: none;
}

.article-author {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  margin-top: auto;
  font-family: var(--font-mono);
}

.no-articles, .error-message {
  padding: calc(var(--spacing-base) * 3);
  color: var(--color-text-light);
  background: var(--color-background-alt);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  margin-top: calc(var(--spacing-base) * 2);
}

.error-message h2 {
  color: var(--color-text);
  margin-bottom: var(--spacing-base);
  font-family: var(--font-mono);
}

.tech-details {
  margin-top: var(--spacing-base);
  font-size: 0.75rem;
  padding: var(--spacing-base);
  background: var(--color-background);
  border-radius: calc(var(--border-radius) / 2);
  overflow-wrap: break-word;
  font-family: var(--font-mono);
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
}

.hint {
  margin-top: var(--spacing-base);
  font-size: 0.875rem;
}

.hint code {
  background: var(--color-background);
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--border-radius) / 2);
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
}

/* Footer styles */
footer {
  padding: calc(var(--spacing-base) * 1.5) 0;
  margin-top: calc(var(--spacing-base) * 3);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  font-family: var(--font-mono);
  text-transform: lowercase;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-notice {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}

.footer-notice a {
  color: var(--color-text-light);
}

.footer-notice a:hover {
  color: var(--color-secondary);
}

.footer-right a {
  color: var(--color-text-light);
}

.footer-right a:hover {
  color: var(--color-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: calc(var(--spacing-base) * 2);
  padding: calc(var(--spacing-base) * 1.5) 0;
  background-color: var(--color-background);
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: auto;
}

.page-number {
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.5rem;
  min-width: 2rem;
  text-align: center;
  transition: color 0.2s ease;
  text-transform: lowercase;
}

.page-number:hover {
  color: var(--color-primary);
}

.page-number.current {
  color: var(--color-primary);
  position: relative;
}

.page-number.current::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
}

.page-number.prev-next {
  font-weight: bold;
  color: var(--color-primary);
}

.page-ellipsis {
  color: var(--color-text-lighter);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.25rem;
}

/* Responsive styles */
@media (max-width: 768px) {
  .intro p {
    font-size: 0.875rem;
  }
  
  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
  }
  
  .page-number {
    padding: 0.2rem 0.4rem;
    min-width: 1.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .tagline {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: var(--spacing-base) 0 0 0;
  }
  
  .header-content {
    flex-direction: column;
    gap: var(--spacing-base);
  }
  
  .header-left {
    width: 100%;
    margin-bottom: calc(var(--spacing-base) * 0.5);
  }
  
  .footer-content {
    flex-direction: column;
    gap: calc(var(--spacing-base) * 0.5);
    text-align: center;
  }
  
  /* Further optimize pagination for very small screens */
  .pagination {
    gap: 0.1rem;
    padding: calc(var(--spacing-base)) 0;
  }
  
  .page-number {
    padding: 0.15rem 0.3rem;
    min-width: 1.2rem;
    font-size: 0.75rem;
  }
  
  /* On very small screens, consider hiding some numbers */
  .page-ellipsis {
    padding: 0.15rem 0.1rem;
    font-size: 0.75rem;
  }
}