/*
Theme Name: Simple Blog
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A clean, minimal personal blog theme with a sidebar layout.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: simple-blog
*/

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

:root {
  --bg:        #faf9f7;
  --surface:   #ffffff;
  --border:    #e8e4de;
  --text:      #1a1a18;
  --muted:     #7a776f;
  --accent:    #c0392b;
  --accent-2:  #f5f0e8;
  --font-body: 'Lora', Georgia, serif;
  --font-ui:   'DM Sans', sans-serif;
  --max-w:     1100px;
  --gap:       2rem;
}

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

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

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

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

/* ─── Layout ────────────────────────────────────────────────── */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Site Header ───────────────────────────────────────────── */
.site-header {
  border-bottom: 2px solid var(--text);
  padding: 1.5rem 0;
  background: var(--surface);
}

.site-header .site-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-branding .site-title {
  font-family: var(--font-body);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

.site-branding .site-description {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* ─── Nav ───────────────────────────────────────────────────── */
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.main-navigation a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ─── Content Layout ────────────────────────────────────────── */
.content-area {
  padding: 3rem 0;
}

.content-area .site-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--gap);
  align-items: start;
}

/* ─── Main Content Column ───────────────────────────────────── */
.main-content {
  min-width: 0; /* prevents grid blowout from large content */
  overflow: hidden;
}

.main-content img {
  max-width: 100%;
  height: auto;
}

/* ─── Posts Loop ────────────────────────────────────────────── */
.posts-loop { display: flex; flex-direction: column; gap: 2.5rem; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover { box-shadow: 4px 4px 0 var(--text); }

.post-card-thumbnail img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.post-card-body { padding: 1.5rem; }

.post-card-meta {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.post-card-meta .cat-link {
  color: var(--accent);
  font-weight: 600;
}

.post-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

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

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.read-more {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s;
}

.read-more:hover { color: var(--accent); text-decoration: none; }

/* ─── Pagination ────────────────────────────────────────────── */
.posts-pagination {
  margin-top: 2rem;
  font-family: var(--font-ui);
}

.posts-pagination .nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.posts-pagination a,
.posts-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.posts-pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.posts-pagination .current { background: var(--text); color: #fff; border-color: var(--text); }

/* ─── Single Post ───────────────────────────────────────────── */
.single-post-header { margin-bottom: 2rem; }

.single-post-header .post-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
}

.single-post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-thumbnail { margin-bottom: 2rem; border-radius: 4px; overflow: hidden; }
.post-thumbnail img { width: 100%; }

.entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--font-body);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }

.entry-content p { margin-bottom: 1.25rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.25rem 1.5rem; }
.entry-content li { margin-bottom: 0.4rem; }

.entry-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.5rem;
  background: var(--accent-2);
  font-style: italic;
  color: var(--muted);
}

.entry-content pre {
  background: var(--text);
  color: #f8f8f2;
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.entry-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--accent-2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

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

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.widget-title {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.widget ul { list-style: none; }
.widget ul li {
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.widget ul li:last-child { border-bottom: none; }

.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--accent); }

/* ─── Tag Cloud ─────────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: baseline;
  line-height: 1.4;
}

.tag-cloud-link {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--accent-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15em 0.5em;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.tag-cloud-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ─── Dropdowns (e.g. Archive widget) ──────────────────────── */
.widget select {
  width: 100%;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a776f'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.widget select:focus {
  border-color: var(--accent);
}

.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form button {
  padding: 0.55rem 1rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.search-form button:hover { background: var(--accent); }

/* ─── Site Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 2px solid var(--text);
  background: var(--text);
  color: #fff;
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer .site-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}

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

.footer-nav a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  transition: color 0.2s;
}

.footer-nav a:hover { color: #fff; text-decoration: none; }

/* ─── Homepage Hero ─────────────────────────────────────────── */
.home-hero {
  background: var(--text);
  color: #fff;
  padding: 4rem 0 3.5rem;
  margin-bottom: 0;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  max-width: 700px;
}

.home-hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  max-width: 540px;
  line-height: 1.7;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .content-area .site-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .site-header .site-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
}
