/* HN Digest - Shared Styles */

:root {
  --hn-orange: #ff6600;
  --hn-orange-dark: #cc5200;
  --hn-orange-light: #ff8533;
  --bg-color: #f6f6ef;
  --text-color: #333;
  --text-muted: #666;
  --border-color: #ddd;
  --card-bg: #fff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background-color: var(--hn-orange);
  padding: 16px 20px;
  margin-bottom: 32px;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  max-width: 800px;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

header h1 a {
  color: #fff;
  text-decoration: none;
}

header nav a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
  font-size: 0.9rem;
}

header nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--hn-orange);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Page title */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-color);
}

.page-subtitle {
  color: var(--text-muted);
  margin: 0 0 32px 0;
  font-size: 1rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--hn-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error state */
.error {
  background-color: #fff3f3;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: #c62828;
}

.error h2 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
}

.error p {
  margin: 0 0 16px 0;
}

.error a {
  color: var(--hn-orange);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* Newsletter list */
.newsletter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.newsletter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--hn-orange);
}

.date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--hn-orange);
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
}

.date-badge .day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.date-badge .month {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.card-content {
  flex: 1;
}

.card-title {
  font-weight: 600;
  margin: 0 0 4px 0;
  font-size: 1rem;
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.card-arrow {
  color: var(--hn-orange);
  font-size: 1.25rem;
}

/* Newsletter viewer */
.newsletter-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  margin-top: 16px;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 48px;
  border-top: 1px solid var(--border-color);
}

footer a {
  color: var(--hn-orange);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 16px;
  }

  header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .newsletter-card {
    padding: 12px;
    gap: 12px;
  }

  .date-badge {
    width: 48px;
    height: 48px;
  }

  .date-badge .day {
    font-size: 1.25rem;
  }

  .newsletter-container {
    padding: 16px;
  }
}
