/*
 Theme Name:   Elkartenet Child
 Theme URI:    https://elkartenet.eus
 Description:  Astra child theme for Elkartenet — cooperative network website.
               Contains all shared design tokens and utility classes so
               Elementor templates only need layout, not styling.
 Author:       Elkartenet
 Author URI:   https://elkartenet.eus
 Template:     astra
 Version:      1.0.0
 Text Domain:  elkartenet-child
*/

/* ==========================================================================
   0. GOOGLE FONTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS  (CSS Custom Properties)
   ========================================================================== */

:root {
  /* --- Colors ----------------------------------------------------------- */
  --teal:      #2AA198;
  --green:     #4CAF50;
  --cyan:      #00BCD4;
  --dark:      #1a1a2e;
  --text:      #333333;
  --text-light:#5a6672;
  --bg-white:  #ffffff;
  --bg-off:    #f8f9fa;
  --bg-tint:   #f0faf8;

  /* Translucent variants */
  --teal-10:   rgba(42, 161, 152, 0.1);
  --teal-20:   rgba(42, 161, 152, 0.2);
  --green-10:  rgba(76, 175, 80, 0.1);
  --cyan-10:   rgba(0, 188, 212, 0.08);

  /* --- Typography ------------------------------------------------------- */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* --- Spacing & Sizing ------------------------------------------------- */
  --section-padding:  80px 0;
  --card-radius:      12px;
  --btn-radius:       8px;
  --transition-base:  0.3s ease;
  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md:        0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-lg:        0 16px 48px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   2. BASE TYPOGRAPHY
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.05rem, 2vw, 1.25rem); }

p {
  margin-bottom: 1.2em;
  color: var(--text);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover,
a:focus {
  color: var(--green);
}

/* ==========================================================================
   3. HERO SECTION  (.ek-hero)
   ========================================================================== */

.ek-hero {
  position: relative;
  width: 100%;
  min-height: 540px;
  display: flex;
  align-items: center;
  background-color: var(--dark);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  color: var(--bg-white);
}

/* Dark overlay — apply to ::before so background image shows through */
.ek-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 46, 0.92) 0%,
    rgba(42, 161, 152, 0.35) 100%
  );
  z-index: 1;
}

.ek-hero > * {
  position: relative;
  z-index: 2;
}

.ek-hero h1 {
  color: var(--bg-white);
  font-weight: 800;
  margin-bottom: 0.4em;
}

.ek-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.125rem;
  max-width: 640px;
}

/* ==========================================================================
   4. SECTION LABEL & TITLE
   ========================================================================== */

/* Small uppercase teal label with a short line before it */
.ek-section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.ek-section-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background-color: var(--teal);
  border-radius: 2px;
}

/* Large heading used as section title */
.ek-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.6em;
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

/* Shared base for all .ek-btn-* buttons */
.ek-btn-primary,
.ek-btn-outline,
.ek-btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--btn-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
  text-decoration: none;
  line-height: 1;
}

/* Primary — solid teal */
.ek-btn-primary {
  background-color: var(--teal);
  color: var(--bg-white);
  border-color: var(--teal);
}

.ek-btn-primary:hover,
.ek-btn-primary:focus {
  background-color: #239089;
  border-color: #239089;
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(42, 161, 152, 0.35);
  transform: translateY(-1px);
}

/* Outline — transparent with teal border */
.ek-btn-outline {
  background-color: transparent;
  color: var(--teal);
  border-color: var(--teal);
}

.ek-btn-outline:hover,
.ek-btn-outline:focus {
  background-color: var(--teal);
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(42, 161, 152, 0.25);
  transform: translateY(-1px);
}

/* CTA — dark background */
.ek-btn-cta {
  background-color: var(--dark);
  color: var(--bg-white);
  border-color: var(--dark);
}

.ek-btn-cta:hover,
.ek-btn-cta:focus {
  background-color: #2c2c4a;
  border-color: #2c2c4a;
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.30);
  transform: translateY(-1px);
}

/* ==========================================================================
   6. CARDS  (.ek-card)
   ========================================================================== */

.ek-card {
  background: var(--bg-white);
  border: 1px solid #e8ecf0;
  border-radius: var(--card-radius);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

/* Teal top border — starts hidden, slides in on hover */
.ek-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.ek-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.ek-card:hover::before {
  transform: scaleX(1);
}

.ek-card h3,
.ek-card h4 {
  color: var(--dark);
}

.ek-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ==========================================================================
   7. STAT CARD  (.ek-stat-card)
   ========================================================================== */

.ek-stat-card {
  text-align: center;
  padding: 28px 20px;
}

.ek-stat-card .ek-stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
  margin-bottom: 6px;
}

.ek-stat-card .ek-stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   8. TAGS / PILLS  (.ek-tag)
   ========================================================================== */

.ek-tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 50px;
  background-color: var(--teal-10);
  color: var(--teal);
  text-transform: uppercase;
  line-height: 1.6;
}

/* Variant colors — add modifier class alongside .ek-tag */
.ek-tag--green {
  background-color: var(--green-10);
  color: var(--green);
}

.ek-tag--cyan {
  background-color: var(--cyan-10);
  color: var(--cyan);
}

/* ==========================================================================
   9. PROJECT TAG  (.ek-project-tag)
   ========================================================================== */

.ek-project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background-color: var(--teal-10);
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   10. BLOCKQUOTE / QUOTE  (.ek-quote)
   ========================================================================== */

/* Designed for use on dark backgrounds */
.ek-quote {
  position: relative;
  padding: 28px 32px 28px 40px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  border-left: 3px solid var(--teal);
}

.ek-quote cite,
.ek-quote footer {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--teal);
}

/* ==========================================================================
   11. CTA BAND  (.ek-cta-band)
   ========================================================================== */

.ek-cta-band {
  width: 100%;
  padding: 60px 0;
  background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
  text-align: center;
  color: var(--bg-white);
}

.ek-cta-band h2,
.ek-cta-band h3 {
  color: var(--bg-white);
}

.ek-cta-band p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   12. INFO BOX  (.ek-info-box)
   ========================================================================== */

.ek-info-box {
  background-color: var(--bg-tint);
  border: 1px solid var(--teal-20);
  border-left: 4px solid var(--teal);
  border-radius: var(--btn-radius);
  padding: 24px 28px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

.ek-info-box strong {
  color: var(--dark);
}

/* ==========================================================================
   13. TIMELINE  (.ek-timeline)
   ========================================================================== */

.ek-timeline {
  position: relative;
  padding-left: 32px;
}

/* Vertical line */
.ek-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 11px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--teal), var(--cyan));
  border-radius: 2px;
}

.ek-timeline-item {
  position: relative;
  padding-bottom: 36px;
}

.ek-timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot */
.ek-timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--bg-white);
  border: 3px solid var(--teal);
  z-index: 1;
  transition: background-color var(--transition-base);
}

.ek-timeline-item:hover::before {
  background-color: var(--teal);
}

.ek-timeline-item h4 {
  margin-bottom: 4px;
}

.ek-timeline-item p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* ==========================================================================
   14. ANIMATION — REVEAL ON SCROLL  (.ek-reveal)
   ========================================================================== */

/*
 * Usage: Add .ek-reveal to any element. In Elementor, pair with
 * Motion Effects > Scrolling > Transparency, or use a lightweight
 * JS IntersectionObserver that adds .ek-visible when the element
 * enters the viewport.
 */

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

.ek-reveal.ek-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays — add .ek-delay-1 through .ek-delay-4 for cascading */
.ek-reveal.ek-delay-1 { transition-delay: 0.1s; }
.ek-reveal.ek-delay-2 { transition-delay: 0.2s; }
.ek-reveal.ek-delay-3 { transition-delay: 0.3s; }
.ek-reveal.ek-delay-4 { transition-delay: 0.4s; }

/* ==========================================================================
   15. HEADER OVERRIDES — GLASSMORPHIC STICKY HEADER
   ========================================================================== */

/*
 * Works with Astra's sticky header or a sticky-header plugin.
 * The .header-scrolled class is expected to be toggled by JS
 * when the user scrolls past a threshold (e.g. 60 px).
 */

.site-header,
#masthead {
  transition:
    background-color 0.4s ease,
    backdrop-filter 0.4s ease,
    box-shadow 0.4s ease;
}

/* Glassmorphic state on scroll */
.site-header.header-scrolled,
#masthead.header-scrolled {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* Keep nav links teal-accented */
.main-navigation a,
.ast-header-sections-navigation a {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--dark);
  transition: color var(--transition-base);
}

.main-navigation a:hover,
.ast-header-sections-navigation a:hover {
  color: var(--teal);
}

/* Active / current page link */
.main-navigation .current-menu-item > a {
  color: var(--teal);
}

/* ==========================================================================
   16. FOOTER OVERRIDES  (Elementor footer on dark background)
   ========================================================================== */

footer.site-footer,
.ast-footer-overlay,
.site-footer {
  background-color: var(--dark) !important;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer h4,
.site-footer .widget-title {
  color: var(--bg-white);
  font-family: var(--font-display);
  font-weight: 600;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-base);
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--teal);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.55);
}

/* Footer bottom bar / copyright area */
.ast-small-footer,
.site-footer .ast-small-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   17. ELEMENTOR INTEGRATION HELPERS
   ========================================================================== */

/* Remove default Elementor widget margins when inside ek- containers */
.ek-card .elementor-widget:last-child,
.ek-info-box .elementor-widget:last-child {
  margin-bottom: 0;
}

/* Ensure Elementor sections using ek- classes stretch full width */
.ek-hero.elementor-section,
.ek-cta-band.elementor-section {
  width: 100vw;
  max-width: 100vw;
}

/* ==========================================================================
   18. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

/* --- Tablet (max 1024px) ------------------------------------------------ */
@media (max-width: 1024px) {
  :root {
    --section-padding: 60px 0;
  }

  .ek-hero {
    min-height: 420px;
  }

  .ek-card {
    padding: 24px 22px;
  }

  .ek-cta-band {
    padding: 48px 0;
  }
}

/* --- Mobile (max 767px) ------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --section-padding: 40px 0;
  }

  body {
    font-size: 15px;
  }

  .ek-hero {
    min-height: 360px;
    padding: 60px 16px;
  }

  .ek-hero p {
    font-size: 1rem;
  }

  .ek-btn-primary,
  .ek-btn-outline,
  .ek-btn-cta {
    padding: 12px 24px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }

  .ek-card {
    padding: 20px 18px;
  }

  .ek-stat-card .ek-stat-number {
    font-size: 2rem;
  }

  .ek-quote {
    padding: 20px 20px 20px 24px;
    font-size: 1rem;
  }

  .ek-timeline {
    padding-left: 28px;
  }

  .ek-timeline::before {
    left: 9px;
  }

  .ek-timeline-item::before {
    left: -28px;
    width: 18px;
    height: 18px;
  }

  .ek-section-title {
    font-size: 1.5rem;
  }

  .ek-cta-band {
    padding: 36px 0;
  }
}

/* --- Small Mobile (max 480px) ------------------------------------------- */
@media (max-width: 480px) {
  .ek-hero {
    min-height: 300px;
  }

  .ek-section-label {
    font-size: 0.72rem;
  }

  .ek-section-label::before {
    width: 20px;
  }
}
