/* ============================================================
   LEGO WORLD — styles.css
   カラー・レイアウト・コンポーネント
   ============================================================ */

/* ---- カスタムプロパティ ---- */
:root {
  /* Colors */
  --color-bg:        #ffffff;
  --color-bg-alt:    #f8f8f8;
  --color-text:      #1a1a1a;
  --color-text-sub:  #555555;
  --color-accent:    #ffd700; /* LEGO Yellow */
  --color-accent-dark: #e6c200;
  --color-red:       #e3000b; /* LEGO Red */
  --color-border:    #e8e8e8;
  --color-white:     #ffffff;

  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-size-base: 1rem;      /* 16px */
  --line-height: 1.8;

  /* Spacing */
  --section-py: 80px;
  --container-max: 1100px;
  --container-narrow: 720px;
  --gap: 24px;

  /* Misc */
  --radius: 8px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
}

/* ---- リセット ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  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;
}

/* ---- レイアウト共通 ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

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

.section {
  padding-block: var(--section-py);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* セクション見出し */
.section__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 16px;
}

.section__title::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background-color: var(--color-accent);
  position: absolute;
  bottom: 0;
  left: 0;
}

/* ---- ボタン ---- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  border: 2px solid transparent;
  text-align: center;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
}

/* ---- HEADER ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

/* スクロール後にシャドウを付与（JS で .scrolled を付与） */
.header.scrolled {
  border-color: var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header__logo::before {
  content: "🧱";
  font-size: 1.2rem;
}

/* デスクトップナビ */
.header__nav {
  display: none;
  gap: 32px;
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-sub);
  transition: color var(--transition);
}

.nav__link:hover {
  color: var(--color-text);
}

/* ハンバーガーボタン */
.header__menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

/* ハンバーガー → × アニメーション */
.header__menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__menu-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header__menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* モバイルナビオーバーレイ */
.header__nav.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 64px 0 0 0;
  background-color: var(--color-bg);
  padding: 32px 20px;
  gap: 0;
  border-top: 1px solid var(--color-border);
}

.header__nav.open .nav__link {
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--color-border);
}

/* ---- HERO ---- */
.hero {
  padding-top: calc(64px + 80px); /* ヘッダー高さ + 余白 */
  padding-bottom: 100px;
  background-color: var(--color-bg);
}

.hero__inner {
  max-width: 800px;
  margin-inline: auto;
}

.hero__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-sub);
  margin-bottom: 16px;
  padding: 4px 12px;
  background-color: var(--color-bg-alt);
  border-radius: 100px;
  border: 1px solid var(--color-border);
}

.hero__title {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  /* アクセントカラーでアンダーライン */
  background-image: linear-gradient(transparent 85%, var(--color-accent) 85%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: inline;
}

.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-text-sub);
  line-height: 1.9;
  margin-top: 24px;
  margin-bottom: 16px;
}

.hero__tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-sub);
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- ABOUT ---- */
.about__content p {
  margin-bottom: 16px;
  color: var(--color-text-sub);
  line-height: 1.9;
}

.about__content p:last-child {
  margin-bottom: 0;
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 100px;
  background-color: var(--color-accent);
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* ---- VIDEOS ---- */
.videos__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

.video-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-card);
}

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

.video-card__thumb-link {
  display: block;
}

.video-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #d0d0d0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* 読み込み中の背景色は .video-card__thumb の background-color で対応 */

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--color-white);
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
}

.video-card__thumb-link:hover .video-card__play {
  opacity: 1;
}

.video-card__body {
  padding: 16px 20px 20px;
}

.video-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}

.video-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-sub);
  line-height: 1.7;
}

.video-card__date {
  font-size: 0.8rem;
  color: var(--color-text-sub);
  margin-top: 6px;
}

.videos__more {
  text-align: center;
  margin-top: 48px;
}

/* ---- PROFILE ---- */
.profile__card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}

.profile__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile__avatar-icon {
  font-size: 2rem;
  line-height: 1;
}

.profile__role {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-sub);
  margin-bottom: 12px;
}

.profile__text p {
  color: var(--color-text-sub);
  line-height: 1.9;
}

/* ---- SOCIAL ---- */
.social__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-white);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

.social__link:hover {
  border-color: currentColor;
  transform: translateX(4px);
  box-shadow: var(--shadow-card);
}

.social__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.social__link--youtube { color: #FF0000; }
.social__link--x       { color: #000000; }
.social__link--instagram { color: #E1306C; }

/* ---- CONTACT ---- */
.contact {
  text-align: center;
}

.contact .section__title::after {
  left: 50%;
  transform: translateX(-50%);
}

.contact__text {
  color: var(--color-text-sub);
  margin-bottom: 32px;
  font-size: 1rem;
}

/* ---- FOOTER ---- */
.footer {
  background-color: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding-block: 32px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer__copy {
  font-size: 0.8rem;
}

.footer__social {
  display: flex;
  gap: 20px;
}

.footer__social a {
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer__social a:hover {
  color: var(--color-accent);
}

/* ============================================================
   RESPONSIVE — Tablet (min-width: 640px)
   ============================================================ */
@media (min-width: 640px) {
  .videos__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile__card {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* ============================================================
   RESPONSIVE — Desktop (min-width: 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  :root {
    --section-py: 100px;
  }

  /* ナビ表示切り替え */
  .header__nav {
    display: flex;
  }

  .header__menu-btn {
    display: none;
  }

  .videos__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .social__list {
    flex-direction: row;
  }

  .social__link {
    flex-direction: column;
    padding: 24px 28px;
    gap: 12px;
    text-align: center;
    flex: 1;
  }

  .social__link:hover {
    transform: translateY(-4px);
  }

  .social__icon {
    width: 32px;
    height: 32px;
  }
}

/* ============================================================
   CHANNEL BADGE
   ============================================================ */
.channel-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.channel-badge--jp {
  background-color: var(--color-accent);
  color: var(--color-text);
}

.channel-badge--global {
  background-color: var(--color-text);
  color: var(--color-white);
}

/* ============================================================
   CHANNEL SECTION（トップページ）
   ============================================================ */
.channel-section__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.channel-section__title {
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.channel-section__desc {
  font-size: 0.9rem;
  color: var(--color-text-sub);
  line-height: 1.7;
  margin-top: 6px;
}

.channel-section__btn {
  align-self: flex-start;
}

@media (min-width: 768px) {
  .channel-section__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .channel-section__btn {
    flex-shrink: 0;
  }
}

/* ============================================================
   CHANNEL HERO（詳細ページ）
   ============================================================ */
.channel-hero {
  padding-top: calc(64px + 60px);
  padding-bottom: 72px;
  background-color: var(--color-bg);
}

.channel-hero__inner {
  max-width: 720px;
  margin-inline: auto;
}

.channel-hero__back {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-sub);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.channel-hero__back:hover {
  color: var(--color-text);
}

.channel-hero__title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.channel-hero__title-sub {
  font-size: 0.6em;
  font-weight: 600;
  color: var(--color-text-sub);
  letter-spacing: 0;
}

.channel-hero__desc {
  font-size: 1rem;
  color: var(--color-text-sub);
  line-height: 1.9;
  margin-bottom: 32px;
}

.channel-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   CHANNEL AVATAR
   ============================================================ */
.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.channel-avatar--lg {
  width: 64px;
  height: 64px;
}

.channel-section__name-row,
.channel-hero__name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- nav active state ---- */
.nav__link--active {
  color: var(--color-text);
  font-weight: 700;
}
