/* ============================================
   GLOBAL STYLES
   Main stylesheet for dkangfx.com
   
   Design tokens are in tokens.css
   ============================================ */

/* Import design tokens */
@import url('tokens.css');

/* ============================================
   BREAKPOINTS REFERENCE
   ============================================
   
   --bp-desktop: 75rem (1200px)
   --bp-tablet:  48rem (768px)
   --bp-mobile:  30rem (480px)
   
   Usage (CSS vars can't be used in media queries):
   @media (max-width: 75rem)  { }  <- Desktop → Tablet
   @media (max-width: 48rem)  { }  <- Tablet → Mobile
   @media (max-width: 30rem)  { }  <- Mobile → Small
   
   ============================================ */

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  
  /* Prevent FOUC (Flash of Unstyled Content) */
  visibility: hidden;
}

body.loaded {
  visibility: visible;
}

/* Skeleton placeholders for header and footer */
#header:empty,
#footer:empty {
  min-height: var(--header-height);
  background: var(--header-bg);
}

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

/* Accessibility: Screen reader only */
.a11y-hidden {
  position: absolute;
  left: -625rem;
}

/* ============================================
   3. HEADER & NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--header-bg);
  backdrop-filter: blur(var(--blur));
  border-bottom: var(--border-width) solid var(--header-border);
  box-shadow: var(--header-shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text);
  font-weight: var(--font-bold);
}

.logo {
  filter: drop-shadow(0 0 var(--blur) rgba(var(--accent-rgb), 0.25));
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
  margin: 0 var(--space-2);
  transition: opacity var(--transition-base), color var(--transition-base);
}

.nav a:hover {
  opacity: 1;
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 0.85;
  cursor: pointer;
  padding: var(--space-2);
  margin: 0 var(--space-2);
  font-size: var(--text-base);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: opacity var(--transition-base);
}

.nav-dropdown-toggle:hover {
  opacity: 1;
}

.dropdown-arrow {
  font-size: var(--text-xs);
  transition: transform var(--transition-base);
}

.nav-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  background: var(--dropdown-bg);
  border: var(--border-width) solid var(--dropdown-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
  min-width: var(--size-dropdown);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(var(--radius-lg) * -1));
  transition: all var(--transition-base);
  z-index: 100;
  backdrop-filter: blur(var(--blur));
}

.nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  margin: 0;
  transition: all var(--transition-base);
}

.nav-dropdown-menu a:hover {
  color: var(--text-secondary);
  background: rgba(var(--accent-rgb), 0.15);
}

/* Responsive adjustments for dropdown */
@media (max-width: 48rem) {
  .nav {
    gap: var(--space-1);
  }
  
  .nav a,
  .nav-dropdown-toggle {
    margin: 0 var(--space-1);
    font-size: var(--text-sm);
  }
  
  .nav-dropdown-menu {
    min-width: var(--size-dropdown-sm);
  }
}

/* ============================================
   4. BUTTONS
   ============================================ */
.btn {
  appearance: none;
  border: var(--border-width) solid var(--border-strong);
  color: var(--text);
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-ghost:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: var(--border-accent);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: var(--bg);
  font-weight: var(--font-bold);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  border-color: var(--border-strong);
}

/* ============================================
   5. HERO SECTION
   ============================================ */
.hero {
  padding: var(--space-16) var(--space-4);
  text-align: center;
  background: radial-gradient(50rem 25rem at 50% 0%, rgba(var(--accent-rgb), 0.15), transparent 70%);
}

.hero .logo {
  margin: 0 auto var(--space-4);
  width: clamp(var(--size-logo-min), 25vw, var(--size-logo-max));
  height: auto;
}

.hero h1,
.hero h2 {
  font-size: clamp(var(--text-4xl), 4vw, var(--text-6xl));
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
}

.cta {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   6. MAIN CONTENT SECTIONS
   ============================================ */
main {
  flex: 1;
}

.section {
  padding: var(--space-12) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section h2 {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-4);
}

/* Keypoints List */
.keypoints {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.keypoints li {
  background: var(--card-solid-bg);
  border: var(--border-width) solid var(--border-default);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
}

/* Resource List */
.resource-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.resource-list a {
  color: var(--text);
  text-decoration: none;
}

.resource-list a:hover {
  text-decoration: none;
}

/* ============================================
   7. FOOTER
   ============================================ */
.site-footer {
  padding: var(--space-2) var(--space-4);
  text-align: center;
  border-top: var(--border-width) solid var(--header-border);
  background: var(--header-bg);
}

.site-footer p {
  font-size: var(--text-xs);
  text-align: left;
  color: var(--text-tertiary);
}

/* ============================================
   8. LANGUAGE SWITCHING
   ============================================ */
[data-lang] {
  display: none;
}

html[lang="es"] [data-lang="es"] {
  display: inline;
}

html[lang="en"] [data-lang="en"] {
  display: inline;
}

/* ============================================
   9. PLAN & ADVICE BLOCKS
   ============================================ */
.plan-block {
  background: var(--card-solid-bg);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.plan-block h2 {
  font-size: var(--text-3xl);
  margin: 0 0 var(--space-6);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.plan-block h3 {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-3);
  color: var(--text-primary);
}

.plan-block ul,
.plan-block ol {
  margin: var(--space-2) 0;
}

.plan-block li {
  margin-bottom: var(--space-3);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.plan-block p {
  line-height: var(--leading-normal);
  margin: var(--space-2) 0;
  color: var(--text-secondary);
}

/* ============================================
   10. PROFILES SECTION
   ============================================ */
.profiles-section {
  padding: var(--space-8) var(--space-4);
  border-top: var(--border-width) solid var(--border-default);
  background: var(--surface-3);
}

.profiles-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.profile-link {
  display: flex;
  align-items: center;
  color: var(--text);
  opacity: 0.7;
  transition: all var(--transition-base);
}

.profile-link:hover {
  opacity: 1;
  color: var(--accent);
}

.profile-icon {
  width: auto;
  height: var(--size-icon);
}
