/* ============================================================
   RQ MEDICAL — home.css
   Estilos específicos de la página de inicio.
   Usa las variables/tokens definidos en main.css.
   ============================================================ */

/* === 1. HERO === */
.hero {
  position: relative;
  /* min() evita que el hero crezca sin límite en pantallas muy altas */
  min-height: min(92vh, 960px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--ink);
}

/* Header sobre el hero (antes de scrollear): logo y nav en blanco
   para contrastar con la imagen; al scrollear vuelve al estilo normal */
.page-home .site-header:not(.scrolled) .logo img {
  filter: brightness(0) invert(1);
}

.page-home .site-header:not(.scrolled) .main-nav .nav-links a {
  color: var(--white);
}

.page-home .site-header:not(.scrolled) .nav-toggle span {
  background: var(--white);
}

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

.hero-bg picture,
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 30, 34, 0.55) 0%, rgba(10, 30, 34, 0.35) 45%, rgba(10, 30, 34, 0.72) 100%);
}

.hero-particles-wrap {
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 620px;
  margin-left: auto;
  color: var(--white);
}

.hero-kicker {
  color: var(--aqua);
}

.hero-title {
  color: var(--white);
  margin-bottom: 22px;
}

/* El gradiente de marca (teal→aqua) no contrasta sobre el fondo teal del
   hero: variante clara blanco→aqua solo para el título del hero */
.hero-title .text-gradient {
  background-image: linear-gradient(90deg, #ffffff 15%, #b5e3e6 90%);
}

.hero-text {
  color: rgba(234, 243, 245, 0.85);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.btn-hero-outline {
  border-color: rgba(234, 243, 245, 0.55);
  color: var(--white);
}

.btn-hero-outline:hover {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}

/* --- Entrada animada sin esperar scroll --- */
.hero-kicker,
.hero-title,
.hero-text,
.hero-actions {
  opacity: 0;
  transform: translateY(24px);
  animation: heroFadeInUp 0.9s var(--ease-smooth) forwards;
}

.hero-kicker { animation-delay: 0.15s; }
.hero-title { animation-delay: 0.3s; }
.hero-text { animation-delay: 0.5s; }
.hero-actions { animation-delay: 0.7s; }

@keyframes heroFadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Línea de escaneo decorativa --- */
.hero-scanline {
  position: absolute;
  top: 6%;
  left: 12%;
  width: 2px;
  height: 88%;
  background: linear-gradient(180deg, rgba(88, 174, 181, 0) 0%, rgba(88, 174, 181, 0.75) 45%, rgba(88, 174, 181, 0) 100%);
  filter: blur(0.5px);
  opacity: 0;
  animation: scanSweep 7s ease-in-out infinite;
  display: block;
}

@keyframes scanSweep {
  0% {
    left: 6%;
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  50% {
    left: 38%;
    opacity: 0.6;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    left: 6%;
    opacity: 0;
  }
}

/* --- Indicador de scroll --- */
.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(234, 243, 245, 0.8);
  opacity: 0;
  animation: heroFadeInUp 0.9s var(--ease-smooth) forwards;
  animation-delay: 0.9s;
}

.hero-scroll-mouse {
  width: 26px;
  height: 42px;
  border: 2px solid rgba(234, 243, 245, 0.6);
  border-radius: 100px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.hero-scroll-dot {
  width: 4px;
  height: 8px;
  border-radius: 100px;
  background: var(--aqua);
  animation: scrollDot 1.8s ease-in-out infinite;
}

.hero-scroll-indicator svg {
  width: 16px;
  height: 16px;
  stroke: rgba(234, 243, 245, 0.6);
  animation: chevronBounce 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.3; }
}

@keyframes chevronBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-kicker,
  .hero-title,
  .hero-text,
  .hero-actions,
  .hero-scroll-indicator {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero-scanline {
    display: none;
  }

  .hero-scroll-dot,
  .hero-scroll-indicator svg {
    animation: none;
  }
}

@media (max-width: 992px) {
  .hero-scanline {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: min(100vh, 900px);
  }

  .hero-overlay {
    background: rgba(10, 30, 34, 0.62);
  }

  .hero-content {
    margin-left: 0;
    max-width: 100%;
  }

  .hero-text {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* === 2. QUIÉNES SOMOS === */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 60px;
  align-items: center;
}

.about-visual {
  position: relative;
  padding: 20px;
}

.about-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-ring {
  position: absolute;
  top: -24px;
  left: -24px;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(var(--mist), var(--mist)) padding-box,
    var(--gradient-accent) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  z-index: 0;
}

.about-float-card {
  position: absolute;
  bottom: 8px;
  right: -12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 16px 20px;
  max-width: 240px;
}

.about-float-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-float-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--white);
}

.about-float-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.about-content .section-head {
  margin-bottom: 28px;
}

@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-visual {
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .about-float-card {
    right: 0;
    max-width: 200px;
    padding: 12px 16px;
  }
}

/* === 3. TARJETAS DE CATEGORÍA === */

/* --- 4.1 Tarjetas de categoría (Tecnología / Insumos) --- */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 56px;
}

.category-tile {
  position: relative;
  display: block;
  min-height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--white);
  transition: box-shadow 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}

.category-tile:hover,
.category-tile:focus-visible {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.category-tile:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
}

.category-tile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.6s var(--ease-smooth);
}

.category-tile:hover .category-tile-bg,
.category-tile:focus-visible .category-tile-bg {
  transform: scale(1.06);
}

.category-tile-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(10, 30, 34, 0.80) 0%, rgba(10, 30, 34, 0.55) 45%, rgba(10, 30, 34, 0.30) 100%);
}

.category-tile-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  gap: 8px;
}

.category-tile-kicker {
  display: inline-flex;
  align-items: center;
  /* Mayúsculas con tracking amplio: van en la tipografía de cuerpo */
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aqua);
}

.category-tile-title {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--white);
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  margin: 0;
  font-weight: 700;
}

.category-tile-desc {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  max-width: 42ch;
}

.category-tile-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 600;
  color: var(--white);
}

.category-tile-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-smooth);
}

.category-tile:hover .category-tile-arrow,
.category-tile:focus-visible .category-tile-arrow {
  transform: translateX(6px);
}

@media (max-width: 768px) {
  .category-tiles {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .category-tile {
    min-height: 240px;
  }

  .category-tile-content {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-tile,
  .category-tile-bg,
  .category-tile-arrow {
    transition: none !important;
  }

  .category-tile:hover .category-tile-bg,
  .category-tile:focus-visible .category-tile-bg {
    transform: none;
  }

  .category-tile:hover .category-tile-arrow,
  .category-tile:focus-visible .category-tile-arrow {
    transform: none;
  }
}

/* === 4. INFORMACIÓN / BLOG === */
.info-grid {
  align-items: stretch;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.5s var(--ease-smooth), box-shadow 0.5s var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.info-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.info-card-head {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card-head--doc {
  background: linear-gradient(135deg, var(--teal), var(--aqua));
}

.info-card-head--event {
  background: linear-gradient(135deg, var(--ink), var(--teal));
}

.info-card-head svg {
  width: 46px;
  height: 46px;
  stroke: var(--white);
}

.info-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.info-card-body h3 {
  font-size: 1.2rem;
}

.info-card-body p {
  font-size: 0.95rem;
  line-height: 1.7;
  flex: 1;
}

.info-card-body .btn {
  align-self: flex-start;
}

/* === 5. CTA BANNER === */
.cta-banner {
  position: relative;
  padding: 72px 0;
  overflow: hidden;
  text-align: center;
}

.cta-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(88, 174, 181, 0.25) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cta-inner h2 {
  max-width: 640px;
}

.cta-inner p {
  max-width: 520px;
  font-size: 1.05rem;
}

.btn-cta-lg {
  margin-top: 10px;
  padding: 18px 40px;
  font-size: 1.02rem;
}

/* === 6. CONTACTO === */
.contact-grid {
  gap: 60px;
  align-items: start;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 28px 0 32px;
}

.contact-list li a,
.contact-list li address {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-style: normal;
  font-size: 0.98rem;
  color: var(--ink);
  transition: color 0.3s ease;
}

.contact-list li a:hover {
  color: var(--teal);
}

.contact-list svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  stroke: var(--teal);
  margin-top: 1px;
}

.contact-form-wrap {
  background: var(--mist);
  border-radius: var(--radius);
  padding: 40px;
}

.sr-only-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-submit {
  width: 100%;
  margin-top: 8px;
}

#form-message:not(:empty) {
  margin-top: 16px;
}

@media (max-width: 992px) {
  .contact-grid {
    gap: 40px;
  }

  .contact-form-wrap {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .contact-form-wrap {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .contact-form-wrap {
    padding: 20px;
  }

  /* El iframe de reCAPTCHA mide 304px fijos: escalarlo si no cabe */
  .g-recaptcha {
    transform: scale(0.88);
    transform-origin: 0 0;
  }
}
