/*
Theme Name: Manus Partner Theme
Theme URI: https://www.manus-partner.blog
Author: Manus Partner
Author URI: https://www.manus-partner.blog
Description: ナチュラルカラー系ミニマルデザインのブログテーマ。スマホファースト設計、SEO最適化済み。
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: manus-partner
Tags: blog, one-column, custom-menu, featured-images, translation-ready
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
*/

/* ===== CSS Variables ===== */
:root {
  --dark-blue: #2d3b2d;
  --medium-blue: #4a5e3a;
  --accent-blue: #6b8f5e;
  --light-blue: #a8c49a;
  --white: #fdfaf5;
  --light-gray: #f5f0e8;
  --medium-gray: #a89880;
  --dark-gray: #5c4f3a;
  --text-primary: #3b2f1e;
  --text-secondary: #7a6a55;
  --border-color: #e0d5c5;
  --shadow-sm: 0 1px 2px rgba(60,40,10,0.06);
  --shadow-md: 0 4px 6px -1px rgba(60,40,10,0.10);
  --shadow-lg: 0 10px 15px -3px rgba(60,40,10,0.10);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --content-width: 780px;
  --transition: 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.8;
  overflow-x: hidden;
}

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

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

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dark-blue);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-logo {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-logo a {
  color: var(--white);
}

/* Hamburger Menu */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1002;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all var(--transition);
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Slide Menu */
.slide-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--dark-blue);
  z-index: 1001;
  transition: right var(--transition);
  overflow-y: auto;
  padding: 80px 24px 40px;
}

.slide-menu.open {
  right: 0;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-section {
  margin-bottom: 28px;
}

.menu-section-title {
  color: var(--light-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.menu-section ul {
  list-style: none;
}

.menu-section ul li a {
  display: block;
  color: rgba(255,255,255,0.85);
  padding: 10px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: all var(--transition);
}

.menu-section ul li a:hover {
  color: var(--white);
  padding-left: 8px;
}

/* ===== Main Content ===== */
body {
  padding-top: 60px;
}

.site-main {
  min-height: 0;
}

/* ===== Hero Section ===== */
.hero-section {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--medium-blue) 100%);
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(59,130,246,0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2%, 2%); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  margin: 0 auto;
}

.hero-catchcopy {
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}

.hero-subcopy {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ===== Section Styles ===== */
.section-white {
  background: var(--white);
  padding: 48px 20px;
}

.section-gray {
  background: var(--light-gray);
  padding: 48px 20px;
}

.section-dark {
  background: var(--dark-blue);
  padding: 48px 20px;
  color: var(--white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--accent-blue);
  border-radius: 2px;
}

.section-dark .section-title::after {
  background: var(--light-blue);
}

/* ===== Category Icons ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.category-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== Post Cards ===== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-color);
}

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

.post-card a {
  display: block;
  color: inherit;
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.post-card-body {
  padding: 16px;
}

.post-card-category {
  display: inline-block;
  background: var(--accent-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-date {
  font-size: 0.75rem;
  color: var(--medium-gray);
  margin-top: 8px;
}

/* ===== Carousel ===== */
.carousel-container {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  display: flex;
  gap: 16px;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  min-width: 280px;
  max-width: 300px;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.carousel-item .post-card {
  height: 100%;
}

/* ===== Ranking ===== */
.ranking-list {
  counter-reset: ranking;
}

.ranking-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  align-items: center;
}

.ranking-item::before {
  counter-increment: ranking;
  content: counter(ranking);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: var(--accent-blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.ranking-item:nth-child(1)::before { background: #f59e0b; }
.ranking-item:nth-child(2)::before { background: #9ca3af; }
.ranking-item:nth-child(3)::before { background: #b45309; }

.ranking-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranking-title a {
  color: var(--white);
}

.ranking-category {
  font-size: 0.7rem;
  color: var(--light-blue);
  margin-top: 4px;
}

/* ===== Single Post ===== */
.single-post-header {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--medium-blue) 100%);
  padding: 32px 20px;
  color: var(--white);
}

.single-post-header .section-inner {
  max-width: var(--content-width);
}

.single-post-category {
  display: inline-block;
  background: var(--accent-blue);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.single-post-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.single-post-meta {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.single-post-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.single-post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding: 12px 16px;
  background: var(--light-gray);
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.single-post-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-blue);
}

.single-post-content p {
  margin-bottom: 20px;
  line-height: 1.9;
}

.single-post-content ul,
.single-post-content ol {
  margin: 16px 0 20px 24px;
}

.single-post-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.single-post-content table th,
.single-post-content table td {
  padding: 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.single-post-content table th {
  background: var(--dark-blue);
  color: var(--white);
  font-weight: 600;
}

.single-post-content table tr:nth-child(even) {
  background: var(--light-gray);
}

.single-post-content strong {
  color: var(--accent-blue);
}

.single-post-content blockquote {
  background: var(--light-gray);
  border-left: 4px solid var(--accent-blue);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, var(--dark-blue), var(--medium-blue));
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  text-align: center;
  color: var(--white);
}

.cta-box p {
  margin-bottom: 16px;
  color: rgba(255,255,255,0.9);
}

.cta-button {
  display: inline-block;
  background: var(--accent-blue);
  color: var(--white);
  padding: 12px 32px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.cta-button:hover {
  background: var(--light-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

/* ===== Related Posts ===== */
.related-posts {
  background: var(--light-gray);
  padding: 48px 20px;
}

.related-posts .section-inner {
  max-width: var(--content-width);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.related-post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

.related-post-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.related-post-card .card-body {
  padding: 12px;
}

.related-post-card .card-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Next Post */
.next-post-section {
  background: var(--white);
  padding: 32px 20px;
  border-top: 1px solid var(--border-color);
}

.next-post-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.next-post-link {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--light-gray);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.next-post-link:hover {
  background: var(--dark-blue);
  color: var(--white);
}

.next-post-link:hover .next-post-title {
  color: var(--white);
}

.next-post-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.next-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition);
}

/* ===== Archive Page ===== */
.archive-header {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--medium-blue) 100%);
  padding: 32px 20px;
  text-align: center;
  color: var(--white);
}

.archive-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.archive-description {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--dark-blue);
  color: rgba(255,255,255,0.6);
  padding: 40px 20px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.footer-nav a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--white);
}

.footer-copyright {
  text-align: center;
  font-size: 0.75rem;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== Scroll Related Posts ===== */
.scroll-related {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(60,40,10,0.10);
  padding: 16px 20px;
  z-index: 999;
  transition: bottom 0.5s ease;
}

.scroll-related.visible {
  bottom: 0;
}

.scroll-related-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.scroll-related-posts {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.scroll-related-posts::-webkit-scrollbar {
  display: none;
}

.scroll-related-item {
  min-width: 200px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.scroll-related-item img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
}

.scroll-related-item .title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.scroll-related-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}

.pagination a {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.pagination .current {
  background: var(--accent-blue);
  color: var(--white);
}

/* ===== 404 Page ===== */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}

.error-404 h1 {
  font-size: 4rem;
  color: var(--accent-blue);
  margin-bottom: 16px;
}

.error-404 p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-catchcopy {
    font-size: 1.75rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-section {
    padding: 80px 20px;
  }
  
  .hero-catchcopy {
    font-size: 2rem;
  }
  
  .single-post-title {
    font-size: 1.75rem;
  }
  
  .related-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Utility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }
