/*
 * Custom theme - Based on Design & Life prototype
 * Overrides for Paper theme
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --warm-beige: #f5f1e8;
  --warm-gray: #3a3632;
  --warm-gray-60: rgba(58, 54, 50, 0.6);
  --warm-gray-50: rgba(58, 54, 50, 0.5);
  --warm-gray-30: rgba(58, 54, 50, 0.3);
  --warm-gray-20: rgba(58, 54, 50, 0.2);
  --warm-gray-10: rgba(58, 54, 50, 0.1);
  --warm-gray-05: rgba(58, 54, 50, 0.05);
}

/* Base styles */
html,
body {
  background-color: #f5f1e8;
  background-color: var(--warm-beige);
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: #3a3632;
  color: var(--warm-gray);
  min-height: 100vh;
}

::selection {
  background-color: var(--warm-gray);
  color: var(--warm-beige);
}

/* Container */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .container {
    padding: 0;
  }
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--warm-gray);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-gray-60);
  text-decoration: none;
  transition: color 0.3s ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-link:hover {
  color: var(--warm-gray);
}

.nav-link.active {
  color: var(--warm-gray);
  border-bottom-color: var(--warm-gray);
}

/* Blog Header */
.blog-header {
  padding-top: 8rem;
  padding-bottom: 6rem;
}

.blog-header h1 {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--warm-gray);
  line-height: 1.1;
  margin: 0;
}

@media (min-width: 768px) {
  .blog-header h1 {
    font-size: 4.5rem;
  }
}

.blog-header h1 span {
  font-weight: 500;
}

.blog-header p {
  margin-top: 2rem;
  font-size: 1.25rem;
  color: var(--warm-gray-60);
  max-width: 28rem;
  font-weight: 300;
  line-height: 1.6;
}

/* Main content */
main {
  flex-grow: 1;
}

/* Post Card */
.post-card {
  display: block;
  padding: 3rem 0;
  border-bottom: 1px solid var(--warm-gray-10);
  text-decoration: none;
  color: inherit;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-inner {
  transition: transform 0.5s ease-out;
}

.post-card:hover .post-card-inner {
  transform: translateY(-4px);
}

.post-card time {
  display: block;
  font-size: 0.875rem;
  color: var(--warm-gray-60);
  font-weight: 500;
  letter-spacing: 0.025em;
  margin-bottom: 0.75rem;
}

.post-card h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--warm-gray);
  line-height: 1.3;
  margin: 0 0 0.75rem 0;
  transition: color 0.3s ease;
}

.post-card:hover h2 {
  color: var(--warm-gray-60);
}

.post-card p {
  font-size: 1.125rem;
  color: rgba(58, 54, 50, 0.8);
  line-height: 1.6;
  font-weight: 300;
  margin: 0 0 1rem 0;
}

.post-card .read-more {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-gray);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.5s ease-out;
}

.post-card:hover .read-more {
  opacity: 1;
  transform: translateX(0);
}

.post-card .read-more svg {
  margin-left: 0.5rem;
  width: 1rem;
  height: 1rem;
}

/* View Archive Button */
.view-archive {
  padding: 6rem 0;
  display: flex;
  justify-content: center;
}

.view-archive button {
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 1px solid var(--warm-gray-30);
  padding-bottom: 0.25rem;
  color: var(--warm-gray);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.view-archive button:hover {
  border-color: var(--warm-gray);
}

/* Footer */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--warm-gray-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: auto;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.social-icons a {
  color: var(--warm-gray);
  transition: opacity 0.3s ease;
}

.social-icons a:hover {
  opacity: 0.6;
}

.social-icons svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.5;
}

footer p {
  font-size: 0.875rem;
  color: var(--warm-gray-50);
  font-weight: 300;
  margin: 0;
}

/* Single Post */
.post-back {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--warm-gray-50);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.3s ease;
}

.post-back:hover {
  color: var(--warm-gray);
}

.post-back svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.post-back:hover svg {
  transform: translateX(-4px);
}

.post-back-bottom {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Reduce gap between content and footer on briefing detail pages */
main:has(.layout-briefing-single),
main:has(.layout-news),
main:has(.layout-opinion),
main:has(.layout-tutorial),
main:has(.layout-video-explainer),
main:has(.layout-github-release) {
  flex-grow: 0;
}

.post-header {
  margin-bottom: 4rem;
}

.post-header time {
  font-size: 0.875rem;
  color: var(--warm-gray-50);
  font-weight: 500;
  display: block;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--warm-gray);
  line-height: 1.1;
  margin: 0 0 2rem 0;
}

@media (min-width: 768px) {
  .post-header h1 {
    font-size: 3rem;
  }
}

.post-header .description {
  font-size: 1.25rem;
  color: var(--warm-gray-60);
  font-weight: 300;
  line-height: 1.6;
  border-left: 2px solid var(--warm-gray-20);
  padding-left: 1.5rem;
  margin: 0;
}

/* Post Content */
.post-content {
  font-size: 1.125rem;
  color: rgba(58, 54, 50, 0.8);
  font-weight: 300;
  line-height: 1.8;
}

.post-content p {
  margin: 0 0 1.5rem 0;
}

.post-content strong {
  font-weight: 500;
  color: var(--warm-gray);
}

.post-content h2,
.post-content h3 {
  font-weight: 500;
  color: var(--warm-gray);
  margin: 2.5rem 0 1rem 0;
}

.post-content h2 {
  font-size: 1.5rem;
}

.post-content h3 {
  font-size: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content a {
  color: var(--warm-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  opacity: 0.7;
}

.post-content blockquote {
  border-left: 2px solid var(--warm-gray-20);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
}

.post-content pre {
  background: var(--warm-gray-05);
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.875em;
}

.post-content p code {
  background: var(--warm-gray-05);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

/* Post Footer */
.post-footer {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--warm-gray-10);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-footer a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-gray-50);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-footer a:hover {
  color: var(--warm-gray);
}

.post-footer .thanks {
  font-size: 0.875rem;
  color: var(--warm-gray-30);
  font-style: italic;
}

/* About Page */
.about-content {
  padding-top: 4rem;
  padding-bottom: 6rem;
  max-width: 42rem;
  margin: 0 auto;
  animation: fadeIn 0.7s ease-out;
}

.about-header {
  text-align: center;
  margin-bottom: 4rem;
}

.about-portrait {
  max-width: 280px;
  height: auto;
  margin: 0 auto 2.5rem auto;
  display: block;
}

/* Kicker - small uppercase intro */
.about-kicker {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--warm-gray-60);
  margin: 0 0 1rem 0;
}

/* Hero heading - "I'm Brett." */
.about-hero {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--warm-gray);
  line-height: 1.1;
  margin: 0 0 1.25rem 0;
}

@media (min-width: 768px) {
  .about-hero {
    font-size: 3.25rem;
  }
}

/* Tagline - uppercase */
.about-tagline {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-gray-50);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 28rem;
}

@media (min-width: 768px) {
  .about-tagline {
    font-size: 0.875rem;
  }
}

/* Role statement - serif with divider */
.about-role {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--warm-gray);
  line-height: 1.4;
  margin: 0 0 1.25rem 0;
}

@media (min-width: 768px) {
  .about-role {
    font-size: 1.625rem;
  }
}

.about-divider {
  width: 3rem;
  height: 2px;
  background: var(--warm-gray-30);
  border-radius: 1px;
  margin: 0 0 2.5rem 0;
}

/* Body text */
.about-content .prose {
  font-size: 1.125rem;
  color: rgba(58, 54, 50, 0.85);
  font-weight: 300;
  line-height: 1.8;
}

.about-content .prose p {
  margin: 0 0 1.5rem 0;
}

.about-content .prose strong {
  font-weight: 500;
  color: var(--warm-gray);
}

.about-content .prose em {
  font-style: italic;
}

/* Pull quote - serif */
.about-pullquote {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(58, 54, 50, 0.75);
  line-height: 1.6;
  margin: 2.5rem 0 3rem 0;
}

@media (min-width: 768px) {
  .about-pullquote {
    font-size: 1.375rem;
    margin: 3rem 0 3.5rem 0;
  }
}

.about-connect {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--warm-gray-10);
}

.about-connect h2 {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-gray-50);
  margin: 0 0 1.5rem 0;
}

/* Contact Page */
.contact-content {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0 6rem;
  animation: fadeIn 0.7s ease-out;
}

.contact-content h1 {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--warm-gray);
  margin: 0 0 1.5rem 0;
}

.contact-content .intro {
  font-size: 1.25rem;
  color: var(--warm-gray-60);
  max-width: 28rem;
  font-weight: 300;
  line-height: 1.6;
  margin: 0 0 3rem 0;
}

.contact-content .email {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--warm-gray);
  text-decoration: none;
  border-bottom: 2px solid var(--warm-gray-10);
  padding-bottom: 0.5rem;
  margin-bottom: 4rem;
  transition: border-color 0.3s ease;
}

@media (min-width: 768px) {
  .contact-content .email {
    font-size: 1.875rem;
  }
}

.contact-content .email:hover {
  border-color: var(--warm-gray-30);
}

.contact-elsewhere {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-elsewhere span {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-gray-50);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.7s ease-out;
}

/* Briefing Styles */
.briefing-card .briefing-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.briefing-card .briefing-meta time {
  margin-bottom: 0;
}

/* Fix double divider: remove border from last visible card when filtering */
.briefing-card.last-visible {
  border-bottom: none;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--warm-gray-05);
  color: var(--warm-gray-60);
}

.source-badge svg {
  flex-shrink: 0;
}

.source-github_releases {
  background: rgba(15, 191, 62, 0.1); /* GitHub Green at 10% */
  color: #0a7c2e; /* Darker green for contrast */
}

.source-rss {
  background: rgba(255, 102, 0, 0.1);
  color: #ff6600;
}

.source-youtube_channel {
  background: rgba(255, 0, 0, 0.1);
  color: #cc0000;
}

.source-x_account {
  background: rgba(0, 0, 0, 0.08);
  color: #14171a;
}

.source-website {
  background: rgba(59, 130, 246, 0.1); /* blue-500 at 10% */
  color: #2563eb; /* Tailwind blue-600 */
}

/* Briefing single page */
.briefing-source-link {
  margin: 1.5rem 0;
}

.view-original,
.post-content .view-original {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--warm-gray);
  color: var(--warm-beige);
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: opacity 0.2s ease;
}

.view-original:hover {
  opacity: 0.85;
}

.view-original svg {
  flex-shrink: 0;
}

/* Briefing Header */
.briefing-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.briefing-header .blog-header {
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .briefing-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

/* Month Dropdown */
.month-dropdown-wrapper {
  position: relative;
  display: inline-block;
  min-width: 160px;
}

.month-dropdown {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 1px solid var(--warm-gray-20);
  color: var(--warm-gray);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.month-dropdown:hover {
  border-color: var(--warm-gray-30);
}

.month-dropdown:focus {
  outline: none;
  border-color: var(--warm-gray-50);
}

.month-dropdown-icon {
  pointer-events: none;
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
  color: var(--warm-gray-50);
}

/* Filtered empty state */
.filtered-empty {
  padding: 4rem 0;
  text-align: center;
  color: var(--warm-gray-50);
  font-size: 1.125rem;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-gray-50);
}

.pagination-prev,
.pagination-next {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--warm-gray-50);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
  background: rgba(120, 113, 108, 0.1);
  color: var(--warm-gray);
}

.pagination-prev.disabled,
.pagination-next.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-text {
  display: none;
}

@media (min-width: 640px) {
  .pagination-text {
    display: inline;
  }
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0.5rem;
}

.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  color: var(--warm-gray-50);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-page:hover {
  background: rgba(120, 113, 108, 0.1);
  color: var(--warm-gray);
}

.pagination-page.current {
  background: var(--warm-gray);
  color: var(--warm-beige);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 404 Page */
.error-content {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0 6rem;
  animation: fadeIn 0.7s ease-out;
}

.error-content h1 {
  font-size: 6rem;
  font-weight: 300;
  color: var(--warm-gray);
  margin: 0 0 1rem 0;
  line-height: 1;
}

.error-content h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--warm-gray-60);
  margin: 0 0 1.5rem 0;
}

.error-content p {
  font-size: 1.125rem;
  color: var(--warm-gray-50);
  max-width: 28rem;
  font-weight: 300;
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

.error-content a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--warm-gray);
  text-decoration: none;
  border-bottom: 1px solid var(--warm-gray-30);
  padding-bottom: 0.25rem;
  transition: border-color 0.3s ease;
}

.error-content a:hover {
  border-color: var(--warm-gray);
}
