/* ============================================
   Mental Echoes Space — Stylesheet
   Light, minimal, editorial
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #FAFAF8;
  color: #1C1C1C;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* --- Layout --- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  flex: 1;
  padding: 3rem 0 5rem;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid #E8E8E4;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  background-color: #FAFAF8;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #C0152A;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.site-title:hover {
  opacity: 0.65;
}

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

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #666;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #1C1C1C;
}

/* --- Homepage Hero --- */
.home-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid #E8E8E4;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.home-hero-text {
  flex: 1;
  min-width: 0;
}

.home-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #C0152A;
}

.home-hero-content {
  margin-top: 1rem;
  font-size: 1.05rem;
  color: #666;
}

.home-hero-content p {
  margin-bottom: 0.75rem;
}

.home-hero-content p:last-child {
  margin-bottom: 0;
}

.home-hero-content a {
  color: #1A56C4;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #1A56C4;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.home-hero-content a:hover {
  color: #0D3A8E;
  text-decoration-color: #0D3A8E;
}

.home-hero-image {
  flex-shrink: 0;
  width: 260px;
}

.home-hero-image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

@media (max-width: 768px) {
  .home-hero {
    flex-direction: column-reverse;
    gap: 2rem;
  }

  .home-hero-image {
    width: 100%;
    max-width: 320px;
    align-self: center;
  }

  .home-hero-image img {
    height: 260px;
  }
}

/* --- Post Grid --- */
.posts-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 2rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}

.post-card {
  background: #FFF;
  border: 1px solid #E8E8E4;
  padding: 2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: #C8C8C4;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.post-card-meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.post-card-title a {
  color: #1C1C1C;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: #555;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1C1C1C;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
  align-self: flex-start;
}

.read-more:hover {
  opacity: 0.5;
}

/* --- Single Post --- */
.post-single {
  max-width: 680px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #E8E8E4;
}

.post-header time {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #C0152A;
}

/* --- Post Content Typography --- */
.post-content {
  font-size: 1.075rem;
  line-height: 1.8;
  color: #2C2C2C;
}

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

.post-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

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

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

.post-content blockquote {
  border-left: 3px solid #1C1C1C;
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: #555;
  font-style: italic;
}

.post-content a {
  color: #1A56C4;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #1A56C4;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.post-content a:hover {
  color: #0D3A8E;
  text-decoration-color: #0D3A8E;
}

.post-content code {
  background: #F0F0EC;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: 'Fira Code', 'Courier New', monospace;
}

.post-content pre {
  background: #F5F5F2;
  border: 1px solid #E8E8E4;
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

.post-content hr {
  border: none;
  border-top: 1px solid #E8E8E4;
  margin: 2.5rem 0;
}

/* --- Standalone Pages (About, etc.) --- */
.standalone-page {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid #E8E8E4;
}

.standalone-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #C0152A;
  margin-bottom: 1.5rem;
}

.standalone-page-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #666;
  max-width: 780px;
}

.standalone-page-content p {
  margin-bottom: 1.25rem;
}

.standalone-page-content p:last-child {
  margin-bottom: 0;
}

.standalone-page-content a {
  color: #1A56C4;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #1A56C4;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.standalone-page-content a:hover {
  color: #0D3A8E;
  text-decoration-color: #0D3A8E;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.empty-state p {
  font-size: 1rem;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid #E8E8E4;
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer p {
  font-size: 0.8rem;
  color: #AAA;
}

.footer-location {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.footer-location img {
  display: inline !important;
  height: 18px !important;
  width: auto !important;
  flex-shrink: 0;
  opacity: 0.8;
}

.footer-location span {
  font-size: 0.8rem;
  color: #AAA;
  white-space: nowrap;
  line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  main {
    padding: 2rem 0 4rem;
  }
}

@media (max-width: 480px) {
  .home-hero {
    padding: 2.5rem 0 2rem;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
