﻿/*
 Theme Name:   guriko-lunch-child
 Theme URI:    https://green-spoonreview.com
 Description:  手書きノート風トップページ（案B）— JSX完全移植版
 Author:       ぐり子
 Template:     cocoon-master
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 Text Domain:  guriko-lunch-child
*/

/* --- トークンは tokens.css に分離済み --- */
/* --- フォント読み込みは functions.php で wp_enqueue_style --- */

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-jp);
  color: var(--ink);
  background:
    repeating-linear-gradient(to bottom, transparent 0 30px, rgba(139,168,135,.12) 30px 31px),
    #FDFBF3;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width:100%; height:auto; display:block; }
a   { color:inherit; text-decoration:none; }
ul, ol { list-style:none; }
.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ─── ① グローバルナビ ─── */
.glc-nav {
  padding: 12px 48px;
  border-bottom: 1.5px dashed var(--green-200);
  background: rgba(255,253,243,.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-soft);
  position: sticky; top: 0; z-index: 100;
}
.glc-nav__brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-accent);
  color: var(--green-600); font-weight: 700;
}
.glc-nav__brand svg { color: var(--green-600); }
.glc-nav__menu { display: flex; gap: 22px; font-weight: 700; }
.glc-nav__menu a { transition: color .15s; }
.glc-nav__menu a:hover { color: var(--green-600); }

/* ─── レイアウト ─── */
.glc-body { padding: 0; }
.glc-header-wrap { padding: 28px 48px 0; }
.glc-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 32px 48px 48px;
  max-width: var(--content-max);
  margin: 0 auto;
}
/* headerも同じ最大幅に */
.glc-header-wrap { max-width: var(--content-max); margin: 0 auto; box-sizing: border-box; width: 100%; }
.glc-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* ─── ② ヘッダーバナー ─── */
.glc-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: visible;
  border: 1.5px solid #EEE6D0;
  box-shadow: 0 6px 22px rgba(80,70,40,.08);
  background: linear-gradient(135deg, #EDF5EE 0%, #FFF4D6 55%, #FFF1E7 100%);
  padding: 48px 56px;
  min-height: 240px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
/* ヘッダー内の装飾SVGライン */
.glc-hero__doodle {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .35; pointer-events: none;
  overflow: hidden; border-radius: var(--radius-lg);
}
/* マスキングテープ（inline div） */
.glc-tape {
  display: block;
  height: 22px;
  opacity: .7;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px);
  position: absolute;
  pointer-events: none;
}
.glc-tape--peach   { background-color: var(--accent-peach); }
.glc-tape--cream   { background-color: var(--accent-cream); }
.glc-tape--sky     { background-color: var(--accent-sky); }
.glc-tape--lavender{ background-color: #D9D0F0; }

/* ヘッダーバナー内テープ位置 */
.glc-hero__tape1 { width:110px; transform:rotate(-7deg);  top:-10px; left:70px; }
.glc-hero__tape2 { width:90px;  transform:rotate(9deg);   top:-9px;  right:110px; }
.glc-hero__tape3 { width:70px;  transform:rotate(-14deg); bottom:14px; left:40px; }
/* ヘッダーバナー内葉っぱ */
.glc-hero__leaf { position:absolute; pointer-events:none; color: var(--green-300); }
.glc-hero__leaf--1 { top:30px;  right:40px;  transform:rotate(16deg);  width:28px; height:28px; color: var(--green-300); }
.glc-hero__leaf--2 { bottom:34px; right:180px; transform:rotate(-20deg); width:20px; height:20px; color: var(--green-400); }
.glc-hero__leaf--3 { top:110px; left:28px;  transform:rotate(40deg);  width:22px; height:22px; color: var(--green-200); }

/* 左テキスト */
.glc-hero__left { position: relative; }
.glc-hero__catch {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 16px;
  color: var(--accent-rose);
  transform: rotate(-1deg);
  margin-bottom: 10px;
  line-height: 1;
}
.glc-hero__title {
  margin: 0;
  font-size: 44px;
  line-height: 1.4;
  color: var(--green-700);
  font-weight: 700;
  letter-spacing: .01em;
}
.glc-hero__title-wave {
  position: relative;
  display: inline-block;
}
.glc-hero__wave {
  position: absolute;
  left: 0;
  bottom: -8px;
  pointer-events: none;
}
.glc-hero__subcopy {
  font-family: var(--font-accent);
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 2;
  margin-top: 22px;
  max-width: 420px;
}

/* ポラロイド */
.glc-polars {
  position: relative;
  height: 200px;
}
.glc-polar {
  position: absolute;
  background: #fff;
  padding: 9px;
  box-shadow: var(--shadow-polar);
}
.glc-polar--1 { left: 8%; top: 10px; transform: rotate(-7deg); width: 148px; z-index: 1; }
.glc-polar--2 { right: 4%; top: 50px; transform: rotate(6deg); width: 130px; z-index: 2; }
.glc-polar__img {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, #E4EFDF 0 10px, #D1E2CA 10px 20px);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}
.glc-polar__img img { width: 100%; height: 100%; object-fit: cover; }
.glc-polar__caption {
  display: block;
  text-align: center;
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}
.glc-polars__tape {
  position: absolute;
  left: 40%; top: 0;
  width: 50px;
  transform: rotate(-15deg);
}

/* ─── セクション見出し ─── */
.glc-section-hd { margin-bottom: 0; }
.glc-section-kicker {
  font-family: var(--font-accent);
  font-size: 18px;
  color: var(--accent-rose);
}
.glc-section-title {
  margin: 4px 0 0;
  font-size: 26px;
  color: var(--green-700);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── ③ カテゴリカード ─── */
.glc-cats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.glc-cat-card {
  background: #FFFDF6;
  border: 2px dashed var(--green-300);
  border-radius: var(--radius);
  padding: 22px 18px 18px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
}
.glc-cat-card:hover { box-shadow: 0 8px 24px rgba(80,70,40,.14); }
.glc-cat-card--0 { transform: rotate(-.3deg); }
.glc-cat-card--1 { transform: rotate(.4deg); }
.glc-cat-card--2 { transform: rotate(-.4deg); }
.glc-cat-card--3 { transform: rotate(.3deg); }
.glc-cat-card:hover { transform: rotate(0) translateY(-3px); }

/* テープ（カテゴリカード上部中央） */
.glc-cat-card__tape {
  position: absolute;
  top: -12px;
  left: 50%;
  margin-left: -25px;
  width: 50px;
}
/* 偶数カードのテープ回転 */
.glc-cat-card--0 .glc-cat-card__tape,
.glc-cat-card--2 .glc-cat-card__tape { transform: rotate(-8deg); }
.glc-cat-card--1 .glc-cat-card__tape,
.glc-cat-card--3 .glc-cat-card__tape { transform: rotate(8deg); }

.glc-cat-card__emoji {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 4px;
}
.glc-cat-card__name {
  font-family: var(--font-accent);
  font-size: 18px;
  color: var(--green-700);
  font-weight: 700;
  line-height: 1.3;
}
.glc-cat-card__desc {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.glc-cat-card__badge {
  font-size: 11px;
  color: var(--green-600);
  margin-top: 6px;
  font-weight: 700;
  background: var(--green-50);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ─── ④ 記事カード ─── */
.glc-posts__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.glc-posts__more {
  font-family: var(--font-accent);
  font-size: 15px;
  color: var(--green-600);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
  cursor: pointer;
}
.glc-posts__more:hover { color: var(--green-700); }
.glc-posts__grid {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}
.glc-posts__grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.glc-posts__grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.glc-post-card {
  background: #fff;
  padding: 14px;
  border: 1.5px solid #EEE6D0;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  min-width: 0;
  transition: transform .2s, box-shadow .2s;
}
/* テープ（カード右上） */
.glc-post-card__tape {
  position: absolute;
  top: -8px;
  right: 20px;
  width: 46px;
}
.glc-post-card--even .glc-post-card__tape { transform: rotate(-8deg); }
.glc-post-card--odd  .glc-post-card__tape { transform: rotate(8deg); }
/* 記事カード回転 */
.glc-post-card--0 { transform: rotate(-.4deg); }
.glc-post-card--1 { transform: rotate(.3deg); }
.glc-post-card--2 { transform: rotate(-.2deg); }
.glc-post-card--3 { transform: rotate(.4deg); }
.glc-post-card--4 { transform: rotate(-.3deg); }
.glc-post-card--5 { transform: rotate(.2deg); }
.glc-post-card:hover { transform: rotate(0) translateY(-3px); box-shadow: 0 8px 24px rgba(80,70,40,.14); }

.glc-post-card__thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 2px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #E4EFDF 0 10px, #D1E2CA 10px 20px);
  display: flex; align-items: center; justify-content: center;
}
.glc-post-card__thumb img { width:100%; height:100%; object-fit:cover; border-radius:2px; }
.glc-post-card__body { padding: 4px 6px 10px; display: flex; flex-direction: column; gap: 8px; }
.glc-post-card__meta-top { display: flex; gap: 8px; align-items: center; }
.glc-post-card__cat { font-family: var(--font-accent); font-size: 13px; color: var(--green-600); font-weight: 700; }
.glc-post-card__date { font-size: 11px; color: var(--ink-mute); margin-left: auto; }
.glc-post-card__title { margin: 0; font-size: 14.5px; line-height: 1.7; font-weight: 700; }
.glc-post-card__title a { color: var(--ink); }
.glc-post-card__meta-bottom { font-size: 11.5px; color: var(--ink-mute); display: flex; justify-content: space-between; }
.glc-post-card__tag { color: var(--accent-rose); font-weight: 700; }

/* ─── ⑤ サイドバー ─── */
.glc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 60px;
}
/* サイドバー共通カード */
.glc-side-card {
  background: #FFFDF6;
  border: 1.5px solid #EEE6D0;
  border-radius: var(--radius);
  padding: 0 0 14px;
  box-shadow: 0 4px 14px rgba(80,70,40,.06);
  transform: rotate(-.2deg);
}
/* サイドバー見出し */
.glc-side-heading {
  padding: 14px 18px 10px;
  border-bottom: 1.5px dashed var(--green-300);
  display: flex;
  align-items: center;
  gap: 10px;
}
.glc-side-heading__leaf { width: 14px; height: 14px; color: var(--green-500); flex-shrink: 0; }
.glc-side-heading__text {
  font-family: var(--font-en);
  font-size: 20px;
  color: var(--green-700);
  font-weight: 700;
  line-height: 1;
}

/* プロフィール内 */
.glc-profile-inner {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 10px 4px;
}
.glc-profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%; overflow: hidden;
  border: 3px solid var(--green-200);
  padding: 3px; background: #fff;
}
.glc-profile-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
  background: repeating-linear-gradient(45deg, #FBE7D6 0 10px, #F4D6BE 10px 20px);
}
.glc-profile-name {
  font-family: var(--font-accent);
  font-size: 20px; color: var(--green-700); font-weight: 700; margin-top: 12px;
}
.glc-profile-title { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.glc-profile-bio {
  font-size: 12px; color: var(--ink-soft); line-height: 1.85;
  margin: 12px 0 14px; text-align: center;
}
.glc-profile-btn {
  display: inline-block;
  background: var(--green-500); color: #fff;
  font-family: var(--font-jp); font-size: 12px;
  padding: 9px 18px; border-radius: 999px;
  font-weight: 700; transition: background .2s;
  box-shadow: 0 4px 0 var(--green-700);
  cursor: pointer;
}
.glc-profile-btn:hover { background: var(--green-700); }
.glc-profile-sns { display: flex; gap: 10px; margin-top: 16px; justify-content: center; }
.glc-profile-sns a {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--green-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  color: var(--green-600); font-family: var(--font-en);
  transition: border-color .2s, color .2s;
}
.glc-profile-sns a:hover { border-color: var(--green-600); }

/* カテゴリウィジェット */
.glc-side-cats { list-style: none; margin: 0; padding: 12px 6px 6px; display: flex; flex-direction: column; gap: 2px; }
.glc-side-cats li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  cursor: pointer; color: var(--ink);
  border-bottom: 1px dashed var(--green-200);
  transition: background .15s;
}
.glc-side-cats li a:hover { background: var(--green-50); }
.glc-side-cats__emoji { font-size: 18px; }
.glc-side-cats__label { font-size: 13px; font-weight: 700; }
.glc-side-cats__count {
  margin-left: auto; font-size: 11px; color: var(--ink-mute);
  background: var(--green-50); padding: 2px 8px; border-radius: 999px; font-weight: 700;
}

/* 人気記事 */
.glc-popular-list { list-style: none; margin: 0; padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 12px; }
.glc-popular-item { display: grid; grid-template-columns: 22px 60px 1fr; gap: 10px; align-items: center; cursor: pointer; }
.glc-popular-rank { font-family: var(--font-en); font-size: 22px; color: var(--accent-rose); font-weight: 700; line-height: 1; }
.glc-popular-thumb { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(45deg, #E4EFDF 0 10px, #D1E2CA 10px 20px); }
.glc-popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.glc-popular-title { font-size: 12px; line-height: 1.55; font-weight: 700; color: var(--ink); }
.glc-popular-title:hover { color: var(--green-600); }

/* 検索 */
.glc-side-search { padding: 16px; }
.glc-search-inner {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px dashed var(--green-300);
  border-radius: 12px; padding: 8px 12px;
  background: #FFFDF6;
}
.glc-search-icon { font-size: 14px; flex-shrink: 0; }
.glc-search-input {
  flex: 1; border: none; outline: none;
  background: transparent; font-family: inherit;
  font-size: 13px; color: var(--ink-soft);
}
.glc-search-btn {
  background: var(--green-500); color: #fff;
  border: none; border-radius: 8px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: background .2s;
}
.glc-search-btn:hover { background: var(--green-700); }

/* ─── ⑥ フッター ─── */
.glc-footer {
  padding: 28px 48px;
  border-top: 1.5px dashed var(--green-300);
  font-size: 12.5px; color: var(--ink-soft);
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  background: rgba(237,245,238,.3);
  max-width: 100%;
}
.glc-footer__credit { font-family: var(--font-en); font-size: 15px; }
.glc-footer__links { display: flex; gap: 16px; }
.glc-footer__links a { transition: color .15s; }
.glc-footer__links a:hover { color: var(--green-700); }

/* ─── Cocoon競合対策 ─── */
.glc-body .entry-content,
.glc-body .cocoon-block-spacer { display: none !important; }

/* ─── レスポンシブ ─── */
@media (max-width: 1024px) {
  .glc-nav { padding: 12px 24px; }
  .glc-header-wrap { padding: 20px 24px 0; }
  .glc-grid { padding: 24px 24px 40px; gap: 28px; }
  .glc-hero { padding: 36px 40px; }
  .glc-cats__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .glc-nav { padding: 10px 16px; }
  .glc-nav__menu { display: none; }
  .glc-header-wrap { padding: 14px 16px 0; }
  .glc-grid { grid-template-columns: 1fr; padding: 20px 16px 40px; gap: 40px; }
  .glc-sidebar { position: static; }
  .glc-hero { grid-template-columns: 1fr; padding: 32px 28px 180px; }
  .glc-polars { position: absolute; bottom: 14px; right: 14px; width: 220px; height: 170px; }
  .glc-polar--1 { width: 120px; }
  .glc-polar--2 { width: 106px; }
  .glc-posts__grid.cols-2,
  .glc-posts__grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .glc-footer { padding: 20px 16px; }
}
@media (max-width: 480px) {
  .glc-hero { padding: 24px 16px 160px; }
  .glc-hero__title { font-size: 32px; }
  .glc-cats__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .glc-cat-card { transform: none !important; }
  .glc-posts__grid.cols-2,
  .glc-posts__grid.cols-3 { grid-template-columns: 1fr; }
  .glc-post-card { transform: none !important; }
  .glc-footer { flex-direction: column; align-items: center; text-align: center; }
}

/* ---- アイキャッチ画像ズーム無効化 ---- */
.glc-post-card__thumb img,
.glc-post-card__thumb img:hover,
.a-wrap:hover .glc-post-card__thumb img,
.entry-card-thumb img,
.a-wrap .entry-card-thumb img:hover {
  transform: none !important;
  transition: none !important;
}

/* =====================================================
   カテゴリーページ専用スタイル
   ===================================================== */

/* ── カテゴリーヒーロー ── */
.glc-cat-hero {
  background: linear-gradient(135deg, #e8f5e2 0%, #f5f0e8 100%);
  border-bottom: 2px solid var(--accent, #5a8a5a);
  padding: 32px 16px 28px;
  text-align: center;
}
.glc-cat-hero__inner {
  max-width: 800px;
  margin: 0 auto;
}
.glc-cat-hero__breadcrumb {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}
.glc-cat-hero__breadcrumb a {
  color: var(--accent, #5a8a5a);
  text-decoration: none;
}
.glc-cat-hero__breadcrumb a:hover { text-decoration: underline; }
.glc-cat-hero__emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}
.glc-cat-hero__title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: var(--ink, #2d2d2d);
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.glc-cat-hero__desc {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* ── 記事グリッド ── */
.glc-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
@media (min-width: 640px) {
  .glc-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── ページネーション ── */
.glc-pagination {
  margin: 32px 0 16px;
  text-align: center;
}
.glc-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.glc-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink, #2d2d2d);
  background: #fff;
  border: 2px solid #e0ddd4;
  transition: all .2s;
}
.glc-pagination .page-numbers:hover,
.glc-pagination .page-numbers.current {
  background: var(--accent, #5a8a5a);
  border-color: var(--accent, #5a8a5a);
  color: #fff;
}

/* ── 記事なし ── */
.glc-no-posts {
  text-align: center;
  color: #888;
  padding: 48px 0;
  font-size: 15px;
}