/*
  Professional MMA Fighter Official Site - Design System
  Theme: Reliability, Sincerity, Strength
  
  [THEME SWITCHING]
  To toggle between themes, change the [data-theme] attribute in the <html> tag:
  - data-theme="light" : White Premium (Current)
  - data-theme="dark"  : Original Dark
*/

/* Fonts are loaded via link tag in index.html for performance (display=block) */

:root {
  /* Common variables (Same for both themes) */
  --accent: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.1);
  --font-main: 'Inter', 'Noto Sans JP', sans-serif;
  --section-padding: 8rem 2rem;
  --container-width: 1200px;
  
  /* Hero configuration removed as we now use a simple logo */
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --border: #333333;
  --header-bg: rgba(10, 10, 10, 0.8);
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a1a;
  --text-secondary: #444444; /* Darkened from #666666 for better legibility */
  --border: #e0e0e0;
  --header-bg: rgba(255, 255, 255, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a:hover {
  opacity: 0.8;
}

ul {
  list-style: none;
}

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

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
}

header.scrolled {
  background: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

[data-theme="dark"] header.scrolled {
  background: var(--bg-secondary);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  line-height: 1;
}

.logo-main {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.logo-sub {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-top: 2px;
}

.logo-brand::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  margin-top: 4px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .nav-links {
    gap: 1.2rem;
  }
  .nav-links a {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
  }
  .grid-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .logo-main {
    font-size: 1.5rem;
    transform: scaleY(1.2);
  }
  .home-sponsor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/images/hero.png') no-repeat center center/cover;
  filter: brightness(0.7);
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.hero-action {
  height: 100vh;
  background-color: #010101;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  contain: paint;
}
.hero-action-logo {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 1rem;
}

.hero-action-logo img {
  width: 100%;
  max-width: 900px;
  height: auto;
  object-fit: contain;
  opacity: 0;
  animation: heroImageReveal 1s ease-out forwards;
  will-change: opacity;
  backface-visibility: hidden;
}

@keyframes heroImageReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bgTextReveal {
  from { opacity: 0; transform: scale(0.95) translateZ(0); }
  to { opacity: 1; transform: scale(1) translateZ(0); }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .hero-action {
    height: 55svh;
  }
  
  .hero-action-logo {
    padding-top: 4rem; /* ロゴを少し下にずらす */
  }
}


/* Reveal Animation Helper Classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.reveal.active {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Section Common */
section {
  padding: var(--section-padding);
  contain: paint;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 4rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--accent);
}

/* Grid Navigation */
.grid-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.grid-item {
  background: var(--bg-secondary);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.grid-item:hover {
  background: var(--bg-primary);
}

.grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.grid-item:hover::before {
  opacity: 0.1;
}

.grid-item span {
  font-size: 1.35rem;
  font-weight: 900;
  white-space: nowrap;
  z-index: 1;
}

.grid-item .en {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-top: 0.5rem;
  z-index: 1;
}

/* News Section (Widget Integration) */
.widget-container {
  min-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.widget-placeholder {
  text-align: center;
  padding: 4rem;
  color: var(--text-secondary);
}

.widget-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
  display: block;
}

.widget-placeholder .small {
  font-size: 0.8rem;
  margin-top: 1rem;
  opacity: 0.7;
}

/* Ensure iframe fills container */
.widget-container iframe {
  width: 100% !important;
  border: none !important;
}

/* Home Page Sponsor Logo Grid */
.home-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.sponsor-logo {
  background: var(--bg-secondary);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  transition: all 0.3s ease;
  opacity: 0.75;
  text-decoration: none;
  cursor: pointer;
}

.sponsor-logo:hover {
  opacity: 1;
  border-color: var(--accent);
  background: var(--bg-primary);
}

.sponsor-logo img {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter 0.3s ease;
}

.sponsor-logo:hover img {
  filter: grayscale(0);
}

/* Subpage Styles */
.subpage header {
  background: var(--header-bg);
}

.profile-grid {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Table on left, photo on right */
  gap: 3rem;
  margin-top: 3rem;
  align-items: start;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
}

.info-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 30%;
  padding: 1.2rem;
  text-align: left;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  font-weight: 700;
}

.info-table td {
  padding: 1.2rem;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

/* History Page Gallery & Split Layout */
.history-split-container {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.history-text {
  flex: 1;
  color: var(--text-primary);
}

.history-side-gallery {
  width: 40%; /* Increased from 35% */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Grid Layout Support */
.history-side-gallery.grid-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.history-side-gallery.grid-layout .history-image-item:last-child:nth-child(odd) {
  grid-column: span 2;
  justify-self: center;
}

.history-side-gallery.grid-layout .history-image-item {
  max-width: 100%; /* Fill the grid cell */
}

.history-image-item {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: transform, box-shadow;
  max-width: 400px; /* Standardize max width */
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure container fills grid row */
}

.history-image-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  border-color: var(--accent);
  z-index: 10;
}

.history-image-item .image-wrapper {
  overflow: hidden;
  width: 100%;
  flex-grow: 1; /* Allow wrapper to grow to fill the container height */
  background-color: #000; /* Dark background for empty areas */
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-image-item img {
  width: 100%;
  height: auto; /* Show full photo height */
  max-height: 100%; /* Ensure it doesn't overflow container */
  display: block;
  object-fit: contain; /* Full visibility, no cropping */
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.history-image-item:hover img {
  transform: scale(1.08); /* Slightly smaller scale for contain zoom */
}

.history-item-label {
  padding: 0.6rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  letter-spacing: 1px;
}

.history-image-caption {
  grid-column: span 2;
  margin-top: 1rem;
  padding: 0.8rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

@media (max-width: 992px) {
  .history-split-container {
    flex-direction: column;
    gap: 2rem;
  }

  .history-side-gallery {
    width: 100%;
    flex-direction: row;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .history-gallery,
  .history-side-gallery {
    grid-template-columns: 1fr;
  }
}

.achievement-list {
  list-style: none;
  padding: 0;
}

.achievement-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1.0rem;
  line-height: 1.8;
}

.achievement-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
}

@media (max-width: 992px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .info-table th {
    width: 40%;
  }
}

/* SNS Section */
#sns .section-title {
  margin-bottom: 2rem;
}

.sns-icons {
  display: flex;
  justify-content: center;
  gap: 8rem;
  margin-top: 1rem;
}

.sns-icons a {
  font-size: 10rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.3s ease, color 0.3s ease;
}

.sns-icons a:hover {
  transform: translateY(-5px);
  color: #fff;
}

@media (max-width: 768px) {
  .sns-icons {
    gap: 4rem;
  }
  .sns-icons a {
    font-size: 7rem;
  }
}

/* Footer */
footer {
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  text-align: center;
  border-top: 1px solid var(--border);
}
/* CSS-only hamburger toggle (checkbox hack) */
.nav-toggle-input {
  display: none;
}

/* Hamburger Base */
.hamburger {
  display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1rem;
  }

  .hero-action-branding {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    letter-spacing: 2px;
  }

  /* Mobile: shrink header logo */
  .logo-main {
    font-size: 1.1rem;
  }

  .logo-sub {
    font-size: 0.42rem;
    letter-spacing: 1px;
  }

  /* CSS Checkbox Hack: show menu when checked */
  .nav-toggle-input:checked ~ .nav-links {
    right: 0;
  }
  .nav-toggle-input:checked ~ .nav-links {
    right: 0;
  }

  /* Hamburger X animation on checked */
  .nav-toggle-input:checked + .hamburger span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .nav-toggle-input:checked + .hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle-input:checked + .hamburger span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  .hamburger {
    display: block;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
    padding: 10px;
  }
  .hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px;
    transition: all 0.3s ease;
  }
  .hamburger.toggle span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .hamburger.toggle span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.toggle span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  .nav-links {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100vh;
    width: 250px;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 1000;
  }
  [data-theme="dark"] .nav-links {
    background-color: var(--bg-secondary);
  }
  .nav-links.active {
    right: 0;
  }
  .nav-links li {
    margin: 1.5rem 0;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .grid-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-item span {
    font-size: 1.1rem;
    text-align: center;
    word-break: keep-all;
  }

  .grid-item .en {
    font-size: 0.6rem;
  }

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

  .home-sponsor-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

