/*
Theme Name: My Theme
Theme URI: https://yoursite.com
Author: Your Name
Description: A clean, minimal custom WordPress theme
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: mytheme
*/

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

:root {
  --color-bg:        #ffffff;
  --color-surface:   #f7f7f7;
  --color-border:    #e2e2e2;
  --color-text:      #1a1a1a;
  --color-muted:     #666666;
  --color-accent:    #2563eb;
  --color-accent-h:  #1d4ed8;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;

  --max-width: 1200px;
  --radius:    6px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =====================
   LAYOUT
   ===================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.site-main {
  flex: 1;
  padding: var(--space-lg) 0;
}

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

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

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title:hover {
  text-decoration: none;
  color: var(--color-accent);
}

/* Desktop nav */
.nav-primary ul {
  list-style: none;
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-primary a {
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-primary a:hover,
.nav-primary .current-menu-item > a {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-text);
  line-height: 1;
}

.nav-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle .icon-bar + .icon-bar {
  margin-top: 5px;
}

/* Open state (JS adds .nav-open to <body>) */
.nav-open .nav-toggle .icon-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle .icon-bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle .icon-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================
   FOOTER
   ===================== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* =====================
   CONTENT
   ===================== */
.entry-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
}

.entry-content {
  max-width: 72ch;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
  margin-bottom: var(--space-sm);
}

.entry-content h2, .entry-content h3 {
  margin: var(--space-md) 0 var(--space-xs);
  line-height: 1.3;
}

.entry-meta {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
}

/* Post list */
.post-list {
  list-style: none;
  display: grid;
  gap: var(--space-md);
}

.post-card {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: box-shadow 0.15s;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.post-card .post-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.post-card .post-excerpt {
  font-size: 0.9375rem;
  color: var(--color-muted);
}

/* Pagination */
.pagination {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.pagination .current {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* =====================
   MOBILE — max 768px
   ===================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
  }

  .nav-primary {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

  .nav-open .nav-primary {
    display: block;
  }

  .nav-primary ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .nav-primary li {
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-primary li:last-child {
    border-bottom: none;
  }

  .nav-primary a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: none;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
