/* ==============================================
   style.css — EuropiaTech homepage styles
   ============================================== */

/* ===== Base ===== */
body {
  background: #0a0a0b;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ===== Gradient text ===== */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==============================================
   MOBILE-FIRST (<768px)
   ============================================== */

/* Hero — tighter on small screens */
@media (max-width: 767px) {
  /* Reduce hero vertical padding */
  .hero-section {
    padding-top: 6.5rem;
    padding-bottom: 3rem;
  }

  .hero-section h1 {
    font-size: 2.5rem;
    line-height: 1.15;
  }

  .hero-section .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* Cards — full-width, reduced padding */
  .article-card .p-6 {
    padding: 1.25rem;
  }

  /* Featured card — stack vertically */
  .article-card .md\:flex {
    display: block;
  }

  /* Sections — tighter vertical rhythm */
  .section-block {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Footer — stack and center */
  footer .flex.items-center.gap-6 {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  /* Lighter reveal animation on mobile */
  [data-reveal] {
    transform: translateY(16px);
  }

  /* Disable card hover lift on touch */
  .article-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Disable button lift on touch */
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ==============================================
   DESKTOP (≥768px)
   ============================================== */
@media (min-width: 768px) {
  /* Hero — generous spacing */
  .hero-section {
    padding-top: 9rem;
    padding-bottom: 5rem;
  }

  .hero-section h1 {
    font-size: clamp(3.5rem, 6vw, 5rem);
  }

  /* Article grid — wider gaps */
  .articles-grid {
    gap: 2rem;
  }

  /* Featured card — horizontal layout min-height */
  .card-featured .card-bg {
    min-height: 280px;
  }

  /* Sections — generous vertical rhythm */
  .section-block {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

/* ==============================================
   LARGE DESKTOP (≥1024px)
   ============================================== */
@media (min-width: 1024px) {
  .hero-section {
    padding-top: 10rem;
    padding-bottom: 6rem;
  }

  .articles-grid {
    gap: 2.5rem;
  }
}

/* ==============================================
   FOCUS VISIBLE — keyboard accessibility
   ============================================== */
.article-card:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 4px;
  border-radius: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* ==============================================
   NEWSLETTER INPUT — enhanced states
   ============================================== */
#email-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#email-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==============================================
   FOOTER LINKS — hover underline
   ============================================== */
footer a:not(.font-serif):not([aria-label]) {
  position: relative;
}

footer a:not(.font-serif):not([aria-label])::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #6366f1;
  transition: width 0.3s ease;
}

footer a:not(.font-serif):not([aria-label]):hover::after {
  width: 100%;
}

/* ==============================================
   SCROLL REVEAL SYSTEM
   ============================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }

/* ==============================================
   ARTICLE CARDS
   ============================================== */
.article-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.15);
}

.card-icon {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .card-icon {
  transform: scale(1.2) rotate(2deg);
}

.card-bg {
  transition: opacity 0.5s ease;
  opacity: 1;
}

.article-card:hover .card-bg {
  opacity: 0.65;
}

/* ==============================================
   CTA BUTTONS
   ============================================== */
.btn-primary {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ==============================================
   MOBILE MENU
   ============================================== */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
  opacity: 0;
}

#mobile-menu.menu-open {
  max-height: 320px;
  opacity: 1;
}

/* ==============================================
   NEWSLETTER MESSAGES
   ============================================== */
.form-msg {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(8px);
}

.form-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==============================================
   SOCIAL ICONS
   ============================================== */
.social-icon {
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon:hover {
  color: #6366f1;
  transform: translateY(-2px);
}

/* ==============================================
   NAV ACTIVE LINK
   ============================================== */
nav a.nav-active {
  color: #fff;
  position: relative;
}

nav a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: #6366f1;
  border-radius: 1px;
}

/* ==============================================
   SPINNER
   ============================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 0.6s linear infinite;
}

/* ==============================================
   REDUCED MOTION
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .article-card,
  .btn-primary,
  .btn-secondary,
  .card-icon,
  .card-bg,
  .social-icon {
    transition: none;
  }

  .article-card:hover {
    transform: none;
  }
}
