/*
Theme Name: kodama project
Author: kodama project
Description: Original theme for kodama.project
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kodama
*/

/* ============================================================
   DESIGN SYSTEM
   ============================================================ */

:root {
  --color-bg:        #ffffff;
  --color-text:      #111111;
  --color-muted:     #555555;
  --color-border:    #e0e0e0;
  --font-serif:      'EB Garamond', Georgia, serif;
  --font-size-base:  16px;
  --font-size-sm:    14px;
  --font-size-xs:    12px;
  --line-height:     1.75;
  --letter-spacing:  0.01em;
  --space-xs:   8px;
  --space-sm:   16px;
  --space-md:   32px;
  --space-lg:   48px;
  --space-xl:   64px;
  --sidebar-width:    160px;
  --content-max:      880px;
  --content-padding:  clamp(24px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--font-size-base); }
body {
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* LAYOUT */
.site-wrapper { display: flex; min-height: 100vh; }

.site-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-md) var(--space-sm);
  z-index: 100;
  background-color: var(--color-bg);
}
.site-sidebar .sidebar-logo { display: block; width: 56px; height: 56px; margin-bottom: var(--space-md); }
.site-sidebar .sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }
.site-nav { flex: 1; }
.site-nav ul { display: flex; flex-direction: column; gap: var(--space-xs); }
.site-nav a { font-size: var(--font-size-sm); transition: opacity 0.2s; }
.site-nav a:hover,
.site-nav .current-menu-item > a { text-decoration: underline; text-underline-offset: 3px; }
.sidebar-copyright { font-size: var(--font-size-xs); color: var(--color-muted); line-height: 1.5; padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }

.site-main { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; padding: var(--space-md) var(--content-padding); }

/* MOBILE HEADER */
.mobile-header { display: none; align-items: center; justify-content: space-between; padding: var(--space-sm); position: sticky; top: 0; background-color: var(--color-bg); z-index: 200; }
.mobile-header .mobile-logo { display: block; width: 48px; height: 48px; }
.mobile-header .mobile-logo img { width: 100%; height: 100%; object-fit: contain; }
.hamburger { display: flex; flex-direction: column; justify-content: space-between; width: 28px; height: 18px; cursor: pointer; background: none; border: none; padding: 0; }
.hamburger span { display: block; width: 100%; height: 1.5px; background-color: var(--color-text); transition: all 0.3s; }
.mobile-nav { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--color-bg); z-index: 300; flex-direction: column; padding: var(--space-md); }
.mobile-nav.is-open { display: flex; }
.mobile-nav-close { align-self: flex-end; background: none; border: none; font-size: 1.5rem; cursor: pointer; margin-bottom: var(--space-md); font-family: var(--font-serif); }
.mobile-nav ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.mobile-nav a { font-size: 1.2rem; }
.mobile-nav-footer { margin-top: auto; font-size: var(--font-size-xs); color: var(--color-muted); }

/* FRONT PAGE */
.front-page-title { font-size: var(--font-size-sm); font-weight: 400; letter-spacing: 0.02em; margin-bottom: var(--space-md); color: var(--color-muted); }
.carousel { position: relative; width: 100%; overflow: hidden; margin-bottom: var(--space-md); }
.carousel-track { display: flex; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.carousel-slide { min-width: 100%; flex-shrink: 0; }
.carousel-slide img { width: 100%; height: auto; max-height: 600px; object-fit: cover; display: block; }
.carousel-controls { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); }
.carousel-dot { width: 6px; height: 6px; border-radius: 50%; background-color: var(--color-border); border: none; cursor: pointer; padding: 0; transition: background-color 0.3s; }
.carousel-dot.is-active { background-color: var(--color-text); }
.front-page-text { max-width: 680px; }
.front-page-text p { margin-bottom: var(--space-sm); }
.front-page-text a { text-decoration: underline; text-underline-offset: 3px; }

/* PAGE TITLE */
.page-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; margin-bottom: var(--space-md); }

/* SINGLE COLUMN LAYOUT */
.one-column-content { max-width: var(--content-max); }
.one-column-content .entry-image { margin-bottom: var(--space-md); }
.one-column-content .entry-image img { width: 100%; height: auto; }
.one-column-content .entry-body p { margin-bottom: var(--space-sm); }
.one-column-content .entry-body h2 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 400; margin-bottom: var(--space-sm); margin-top: var(--space-md); }
.one-column-content .entry-body img { margin: var(--space-md) 0; max-width: 100%; }

/* DOUBLE COLUMN LAYOUT */
.two-column-content { max-width: var(--content-max); }
.two-column-entry { display: flex; gap: var(--space-md); align-items: flex-start; margin-bottom: var(--space-xl); padding-bottom: var(--space-xl); border-bottom: 1px solid var(--color-border); }
.two-column-entry:last-child { border-bottom: none; }
.two-column-entry .entry-image { flex: 0 0 45%; max-width: 45%; }
.two-column-entry .entry-image img { width: 100%; height: auto; display: block; }
.two-column-entry .entry-text { flex: 1; }
.two-column-entry .entry-headline { font-size: var(--font-size-sm); font-weight: 400; margin-bottom: var(--space-sm); }
.two-column-entry .entry-body p { margin-bottom: var(--space-sm); }

/* FOOTER */
.site-footer-bar { display: none; }

/* RESPONSIVE 1024px */
@media (max-width: 1024px) {
  .site-sidebar { display: none; }
  .mobile-header { display: flex; }
  .site-main { margin-left: 0; padding: var(--space-sm) var(--space-md); }
  .site-wrapper { flex-direction: column; }
  .site-footer-bar { display: block; padding: var(--space-md); font-size: var(--font-size-xs); color: var(--color-muted); border-top: 1px solid var(--color-border); }
  .carousel-slide img { max-height: 320px; }
  .two-column-entry { flex-direction: column; gap: var(--space-sm); }
  .two-column-entry .entry-image { flex: none; max-width: 100%; width: 100%; order: 2; }
  .two-column-entry .entry-headline { order: 1; }
  .two-column-entry .entry-text { order: 3; width: 100%; }
}

/* RESPONSIVE 767px */
@media (max-width: 767px) {
  .site-main { padding: var(--space-sm); }
  .page-title { margin-bottom: var(--space-sm); }
  .two-column-entry { margin-bottom: var(--space-md); padding-bottom: var(--space-md); }
}

/* ============================================================
   GUTENBERG: Media & Text Block (Two Column用)
   ============================================================ */

.two-column-content .wp-block-media-text {
  display: grid;
  grid-template-columns: 45% 1fr;
  gap: var(--space-md);
  align-items: start;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.two-column-content .wp-block-media-text:last-child {
  border-bottom: none;
}

.two-column-content .wp-block-media-text .wp-block-media-text__media img {
  width: 100%;
  height: auto;
  display: block;
}

.two-column-content .wp-block-media-text .wp-block-media-text__content {
  padding: 0;
}

.two-column-content .wp-block-media-text .wp-block-media-text__content p {
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

/* SP: 見出し → 画像 → テキスト の縦並び */
@media (max-width: 1024px) {
  .two-column-content .wp-block-media-text {
    grid-template-columns: 1fr;
  }

  .two-column-content .wp-block-media-text .wp-block-media-text__media {
    order: 2;
  }

  .two-column-content .wp-block-media-text .wp-block-media-text__content {
    order: 3;
  }
}

/* ============================================================
   MEDIA PAGE — 動画・画像対応1カラム
   ============================================================ */

.media-page-body .wp-block-video video {
  width: 100%;
  height: auto;
  display: block;
}

.media-page-body .wp-block-embed {
  margin: var(--space-md) 0;
}

.media-page-body .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.media-page-body .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   STORE PAGE — 商品グリッド
   ============================================================ */

.store-content {
  max-width: var(--content-max);
}

/* ブランドセクション */
.wp-block-group.store-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.wp-block-group.store-section:last-child {
  border-bottom: none;
}

/* セクション見出し */
.store-content h2 {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

/* セクション説明文 */
.store-content .store-section-desc {
  font-style: italic;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

/* 商品グリッド — Gutenberg カラムブロック 4列 */
.store-content .wp-block-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.store-content .wp-block-column {
  min-width: 0;
}

/* 商品カード内の画像リンク */
.store-content .wp-block-column a {
  display: block;
  margin-bottom: var(--space-xs);
}

.store-content .wp-block-column a img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s;
}

.store-content .wp-block-column a:hover img {
  opacity: 0.8;
}

/* 商品名・説明テキスト */
.store-content .wp-block-column p {
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.6;
  margin-bottom: 2px;
}

.store-content .wp-block-column p:first-of-type {
  font-weight: 700;
}

.store-content .wp-block-column p a {
  display: inline;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: var(--font-size-xs);
}

/* SP: 2列 */
@media (max-width: 1024px) {
  .store-content .wp-block-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
}

@media (max-width: 767px) {
  .store-content .wp-block-columns {
    gap: var(--space-xs);
  }
}

/* ============================================================
   STORE GRID 4列 — ブロックパターン用
   ============================================================ */

.store-grid-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--space-md) !important;
}

.store-grid-4 .wp-block-column {
  width: auto !important;
  flex: none !important;
}

@media (max-width: 1024px) {
  .store-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-sm) !important;
  }
}

@media (max-width: 767px) {
  .store-grid-4 {
    gap: var(--space-xs) !important;
  }
}
