/*
Theme Name: Tokyo Parts
Theme URI: https://tokyoparts.jp
Author: Executive Marketing Japan Inc.
Author URI: https://executive-marketing-japan.co.jp
Description: バイクカスタマイズ専門メディア「tokyo parts」公式WordPressテーマ。アフィリエイト商品管理、CTA一括管理、カラー設定など高機能な管理画面を搭載。モバイルファースト設計。
Version: 1.0.0
License: Proprietary
License URI: https://tokyoparts.jp
Text Domain: tokyoparts
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ========================================
   CSS Variables (defaults - overridden by admin settings)
   ======================================== */
:root {
  --tp-primary: #1a1a1a;
  --tp-secondary: #2d2d2d;
  --tp-accent: #d4a843;
  --tp-accent-hover: #c49a35;
  --tp-text: #333333;
  --tp-text-light: #666666;
  --tp-bg: #ffffff;
  --tp-bg-alt: #f5f5f0;
  --tp-border: #e0e0e0;
  --tp-white: #ffffff;
  --tp-btn-rakuten: #bf0000;
  --tp-btn-amazon: #ff9900;
  --tp-btn-yahoo: #ff0033;
  --tp-btn-official: #1a1a1a;
  --tp-radius: 6px;
  --tp-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --tp-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --tp-font: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --tp-font-heading: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --tp-max-width: 1100px;
  --tp-content-width: 740px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--tp-font); color: var(--tp-text); background: var(--tp-bg); line-height: 1.8; -webkit-font-smoothing: antialiased; }
a { color: var(--tp-accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--tp-accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--tp-font-heading); font-weight: 700; line-height: 1.4; color: var(--tp-primary); }

/* ========================================
   Layout
   ======================================== */
.tp-container { max-width: var(--tp-max-width); margin: 0 auto; padding: 0 16px; }
.tp-content-area { max-width: var(--tp-content-width); margin: 0 auto; }
.tp-section { padding: 40px 0; }
.tp-section--alt { background: var(--tp-bg-alt); }

/* ========================================
   Header (Mobile-first)
   ======================================== */
.tp-header { background: var(--tp-primary); position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--tp-accent); }
.tp-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: var(--tp-max-width); margin: 0 auto; }
.tp-header__logo img { height: 32px; width: auto; }
.tp-header__logo-text { color: var(--tp-white); font-size: 1.2rem; font-weight: 700; letter-spacing: 0.05em; }
.tp-header__menu-btn { background: none; border: none; color: var(--tp-white); font-size: 24px; cursor: pointer; padding: 8px; line-height: 1; }
.tp-header__nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--tp-secondary); border-top: 1px solid rgba(255,255,255,0.1); }
.tp-header__nav.is-open { display: block; }
.tp-header__nav ul { display: flex; flex-direction: column; }
.tp-header__nav li a { display: block; padding: 14px 20px; color: var(--tp-white); font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.2s; }
.tp-header__nav li a:hover { background: rgba(255,255,255,0.05); color: var(--tp-accent); }

/* ========================================
   Hero Section (Front Page)
   ======================================== */
.tp-hero { position: relative; background: var(--tp-primary); color: var(--tp-white); padding: 48px 16px; text-align: center; overflow: hidden; }
.tp-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3)); z-index: 1; }
.tp-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.tp-hero__content { position: relative; z-index: 2; max-width: 600px; margin: 0 auto; }
.tp-hero__title { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.tp-hero__subtitle { font-size: 0.95rem; opacity: 0.85; margin-bottom: 24px; line-height: 1.6; }
.tp-hero__cta { display: inline-block; background: var(--tp-accent); color: var(--tp-primary); padding: 14px 32px; border-radius: var(--tp-radius); font-weight: 700; font-size: 0.95rem; transition: transform 0.2s, box-shadow 0.2s; }
.tp-hero__cta:hover { transform: translateY(-2px); box-shadow: var(--tp-shadow-hover); color: var(--tp-primary); }

/* ========================================
   Post Cards
   ======================================== */
.tp-posts-grid { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 0 16px; }
.tp-card { background: var(--tp-white); border-radius: var(--tp-radius); overflow: hidden; box-shadow: var(--tp-shadow); transition: transform 0.2s, box-shadow 0.2s; }
.tp-card:hover { transform: translateY(-3px); box-shadow: var(--tp-shadow-hover); }
.tp-card__thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--tp-bg-alt); }
.tp-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.tp-card:hover .tp-card__thumb img { transform: scale(1.03); }
.tp-card__body { padding: 16px; }
.tp-card__cat { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--tp-accent); background: rgba(212,168,67,0.1); padding: 3px 10px; border-radius: 3px; margin-bottom: 8px; }
.tp-card__title { font-size: 1rem; font-weight: 700; line-height: 1.5; margin-bottom: 8px; color: var(--tp-primary); }
.tp-card__title a { color: inherit; }
.tp-card__title a:hover { color: var(--tp-accent); }
.tp-card__meta { font-size: 0.8rem; color: var(--tp-text-light); }
.tp-card__excerpt { font-size: 0.85rem; color: var(--tp-text-light); margin-top: 8px; line-height: 1.6; }

/* ========================================
   Single Post
   ======================================== */
.tp-single { padding: 24px 16px 48px; }
.tp-single__header { margin-bottom: 24px; }
.tp-single__cat { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--tp-white); background: var(--tp-accent); padding: 4px 12px; border-radius: 3px; margin-bottom: 12px; }
.tp-single__title { font-size: 1.4rem; line-height: 1.4; margin-bottom: 12px; }
.tp-single__meta { font-size: 0.8rem; color: var(--tp-text-light); display: flex; gap: 16px; flex-wrap: wrap; }
.tp-single__pr { font-size: 0.75rem; color: var(--tp-text-light); background: var(--tp-bg-alt); padding: 6px 12px; border-radius: 3px; margin-top: 10px; display: inline-block; }
.tp-single__thumb { margin-bottom: 24px; border-radius: var(--tp-radius); overflow: hidden; }
.tp-single__content { font-size: 1rem; line-height: 2; }
.tp-single__content h2 { font-size: 1.3rem; margin: 40px 0 16px; padding: 12px 16px; background: var(--tp-bg-alt); border-left: 4px solid var(--tp-accent); }
.tp-single__content h3 { font-size: 1.1rem; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--tp-border); }
.tp-single__content p { margin-bottom: 20px; }
.tp-single__content ul, .tp-single__content ol { margin: 16px 0; padding-left: 24px; }
.tp-single__content ul { list-style: disc; }
.tp-single__content ol { list-style: decimal; }
.tp-single__content li { margin-bottom: 8px; line-height: 1.7; }
.tp-single__content blockquote { margin: 24px 0; padding: 16px 20px; background: var(--tp-bg-alt); border-left: 4px solid var(--tp-accent); font-style: normal; }
.tp-single__content img { border-radius: var(--tp-radius); margin: 20px 0; }

/* ========================================
   Author / Supervisor Box
   ======================================== */
.tp-author-box { background: var(--tp-bg-alt); border-radius: var(--tp-radius); padding: 20px; margin: 32px 0; display: flex; gap: 16px; align-items: flex-start; }
.tp-author-box__avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.tp-author-box__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tp-author-box__info { flex: 1; }
.tp-author-box__role { font-size: 0.75rem; font-weight: 700; color: var(--tp-accent); margin-bottom: 4px; }
.tp-author-box__name { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.tp-author-box__bio { font-size: 0.85rem; color: var(--tp-text-light); line-height: 1.6; }

/* ========================================
   Affiliate Product Card (Shortcode)
   ======================================== */
.tp-affiliate { background: var(--tp-white); border: 2px solid var(--tp-border); border-radius: var(--tp-radius); padding: 20px; margin: 24px 0; }
.tp-affiliate__inner { display: flex; flex-direction: column; gap: 16px; }
.tp-affiliate__image { width: 100%; aspect-ratio: 1/1; max-width: 200px; margin: 0 auto; overflow: hidden; border-radius: var(--tp-radius); background: var(--tp-bg-alt); }
.tp-affiliate__image img { width: 100%; height: 100%; object-fit: contain; }
.tp-affiliate__info { flex: 1; }
.tp-affiliate__name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.tp-affiliate__desc { font-size: 0.85rem; color: var(--tp-text-light); line-height: 1.6; margin-bottom: 16px; }
.tp-affiliate__price { font-size: 1.2rem; font-weight: 700; color: var(--tp-accent); margin-bottom: 16px; }
.tp-affiliate__buttons { display: flex; flex-direction: column; gap: 8px; }
.tp-affiliate__btn { display: block; text-align: center; padding: 12px 16px; border-radius: var(--tp-radius); color: var(--tp-white); font-weight: 700; font-size: 0.9rem; transition: opacity 0.2s, transform 0.2s; text-decoration: none; }
.tp-affiliate__btn:hover { opacity: 0.9; transform: translateY(-1px); color: var(--tp-white); }
.tp-affiliate__btn--rakuten { background: var(--tp-btn-rakuten); }
.tp-affiliate__btn--amazon { background: var(--tp-btn-amazon); color: #111; }
.tp-affiliate__btn--amazon:hover { color: #111; }
.tp-affiliate__btn--yahoo { background: var(--tp-btn-yahoo); }
.tp-affiliate__btn--official { background: var(--tp-btn-official); }

/* ========================================
   CTA Box
   ======================================== */
.tp-cta-box { background: var(--tp-accent); color: var(--tp-primary); border-radius: var(--tp-radius); padding: 24px 20px; margin: 32px 0; text-align: center; }
.tp-cta-box__micro { font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; opacity: 0.8; }
.tp-cta-box__heading { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; line-height: 1.4; }
.tp-cta-box__btn { display: inline-block; background: var(--tp-primary); color: var(--tp-white); padding: 14px 32px; border-radius: var(--tp-radius); font-weight: 700; font-size: 0.95rem; transition: transform 0.2s; }
.tp-cta-box__btn:hover { transform: translateY(-2px); color: var(--tp-white); }

/* ========================================
   Sidebar
   ======================================== */
.tp-sidebar { padding: 24px 16px; }
.tp-widget { margin-bottom: 32px; }
.tp-widget__title { font-size: 1rem; font-weight: 700; padding-bottom: 8px; border-bottom: 3px solid var(--tp-accent); margin-bottom: 16px; }

/* ========================================
   Footer
   ======================================== */
.tp-footer { background: var(--tp-primary); color: rgba(255,255,255,0.7); padding: 40px 16px 20px; }
.tp-footer a { color: rgba(255,255,255,0.7); }
.tp-footer a:hover { color: var(--tp-accent); }
.tp-footer__nav { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; justify-content: center; list-style: none; padding: 0; }
.tp-footer__nav li { list-style: none; display: inline; }
.tp-footer__nav a { font-size: 0.85rem; }
.tp-footer__copy { text-align: center; font-size: 0.75rem; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ========================================
   Pagination
   ======================================== */
.tp-pagination { display: flex; justify-content: center; gap: 8px; padding: 32px 0; }
.tp-pagination a, .tp-pagination span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--tp-radius); font-size: 0.9rem; font-weight: 700; }
.tp-pagination a { background: var(--tp-white); border: 1px solid var(--tp-border); color: var(--tp-text); transition: background 0.2s; }
.tp-pagination a:hover { background: var(--tp-accent); color: var(--tp-white); border-color: var(--tp-accent); }
.tp-pagination .current { background: var(--tp-accent); color: var(--tp-white); border: 1px solid var(--tp-accent); }

/* ========================================
   Category Section (Front Page)
   ======================================== */
.tp-cat-nav { display: flex; gap: 8px; overflow-x: auto; padding: 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tp-cat-nav::-webkit-scrollbar { display: none; }
.tp-cat-nav__item { flex-shrink: 0; padding: 8px 20px; background: var(--tp-white); border: 1px solid var(--tp-border); border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: var(--tp-text); transition: all 0.2s; white-space: nowrap; }
.tp-cat-nav__item:hover, .tp-cat-nav__item--active { background: var(--tp-accent); color: var(--tp-white); border-color: var(--tp-accent); }

/* ========================================
   Breadcrumb
   ======================================== */
.tp-breadcrumb { padding: 12px 16px; font-size: 0.8rem; color: var(--tp-text-light); }
.tp-breadcrumb a { color: var(--tp-text-light); }
.tp-breadcrumb a:hover { color: var(--tp-accent); }
.tp-breadcrumb span { margin: 0 6px; }

/* ========================================
   Simple Fade-in Animation
   ======================================== */
.tp-fadein { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.tp-fadein.is-visible { opacity: 1; transform: translateY(0); }

/* ========================================
   Related Posts
   ======================================== */
.tp-related { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--tp-border); }
.tp-related__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }

/* ========================================
   Search
   ======================================== */
.tp-search-form { display: flex; gap: 0; }
.tp-search-form input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid var(--tp-border); border-right: none; border-radius: var(--tp-radius) 0 0 var(--tp-radius); font-size: 0.9rem; outline: none; }
.tp-search-form input[type="search"]:focus { border-color: var(--tp-accent); }
.tp-search-form button { padding: 10px 16px; background: var(--tp-accent); color: var(--tp-white); border: none; border-radius: 0 var(--tp-radius) var(--tp-radius) 0; cursor: pointer; font-weight: 700; }

/* ========================================
   404
   ======================================== */
.tp-404 { text-align: center; padding: 80px 16px; }
.tp-404__num { font-size: 4rem; font-weight: 700; color: var(--tp-accent); margin-bottom: 16px; }
.tp-404__text { font-size: 1rem; color: var(--tp-text-light); margin-bottom: 24px; }

/* ========================================
   Tablet (min-width: 600px)
   ======================================== */
@media (min-width: 600px) {
  .tp-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-hero__title { font-size: 2rem; }
  .tp-single__title { font-size: 1.6rem; }
  .tp-affiliate__inner { flex-direction: row; align-items: flex-start; }
  .tp-affiliate__image { max-width: 180px; margin: 0; }
  .tp-affiliate__buttons { flex-direction: row; flex-wrap: wrap; }
  .tp-affiliate__btn { flex: 1; min-width: 140px; }
}

/* ========================================
   Desktop (min-width: 960px)
   ======================================== */
@media (min-width: 960px) {
  .tp-container { padding: 0 24px; }
  .tp-header__menu-btn { display: none; }
  .tp-header__nav { display: flex !important; position: static; background: transparent; border: none; }
  .tp-header__nav ul { flex-direction: row; gap: 0; }
  .tp-header__nav li a { padding: 8px 16px; border-bottom: none; font-size: 0.9rem; }
  .tp-posts-grid { grid-template-columns: repeat(3, 1fr); }
  .tp-single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; max-width: var(--tp-max-width); margin: 0 auto; padding: 24px; }
  .tp-hero { padding: 80px 24px; }
  .tp-hero__title { font-size: 2.4rem; }
  .tp-section { padding: 60px 0; }
}
