/*
Theme Name: Daikuno Gensan
Theme URI: https://blog.kyokutoh-design.com
Author: yusuke
Author URI: https://blog.kyokutoh-design.com
Description: 町の大工「げんさん」の静的LPをWordPressテーマ化したものです。
Version: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: daikuno-gensan
*/

:root {
  --brown: #8b4513;
  --green: #2f5233;
  --sand: #f5f5dc;
  --cream: #fffaf2;
  --text: #2f2a26;
  --muted: #6b5f57;
  --border: #e2d7c8;
  --max-width: 1200px;
  --wood-light: #deb887;
  --wood-dark: #8b4513;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.8;
  min-height: 100vh;
}

img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

section {
  scroll-margin-top: 80px;
}

.container {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 80px 0;
}

.section-sand {
  background: var(--sand);
}

.section-heading {
  text-align: center;
  margin-bottom: 48px;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  color: var(--brown);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
  transition: box-shadow 0.2s ease;
}

.site-header.has-shadow {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.site-brand {
  font-weight: 700;
  color: var(--brown);
  font-size: 1.2rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  color: #4a4039;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--brown);
  border-color: var(--brown);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

/* ブログリストのスタイル */
.blog-list {
  padding: 80px 0;
  background: var(--sand);
  min-height: calc(100vh - 72px);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin: 40px 0;
}

.blog-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.blog-card__link {
  display: block;
}

.blog-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.05);
}

.blog-card__content {
  padding: 24px;
  background: linear-gradient(to bottom right, #fff, #fff8f0);
}

.blog-card__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: var(--wood-dark);
  line-height: 1.4;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

.blog-card__date {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.blog-card__excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.9;
}

/* ページネーション */
.pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--wood-dark);
  font-weight: 600;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
  background: var(--wood-light);
  color: #fff;
  border-color: var(--wood-light);
}

.pagination .current {
  background: var(--wood-dark);
  color: #fff;
  border-color: var(--wood-dark);
}

/* 記事がない場合のメッセージ */
.no-posts {
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.no-posts p:first-child {
  font-size: 1.25rem;
  color: var(--wood-dark);
  margin: 0 0 16px;
}

.no-posts p:last-child {
  color: var(--muted);
  margin: 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .blog-card__content {
    padding: 20px;
  }
  
  .blog-card__title {
    font-size: 1.1rem;
  }
  
  .pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #244126;
}

.btn-outline {
  border-color: var(--green);
  color: var(--green);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--green);
  color: #fff;
}

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  color: #fff;
  background-image: url("https://images.unsplash.com/photo-1683115100702-af818681184d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3Nzg4Nzd8MHwxfHNlYXJjaHwxfHxjYXJwZW50ZXIlMjB3b29kd29ya2luZyUyMHdvcmtzaG9wfGVufDF8fHx8MTc2MjY0OTE3Nnww&ixlib=rb-4.1.0&q=80&w=1600&utm_source=figma&utm_medium=referral");
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.35));
}

.hero-content {
  position: relative;
  max-width: 600px;
  padding: 60px 0;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 24px;
  font-weight: 600;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.92);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: center;
}

.about-text p + p {
  margin-top: 16px;
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.philosophy-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 15px 30px rgba(47, 82, 51, 0.08);
}

.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
  font-weight: 600;
}

.portfolio-item {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.portfolio-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.portfolio-item h3 {
  text-align: center;
  color: var(--brown);
  margin-bottom: 24px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.media-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.badge-before {
  background: var(--brown);
}

.badge-after {
  background: var(--green);
}

.portfolio-description {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.process-step {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  position: relative;
  min-height: 260px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.process-step h3 {
  margin: 12px 0;
  color: var(--brown);
}

.step-number {
  font-weight: 700;
  color: rgba(139, 69, 19, 0.35);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
}

.step-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.contact-grid {
  display: grid;
  gap: 32px;
}

.callout {
  background: var(--green);
  color: #fff;
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 25px 40px rgba(47, 82, 51, 0.25);
}

.callout a {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-block;
  margin: 12px 0;
}

.form-card {
  background: var(--sand);
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

form label {
  display: block;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 6px;
}

form input,
form textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px 14px;
  margin-bottom: 20px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

form input:focus-visible,
form textarea:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 82, 51, 0.15);
  outline: none;
}

.site-footer {
  background: #3e2723;
  color: #f4e9de;
  padding: 64px 0 32px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.footer-grid h3,
.footer-grid h4 {
  margin: 0 0 12px;
}

.footer-grid p {
  margin: 0;
}

.footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  img {
    border-radius: 20px;
  }
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .contact-grid .section-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-nav {
    position: absolute;
    inset: 72px 0 auto 0;
    padding: 24px 16px 32px;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 0;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
