/**
 * Tools Calculators — Styles globaux
 * Header, navigation, footer, éléments communs
 */

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.site-header,
.tc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--tc-white);
  border-bottom: 1px solid var(--tc-border);
  height: var(--tc-header-height);
  display: flex;
  align-items: center;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.tc-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--tc-container);
  margin-inline: auto;
  padding-inline: var(--tc-space-6);
  gap: var(--tc-space-8);
}

/* Logo */
.tc-header__logo {
  flex-shrink: 0;
}
.tc-header__logo img {
  height: 42px;
  width: auto;
}
.tc-header__logo-text {
  font-family: var(--tc-font-heading);
  font-size: var(--tc-text-2xl);
  font-weight: 800;
  color: var(--tc-text);
  letter-spacing: -0.01em;
  line-height: 1;
}
.tc-header__logo-text span {
  color: var(--tc-primary);
}

/* Navigation principale */
.tc-nav {
  display: flex;
  align-items: center;
  gap: var(--tc-space-2);
}
.tc-nav__item {
  position: relative;
}
.tc-nav__link {
  display: flex;
  align-items: center;
  gap: var(--tc-space-1);
  padding: var(--tc-space-2) var(--tc-space-3);
  font-size: var(--tc-text-sm);
  font-weight: 600;
  color: var(--tc-text-secondary);
  border-radius: var(--tc-radius);
  transition: var(--tc-transition);
  white-space: nowrap;
}
.tc-nav__link:hover,
.tc-nav__link.is-active {
  color: var(--tc-primary);
  background: var(--tc-primary-pale);
}

/* Dropdown catégories */
.tc-nav__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--tc-white);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  box-shadow: var(--tc-shadow-lg);
  padding: var(--tc-space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--tc-transition);
  z-index: 100;
}
.tc-nav__item:hover .tc-nav__dropdown,
.tc-nav__item:focus-within .tc-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tc-nav__dropdown-link {
  display: flex;
  align-items: center;
  gap: var(--tc-space-3);
  padding: var(--tc-space-3) var(--tc-space-3);
  border-radius: var(--tc-radius);
  font-size: var(--tc-text-sm);
  color: var(--tc-text);
  transition: var(--tc-transition);
}
.tc-nav__dropdown-link:hover {
  background: var(--tc-surface);
  color: var(--tc-primary);
}
.tc-nav__dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--tc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* CTA header */
.tc-header__cta {
  flex-shrink: 0;
}

/* Burger mobile */
.tc-header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--tc-space-2);
  cursor: pointer;
  background: none;
  border: none;
}
.tc-header__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--tc-text);
  border-radius: 2px;
  transition: var(--tc-transition);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.tc-breadcrumb {
  background: var(--tc-surface);
  border-bottom: 1px solid var(--tc-border);
  padding: var(--tc-space-3) 0;
}
.tc-breadcrumb__inner {
  display: flex;
  align-items: center;
  gap: var(--tc-space-2);
  font-size: var(--tc-text-sm);
  color: var(--tc-text-muted);
}
.tc-breadcrumb__inner a {
  color: var(--tc-text-secondary);
}
.tc-breadcrumb__inner a:hover {
  color: var(--tc-primary);
}
.tc-breadcrumb__sep {
  color: var(--tc-border-dark);
}

/* ============================================================
   HERO PAGE (calculateur / catégorie)
   ============================================================ */
.tc-hero {
  padding: var(--tc-space-16) 0 var(--tc-space-12);
  background: linear-gradient(135deg, var(--tc-primary-pale) 0%, var(--tc-white) 60%);
  border-bottom: 1px solid var(--tc-border);
  position: relative;
  overflow: hidden;
}
.tc-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(29,78,216,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Variantes par catégorie */
.tc-hero--hyrox {
  background: linear-gradient(135deg, var(--tc-hyrox-pale) 0%, var(--tc-white) 60%);
}
.tc-hero--hyrox::before {
  background: radial-gradient(circle, rgba(239,68,68,.06) 0%, transparent 70%);
}
.tc-hero--cycling {
  background: linear-gradient(135deg, var(--tc-cycling-pale) 0%, var(--tc-white) 60%);
}
.tc-hero--cycling::before {
  background: radial-gradient(circle, rgba(16,185,129,.06) 0%, transparent 70%);
}

.tc-hero__inner {
  position: relative;
  z-index: 1;
}
.tc-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--tc-space-2);
  margin-bottom: var(--tc-space-4);
}
.tc-hero__title {
  font-family: var(--tc-font-heading);
  font-weight: 800;
  margin-bottom: var(--tc-space-4);
  color: var(--tc-text);
}
.tc-hero__title span {
  color: var(--tc-primary);
}
.tc-hero__desc {
  font-size: var(--tc-text-lg);
  color: var(--tc-text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.tc-footer {
  background: var(--tc-text);
  color: #94A3B8;
  padding-top: var(--tc-space-16);
}
.tc-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--tc-space-12);
  padding-bottom: var(--tc-space-12);
  border-bottom: 1px solid #1E293B;
}
.tc-footer__brand .tc-header__logo-text {
  color: var(--tc-white);
}
.tc-footer__brand p {
  margin-top: var(--tc-space-4);
  font-size: var(--tc-text-sm);
  line-height: 1.7;
  color: #64748B;
}
.tc-footer__col-title {
  font-family: var(--tc-font-heading);
  font-size: var(--tc-text-lg);
  font-weight: 700;
  color: var(--tc-white);
  letter-spacing: 0.03em;
  margin-bottom: var(--tc-space-5);
  text-transform: uppercase;
}
.tc-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tc-space-3);
}
.tc-footer__links a {
  color: #64748B;
  font-size: var(--tc-text-sm);
  transition: var(--tc-transition);
  display: flex;
  align-items: center;
  gap: var(--tc-space-2);
}
.tc-footer__links a:hover {
  color: var(--tc-primary-light);
  padding-left: var(--tc-space-1);
}

/* Category dot */
.tc-footer__links a::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  flex-shrink: 0;
}

.tc-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--tc-space-5);
  font-size: var(--tc-text-xs);
  color: #475569;
  flex-wrap: wrap;
  gap: var(--tc-space-4);
}
.tc-footer__bottom a {
  color: #475569;
  transition: var(--tc-transition);
}
.tc-footer__bottom a:hover {
  color: var(--tc-primary-light);
}
.tc-footer__legal {
  display: flex;
  gap: var(--tc-space-5);
}

/* ============================================================
   RESPONSIVE — HEADER & FOOTER
   ============================================================ */
@media (max-width: 1024px) {
  .tc-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .tc-header__burger {
    display: flex;
  }
  .tc-nav,
  .tc-header__cta {
    display: none;
  }
  .tc-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--tc-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tc-white);
    padding: var(--tc-space-6);
    z-index: 999;
    overflow-y: auto;
    border-top: 1px solid var(--tc-border);
  }
  .tc-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--tc-space-8);
  }
  .tc-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
  .tc-hero {
    padding: var(--tc-space-10) 0 var(--tc-space-8);
  }
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.tc-scroll-top {
  position: fixed;
  bottom: var(--tc-space-6);
  right: var(--tc-space-6);
  width: 44px;
  height: 44px;
  background: var(--tc-primary);
  color: var(--tc-white);
  border: none;
  border-radius: var(--tc-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--tc-shadow-md);
  transition: var(--tc-transition);
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  font-size: 1.25rem;
}
.tc-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
}
.tc-scroll-top:hover {
  background: var(--tc-primary-dark);
  transform: translateY(-2px);
}

/* ============================================================
   OVERRIDES ELEMENTOR
   ============================================================ */

/* Forcer les polices dans l'éditeur Elementor */
.elementor-widget-heading .elementor-heading-title {
  font-family: var(--tc-font-heading) !important;
}
.elementor-widget-text-editor {
  font-family: var(--tc-font-body);
}

/* Suppression du padding Elementor section par défaut si classe tc- */
.elementor-section.tc-no-pad .elementor-container {
  padding: 0;
}

/* Boutons Elementor en style tc */
.elementor-button.tc-btn-style {
  font-family: var(--tc-font-body) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  transition: var(--tc-transition) !important;
}
