/*
Theme Name: Lightning Child
Theme URI: 
Template: lightning
Description: 
Author: 
Tags: 
Version: 0.6.0
*/

body{
    color: #181818;
}

/* 16:9 の比率ボックスを強制 */
.works-grid .works-grid__thumb {
  position: relative !important;
  width: 100% !important;
  padding-top: 56.25% !important; /* 16:9 */
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* サムネ画像を枠にフィット強制 */
.works-grid .works-grid__thumb img,
.works-thumbs-grid .works-thumbs-item img,
.works-grid img.wp-post-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: none !important; /* テーマの max-width:100% を無効化 */
  display: block !important;
}
/* グリッドレイアウト（レスポンシブ対応） */
.works-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr); /* PCでは3列 */
}

@media (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr); /* タブレットで2列 */
  }
}

@media (max-width: 768px) {
  .works-grid {
    grid-template-columns: 1fr; /* スマホで1列 */
  }
}

/* カード */
.works-grid__item {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.works-grid__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.works-grid__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* サムネイル（16:9固定） */
.works-grid__thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 0;
  overflow: hidden;
}
.works-grid__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: none;
}

/* タイトル */
.works-grid__title {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 10px 12px 14px;
  font-weight: 600;
  color: #333;
}

.widget_works_tax .works-tax-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 親は relative 必須（あなたのCSSでOK） */
.works-grid__thumb { position: relative; }

/* ラベルの見た目・位置 */
.works-category-label{
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: .75rem;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,.45);
  pointer-events: none;
}

/* 複数出す場合の積み上げ（必要なら） */
.works-category-label + .works-category-label{ right: auto; left: 8px; margin-left: 6px; }

/* スラッグ別カラー（例） */
.works-category-web-production{ background:#1e50a2; }
.works-category-site-design   { background:#3a8fb7; }
.works-category-lp-production { background:#e67e22; }
.works-category-web-image     { background:#9b59b6; }
.works-category-fv-image      { background:#8e44ad; }
.works-category-banner        { background:#e74c3c; }
.works-category-thumnail      { background:#16a085; } /* ←スラッグが thum*n*ail でOK？ */
.works-category-eyecatch      { background:#f1c40f; color:#333; }


.widget_works_tax .works-tax-list li {
  margin: 4px 0;
}

/* 横並びの基本レイアウト（リスト表示時） */
.wp-block-latest-posts__list:not(.is-grid) li{
  display: grid;
  grid-template-columns: 180px 1fr;          /* 左：サムネ／右：テキスト */
  grid-template-rows: auto auto auto;        /* タイトル → 抜粋 → 日付 */
  grid-template-areas:
    "thumb title"
    "thumb excerpt"
    "thumb meta";
  gap: 12px 16px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

/* 各要素をエリアに割り当て */
.wp-block-latest-posts__featured-image{ grid-area: thumb; }
.wp-block-latest-posts__featured-image img{
  width: 100%; height: 120px; object-fit: cover; border-radius: 8px; display:block;
}

.wp-block-latest-posts__post-title{ grid-area: title; display:block; font-weight:700; color:#333; line-height:1.35; text-decoration:none; }
.wp-block-latest-posts__post-title:hover{ color:#4c6cb3; } /* メインカラー */

.wp-block-latest-posts__post-excerpt{ grid-area: excerpt; margin:.35em 0 0; line-height:1.7; color:#555; }
.wp-block-latest-posts__list.has-dates time{ grid-area: meta; color:#777; font-size:.9em; margin-top:.25em; display:inline-block; }

/* モバイルは縦積みに戻す */
@media (max-width: 640px){
  .wp-block-latest-posts__list:not(.is-grid) li{
    grid-template-columns: 1fr;
    grid-template-areas:
      "thumb"
      "title"
      "excerpt"
      "meta";
  }
  .wp-block-latest-posts__featured-image img{ height: 180px; }
}

/* 見出しそのものにクラスを付けた場合 */
h2.no-top-border {
  border-top: none !important;
  padding-top: 0 !important;
  box-shadow: none !important;
  background: none !important;
}
h2.no-top-border::before,
h2.no-top-border::after {
  content: none !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* 見出しブロック（VK Blocks）の場合：ブロック全体 or ラッパにクラスを付けたとき */
.no-top-border .vk-heading_title,
.no-top-border .vk_heading_title,
.vk-heading.no-top-border .vk-heading_title,
.vk_heading.no-top-border .vk_heading_title {
  border-top: none !important;
  padding-top: 0 !important;
  box-shadow: none !important;
  background: none !important;
}
.no-top-border .vk-heading_title::before,
.no-top-border .vk_heading_title::before,
.vk-heading.no-top-border .vk-heading_title::before,
.vk_heading.no-top-border .vk_heading_title::before {
  content: none !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* スタイルパネルから「上線なし」を選んだときに効く */
h2.is-style-no-top-border,
.is-style-no-top-border .vk-heading_title,
.is-style-no-top-border .vk_heading_title {
  border-top: none !important;
  padding-top: 0 !important;
  box-shadow: none !important;
  background: none !important;
}
.is-style-no-top-border .vk-heading_title::before,
.is-style-no-top-border .vk_heading_title::before {
  content: none !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

