/*
Theme Name: uma1-2026 Theme
Theme URI: https://dev.uma1.net
Author: Ichiro Baba
Author URI: https://dev.uma1.net
Description: Clean Dev Log & Warm Workspace theme for regional SE dad. Features AI notes, Minecraft kids tech, remote work logs, dark mode, and Zenn/Qiita-inspired minimal UI.
Version: 2.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: uma1-2026
*/

/* ==========================================================================
   1. Design System & CSS Variables (Clean Dev Log & Warm Workspace)
   ========================================================================== */
:root {
  /* Typography */
  --font-sans: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  /* Color Palette - Light (Warm Paper & Slate Blue with AI Teal Accent) */
  --color-bg-base: #fcfbf9;          /* Warm Paper White */
  --color-bg-surface: #ffffff;
  --color-bg-surface-elevated: #f1f5f9;
  --color-bg-subtle: #f8fafc;
  
  --color-text-main: #1e293b;         /* Slate 800 */
  --color-text-muted: #64748b;        /* Slate 500 */
  --color-text-subtle: #94a3b8;       /* Slate 400 */
  
  --color-primary: #1e293b;
  --color-primary-hover: #334155;
  
  /* Accent: AI Teal & Workspace Green */
  --color-accent: #0d9488;           /* Teal 600 */
  --color-accent-hover: #0f766e;     /* Teal 700 */
  --color-accent-light: #ccfbf1;     /* Teal 100 */
  --color-accent-glow: rgba(13, 148, 136, 0.12);

  --color-border: #e2e8f0;           /* Slate 200 */
  --color-border-subtle: #f1f5f9;
  --color-divider: #cbd5e1;

  /* Tag Badges Colors */
  --badge-ai-bg: #ccfbf1;
  --badge-ai-text: #0f766e;
  --badge-kids-bg: #e0f2fe;
  --badge-kids-text: #0369a1;
  --badge-work-bg: #fef3c7;
  --badge-work-text: #b45309;

  /* Callout Colors */
  --color-info-bg: #f0fdf4;
  --color-info-border: #0d9488;
  --color-info-text: #065f46;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(30, 41, 59, 0.04);
  --shadow-md: 0 4px 10px -2px rgba(30, 41, 59, 0.06), 0 2px 4px -1px rgba(30, 41, 59, 0.03);
  --shadow-lg: 0 10px 20px -3px rgba(30, 41, 59, 0.08);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
body.dark-mode {
  --color-bg-base: #0f172a;          /* Dark Slate */
  --color-bg-surface: #1e293b;
  --color-bg-surface-elevated: #334155;
  --color-bg-subtle: #1a2333;

  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;

  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;

  --color-accent: #2dd4bf;           /* Bright Teal */
  --color-accent-hover: #5eead4;
  --color-accent-light: rgba(45, 212, 191, 0.15);
  --color-accent-glow: rgba(45, 212, 191, 0.25);

  --color-border: #334155;
  --color-border-subtle: #1e293b;
  --color-divider: #475569;

  --badge-ai-bg: rgba(45, 212, 191, 0.15);
  --badge-ai-text: #2dd4bf;
  --badge-kids-bg: rgba(56, 189, 248, 0.15);
  --badge-kids-text: #38bdf8;
  --badge-work-bg: rgba(251, 191, 36, 0.15);
  --badge-work-text: #fbbf24;

  --color-info-bg: #1e293b;
  --color-info-border: #2dd4bf;
  --color-info-text: #5eead4;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. Reset & Base Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
  color: var(--color-accent-hover);
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.4;
  margin-top: 0;
  color: var(--color-text-main);
}

code, pre, kbd {
  font-family: var(--font-mono);
}

kbd {
  background-color: var(--color-bg-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.75rem;
}

/* ==========================================================================
   3. Container & Layout
   ========================================================================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding: 32px 0 60px;
}

@media (min-width: 992px) {
  .site-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

.main-content {
  min-width: 0;
}

/* ==========================================================================
   4. Header & Navigation (Clean Dev Brand)
   ========================================================================== */
.site-header {
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

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

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  font-family: var(--font-mono);
}

.site-title a {
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-title a .devlog-tag {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.site-description {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  display: none;
}

@media (min-width: 768px) {
  .site-description {
    display: inline-block;
    padding-left: 12px;
    border-left: 1px solid var(--color-border);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Navigation Menu */
.main-navigation ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.main-navigation a {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  background-color: var(--color-bg-subtle);
  color: var(--color-accent);
}

/* Cmd + K Trigger Button */
.cmd-k-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cmd-k-trigger:hover {
  border-color: var(--color-accent);
  color: var(--color-text-main);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dark-mode-toggle:hover {
  background-color: var(--color-bg-subtle);
  border-color: var(--color-accent);
}

/* ==========================================================================
   5. Hero Section (Work & Life Lab Statement)
   ========================================================================== */
.hero-section {
  background-color: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 40px 0;
  margin-bottom: 28px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

@media (min-width: 868px) {
  .hero-inner {
    grid-template-columns: 1.3fr 1fr;
  }
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.hero-title {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 14px;
}

.hero-title .highlight {
  color: var(--color-accent);
}

.hero-subtitle {
  font-size: 0.975rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.hero-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-tag-item {
  font-size: 0.775rem;
  font-family: var(--font-mono);
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
}

/* Featured Log Box */
.featured-card {
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.featured-card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.featured-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.featured-title a {
  color: var(--color-text-main);
}

.featured-title a:hover {
  color: var(--color-accent);
}

.featured-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* ==========================================================================
   6. DevLog Article Cards (Zenn/Qiita-like Minimal Cards)
   ========================================================================== */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 18px;
  background-color: var(--color-accent);
  border-radius: 3px;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.post-card {
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  padding: 20px;
}

.post-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.badge-log-type {
  background-color: var(--badge-ai-bg);
  color: var(--badge-ai-text);
  font-weight: 700;
}

.badge-category {
  background-color: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.post-reading-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.45;
}

.post-card-title a {
  color: var(--color-text-main);
}

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

.post-card-note {
  font-size: 0.825rem;
  background-color: var(--color-bg-subtle);
  border-left: 3px solid var(--color-accent);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.post-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.read-more-link {
  font-weight: 600;
  font-size: 0.825rem;
  color: var(--color-accent);
}

/* ==========================================================================
   7. Single Article Detail Layout (single.php)
   ========================================================================== */
.single-post-article {
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .single-post-article {
    padding: 20px 16px;
  }
}

.single-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 20px;
}

.single-title {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 12px 0;
}

/* Dev Note Callout Box */
.dev-note-box {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
}

.dev-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-info-text);
  margin-bottom: 10px;
}

.dev-note-content {
  font-size: 0.925rem;
  color: var(--color-text-main);
  line-height: 1.7;
}

.dev-note-content ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}

/* TOC Container */
.toc-box {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 24px 0;
}

.toc-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 6px;
  font-size: 0.875rem;
}

.toc-list li.toc-h3 {
  padding-left: 14px;
  font-size: 0.825rem;
}

.toc-list a {
  color: var(--color-text-muted);
}

.toc-list a:hover {
  color: var(--color-accent);
}

/* Headings in Article */
.entry-content h2 {
  font-size: 1.4rem;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.entry-content h3 {
  font-size: 1.15rem;
  margin-top: 32px;
  margin-bottom: 12px;
  border-left: 3px solid var(--color-accent);
  padding-left: 10px;
}

.entry-content p {
  margin-bottom: 20px;
}

/* Code & Commands */
.entry-content pre, pre {
  background: #0f172a !important;
  color: #f8fafc !important;
  padding: 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid #1e293b;
  margin: 24px 0;
}

/* Step Block */
.step-container {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.step-number {
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 800;
  font-family: var(--font-mono);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex-grow: 1;
}

.step-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

/* Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  background-color: var(--color-bg-subtle);
  font-weight: 700;
}

/* ==========================================================================
   8. Sidebar & Author Profile Widget (Real SE Dad Profile)
   ========================================================================== */
.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

/* Real Profile Card */
.profile-card {
  text-align: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2rem;
  border: 2px solid var(--color-accent);
}

.profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-tagline {
  font-size: 0.775rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.profile-bio {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 14px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.profile-chip {
  font-size: 0.7rem;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  font-family: var(--font-mono);
}

/* Ad Space */
.ad-space {
  margin: 24px 0;
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
}

.ad-space-infeed { min-height: 220px; width: 100%; }
.ad-space-article { min-height: 250px; width: 100%; }
.ad-space-sidebar { min-height: 220px; width: 100%; }

.ad-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ad-placeholder-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Modal Search UI */
.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  gap: 10px;
}

.search-modal-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  color: var(--color-text-main);
  outline: none;
  font-family: var(--font-sans);
}

.search-modal-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.search-modal-footer {
  padding: 10px 18px;
  background-color: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Footer */
.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 36px 0;
  margin-top: auto;
  border-top: 1px solid #334155;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-container {
    flex-direction: row;
    text-align: left;
  }
}

.footer-copyright {
  font-size: 0.85rem;
}
