/*
Theme Name: Infocrear Theme
Theme URI: https://infocrear.com
Author: Arkana Tech
Description: Tema premium para grupo de investigación en Ciencia de la Información y Bibliotecología
Version: 1.1.0
License: GPL-2.0-or-later
Text Domain: infocrear
*/

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
  --blue-deep:    #0a0f2e;
  --blue-mid:     #1a2575;
  --blue-bright:  #2563eb;
  --blue-light:   #60a5fa;
  --red-deep:     #7f1d1d;
  --red-mid:      #dc2626;
  --red-bright:   #f87171;
  --accent-cyan:  #06b6d4;
  --accent-violet:#7c3aed;
  --white:        #ffffff;
  --off-white:    #f8faff;
  --gray-light:   #e2e8f0;
  --gray-mid:     #94a3b8;
  --gray-dark:    #334155;
  --text-primary: #0f172a;
  --text-secondary:#475569;

  --grad-main:   linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 40%, var(--red-deep) 100%);
  --grad-accent: linear-gradient(90deg, var(--blue-bright), var(--accent-violet), var(--red-mid));
  --grad-arc:    conic-gradient(from 180deg at 50% 70%, #2563eb, #7c3aed, #dc2626, #f87171, #06b6d4, #2563eb);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-card:     0 4px 32px rgba(10,15,46,0.12);
  --shadow-elevated: 0 20px 60px rgba(10,15,46,0.22);
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Compensate for fixed header on all pages */
  padding-top: 72px;
}

/* Pages that start with their own full-bleed dark section
   don't need the body padding — the section itself handles spacing */
.home,
.page-template-template-quienes-somos,
.page-template-template-historia {
  padding-top: 0;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
}
h1 { font-size: clamp(2.4rem, 6vw, 5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.2rem; }
p  { font-size: 1rem; color: var(--text-secondary); max-width: 65ch; }

.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   LAYOUT HELPERS
   ========================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section { padding: 6rem 0; }
.section--dark { background: var(--blue-deep); color: var(--white); }
.section--dark p { color: rgba(255,255,255,0.7); }

/* ==========================================
   HEADER & NAV
   ========================================== */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.2rem 0;
  transition: var(--transition);
  /* Always has a dark background so it's visible on any page */
  background: rgba(10, 15, 46, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#site-header.scrolled {
  background: rgba(10, 15, 46, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.8rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--grad-accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: white;
  font-weight: 900;
  flex-shrink: 0;
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: 0.25rem; }

.site-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  letter-spacing: 0.01em;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 1rem; right: 1rem;
  height: 2px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  border-radius: 2px;
}
.site-nav a:hover { color: var(--white); }
.site-nav a:hover::after { transform: scaleX(1); }

.nav-cta {
  background: var(--grad-accent);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  margin-left: 0.5rem;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================
   HERO — ARC ANIMATION (homepage)
   ========================================== */
.hero {
  min-height: 100vh;
  background: var(--grad-main);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  /* padding-top matches fixed header height */
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.arc-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.arc-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--grad-arc) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  animation: arcReveal 2s ease-out forwards;
}
.arc-ring:nth-child(1) { width:700px; height:700px; top:-200px; right:-100px; animation-delay:0.2s; }
.arc-ring:nth-child(2) { width:550px; height:550px; top:-130px; right: -30px; animation-delay:0.5s; border-width:1.5px; }
.arc-ring:nth-child(3) { width:400px; height:400px; top: -60px; right:  40px; animation-delay:0.8s; border-width:1px; }

.arc-glow {
  position: absolute;
  width: 600px; height: 600px;
  top: -180px; right: -120px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(37,99,235,0.25) 0%,
    rgba(124,58,237,0.15) 40%,
    rgba(220,38,38,0.1) 70%,
    transparent 100%);
  animation: glowPulse 4s ease-in-out infinite alternate;
  filter: blur(30px);
}

.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
}

.hero-content { position: relative; z-index: 2; max-width: 680px; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--blue-light);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}
.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: blink 1.5s ease-in-out infinite;
}

.hero h1 { color: var(--white); margin-bottom: 1.5rem; }
.hero h1 em { font-style: normal; display: block; }
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.scroll-indicator {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
}
.scroll-indicator::after {
  content: '';
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-accent);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(37,99,235,0.5); }

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }

/* ==========================================
   STATS BAR
   ========================================== */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  padding: 2rem 0;
  box-shadow: var(--shadow-card);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
.stat-item { padding: 1rem; }
.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================
   ABOUT / MISSION
   ========================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-visual { position: relative; }
.about-card-main {
  background: var(--grad-main);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  color: var(--white);
  position: relative; overflow: hidden;
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.about-card-main::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.about-card-float {
  position: absolute; top: -1.5rem; right: -1.5rem;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-elevated);
  font-size: 0.85rem; font-weight: 600; color: var(--blue-mid);
  border-left: 3px solid; border-image: var(--grad-accent) 1;
}

.section-tag {
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--blue-bright); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-tag::before {
  content: ''; width: 24px; height: 2px;
  background: var(--grad-accent); border-radius: 2px;
}

/* ==========================================
   PROJECTS / CARDS
   ========================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 3rem;
}
.project-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s ease;
}
.project-card:hover { border-color: transparent; box-shadow: var(--shadow-elevated); transform: translateY(-4px); }
.project-card:hover::before { transform: scaleX(1); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(220,38,38,0.1));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1.25rem;
}
.project-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.project-card p  { font-size: 0.9rem; color: var(--text-secondary); max-width: none; }

/* ==========================================
   BLOG / NEWS
   ========================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 3rem;
}
.blog-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-light);
  transition: var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-elevated); }
.blog-card-image {
  height: 180px;
  background: var(--grad-main);
  position: relative; overflow: hidden;
}
.blog-card-image::after {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-arc); opacity: 0.3;
}
.blog-category {
  position: absolute; top: 1rem; left: 1rem; z-index: 1;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem; border-radius: 100px;
}
.blog-card-body { padding: 1.5rem; }
.blog-card-body h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.blog-meta { font-size: 0.78rem; color: var(--gray-mid); margin-top: 1rem; }

/* ==========================================
   FOOTER
   ========================================== */
#site-footer {
  background: var(--blue-deep);
  color: rgba(255,255,255,0.7);
  padding: 4rem 0 2rem;
  position: relative; overflow: hidden;
}
#site-footer::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--grad-accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 2rem;
}
.footer-brand .site-logo { margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white); margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { font-size: 0.9rem; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-col a:hover { color: var(--blue-light); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: rgba(255,255,255,0.35);
}

/* ==========================================
   PAGE TEMPLATES — GENERIC INTERIOR
   ========================================== */
.page-hero {
  background: var(--grad-main);
  padding: 8rem 0 4rem;
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 60px; background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero h1 { color: var(--white); }
.page-hero p  { color: rgba(255,255,255,0.75); max-width: none; }

.page-content { padding: 4rem 0 6rem; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.prose p  { margin-bottom: 1.25rem; color: var(--text-secondary); }
.prose a  { color: var(--blue-bright); text-decoration: underline; }

/* ==========================================
   QUIÉNES SOMOS — No duplicate hero, no white gap
   ==========================================
   WordPress adds body class "page-template-{slug}" automatically.
   The slug is derived from the file path inside /templates/
   so the class will be: page-template-templates-template-quienes-somos
   We target BOTH variants to be safe.
   ========================================== */
.page-template-template-quienes-somos,
.page-template-templates-template-quienes-somos {
  /* Override body padding-top so the dark intro starts right under the header */
  padding-top: 0 !important;
}

/* Hide any WordPress-generated title or hero that appears before our content */
.page-template-template-quienes-somos .page-hero,
.page-template-templates-template-quienes-somos .page-hero,
.page-template-template-quienes-somos .entry-header,
.page-template-templates-template-quienes-somos .entry-header,
.page-template-template-quienes-somos .entry-title,
.page-template-templates-template-quienes-somos .entry-title,
.page-template-template-quienes-somos h1.page-title,
.page-template-templates-template-quienes-somos h1.page-title {
  display: none !important;
}

/* Remove any wrapper padding that creates white space */
.page-template-template-quienes-somos .page-content,
.page-template-templates-template-quienes-somos .page-content,
.page-template-template-quienes-somos .entry-content,
.page-template-templates-template-quienes-somos .entry-content,
.page-template-template-quienes-somos main,
.page-template-templates-template-quienes-somos main,
.page-template-template-quienes-somos article,
.page-template-templates-template-quienes-somos article,
.page-template-template-quienes-somos .site-content,
.page-template-templates-template-quienes-somos .site-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* The .intro dark section handles its own top-padding to clear the fixed header */
.intro {
  padding-top: 72px; /* matches header height */
}

/* ==========================================
   UTILITIES
   ========================================== */
.text-center { text-align: center; }
.text-white  { color: var(--white) !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==========================================
   ANIMATIONS
   ========================================== */
.fade-up {
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 0.7s ease forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.10s; }
.fade-up:nth-child(2) { animation-delay: 0.25s; }
.fade-up:nth-child(3) { animation-delay: 0.40s; }
.fade-up:nth-child(4) { animation-delay: 0.55s; }

.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes arcReveal {
  0%   { opacity: 0; transform: scale(0.7) rotate(-20deg); }
  60%  { opacity: 0.7; }
  100% { opacity: 0.55; transform: scale(1) rotate(0deg); }
}
@keyframes glowPulse {
  0%   { transform: scale(1) translate(0,0);       opacity: 0.7; }
  100% { transform: scale(1.1) translate(-20px,20px); opacity: 1; }
}
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes float {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollBounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(6px); }
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.3; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .about-grid    { grid-template-columns: 1fr; gap: 3rem; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid     { grid-template-columns: repeat(2, 1fr); }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .stats-inner   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { padding-top: 60px; }
  .home,
  .page-template-template-quienes-somos,
  .page-template-templates-template-quienes-somos { padding-top: 0 !important; }
  .intro { padding-top: 60px; }

  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--blue-deep);
    flex-direction: column;
    padding: 1rem 2rem; gap: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .menu-toggle { display: flex; }

  .projects-grid, .blog-grid { grid-template-columns: 1fr; }
  .footer-grid   { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .hero          { min-height: auto; padding: 6rem 0 4rem; }
  .arc-ring:nth-child(1) { width: 400px; height: 400px; }
  .stats-inner   { grid-template-columns: repeat(2, 1fr); }
}
.page-hero::after { display: none !important; }