/* ============================================
   うんちくおじさん - Custom Theme
   Warm, retro-modern Japanese blog style
   ============================================ */

:root {
  --color-primary: #E65100;
  --color-primary-light: #FF8F00;
  --color-primary-dark: #BF360C;
  --color-bg: #FFFAF5;
  --color-bg-card: #FFFFFF;
  --color-bg-warm: #FFF3E0;
  --color-text: #3E2723;
  --color-text-light: #6D4C41;
  --color-border: #FFCC80;
  --color-accent: #1565C0;
  --color-badge: #D32F2F;
  --font-heading: 'M PLUS Rounded 1c', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --max-width: 1100px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(230, 81, 0, 0.08);
  --shadow-hover: 0 6px 24px rgba(230, 81, 0, 0.15);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  min-height: 100vh;
  /* Subtle paper texture feel */
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 204, 128, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(230, 81, 0, 0.05) 0%, transparent 50%);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

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

/* ============================================
   Header
   ============================================ */
.site-header {
  background: var(--color-bg-card);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo img {
  border-radius: 50%;
  border: 2px solid var(--color-border);
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-nav a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.site-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 3rem 0;
  margin-bottom: 3rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

.ojisan-avatar img {
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.5);
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-text h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.hero-intro {
  font-size: 1rem;
  opacity: 0.85;
  line-height: 1.7;
}

/* ============================================
   Posts Section
   ============================================ */
.posts-section {
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary-dark);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon { font-size: 1.3rem; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ============================================
   Post Card
   ============================================ */
.post-card {
  background: var(--color-bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(255, 204, 128, 0.3);
}

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

.post-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-warm);
}

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

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

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

.trend-badge {
  display: inline-block;
  background: linear-gradient(135deg, #D32F2F, #FF5722);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.post-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.post-card-body h3 a {
  color: var(--color-text);
}
.post-card-body h3 a:hover {
  color: var(--color-primary);
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  opacity: 0.7;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 1rem 0;
}

.pagination a {
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  background: var(--color-primary);
  color: white;
  border-radius: 8px;
  transition: background 0.2s;
}
.pagination a:hover {
  background: var(--color-primary-dark);
  color: white;
}

.pagination-info {
  font-weight: 700;
  color: var(--color-text-light);
}

/* ============================================
   Post Full (Single Post)
   ============================================ */
.post-full {
  max-width: 780px;
  margin: 2rem auto 4rem;
}

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

.post-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.4;
  color: var(--color-text);
  margin-top: 0.5rem;
}

.post-header .post-meta {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.post-author {
  margin-left: 1rem;
  color: var(--color-primary);
  font-weight: 700;
}

.post-hero-image {
  margin: 0 -1rem 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post-hero-image img {
  width: 100%;
}

/* Post Content */
.post-content {
  font-size: 1.05rem;
  line-height: 2;
}

.post-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary-dark);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-border);
}

.post-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 2rem 0 0.75rem;
}

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

.post-content img {
  border-radius: var(--radius);
  margin: 1.5rem auto;
  box-shadow: var(--shadow);
}

.post-content blockquote {
  background: var(--color-bg-warm);
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-light);
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content code {
  background: var(--color-bg-warm);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: #2E2E2E;
  color: #F5F5F5;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

/* Ojisan tone special styling */
.ojisan-tone .ojisan-comment {
  background: var(--color-bg-warm);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  border: 2px solid var(--color-border);
}

.ojisan-tone .ojisan-comment::before {
  content: '💡 おじさんの豆知識';
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* ============================================
   Post Footer
   ============================================ */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-border);
}

.ojisan-signature {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-bg-warm);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.ojisan-signature img {
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}

.ojisan-signature strong {
  font-family: var(--font-heading);
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.ojisan-signature p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--color-bg-warm);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-family: var(--font-heading);
}

/* ============================================
   Post Navigation
   ============================================ */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 780px;
  margin: 0 auto 4rem;
}

.post-navigation a {
  display: block;
  padding: 1.25rem;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}

.post-navigation a:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary);
}

.post-navigation span {
  font-size: 0.8rem;
  color: var(--color-text-light);
  display: block;
  margin-bottom: 0.25rem;
}

.post-navigation strong {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.nav-next { text-align: right; }

/* ============================================
   About Page
   ============================================ */
.page-content {
  max-width: 700px;
  margin: 2rem auto 4rem;
}

.page-content h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-primary-dark);
  text-align: center;
  margin-bottom: 2rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.8);
  padding: 2rem 0;
  margin-top: 2rem;
}

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

.footer-quote {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-border);
  margin-bottom: 0.75rem;
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .hero-text h1 { font-size: 1.8rem; }
  .hero-intro br { display: none; }

  .header-inner {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .site-nav { gap: 1rem; }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-header h1 { font-size: 1.5rem; }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .ojisan-avatar img {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .hero { padding: 2rem 0; }
  .hero-text h1 { font-size: 1.5rem; }
}
