/* ==========================================================================
   CSS Variables (Design System)
   ========================================================================== */
:root {
  /* Colors */
  --color-primary: #060097; /* links */
  --color-primary-hover: #c10fff; /* link hover */
  --color-text: #383b3f; /* general text */
  --color-heading: #2a2a2a; /* headings */
  --color-text-light: #67768e;
  --color-button-bg: #ffcd57;
  --color-button-text: #1e293b;
  --color-button-hover-bg: #ffcd57;
  --color-button-hover-text: #1e293b;
  --color-bg-light: #F2F5F7;
  --color-white: #FFFFFF;
  --color-black: #000000;
  
  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --container-padding: 3em;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 112.5%; /* 18px base */
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

h1 { font-size: 3.555rem; margin-bottom: 0.5em; }
h2 { font-size: 2.666rem; margin-bottom: 0.5em; }
h3 { font-size: 1.333rem; margin-bottom: 0.5em; }
h4 { font-size: 1.111rem; margin-bottom: 0.5em; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--color-primary-hover);
}

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

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.site-main {
  flex-grow: 1;
  padding: 3em 0 6em;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-bg-light);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-size: 1.111rem;
  margin: 0;
}

.site-logo a {
  color: var(--color-black);
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.main-navigation a {
  color: var(--color-heading);
  font-weight: 500;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--color-primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
  padding: 20px 40px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.111rem;
  text-align: center;
  transition: opacity 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
  color: var(--color-button-text);
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-3 { margin-top: 3rem; }
.spacer { height: 100px; }

/* ==========================================================================
   Specific Sections
   ========================================================================== */
/* About/Home */
.avatar-img {
  width: 226px;
  height: 226px;
  border-radius: 50%;
  margin: 0 auto 2rem;
}

.about-content {
  max-width: 960px;
  margin: 0 auto;
}

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

.actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--color-bg-light);
  text-align: center;
  font-size: 0.888rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 921px) {
  html { font-size: 102.6%; }
  
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  
  .menu-toggle {
    display: block;
    color: var(--color-heading);
  }
  
  .main-navigation {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-white);
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    z-index: 100;
  }
  
  .main-navigation.is-open {
    display: block;
  }
  
  .main-navigation ul {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 544px) {
  .container { padding: 0 1.5em; }
  .btn { padding: 15px 28px; }
  .spacer { height: 50px; }
}

/* ==========================================================================
   Blog Posts Grid
   ========================================================================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  min-height: 440px;
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-bg-light);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.post-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.post-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-title {
  font-size: 1.111rem;
  line-height: 1.4;
  margin-bottom: 10px;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-title a {
  color: var(--color-heading);
}

.post-meta {
  font-size: 0.888rem;
  color: var(--color-text-light);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-excerpt {
  margin-bottom: 20px;
  flex-grow: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 4.5em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  margin-top: auto;
}

.post-meta svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
}

.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-light);
  color: var(--color-text);
  font-weight: 500;
}

.pagination .current {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.pagination .next {
  width: auto;
  padding: 0 15px;
  border-radius: 20px;
}

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

@media (max-width: 544px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

/* Post Content Media Centering */
.post-content img,
.post-content figure img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.post-content figure {
  text-align: center;
  margin: 2rem auto;
}

.post-header {
  text-align: center;
  margin-bottom: 2rem;
}

.post-header .post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
