/* ==============================================
   hkl-top.css — ヒカクラベル カスタムスタイル
   対象: front-page.php のトップページ全セクション
   作成: 2026-04-20

   目次:
     1.  CSS変数（カラー・サイズ）
     2.  共通リセット・ベース
     3.  共通コンポーネント（コンテナ・ボタン・セクション）
     4.  ヒーローセクション
     5.  カテゴリカード
     6.  記事カード
     7.  新着セクション
     8.  用途別まとめ
     8.  CTAバナー
     9.  AFFINGER上書き（既存スタイルの調整）
     10. レスポンシブ
============================================== */


/* ----------------------------------------------
   1. CSS変数
---------------------------------------------- */
:root {
  /* カラー */
  --hkl-dark:       #0f172a;   /* ヘッダー・ヒーロー背景 */
  --hkl-blue:       #2563eb;   /* アクセントカラー */
  --hkl-blue-light: #dbeafe;   /* 薄いブルー背景 */
  --hkl-amber:      #f59e0b;   /* CTAボタン */
  --hkl-amber-dark: #d97706;   /* CTAホバー */
  --hkl-gray-bg:    #f1f5f9;   /* セクション背景（薄グレー） */
  --hkl-white:      #ffffff;
  --hkl-text:       #1e293b;   /* メインテキスト */
  --hkl-text-muted: #64748b;   /* サブテキスト */
  --hkl-border:     #e2e8f0;   /* ボーダー */

  /* カテゴリカラー */
  --hkl-cat-desk:   #0ea5e9;   /* デスク環境 */
  --hkl-cat-gadget: #8b5cf6;   /* ガジェット */
  --hkl-cat-ai:     #10b981;   /* AIツール */
  --hkl-cat-wp:     #f97316;   /* WordPress */

  /* サイズ */
  --hkl-radius:     10px;
  --hkl-radius-lg:  16px;
  --hkl-shadow:     0 2px 12px rgba(0,0,0,.08);
  --hkl-shadow-hover: 0 8px 30px rgba(0,0,0,.14);
  --hkl-transition: .2s ease;
}


/* ----------------------------------------------
   2. 共通リセット・ベース
---------------------------------------------- */
#hkl-top,
#hkl-top * {
  box-sizing: border-box;
}

#hkl-top a {
  text-decoration: none;
  color: inherit;
}

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


/* ----------------------------------------------
   3. 共通コンポーネント
---------------------------------------------- */

/* コンテナ */
.hkl-container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* セクション共通 */
.hkl-section {
  padding-block: clamp(48px, 8vw, 80px);
}

.hkl-section--gray {
  background: var(--hkl-gray-bg);
}

.hkl-section__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--hkl-dark);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* 見出しの装飾ライン */
.hkl-section__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--hkl-blue);
  border-radius: 2px;
  margin: 12px auto 0;
}

.hkl-section__desc {
  text-align: center;
  color: var(--hkl-text-muted);
  font-size: .95rem;
  margin-bottom: 36px;
}

.hkl-section__footer {
  text-align: center;
  margin-top: 40px;
}

.hkl-no-post {
  text-align: center;
  color: var(--hkl-text-muted);
  padding: 40px 0;
}

/* ボタン */
.hkl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 50px;
  font-size: .95rem;
  font-weight: 700;
  transition: var(--hkl-transition);
  cursor: pointer;
  border: 2px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

/* プライマリボタン（青） */
.hkl-btn--primary {
  background: var(--hkl-blue);
  color: var(--hkl-white) !important;
  border-color: var(--hkl-blue);
}
.hkl-btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
}

/* ゴーストボタン（白枠） */
.hkl-btn--ghost {
  background: transparent;
  color: var(--hkl-white) !important;
  border-color: rgba(255,255,255,.6);
}
.hkl-btn--ghost:hover {
  background: rgba(255,255,255,.15);
  border-color: var(--hkl-white);
}

/* アウトラインボタン（青枠） */
.hkl-btn--outline {
  background: transparent;
  color: var(--hkl-blue) !important;
  border-color: var(--hkl-blue);
}
.hkl-btn--outline:hover {
  background: var(--hkl-blue);
  color: var(--hkl-white) !important;
  transform: translateY(-2px);
}

/* CTAボタン（アンバー） */
.hkl-btn--cta {
  background: var(--hkl-amber);
  color: var(--hkl-dark) !important;
  border-color: var(--hkl-amber);
  font-size: 1rem;
  padding: 15px 36px;
}
.hkl-btn--cta:hover {
  background: var(--hkl-amber-dark);
  border-color: var(--hkl-amber-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,158,11,.35);
}


/* ----------------------------------------------
   4. ヒーローセクション
---------------------------------------------- */
.hkl-hero {
  background: linear-gradient(135deg, var(--hkl-dark) 0%, #1e3a8a 100%);
  padding-block: clamp(64px, 12vw, 120px);
  position: relative;
  overflow: hidden;
}

/* 背景の装飾円 */
.hkl-hero::before,
.hkl-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: .07;
  background: var(--hkl-white);
  pointer-events: none;
}
.hkl-hero::before {
  width: 500px;
  height: 500px;
  right: -100px;
  top: -150px;
}
.hkl-hero::after {
  width: 300px;
  height: 300px;
  left: -80px;
  bottom: -80px;
}

.hkl-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hkl-hero__label {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: #93c5fd;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
}

.hkl-hero__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--hkl-white);
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -.01em;
}

.hkl-hero__desc {
  font-size: clamp(.9rem, 2vw, 1.05rem);
  color: #cbd5e1;
  line-height: 1.85;
  margin-bottom: 36px;
}

.hkl-hero__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}


/* ----------------------------------------------
   5. カテゴリカード
---------------------------------------------- */
.hkl-categories {
  background: var(--hkl-white);
}

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

.hkl-cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 24px;
  border-radius: var(--hkl-radius-lg);
  border: 1px solid var(--hkl-border);
  background: var(--hkl-white);
  transition: var(--hkl-transition);
  position: relative;
  overflow: hidden;
}

/* カテゴリ別アクセントライン */
.hkl-cat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.hkl-cat-card--desk::before   { background: var(--hkl-cat-desk); }
.hkl-cat-card--gadget::before { background: var(--hkl-cat-gadget); }
.hkl-cat-card--ai::before     { background: var(--hkl-cat-ai); }
.hkl-cat-card--wp::before     { background: var(--hkl-cat-wp); }

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

.hkl-cat-card__icon {
  font-size: 2rem;
  margin-bottom: 14px;
  line-height: 1;
}

.hkl-cat-card__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--hkl-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.hkl-cat-card__desc {
  font-size: .82rem;
  color: var(--hkl-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.hkl-cat-card__link {
  font-size: .82rem;
  font-weight: 700;
  color: var(--hkl-blue);
  margin-top: auto;
}

.hkl-cat-card--desk   .hkl-cat-card__link { color: var(--hkl-cat-desk); }
.hkl-cat-card--gadget .hkl-cat-card__link { color: var(--hkl-cat-gadget); }
.hkl-cat-card--ai     .hkl-cat-card__link { color: var(--hkl-cat-ai); }
.hkl-cat-card--wp     .hkl-cat-card__link { color: var(--hkl-cat-wp); }


/* ----------------------------------------------
   6. 記事カード（おすすめ比較・3カラム）
---------------------------------------------- */
.hkl-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.hkl-post-grid--4col {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.hkl-post-card {
  background: var(--hkl-white);
  border-radius: var(--hkl-radius-lg);
  border: 1px solid var(--hkl-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--hkl-transition);
}

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

/* サムネイル */
.hkl-post-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--hkl-gray-bg);
}

.hkl-post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

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

/* サムネなしのプレースホルダー */
.hkl-post-card__thumb--noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--hkl-text-muted);
}

/* ボディ */
.hkl-post-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* カテゴリバッジ */
.hkl-post-card__cats {
  margin-bottom: 8px;
}

.hkl-post-card__cat {
  display: inline-block;
  background: var(--hkl-blue-light);
  color: var(--hkl-blue);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}

/* タイトル */
.hkl-post-card__title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--hkl-dark);
  line-height: 1.55;
  margin-bottom: 10px;
  flex: 1;
}

.hkl-post-card__title a:hover {
  color: var(--hkl-blue);
}

.hkl-post-card__title--sm {
  font-size: .88rem;
}

/* 抜粋 */
.hkl-post-card__excerpt {
  font-size: .82rem;
  color: var(--hkl-text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
  flex: 1;
}

/* 日付 */
.hkl-post-card__date {
  font-size: .75rem;
  color: var(--hkl-text-muted);
  margin-bottom: 6px;
}

/* もっと読む */
.hkl-post-card__more {
  font-size: .82rem;
  font-weight: 700;
  color: var(--hkl-blue);
  margin-top: auto;
  display: block;
}

/* コンパクトカード（新着セクション用） */
.hkl-post-card--compact {
  background: var(--hkl-white);
}

.hkl-post-card--compact .hkl-post-card__thumb {
  aspect-ratio: 16 / 10;
}

.hkl-post-card--compact .hkl-post-card__body {
  padding: 14px 16px 16px;
}


/* ----------------------------------------------
   7. 用途別まとめ
---------------------------------------------- */
.hkl-purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.hkl-purpose-card {
  display: block;
  border-radius: var(--hkl-radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 220px;
  transition: var(--hkl-transition);
}

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

/* 背景グラデーション（カード別） */
.hkl-purpose-card--telework {
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
}

.hkl-purpose-card--ai {
  background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
}

.hkl-purpose-card__inner {
  padding: 32px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.hkl-purpose-card__tag {
  display: inline-block;
  background: rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 14px;
  letter-spacing: .05em;
}

.hkl-purpose-card__title {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: var(--hkl-white);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

.hkl-purpose-card__desc {
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  line-height: 1.7;
  margin-bottom: 20px;
}

.hkl-purpose-card__btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.2);
  color: var(--hkl-white);
  font-size: .82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.3);
  transition: var(--hkl-transition);
  align-self: flex-start;
}

.hkl-purpose-card:hover .hkl-purpose-card__btn {
  background: rgba(255,255,255,.3);
}


/* ----------------------------------------------
   8. CTAバナー
---------------------------------------------- */
.hkl-cta-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--hkl-dark) 100%);
  padding-block: clamp(48px, 8vw, 80px);
}

.hkl-cta-banner__inner {
  text-align: center;
}

.hkl-cta-banner__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--hkl-white);
  margin-bottom: 12px;
}

.hkl-cta-banner__desc {
  font-size: .95rem;
  color: #93c5fd;
  margin-bottom: 28px;
}

.hkl-cta-banner__btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}


/* ----------------------------------------------
   9. AFFINGER上書き
   （既存スタイルがトップページに干渉する部分を調整）
---------------------------------------------- */

/* トップページではサイドバーを非表示にする */
body.home #sidebar,
body.home .sidebar,
body.home .widget-area {
  display: none !important;
}

/* トップページではコンテンツ幅を100%に広げる */
body.home #contents,
body.home .main-contents,
body.home #main,
body.home .l-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  float: none !important;
}

/* トップページのAFFINGERデフォルトパディングをリセット */
body.home .entry-content,
body.home .post-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* ヘッダーを少し引き締める */
#header .header_in {
  padding-block: 12px;
}

/* ナビゲーションのフォントを調整 */
#navi .navi-in > ul > li > a {
  font-weight: 600;
  font-size: .92rem;
}


/* ----------------------------------------------
   10. レスポンシブ
---------------------------------------------- */

/* タブレット（〜768px） */
@media (max-width: 768px) {

  /* ヒーローのボタンを縦並びに */
  .hkl-hero__btns {
    flex-direction: column;
    align-items: flex-start;
  }

  /* カテゴリカードを2列に */
  .hkl-cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 記事グリッドを2列に */
  .hkl-post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hkl-post-grid--4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* スマートフォン（〜480px） */
@media (max-width: 480px) {

  /* カテゴリカードを1列に */
  .hkl-cat-grid {
    grid-template-columns: 1fr;
  }

  /* 記事グリッドを1列に */
  .hkl-post-grid,
  .hkl-post-grid--4col {
    grid-template-columns: 1fr;
  }

  /* 用途別バナーを1列に */
  .hkl-purpose-grid {
    grid-template-columns: 1fr;
  }

  .hkl-btn {
    width: 100%;
    justify-content: center;
  }
}


/* ----------------------------------------------
   11. アーカイブ・記事一覧ページ
   （home.php / archive.php 共通）
---------------------------------------------- */

/* アーカイブヒーロー */
.hkl-archive-hero {
  background: var(--hkl-dark);
  padding-block: clamp(36px, 6vw, 60px);
  text-align: center;
}

.hkl-archive-hero__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  color: var(--hkl-white);
  margin-bottom: 10px;
}

.hkl-archive-hero__desc {
  font-size: .9rem;
  color: #93c5fd;
}

/* 3カラムグリッド */
.hkl-post-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

/* 記事カードの日付 */
.hkl-post-card__date {
  font-size: .75rem;
  color: var(--hkl-text-muted);
  margin-bottom: 6px;
}

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

.hkl-pagination .nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.hkl-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hkl-border);
  border-radius: 8px;
  font-size: .88rem;
  color: var(--hkl-text);
  text-decoration: none;
  transition: var(--hkl-transition);
  background: var(--hkl-white);
}

.hkl-pagination .page-numbers:hover,
.hkl-pagination .page-numbers.current {
  background: var(--hkl-blue);
  border-color: var(--hkl-blue);
  color: var(--hkl-white);
}

/* アーカイブ・カテゴリー・一覧ページでサイドバー非表示・全幅化 */
body.archive #sidebar,
body.archive .sidebar,
body.archive .widget-area,
body.archive #st-sidebar,
body.archive .sidebar_wrap,
body.archive .side_wrap,
body.category #sidebar,
body.category .sidebar,
body.category .widget-area,
body.category #st-sidebar,
body.category .sidebar_wrap,
body.category .side_wrap,
body.blog #sidebar,
body.blog .sidebar,
body.blog .widget-area,
body.blog #st-sidebar,
body.blog .sidebar_wrap,
body.blog .side_wrap {
  display: none !important;
}

body.archive #contents_wrap,
body.archive #main_wrap,
body.archive #contents,
body.archive .contents_wrap,
body.archive .main-contents,
body.archive #main,
body.archive .l-container,
body.category #contents_wrap,
body.category #main_wrap,
body.category #contents,
body.category .contents_wrap,
body.category .main-contents,
body.category #main,
body.category .l-container,
body.blog #contents_wrap,
body.blog #main_wrap,
body.blog #contents,
body.blog .contents_wrap,
body.blog .main-contents,
body.blog #main,
body.blog .l-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  float: none !important;
  flex: none !important;
}

body.archive .entry-content,
body.archive .post-content,
body.category .entry-content,
body.category .post-content,
body.blog .entry-content,
body.blog .post-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* レスポンシブ（アーカイブ） */
@media (max-width: 768px) {
  .hkl-post-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hkl-post-grid--3col {
    grid-template-columns: 1fr;
  }
}
