/* JiuFlow SSR - Dark Theme with Glassmorphism */
/* Colors:
   background: #09090b  foreground: #fafafa
   card: #09090b  muted: #27272a  muted-fg: #a1a1aa
   primary: #e94560  primary-fg: #fef2f2
   border: #27272a
*/

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', Roboto, sans-serif;
  line-height: 1.5;
  background-color: #09090b;
  color: #fafafa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Glass Effects */
.glass-nav {
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(39, 39, 42, 0.5);
}

.glass-card {
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(39, 39, 42, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-footer {
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(39, 39, 42, 0.5);
}

/* Glow effects */
.glow-primary {
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.4), 0 0 40px rgba(220, 38, 38, 0.2);
}
.glow-primary:hover {
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5), 0 0 60px rgba(220, 38, 38, 0.3);
}

/* Navigation */
.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 300;
  color: #a1a1aa;
  transition: color 0.2s ease;
}
.nav-link:hover { color: #fafafa; }
.nav-link.active { color: #fafafa; }

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

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: opacity 1s ease-in-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.4), rgba(0,0,0,0.6));
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.75rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  margin-bottom: 1rem;
}

.hero-typewriter-container {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero-typewriter {
  font-size: 1.25rem;
  font-weight: 300;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  background: white;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-glass-card {
  max-width: 42rem;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #e94560;
  color: #fef2f2;
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

.btn-ghost {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid #27272a;
}
.btn-ghost:hover {
  color: #fafafa;
  background: rgba(39, 39, 42, 0.5);
}

/* Sections */
.section { padding: 5rem 1.5rem; }

.section-title {
  font-size: 2.25rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: #fafafa;
}

.section-subtitle {
  font-size: 1.125rem;
  color: #a1a1aa;
  font-weight: 300;
}

/* Image sections */
.overhead-section { background: #09090b; }

.overhead-img {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

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

/* Instructor section */
.instructor-section {
  background: linear-gradient(to bottom right, rgba(220,38,38,0.05), #09090b, rgba(220,38,38,0.1));
}

.instructor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #e94560;
  color: #fef2f2;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.instructor-photo {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.instructor-photo img { width: 100%; height: auto; display: block; }

.instructor-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent, transparent);
}

.instructor-quote {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  color: rgba(255,255,255,0.9);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 300;
}

.credential-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.credential-check {
  width: 1.25rem;
  height: 1.25rem;
  color: #e94560;
  flex-shrink: 0;
}

/* SEO Cards */
.seo-card {
  display: block;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.seo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.seo-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: rgba(220,38,38,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background 0.2s ease;
}

.seo-card:hover .seo-card-icon { background: rgba(220,38,38,0.2); }
.seo-card-icon svg { width: 1.25rem; height: 1.25rem; color: #e94560; }
.seo-card h3 { font-size: 1.125rem; font-weight: 500; margin-bottom: 0.25rem; }
.seo-card p { font-size: 0.875rem; color: #a1a1aa; }

/* FAQ Details/Summary */
details.glass-card summary::-webkit-details-marker { display: none; }
details.glass-card[open] summary svg { transform: rotate(180deg); }
details.glass-card:hover { border-color: rgba(220, 38, 38, 0.3); }

/* Guide cards hover */
a.glass-card:hover { transform: translateY(-2px); border-color: rgba(220, 38, 38, 0.3); }

/* Grid-3 */
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Closing CTA */
.cta-section { position: relative; overflow: hidden; }

.cta-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  animation: float 6s ease-in-out infinite;
}

.cta-orb-1 {
  top: 25%; left: 25%;
  width: 24rem; height: 24rem;
  background: rgba(220,38,38,0.1);
}

.cta-orb-2 {
  bottom: 25%; right: 25%;
  width: 18rem; height: 18rem;
  background: rgba(39,39,42,0.1);
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Footer */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-brand { grid-column: span 2; }

.footer-heading {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fafafa;
  margin-bottom: 0.75rem;
}

.footer-link {
  display: block;
  font-size: 0.875rem;
  color: #a1a1aa;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
.footer-link:hover { color: #fafafa; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-copyright { font-size: 0.875rem; color: #a1a1aa; }

/* Animations */
.animate-fade-up { animation: fadeUp 0.8s ease-out forwards; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.6s ease-out forwards; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll-triggered animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Mobile hamburger */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #fafafa;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(20px);
  padding: 5rem 2rem 2rem;
}

.mobile-menu.open { display: flex; flex-direction: column; gap: 1rem; }

.mobile-menu a {
  font-size: 1.25rem;
  padding: 0.75rem 0;
  color: #a1a1aa;
  border-bottom: 1px solid rgba(39, 39, 42, 0.3);
}
.mobile-menu a:hover { color: #fafafa; }

.mobile-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fafafa;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Layout utilities */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.max-w-5xl { max-width: 64rem; margin: 0 auto; }
.max-w-6xl { max-width: 72rem; margin: 0 auto; }
.max-w-4xl { max-width: 56rem; margin: 0 auto; }
.max-w-2xl { max-width: 42rem; margin: 0 auto; }
.text-center { text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-4 { display: flex; gap: 1rem; }
.flex-col { flex-direction: column; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-muted { color: #a1a1aa; }
.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }

.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-10 { margin-top: 2.5rem; }
.pt-16 { padding-top: 4rem; }

.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.p-6 { padding: 1.5rem; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Dark theme overrides for Tailwind-style classes in sub-pages */
.text-gray-900 { color: #fafafa; }
.text-gray-700, .text-gray-600, .text-gray-500 { color: #a1a1aa; }
.text-gray-400 { color: #71717a; }
.text-blue-600 { color: #e94560; }
.text-blue-700 { color: #e94560; }
.text-yellow-700 { color: #eab308; }
.text-green-700 { color: #22c55e; }

.bg-white, .bg-gray-50 { background: rgba(39, 39, 42, 0.3); }
.bg-blue-50, .bg-blue-100 { background: rgba(220, 38, 38, 0.1); }
.bg-yellow-100 { background: rgba(234, 179, 8, 0.15); }
.bg-green-100 { background: rgba(34, 197, 94, 0.15); }
.bg-gray-900 { background: #09090b; }
.bg-blue-600 { background: #e94560; }

.border, .border-b { border-color: #27272a; }
.border-white { border-color: rgba(255,255,255,0.2); }

.hover\:bg-gray-50:hover, .hover\:bg-blue-50:hover { background: rgba(39, 39, 42, 0.5); }
.hover\:text-blue-600:hover { color: #e94560; }
.hover\:text-white:hover { color: #fafafa; }
.hover\:bg-blue-700:hover { background: rgba(220, 38, 38, 0.8); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.hover\:underline:hover { text-decoration: underline; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: ui-monospace, monospace; }
.text-xs { font-size: 0.75rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.max-w-7xl { max-width: 80rem; margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.p-4 { padding: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }

.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.w-24 { width: 6rem; }
.h-24 { height: 6rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-40 { height: 10rem; }
.h-48 { height: 12rem; }
.h-64 { height: 16rem; }
.object-cover { object-fit: cover; }
.aspect-video { aspect-ratio: 16/9; }

.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.3); }
.transition-shadow { transition: box-shadow 0.15s ease-in-out; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease; }
.whitespace-pre-line { white-space: pre-line; }

.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }

.list-disc { list-style-type: disc; }
.pl-6 { padding-left: 1.5rem; }

.prose h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; color: #fafafa; }
.prose p { margin-bottom: 1rem; }
.prose ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.5rem; }
.max-w-none { max-width: none; }

/* Tournament list page */
.tournament-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.tournament-section-header .accent-bar {
  width: 4px;
  height: 2rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.tournament-section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}
.tournament-section-header .count-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
}

.tournament-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .tournament-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .tournament-grid { grid-template-columns: repeat(3, 1fr); }
}

.tournament-card {
  display: block;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #27272a;
  background: rgba(24, 24, 27, 0.8);
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.tournament-card:hover {
  border-color: #52525b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.tournament-card.is-today {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.15);
}
.tournament-card.is-today:hover {
  border-color: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.25);
}
.tournament-card.is-past {
  background: rgba(24, 24, 27, 0.4);
  opacity: 0.55;
}
.tournament-card.is-past:hover {
  opacity: 0.85;
}

.tournament-card .top-bar {
  height: 3px;
  background: #27272a;
  transition: background 0.2s ease;
}
.tournament-card:hover .top-bar { background: rgba(220, 38, 38, 0.5); }
.tournament-card.is-today .top-bar { background: #e94560; }

.tournament-card .card-body {
  padding: 1.1rem 1.25rem 1.25rem;
}

.tournament-card .badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.tournament-card .badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.badge-ibjjf  { background: #2563eb; color: #fff; }
.badge-asjjf  { background: #d63851; color: #fff; }
.badge-ajp    { background: #059669; color: #fff; }
.badge-adcc   { background: #d97706; color: #fff; }
.badge-sjjjf  { background: #7c3aed; color: #fff; }
.badge-jbjjf  { background: #ea580c; color: #fff; }
.badge-pbjjf  { background: #0891b2; color: #fff; }
.badge-jjfj   { background: #e11d48; color: #fff; }
.badge-jjif   { background: #4f46e5; color: #fff; }
.badge-default { background: #3f3f46; color: #a1a1aa; }

.badge-today {
  background: #e94560;
  color: #fff;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(220, 38, 38, 0.3); }
}

.badge-intl {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tournament-card .country-flag {
  margin-left: auto;
  font-size: 1.15rem;
  line-height: 1;
}

.tournament-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 0.7rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}
.tournament-card:hover .card-title { color: #fca5a5; }
.tournament-card.is-past .card-title { color: #d4d4d8; }

.tournament-card .card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.825rem;
  color: #a1a1aa;
}
.tournament-card .card-meta svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: #52525b;
}
.tournament-card.is-today .card-meta.date-meta {
  color: #fca5a5;
}
.tournament-card.is-today .card-meta.date-meta svg {
  color: #e94560;
}

.past-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fafafa;
  padding: 0;
  font-family: inherit;
}
.past-toggle-btn:hover h2 { color: #d4d4d8; }
.past-toggle-btn .arrow {
  font-size: 1.1rem;
  color: #71717a;
  transition: transform 0.2s ease;
}

/* Sub-page responsive */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:text-6xl { font-size: 3.75rem; }
  .md\:text-2xl { font-size: 1.5rem; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Main responsive */
@media (min-width: 640px) {
  .hero-title { font-size: 5rem; }
  .hero-typewriter { font-size: 1.5rem; }
  .hero-typewriter-container { height: 5rem; }
  .btn-row { flex-direction: row; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 768px) {
  .hamburger-btn { display: none; }
  .desktop-nav { display: flex !important; }
  .hero-title { font-size: 6rem; }
  .hero-typewriter { font-size: 1.875rem; }
  .section-title { font-size: 2.5rem; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: repeat(5, 1fr); }
  .footer-brand { grid-column: span 1; }
}

@media (max-width: 767px) {
  .desktop-nav { display: none !important; }
  .hamburger-btn { display: block; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 8rem; }
}

/* News page */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}

.news-card {
  display: block;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #27272a;
  background: rgba(24, 24, 27, 0.8);
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.news-card:hover {
  border-color: #52525b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.news-card.is-featured {
  border-color: rgba(220, 38, 38, 0.4);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.1);
}
.news-card.is-featured:hover {
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 0 24px rgba(220, 38, 38, 0.2);
}

.news-card .top-bar {
  height: 3px;
  background: #27272a;
  transition: background 0.2s ease;
}
.news-card:hover .top-bar { background: rgba(220, 38, 38, 0.5); }
.news-card.is-featured .top-bar { background: #e94560; }

.news-card .card-body {
  padding: 1.1rem 1.25rem 1.25rem;
}

.news-card .badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.news-card .badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.badge-bjj {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.badge-site {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-featured {
  background: #e94560;
  color: #fff;
  animation: pulse-glow 2s ease-in-out infinite;
}

.news-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}
.news-card:hover .card-title { color: #fca5a5; }

.news-summary {
  font-size: 0.825rem;
  color: #a1a1aa;
  line-height: 1.5;
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.825rem;
  color: #a1a1aa;
}
.news-card .card-meta svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: #52525b;
}

.news-filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(39, 39, 42, 0.5);
  color: #a1a1aa;
  border: 1px solid #27272a;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.news-filter-btn:hover {
  color: #fafafa;
  border-color: #52525b;
}
.news-filter-btn.active {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

/* ========================================
   MOBILE-FIRST RESPONSIVE FIXES
   ======================================== */

/* Global mobile fixes */
@media (max-width: 767px) {
  /* Prevent horizontal scroll */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Hero: smaller text, less padding */
  .hero { min-height: 60vh; padding: 3rem 0; }
  .hero-title { font-size: 2.5rem; line-height: 1.1; }
  .hero-typewriter { font-size: 1rem; }
  .hero-typewriter-container { height: 3rem; margin-bottom: 1rem; }
  .hero-content { padding: 0 1rem; }

  /* Buttons: full width on mobile */
  .btn-row { flex-direction: column; gap: 0.75rem; width: 100%; }
  .btn-row a, .btn-row button { width: 100%; text-align: center; }

  /* Container: less padding */
  .container { padding: 0 1rem; }
  .max-w-5xl, .max-w-6xl, .max-w-4xl, .max-w-2xl, .max-w-7xl { padding: 0 1rem; }

  /* Section titles */
  .section-title { font-size: 1.75rem; }

  /* Cards: full width, less padding */
  .glass-card { padding: 1rem; }

  /* Footer: single column */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .footer-brand { grid-column: span 2; }

  /* Navigation header */
  header nav { padding: 0.5rem 1rem; }

  /* Tables: horizontal scroll */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Video embeds */
  iframe, video { max-width: 100%; height: auto; }

  /* Technique flow page */
  .flow-container { padding: 0.5rem; }

  /* Athlete grid */
  .athletes-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }

  /* Dojo cards */
  .dojo-card { flex-direction: column; }
  .dojo-card img { width: 100%; height: 150px; object-fit: cover; }

  /* Game plan cards */
  .game-plan-card { padding: 1rem; }

  /* Tournament list */
  .tournament-card { padding: 0.75rem; }

  /* Modal / drawer on mobile */
  .mobile-menu { padding: 4rem 1.5rem 2rem; }

  /* Form inputs */
  input, textarea, select {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
    width: 100%;
    box-sizing: border-box;
  }

  /* CTA orbs: smaller on mobile */
  .cta-orb-1 { width: 12rem; height: 12rem; }
  .cta-orb-2 { width: 8rem; height: 8rem; }

  /* News filters: scrollable */
  .news-filters {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .news-filter-btn { white-space: nowrap; flex-shrink: 0; }

  /* Blog grid */
  .blog-grid { grid-template-columns: 1fr !important; }

  /* Hide large decorative elements */
  .cta-orb { display: none; }

  /* Spacing reductions */
  section { padding: 2rem 0; }
  .py-24 { padding-top: 3rem; padding-bottom: 3rem; }
  .py-16 { padding-top: 2rem; padding-bottom: 2rem; }
  .mb-16 { margin-bottom: 2rem; }
  .gap-8 { gap: 1.5rem; }
  .gap-12 { gap: 2rem; }

  /* Text sizes */
  .text-5xl, .text-6xl { font-size: 2rem; }
  .text-4xl { font-size: 1.75rem; }
  .text-3xl { font-size: 1.5rem; }
  .text-2xl { font-size: 1.25rem; }

  /* Flex wrapping */
  .flex-nowrap { flex-wrap: wrap; }

  /* Stats row */
  .stats-row { flex-wrap: wrap; gap: 1rem; }
  .stats-row > * { flex: 1 1 calc(50% - 0.5rem); min-width: 120px; }
}

/* Small phones (iPhone SE, etc) */
@media (max-width: 374px) {
  .hero-title { font-size: 2rem; }
  .hero-typewriter { font-size: 0.875rem; }
  .container { padding: 0 0.75rem; }
  .glass-card { padding: 0.75rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .athletes-grid { grid-template-columns: 1fr !important; }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  a, button { min-height: 44px; min-width: 44px; }
  .footer-link { padding: 0.5rem 0; }
  nav a { padding: 0.75rem 1rem; }
  .news-filter-btn { padding: 0.5rem 1rem; }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .mobile-menu { padding-top: calc(4rem + env(safe-area-inset-top)); }
}

/* ═══════════════════════════════════════════════════════════
   Premium content gate
═══════════════════════════════════════════════════════════ */
.premium-lock {
  position: relative;
  overflow: hidden;
}
.premium-lock::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(9,9,11,0.9) 70%);
  pointer-events: none;
}
.premium-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  background: linear-gradient(135deg, #D4A853, #B8860B);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.premium-cta {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: linear-gradient(135deg, #e94560, #991b1b);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}
.premium-cta:hover { opacity: 0.9; }
