/* ============================================
   Inspired Nonsense — Editorial Design
   Based on Magic Patterns prototype
   ============================================ */

/* --- Reset & Base --- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #FAFAF7;
  color: #1A1A1A;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Typography --- */

.masthead {
  font-family: 'Instrument Serif', serif;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
}

/* --- Layout --- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Header --- */

.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid #E5E5E0;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.theme-link,
.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6B6B6B;
  transition: color 0.3s ease;
}

.theme-link:hover,
.nav-link:hover {
  color: #1A1A1A;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid #E5E5E0;
  padding: 2rem 0;
  margin-top: 6rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-family: 'Instrument Serif', serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-copyright {
  font-size: 0.875rem;
  color: #6B6B6B;
}

/* --- Homepage --- */

.homepage {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Featured Article --- */

.featured-article {
  padding: 4rem 0;
}

.featured-link {
  display: block;
}

.featured-image {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  margin-bottom: 2rem;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 1s ease;
}

.featured-link:hover .featured-image img {
  transform: scale(1.05);
}

.featured-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.featured-link:hover .featured-title {
  color: #6B6B6B;
}

.featured-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.875rem;
  color: #6B6B6B;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.featured-theme {
  font-weight: 600;
  color: #1A1A1A;
}

.featured-excerpt {
  font-size: 1.125rem;
  color: #6B6B6B;
  max-width: 700px;
  line-height: 1.7;
}

/* --- Theme Sections --- */

.theme-section {
  padding: 3rem 0;
}

.theme-header {
  text-align: center;
  margin-bottom: 3rem;
}

.theme-title {
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.theme-divider {
  width: 100%;
  height: 1px;
  background-color: #E5E5E0;
}

/* --- Article Grid --- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* --- Article Card --- */

.article-card {
  display: flex;
  flex-direction: column;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: transform 1s ease;
}

.card-link:hover .card-image img {
  transform: scale(1.05);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  transition: text-decoration 0.3s ease;
}

.card-link:hover .card-title {
  text-decoration: underline;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #6B6B6B;
  margin-bottom: 0.5rem;
}

.card-excerpt {
  font-size: 0.9375rem;
  color: #6B6B6B;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Single Post --- */

.post {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.post-header {
  text-align: center;
  padding: 4rem 0 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.post-theme {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6B6B6B;
}

.post-title {
  font-size: 3.5rem;
  margin: 1rem 0;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: #6B6B6B;
}

.post-meta .post-author {
  font-weight: 600;
  color: #1A1A1A;
}

/* --- Post Hero Image --- */

.post-hero {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  max-width: 1000px;
  margin: 2rem auto;
}

.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

/* --- Post Body --- */

.post-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-size: 2rem;
  margin: 3rem 0 1rem;
}

.post-body h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

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

.post-body blockquote {
  border-left: 2px solid #1A1A1A;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.375rem;
  font-style: italic;
  color: #6B6B6B;
  line-height: 1.6;
}

.post-body pre {
  background: #f0f0ec;
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.post-body code {
  font-size: 0.9em;
  background: #f0f0ec;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body img {
  margin: 2rem 0;
  border-radius: 4px;
}

.post-body a {
  color: #1A1A1A;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: #6B6B6B;
}

/* --- Related Articles --- */

.related-articles {
  border-top: 1px solid #E5E5E0;
  padding-top: 3rem;
  margin-top: 4rem;
}

.related-title {
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 2rem;
}

/* --- List Page --- */

.list-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.list-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
}

/* --- Reading Time --- */

.reading-time::before {
  content: "·";
  margin-right: 0.25rem;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured-title {
    font-size: 2.5rem;
  }

  .post-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .theme-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .featured-title {
    font-size: 2rem;
  }

  .featured-image {
    aspect-ratio: 16 / 9;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .homepage,
  .post,
  .list-page {
    padding: 0 1rem;
  }

  .header-inner,
  .footer-inner {
    padding: 0 1rem;
  }
}
