/* ============================================
   CREATIVE MIND HABITS
   Elegant, Literary, Sophisticated
   ============================================ */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Georgia', serif;
  background: #fafaf9;
  color: #292524;
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Georgia', serif;
  font-weight: 400;
  color: #1c1917;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin: 0 0 1rem 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }

a {
  color: #292524;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: #1c1917;
}

p {
  color: #44403c;
  line-height: 1.7;
  margin: 1rem 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === HEADER === */
.site-header {
  background: white;
  border-bottom: 1px solid #e7e5e4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.site-header.scroll-down {
  transform: translateY(-100%);
}

.site-header.scroll-up {
  transform: translateY(0);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  gap: 1rem;
  position: relative;
}

.site-title {
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: -0.5px;
}

.site-title a {
  text-decoration: none;
  color: #1c1917;
}

.site-tagline {
  color: #78716c;
  font-size: 0.9rem;
  font-style: italic;
  margin: 0.25rem 0 0 0;
}

/* Hamburger menu button (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: #1c1917;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: #57534e;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  color: #1c1917;
  border-bottom-color: #57534e;
}

/* === MAIN CONTENT === */
.site-main {
  padding: 3.75rem 0;
  min-height: 70vh;
}

/* === POST GRID === */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}

.post-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.post-card-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-bottom: 1px solid #e7e5e4;
  background: #f5f5f4;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 0;
}

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

.post-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.post-card-title a {
  text-decoration: none;
  color: #1c1917;
}

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

.post-card-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: #78716c;
  margin-bottom: 0.75rem;
}

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

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: auto;
}

.post-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  border-radius: 100px;
  font-size: 0.8rem;
  color: #44403c;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.post-tag:hover {
  background: #e7e5e4;
}

.read-more {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: #1c1917;
  color: white !important;
  text-decoration: none;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  align-self: flex-start;
  transition: background 0.2s ease;
  margin-top: 1rem;
}

.read-more:hover {
  background: #292524;
}

/* === SINGLE POST === */
.post-single {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e7e5e4;
}

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

.post-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  color: #78716c;
}

.post-image {
  margin: 2rem 0;
}

.post-image img {
  width: 100%;
  border-radius: 6px;
}

.post-content {
  color: #44403c;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

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

.post-content li {
  margin: 0.5rem 0;
  color: #44403c;
}

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

.post-content code {
  background: #f5f5f4;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-content pre {
  background: #f5f5f4;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e5e4;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-nav a {
  color: #44403c;
  text-decoration: none;
  padding: 0.75rem 1rem;
  background: #f5f5f4;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.post-nav a:hover {
  background: #e7e5e4;
}

/* === FOOTER === */
.site-footer {
  background: white;
  border-top: 1px solid #e7e5e4;
  padding: 3rem 0;
  margin-top: 5rem;
}

.footer-content {
  text-align: center;
}

.footer-content p {
  color: #78716c;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.footer-tagline {
  font-style: italic;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .container {
    padding: 0 1.25rem;
  }
  
  /* Show hamburger on mobile */
  .nav-toggle {
    display: flex;
  }
  
  .header-content {
    flex-wrap: nowrap;
    padding: 1rem 0;
  }
  
  /* Hide nav by default on mobile */
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e7e5e4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .site-nav.active {
    max-height: 400px;
  }
  
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 1rem 1.5rem;
  }
  
  .site-nav li {
    border-bottom: 1px solid #f5f5f4;
  }
  
  .site-nav li:last-child {
    border-bottom: none;
  }
  
  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: none;
  }
  
  .site-main {
    padding: 2.5rem 0;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .post-single {
    padding: 2rem 1.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  
  .post-nav {
    flex-direction: column;
  }
}

/* === UTILITIES === */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.home-intro {
  max-width: 800px;
  margin: 0 auto 3rem;
}

/* Fix list alignment on mobile */
ul, ol {
  padding-left: 1.5rem;
  margin-left: 0;
}

@media (max-width: 768px) {
  ul, ol {
    padding-left: 1.25rem;
    margin-left: 0.5rem;
  }
  
  li {
    margin-bottom: 0.75rem;
  }
}

/* For nested lists */
ul ul, ol ol, ul ol, ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}