/*
Theme Name: bridge+
Theme URI: https://brg.plus/
Author: Kogure Jouta
Description: bridge+ 大学受験対策プラットフォーム カスタムテーマ
Version: 0.2.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: Proprietary
Text Domain: bridgeplus
*/

/* =====================================================
   DESIGN TOKENS
===================================================== */
:root {
  --color-primary: #1A90A7;
  --color-primary-dark: #147285;
  --color-primary-light: #E6F3F5;
  --color-accent-pink: #ED9DA0;

  --color-text-main: #333333;
  --color-text-sub: #555555;
  --color-text-muted: #777777;
  --color-text-light: #999999;

  --color-bg: #FFFFFF;
  --color-bg-light: #F7F7F7;
  --color-bg-gray: #F2F2F2;
  --color-border: #EAEAEA;
  --color-border-light: #E4E4E4;

  --font-jp: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-en: 'Inter', var(--font-jp);

  --container-max: 1440px;
  --container-narrow: 1080px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);

  --tap-min: 48px;
}

/* =====================================================
   RESET / BASE
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-main);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

/* =====================================================
   LAYOUT UTILITIES
===================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

/* =====================================================
   SECTION HEADER (parts/section-header.php)
===================================================== */
.section-header {
  margin-bottom: 48px;
}

.section-header--center {
  text-align: center;
}

.section-header--left {
  text-align: left;
}

.section-label {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.2;
  color: #000;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 20px;
}

.section-title {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 16px;
  color: #000;
}

.section-lead {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  color: #000;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.section-header--left .section-lead {
  margin-left: 0;
  margin-right: 0;
}

/* =====================================================
   BUTTONS
===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  min-height: var(--tap-min);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  opacity: 1;
}

.btn-outline {
  background: #fff;
  color: var(--color-text-main);
  border-color: var(--color-text-main);
}

.btn-outline:hover {
  background: var(--color-text-main);
  color: #fff;
  opacity: 1;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-link {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
}

.btn-link::after {
  content: '→';
  margin-left: 6px;
}

/* =====================================================
   HEADER
===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  height: 72px;
}

.site-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}

.site-logo img {
  display: block;
  height: 32px;
  width: auto;
}

.site-logo .plus {
  color: var(--color-primary);
}

.global-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: flex-end;
}

.global-nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-main);
}

.global-nav a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-actions .btn {
  padding: 10px 20px;
  min-height: 40px;
  font-size: 13px;
}

.hamburger {
  display: none;
  width: var(--tap-min);
  height: var(--tap-min);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-main);
  transition: all 0.3s ease;
}

/* =====================================================
   PAGE HERO (parts/page-hero.php)
===================================================== */
.page-hero {
  padding: 56px 0 48px;
}

.page-hero--light {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #fff 100%);
}

.page-hero--primary {
  background: var(--color-primary);
  color: #fff;
}

.page-hero .container {
  max-width: var(--container-narrow);
}

.breadcrumb {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.breadcrumb-sep {
  color: var(--color-border);
}

.page-hero-label {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 300;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.page-hero--primary .page-hero-label {
  color: rgba(255, 255, 255, 0.8);
}

.page-hero-title {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--color-text-main);
}

.page-hero--primary .page-hero-title {
  color: #fff;
}

.page-hero-lead {
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-text-sub);
  max-width: 720px;
}

.page-hero--primary .page-hero-lead {
  color: rgba(255, 255, 255, 0.9);
}

/* =====================================================
   CTA BAND (parts/cta-band.php)
===================================================== */
.cta-band {
  padding: 64px 0;
  text-align: center;
}

.cta-band--light {
  background: var(--color-primary-light);
}

.cta-band--primary {
  background: var(--color-primary);
  color: #fff;
}

.cta-band--none {
  background: transparent;
}

.cta-band-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text-main);
}

.cta-band--primary .cta-band-title {
  color: #fff;
}

.cta-band-lead {
  font-size: 15px;
  color: var(--color-text-sub);
  margin-bottom: 32px;
}

.cta-band--primary .cta-band-lead {
  color: rgba(255, 255, 255, 0.9);
}

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

.cta-band-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 16px;
}

.cta-band--primary .cta-band-note {
  color: rgba(255, 255, 255, 0.8);
}

/* =====================================================
   LESSON CARD (parts/lesson-card.php) - shared component
===================================================== */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* 講座が0件のときの「準備中」表示 */
.lesson-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
  background: #f7f7f4;
  border-radius: 8px;
}

/* =====================================================
   共通フィルタタブ（講師一覧 / 講座を探す 等で使用）
===================================================== */
.bp-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.bp-filter-tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 8px 18px;
  font-size: 14px;
  color: var(--color-text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-weight: 500;
  font-family: inherit;
}
.bp-filter-tab:hover {
  color: var(--color-text-main);
}
.bp-filter-tab.is-active {
  color: var(--color-text-main);
  font-weight: 700;
  border-bottom-color: var(--color-primary);
}

/* フィルタ行：タブ + ドロップダウンの横並び */
.bp-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.bp-filter-row .bp-filter-tabs {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ドロップダウン型フィルタ（ラベル + select） */
.bp-filter-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-sub);
}
.bp-filter-select-label {
  font-weight: 500;
  white-space: nowrap;
}
.bp-filter-select-input {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 36px 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-main);
  cursor: pointer;
  min-width: 180px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3e%3cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bp-filter-select-input:hover {
  border-color: var(--color-text-light);
}
.bp-filter-select-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* フィルタで非表示にされた要素 */
.bp-filter-target [data-hidden="true"] {
  display: none !important;
}

@media (max-width: 640px) {
  .bp-filter-tabs {
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .bp-filter-tab {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
  }
  .bp-filter-row {
    align-items: stretch;
    gap: 12px;
  }
  .bp-filter-select {
    width: 100%;
  }
  .bp-filter-select-input {
    flex: 1;
    min-width: 0;
  }
}

/* =====================================================
   FINAL CTA (parts/final-cta.php) - 全ページ共通の最終コンバージョンCTA
===================================================== */
.home-final-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  text-align: center;
}

.home-final-cta-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.5;
  margin-bottom: 32px;
  color: #fff;
}

.home-final-cta-note {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 24px;
}

.home-final-cta .btn-primary {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
  padding: 18px 48px;
  font-size: 16px;
}

.home-final-cta .btn-primary:hover {
  background: var(--color-bg-light);
  border-color: var(--color-bg-light);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .home-final-cta { padding: 56px 0; }
  .home-final-cta-title { font-size: 22px; }
}

/* 講師カード（.instructor-card）と統一されたスタイル */
.lesson-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lesson-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  opacity: 1;
}

.lesson-thumb {
  aspect-ratio: 16 / 9;
  background: var(--color-bg-gray);
  overflow: hidden;
}

.lesson-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-body {
  padding: 16px 18px;
}

.lesson-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* 講師カードのタグ（.instructor-card-tag）と同形：白背景＋ボーダー＋グレー文字 */
.lesson-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-sub);
  background: var(--color-bg-light);
}

.lesson-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--color-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-sub);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-instructor {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-light);
}

/* =====================================================
   COURSE FILTER (templates/page-courses-archive.php)
===================================================== */
.course-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.course-filter-tab {
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--color-text-sub);
  background: #fff;
  transition: all 0.2s ease;
}

.course-filter-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  opacity: 1;
}

.course-filter-tab.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* =====================================================
   PAGINATION
===================================================== */
.pagination {
  margin-top: 48px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text-sub);
  background: #fff;
}

.pagination .current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* =====================================================
   PLACEHOLDER NOTICE
===================================================== */
.placeholder-notice {
  text-align: center;
  padding: 80px 24px;
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 15px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--color-text-muted);
}

/* =====================================================
   FOOTER
===================================================== */
.site-footer {
  background: #fff;
  color: #333;
  padding: 40px 0 24px;
  border-top: 1px solid #e5e5e5;
}

.site-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 24px;
  margin-bottom: 16px;
}

.footer-brand .site-logo {
  color: #333;
}

.footer-logo {
  display: inline-block;
  line-height: 0;
}

.footer-logo img {
  display: block;
  width: 121px;
  height: auto;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.footer-links-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 32px;
}

.footer-links a {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.footer-links a:hover {
  opacity: 0.7;
}

.footer-copy {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
}

/* =====================================================
   RESPONSIVE - TABLET (769px ～ 1024px)
===================================================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 26px;
  }

  .page-hero-title {
    font-size: 30px;
  }

  .lesson-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .course-detail-grid {
    grid-template-columns: 1fr 280px;
    gap: 32px;
  }

  .footer-top {
    gap: 32px;
  }
}

/* =====================================================
   RESPONSIVE - SP (≤ 768px)
===================================================== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 48px 0;
  }

  /* Section header */
  .section-header {
    margin-bottom: 32px;
  }

  .section-title {
    font-size: 22px;
  }

  .section-lead {
    font-size: 14px;
  }

  /* Buttons: ensure tap-friendly */
  .btn {
    padding: 14px 24px;
    font-size: 14px;
  }

  .btn-lg {
    padding: 16px 28px;
    font-size: 15px;
  }

  /* Header */
  .site-header {
    height: 60px;
  }

  .site-header-inner {
    padding: 0 16px;
    gap: 16px;
  }

  .site-logo img {
    height: 26px;
  }

  .global-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .global-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .global-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
  }

  .header-actions {
    margin-left: auto;
  }

  .header-actions .btn-outline,
  .header-actions .btn-primary {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.is-active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Page hero */
  .page-hero {
    padding: 32px 0 40px;
  }

  .page-hero-title {
    font-size: 24px;
  }

  .page-hero-lead {
    font-size: 14px;
  }

  /* CTA band */
  .cta-band {
    padding: 48px 0;
  }

  .cta-band-title {
    font-size: 20px;
  }

  .cta-band-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-band-actions .btn {
    width: 100%;
  }

  /* Lesson grid */
  .lesson-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Course filter */
  .course-filter {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-bottom: 28px;
    padding-bottom: 4px;
  }

  .course-filter-tab {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
    min-height: var(--tap-min);
    display: inline-flex;
    align-items: center;
  }

  /* Footer */
  .site-footer {
    padding: 28px 0 20px;
  }

  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 16px;
    margin-bottom: 12px;
  }

  .footer-brand {
    display: flex;
    justify-content: center;
  }

  .footer-links {
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .footer-links-row {
    justify-content: center;
    gap: 20px;
    row-gap: 8px;
  }

  .footer-links a {
    font-size: 10px;
  }
}

/* =====================================================
   RESPONSIVE - SMALL SP (≤ 375px) iPhone SE等
===================================================== */
@media (max-width: 375px) {
  .container {
    padding: 0 14px;
  }

  .section-title {
    font-size: 20px;
  }

  .page-hero-title {
    font-size: 22px;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .footer-links-row {
    gap: 14px;
    row-gap: 6px;
  }
}
