.page-header { margin-top: 60px; padding: 60px 0; background: var(--gray-100) !important; border-bottom: 1px solid var(--gray-200); }
.page-header__inner { grid-column: 1/-1; max-width: 1120px; margin: 0; text-align: left; }
.page-header__title { font-size: 36px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 700; }
.page-header__sub { margin-top: 10px; font-size: 18px; line-height: 1.6; color: var(--gray-700); max-width: 72ch; }
.breadcrumbs { color: var(--gray-600); font-size: 14px; }
.breadcrumbs a { color: inherit; text-decoration: underline; }
@media (max-width: 768px) { .page-header { padding: 24px 0; } .page-header__title { font-size: 28px; } .page-header__sub { font-size: 16px; } }

.blog-section { padding: 40px 0 80px; background: var(--white); }
.blog-container { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
.search-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; border: 2px solid var(--black); background: #fff; padding: 16px; border-radius: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; grid-column: span 4; }
.form-label { font-weight: 600; }
.form-input { width: 100%; border: 2px solid var(--black); padding: 10px 12px; font-size: 16px; font-family: inherit; border-radius: 0; }
.form-input:focus { outline: none; border-color: var(--primary); }
.btn { padding: 10px 16px; border: 2px solid var(--black); background: #fff; color: var(--black); text-decoration: none; cursor: pointer; border-radius: 0; }
.btn.btn-primary { background: var(--black); color: var(--white); }
.btn.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }
.btn.btn-secondary { background: transparent; }
.btn.btn-secondary:hover { background: var(--black); color: var(--white); }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } .form-group { grid-column: span 12; } }
.blog-card { display: block; border: 2px solid var(--black); background: #fff; color: var(--black); text-decoration: none; }
.blog-card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1); text-decoration: none; color: var(--black); }
.blog-thumbnail { position: relative; height: 240px; background: var(--gray-100); border-bottom: 2px solid var(--black); overflow: hidden; }
.blog-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.blog-card:hover .blog-thumbnail img { transform: scale(1.05); }
.blog-thumbnail-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; color: var(--gray-500); }
.blog-category-badge { position: absolute; left: 12px; top: 12px; color: var(--black); font-weight: 600; line-height: 1.1; background: #fff; border: 1px solid var(--black); padding: 2px 8px; font-size: 12px; }
.blog-content { padding: 12px; }
.blog-meta { display: flex; align-items: center; gap: 8px; color: var(--gray-600); margin-bottom: 6px; }
.blog-date { font-size: 12px; font-weight: 600; color: var(--primary); }
.blog-post-title { font-size: 18px; line-height: 1.4; margin: 4px 0 6px; font-weight: 700; }
.blog-excerpt { font-size: 14px; color: var(--gray-700); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 24px 0; }
.pager a, .pager span { border: 1px solid var(--black); padding: 6px 10px; background: #fff; text-decoration: none; }
.pager .is-current { background: var(--gray-100); pointer-events: none; }

.post { padding: 40px 0 80px; background: var(--white); }
.post__inner { max-width: 960px; margin: 0 auto; padding: 0 48px; }
.post__title { font-size: 32px; font-weight: 800; line-height: 1.3; margin: 8px 0 16px; }
.post__meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.post__hero { border: 2px solid var(--black); background: var(--gray-100); margin: 12px 0 24px; }
.post__hero img { width: 100%; height: 420px; object-fit: cover; display: block; }
.post__body { font-size: 16px; line-height: 1.9; color: var(--gray-800); border: 2px solid var(--black); background: #fff; padding: 24px; overflow: hidden; word-wrap: break-word; }
.post__body img, .post__body video, .post__body iframe { max-width: 100% !important; height: auto !important; display: block; }
.post__body figure { margin: 1.2em auto; max-width: 100%; }
.post__body figure.image img, .post__body figure.image_resized img { width: 100% !important; height: auto !important; }
.post__body .image-style-align-left { float: left; margin: 0 1rem 1rem 0; max-width: calc(50% - 1rem); }
.post__body .image-style-align-right { float: right; margin: 0 0 1rem 1rem; max-width: calc(50% - 1rem); }
@media (max-width: 1024px) { .post__hero img { height: 260px; } }
@media (max-width: 768px) { .post__body .image-style-align-left, .post__body .image-style-align-right { float: none; margin: 0 0 1rem 0; max-width: 100%; } }
.post__body figure figcaption { font-size: 0.9em; color: var(--gray-600); text-align: center; margin-top: .5em; }
.post__body table { width: 100%; border-collapse: collapse; }
.post__body pre, .post__body code, .post__body table { max-width: 100%; overflow-x: auto; }
.post__back { margin-top: 24px; }

/* ===== Responsive overrides for blogs index ===== */
/* Smartphone: stack action row (検索/リセット/表示件数) vertically */
@media (max-width: 767px) {
  .blog-section .search-form .form-group:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .blog-section .search-form .form-group:last-child .btn { width: 100%; }
  .blog-section .search-form .form-group:last-child .caption {
    margin-left: 0 !important;
    display: block;
  }

  /* One article per row, no horizontal scroll */
  .blog-section .blog-grid {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }
  .blog-section .blog-card { width: 100% !important; }
}

/* Tablet: two columns, no horizontal scroll */
@media (min-width: 768px) and (max-width: 1023px) {
  .blog-section .blog-grid {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }
}
