/* ============================================
   Modern Blog Template - Shared Styles
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--primary);
}

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--primary);
  color: var(--white);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary);
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 100%);
  color: var(--white);
  padding: 70px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 28px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--secondary);
}

/* ========== MAIN CONTENT ========== */
main {
  flex: 1;
  padding: 48px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 28px;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* ========== POST CARDS (Home) ========== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card .thumb {
  height: 180px;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 2.5rem;
  font-weight: 700;
  opacity: 0.9;
}

.post-card .content {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.post-meta .category {
  background: #eff6ff;
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

.post-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--secondary);
  line-height: 1.4;
}

.post-card h2 a {
  color: inherit;
}

.post-card h2 a:hover {
  color: var(--primary);
}

.post-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  flex: 1;
}

.read-more {
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more::after {
  content: '→';
  transition: transform 0.2s ease;
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* ========== SINGLE POST ========== */
.single-post {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.single-post .featured {
  height: 280px;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 3rem;
  font-weight: 700;
}

.single-post .body {
  padding: 36px 40px;
}

.single-post .post-meta {
  margin-bottom: 16px;
}

.single-post h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 20px;
  line-height: 1.3;
}

.single-post .content p {
  margin-bottom: 18px;
  font-size: 1.05rem;
  color: var(--text);
}

.single-post .content h2 {
  font-size: 1.4rem;
  margin: 28px 0 14px;
  color: var(--secondary);
}

.single-post .content ul {
  margin: 0 0 18px 24px;
}

.single-post .content li {
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.tag {
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tag:hover {
  background: var(--primary);
  color: var(--white);
}

/* ========== CONTACT FORM ========== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-info h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--secondary);
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.info-item .icon {
  width: 42px;
  height: 42px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.info-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--secondary);
  margin-bottom: 2px;
}

.info-item span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-form {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--white);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* ========== SIMPLE PAGES (About / Terms) ========== */
.page-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  max-width: 800px;
  margin: 0 auto;
}

.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.page-content .subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.page-content h2 {
  font-size: 1.35rem;
  margin: 28px 0 12px;
  color: var(--secondary);
}

.page-content p {
  margin-bottom: 16px;
  color: var(--text);
}

.page-content ul {
  margin: 0 0 16px 22px;
}

.page-content li {
  margin-bottom: 8px;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--secondary);
  color: #94a3b8;
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: 12px;
  display: inline-block;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-links h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-links a {
  display: block;
  color: #94a3b8;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 16px;
  }

  .hero {
    padding: 50px 0;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .single-post .body,
  .page-content {
    padding: 28px 22px;
  }

  .single-post .featured {
    height: 200px;
    font-size: 2.2rem;
  }
}

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