/*
Theme Name: Toolips Blog
Theme URI: https://toolips.net/blog/
Author: LOM
Author URI: https://lomdesign.jp/
Description: Official blog theme for Toolips — Free Online Tools. Matches the Toolips design system with Google 4-color branding, glassmorphism cards, and clean typography.
Version: 1.0.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toolips-blog
Tags: blog, one-column, custom-logo, featured-images, translation-ready
*/

/* ============================================
   Toolips Blog — WordPress Theme Styles
   ============================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --blue: #4285F4;
  --green: #34A853;
  --yellow: #FBBC04;
  --red: #EA4335;
  --blue-bg: #EBF3FE;
  --green-bg: #E6F4EA;
  --yellow-bg: #FEF7E0;
  --red-bg: #FCE8E6;
  --text-primary: #1A1A2E;
  --text-secondary: #5F6368;
  --text-muted: #9AA0A6;
  --text-faint: #BDC1C6;
  --border: #ECEEF1;
  --border-hover: #D0D4DA;
  --bg-page: #FAFBFC;
  --bg-card: #FFFFFF;
  --bg-input: #F1F3F4;
  --max-width: 1100px;
  --content-width: 780px;
  --padding-page: 40px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'DM Sans', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  font-size: 16px;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

.site-logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--blue), var(--green), var(--yellow), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--blue); }

.lang-switcher {
  display: flex;
  gap: 8px;
}

.lang-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.lang-btn:hover { border-color: var(--border-hover); }
.lang-btn.active { background: var(--blue); color: white; border-color: var(--blue); }

/* ---------- Blog Hero ---------- */
.blog-hero {
  text-align: center;
  padding: 72px var(--padding-page) 48px;
  position: relative;
}

.blog-hero-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.blog-hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Background Blobs ---------- */
.blob {
  position: fixed;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.5;
  z-index: 0;
  border-radius: 50%;
}

.blob-1 {
  top: 2%; left: -5%;
  width: 380px; height: 380px;
  background: linear-gradient(135deg, rgba(66,133,244,0.3), rgba(52,168,83,0.15));
  animation: blobMorph1 18s ease-in-out infinite;
}

.blob-2 {
  top: 55%; right: -8%;
  width: 340px; height: 340px;
  background: linear-gradient(135deg, rgba(234,67,53,0.25), rgba(251,188,4,0.15));
  animation: blobMorph2 22s ease-in-out infinite;
}

@keyframes blobMorph1 {
  0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: rotate(0deg) scale(1); }
  50% { border-radius: 30% 70% 40% 60% / 55% 30% 70% 45%; transform: rotate(180deg) scale(0.95); }
}

@keyframes blobMorph2 {
  0%, 100% { border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%; transform: rotate(0deg) scale(1); }
  50% { border-radius: 60% 40% 45% 55% / 35% 55% 45% 65%; transform: rotate(180deg) scale(1.05); }
}

/* ---------- Main Content ---------- */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-page) 60px;
  position: relative;
  z-index: 1;
}

/* ---------- Post Grid (Archive/Index) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ---------- Post Card ---------- */
.post-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: all 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 40px rgba(66,133,244,0.08);
  transform: translateY(-4px);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-input);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  width: fit-content;
}

.post-card-cat.cat-design { background: var(--blue-bg); color: var(--blue); }
.post-card-cat.cat-seo { background: var(--green-bg); color: var(--green); }
.post-card-cat.cat-ai { background: var(--red-bg); color: var(--red); }
.post-card-cat.cat-tools { background: var(--yellow-bg); color: var(--yellow); }

.post-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  transition: color 0.2s;
}

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

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.post-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-card-meta time { font-weight: 500; }

.reading-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Category Filter Bar ---------- */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.cat-filter a {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.cat-filter a:hover { border-color: var(--blue); color: var(--blue); }
.cat-filter a.active { background: var(--blue); color: white; border-color: var(--blue); }

/* ---------- Single Post ---------- */
.single-header {
  text-align: center;
  padding: 72px var(--padding-page) 40px;
  max-width: var(--content-width);
  margin: 0 auto;
}

.single-cat {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.single-cat.cat-design { background: var(--blue-bg); color: var(--blue); }
.single-cat.cat-seo { background: var(--green-bg); color: var(--green); }
.single-cat.cat-ai { background: var(--red-bg); color: var(--red); }
.single-cat.cat-tools { background: var(--yellow-bg); color: var(--yellow); }

.single-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 20px;
}

.single-meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.single-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.single-thumb {
  max-width: 900px;
  margin: 0 auto 48px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}

.single-thumb img {
  width: 100%;
  height: auto;
}

/* ---------- Article Content ---------- */
.article-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--padding-page) 48px;
  position: relative;
  z-index: 1;
}

.article-content p {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.article-content h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 16px;
}

.article-content h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.article-content a {
  color: var(--blue);
  font-weight: 500;
  border-bottom: 1px solid rgba(66,133,244,0.3);
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-color: var(--blue);
}

.article-content ul, .article-content ol {
  margin: 0 0 28px 24px;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-secondary);
}

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

.article-content blockquote {
  border-left: 4px solid var(--blue);
  margin: 32px 0;
  padding: 20px 28px;
  background: var(--blue-bg);
  border-radius: 0 16px 16px 0;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-content blockquote p:last-child { margin-bottom: 0; }

.article-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 24px 28px;
  border-radius: 16px;
  overflow-x: auto;
  margin: 32px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
}

.article-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 6px;
}

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

.article-content img {
  border-radius: 14px;
  margin: 32px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.article-content figure {
  margin: 32px 0;
}

.article-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

.article-content table,
.article-content .wp-block-table table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 32px 0 !important;
  font-size: 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

.article-content table th,
.article-content table td,
.article-content .wp-block-table th,
.article-content .wp-block-table td {
  padding: 14px 20px !important;
  text-align: left !important;
  border: none !important;
  border-bottom: 1px solid var(--bg-input) !important;
}

.article-content table thead th,
.article-content .wp-block-table thead th {
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.02em !important;
  color: var(--text-secondary) !important;
  background: var(--bg-page) !important;
  border-bottom: 1.5px solid var(--border) !important;
}

.article-content table tr:last-child td,
.article-content .wp-block-table tr:last-child td {
  border-bottom: none !important;
}

.article-content table tbody tr:hover,
.article-content .wp-block-table tbody tr:hover {
  background: var(--bg-page) !important;
}

.article-content table td:first-child,
.article-content .wp-block-table td:first-child {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

.article-content .wp-block-table {
  overflow: visible !important;
  margin: 0 !important;
  border: none !important;
}

.article-content .wp-block-table figcaption {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ---------- Tool CTA Box ---------- */
.tool-cta {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 32px 36px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: border-color 0.3s;
}

.tool-cta:hover { border-color: var(--blue); }

.tool-cta-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  color: var(--blue);
}

.tool-cta-icon svg {
  width: 26px;
  height: 26px;
}

.tool-cta-body { flex: 1; }

.tool-cta-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-cta-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.tool-cta-btn,
.article-content .tool-cta-btn {
  padding: 10px 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--blue), #5B9CF6);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.2s;
  display: inline-block;
  border-bottom: none;
}

.tool-cta-btn:hover,
.article-content .tool-cta-btn:hover { transform: scale(1.03); color: #FFFFFF; border-bottom: none; }

/* ---------- Tags ---------- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--padding-page);
}

.post-tags a {
  padding: 6px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.post-tags a:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-bg);
}

/* ---------- Author Box ---------- */
.author-box {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 32px 36px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.author-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Post Navigation ---------- */
.post-nav {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 0 var(--padding-page);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-nav-item {
  padding: 24px 28px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: white;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(66,133,244,0.06);
}

.post-nav-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.post-nav-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s;
}

.post-nav-item:hover .post-nav-title { color: var(--blue); }
.post-nav-item.next { text-align: right; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  background: white;
  transition: all 0.2s;
}

.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); color: white; border-color: var(--blue); }

/* ---------- Sidebar ---------- */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.sidebar .widget {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.widget ul {
  list-style: none;
}

.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.widget a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.widget a:hover { color: var(--blue); }

/* ---------- Search ---------- */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.search-form input:focus { border-color: var(--blue); }

.search-form button {
  padding: 10px 20px;
  border-radius: 14px;
  border: none;
  background: var(--blue);
  color: white;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- 404 ---------- */
.page-404 {
  text-align: center;
  padding: 120px 40px 80px;
}

.page-404-code {
  font-size: 120px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue), var(--green), var(--yellow), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.page-404-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.page-404-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.page-404-btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--blue), #5B9CF6);
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(66,133,244,0.25);
  transition: transform 0.2s;
}

.page-404-btn:hover { transform: scale(1.03); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--border);
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

@media (max-width: 768px) {
  .site-header { padding: 14px 20px; }
  .header-nav { gap: 14px; }
  .blog-hero { padding: 48px 20px 32px; }
  .blog-hero-title { font-size: 32px; }
  .single-header { padding: 48px 20px 32px; }
  .single-title { font-size: 28px; }
  .article-content { padding: 0 20px 48px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .blob { opacity: 0.3; filter: blur(30px); }
  .tool-cta { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .blog-hero-title { font-size: 26px; }
  .single-title { font-size: 24px; }
  .post-card-body { padding: 18px 20px 22px; }
  .site-header .header-nav a { display: none; }
}