/*
Theme Name: Fenyves Szabadegyetem
Theme URI: https://fenyvesszabadegyetem.hu
Author: You
Version: 2.0
Description: 2026 modern redesign — layered backgrounds, glassmorphism, motion. Palette & content preserved.
*/

/* =====================================================================
   DESIGN TOKENS
   ===================================================================== */
:root {
  /* --- Brand palette (unchanged) --- */
  --forest: #1a5c2f;
  --accent: #ffb703;
  --cream: #f1f7f4;
  --deep-forest: #0e3d20;
  --glass: rgba(255, 255, 255, 0.1);

  /* --- Derived tints / shades --- */
  --forest-700: #134625;
  --forest-600: #16502a;
  --forest-400: #2c7d46;
  --forest-300: #3f9a5d;
  --accent-600: #ff9500;
  --accent-300: #ffce5c;
  --ink: #0c2114;
  --ink-soft: #2c4636;

  /* --- Gradients --- */
  --grad-forest: linear-gradient(135deg, #1f6b38 0%, #0e3d20 100%);
  --grad-forest-deep: linear-gradient(160deg, #134625 0%, #0a2e18 100%);
  --grad-accent: linear-gradient(135deg, #ffce5c 0%, #ffb703 45%, #ff9500 100%);
  --grad-text: linear-gradient(120deg, #ffd874 0%, #ffb703 60%, #ff9500 100%);

  /* --- Surface / glass --- */
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-border-soft: rgba(26, 92, 47, 0.12);

  /* --- Radii --- */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* --- Shadows --- */
  --shadow-sm: 0 2px 8px rgba(14, 61, 32, 0.08);
  --shadow-md: 0 14px 40px -12px rgba(14, 61, 32, 0.28);
  --shadow-lg: 0 30px 70px -20px rgba(14, 61, 32, 0.38);
  --shadow-glow: 0 0 0 1px rgba(255, 183, 3, 0.4), 0 12px 36px -8px rgba(255, 149, 0, 0.55);

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.25s;
  --t-med: 0.45s;
  --t-slow: 0.8s;

  /* --- Layout --- */
  --header-h: 84px;
  --maxw: 1280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* =====================================================================
   BASE
   ===================================================================== */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #eef7f0;
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Layered, living background (pure CSS, no external assets) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(255, 183, 3, 0.14), transparent 60%),
    radial-gradient(55% 45% at 92% 4%, rgba(63, 154, 93, 0.18), transparent 60%),
    radial-gradient(70% 60% at 80% 88%, rgba(26, 92, 47, 0.16), transparent 65%),
    radial-gradient(60% 55% at 8% 92%, rgba(255, 149, 0, 0.10), transparent 60%),
    linear-gradient(180deg, #eefaf0 0%, #ffffff 38%, #f1f8f3 100%);
  background-attachment: fixed;
}

/* --- Faint grid texture for depth --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 61, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 61, 32, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
          mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  opacity: 0.6;
}

h1, h2, h3, h4, h5 {
  font-family: 'Sora', 'Inter', sans-serif;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

a { color: var(--forest); }

::selection {
  background: rgba(255, 183, 3, 0.35);
  color: var(--deep-forest);
}

img { max-width: 100%; }

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

/* =====================================================================
   HEADER / NAV
   ===================================================================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(13, 45, 24, 0.78), rgba(20, 70, 37, 0.62));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  color: white;
  z-index: 1000;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.45);
  transition: padding var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

/* Compact header after scrolling (toggled in JS) */
header.scrolled {
  padding: 0.4rem 1.5rem;
  background: linear-gradient(180deg, rgba(11, 38, 21, 0.92), rgba(16, 58, 31, 0.88));
  box-shadow: 0 10px 34px -14px rgba(0, 0, 0, 0.6);
}

/* Scroll progress bar (element injected by JS) */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(var(--scroll, 0));
  transform-origin: 0 50%;
  background: var(--grad-accent);
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.7);
  z-index: 1001;
  will-change: transform;
}

header strong {
  font-family: 'Sora', sans-serif;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  align-items: center;
  position: relative;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: white;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.main-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li { position: relative; list-style: none; }

.main-nav a {
  display: inline-block;
  font-size: 0.98rem;
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.main-nav a:hover,
.main-nav a:focus { color: var(--accent); }

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transition: width var(--t-med) var(--ease);
}

.main-nav a:hover::after { width: 100%; }

/* Highlighted CTA (last nav item) — default + secondary lang structures */
html body[class] nav.main-nav > ul.menu > li:last-child > a,
html body:not([class]) nav.main-nav > ul.menu > li:last-child > a,
html body[class] nav.main-nav > div.menu > ul > li:last-child > a {
  background: var(--grad-accent);
  color: #1a1a1a;
  padding: 0.55rem 1.3rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  box-shadow: 0 8px 22px -8px rgba(255, 149, 0, 0.7);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
html body[class] nav.main-nav > ul.menu > li:last-child > a::after,
html body:not([class]) nav.main-nav > ul.menu > li:last-child > a::after,
html body[class] nav.main-nav > div.menu > ul > li:last-child > a::after { display: none; }

html body[class] nav.main-nav > ul.menu > li:last-child > a:hover,
html body:not([class]) nav.main-nav > ul.menu > li:last-child > a:hover,
html body[class] nav.main-nav > div.menu > ul > li:last-child > a:hover {
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(255, 149, 0, 0.85);
}

/* =====================================================================
   GENERIC SECTIONS / GLASS CARDS
   ===================================================================== */
main { position: relative; z-index: 1; }

.hero {
  padding-top: calc(var(--header-h) + 4rem);
  padding-bottom: 5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  background: linear-gradient(120deg, var(--deep-forest), var(--forest-400));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--ink-soft);
  max-width: 700px;
  margin: 1.25rem auto 0;
  line-height: 1.65;
}

.glass-section {
  position: relative;
  max-width: 1000px;
  margin: 2.5rem auto;
  background: var(--surface);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
          backdrop-filter: blur(22px) saturate(150%);
  padding: 3rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}

/* Top sheen highlight on glass cards */
.glass-section::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

/* Soft accent glow corner */
.glass-section::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -90px;
  background: radial-gradient(circle, rgba(255, 183, 3, 0.22), transparent 70%);
  pointer-events: none;
}

.glass-section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--forest);
  margin-bottom: 2rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--deep-forest);
  margin-bottom: 1.5rem;
}

.glass-section iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

/* =====================================================================
   PARTNERS
   ===================================================================== */
.partners {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 4.5rem 2rem;
  position: relative;
  z-index: 1;
}

.partners img {
  height: 52px;
  width: auto;
  filter: grayscale(100%) opacity(0.65);
  transition: filter var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}

.partners img:hover {
  filter: grayscale(0%) opacity(1);
  transform: translateY(-4px) scale(1.04);
}

/* =====================================================================
   FOOTER
   ===================================================================== */
footer {
  background: var(--grad-forest-deep);
  color: var(--cream);
  text-align: center;
  padding: 2.5rem 0 0;
  z-index: 2;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 183, 3, 0.6), transparent);
}

footer p {
  font-family: 'Sora', sans-serif;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  opacity: 0.9;
}

.footer-art svg {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  opacity: 0.12;
  fill: var(--cream);
}

.map-embed { margin-top: 1rem; }

.map-frame {
  width: 100%;
  height: 280px;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* =====================================================================
   SCROLL-REVEAL ANIMATION UTILITIES
   (initial hidden state only applied when JS is active)
   ===================================================================== */
.has-js .reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.985);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  will-change: opacity, transform;
}

.has-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* staggered children */
.has-js .reveal[data-delay="1"] { transition-delay: 0.08s; }
.has-js .reveal[data-delay="2"] { transition-delay: 0.16s; }
.has-js .reveal[data-delay="3"] { transition-delay: 0.24s; }
.has-js .reveal[data-delay="4"] { transition-delay: 0.32s; }
.has-js .reveal[data-delay="5"] { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-js .reveal { opacity: 1 !important; transform: none !important; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   MOBILE
   ===================================================================== */
@media (max-width: 768px) {
  .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }

  header strong {
    margin: 0;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
  }

  .menu-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.6rem;
    background: linear-gradient(180deg, rgba(13, 45, 24, 0.98), rgba(16, 58, 31, 0.98));
    -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
    flex-direction: column;
    text-align: center;
    padding: 2rem 0;
    gap: 1.4rem;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease), visibility var(--t-med);
    z-index: 999;
  }

  .main-nav,
  .main-nav ul,
  .main-nav li { list-style: none; margin: 0; padding: 0; }

  .main-nav > ul > li:last-child { margin-bottom: 1rem; }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .lang-switcher {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .lang-switcher li { list-style: none; }

  .lang-switcher li a {
    font-size: 0.85rem;
    background: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    transition: none !important;
  }

  .lang-switcher li a:hover { background: none !important; color: var(--accent); }

  .glass-section { margin: 3rem 1rem; padding: 1.8rem; }
}

@media (min-width: 769px) {
  html body[class] nav.main-nav,
  html body:not([class]) nav.main-nav,
  html body[class] nav.main-nav.open,
  html body:not([class]) nav.main-nav.open {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    transform: none !important;
    max-height: none !important;
    gap: 2rem;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
  }

  html body[class] nav.main-nav > ul.menu,
  html body:not([class]) nav.main-nav > ul.menu,
  html body[class] nav.main-nav > div.menu > ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 1.6rem;
    margin: 0;
    padding: 0;
  }

  html body[class] .menu-toggle,
  html body:not([class]) .menu-toggle { display: none !important; }

  html body[class] nav.main-nav > ul.menu > li,
  html body:not([class]) nav.main-nav > ul.menu > li,
  html body[class] nav.main-nav > div.menu > ul > li {
    list-style: none;
    margin-bottom: 0;
    position: relative;
  }

  html body[class] nav.main-nav > ul.menu > li > a,
  html body:not([class]) nav.main-nav > ul.menu > li > a,
  html body[class] nav.main-nav > div.menu > ul > li > a {
    display: block;
    padding: 0.5rem 0.4rem;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
  }

  html body[class] nav.main-nav > ul.menu > li > a:hover,
  html body:not([class]) nav.main-nav > ul.menu > li > a:hover,
  html body[class] nav.main-nav > div.menu > ul > li > a:hover {
    color: var(--accent);
  }

  html body[class] nav.main-nav > ul.menu > li > a::after,
  html body:not([class]) nav.main-nav > ul.menu > li > a::after,
  html body[class] nav.main-nav > div.menu > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-accent);
    transition: width var(--t-med) var(--ease);
  }
  html body[class] nav.main-nav > ul.menu > li > a:hover::after,
  html body:not([class]) nav.main-nav > ul.menu > li > a:hover::after,
  html body[class] nav.main-nav > div.menu > ul > li > a:hover::after { width: 100%; }

  /* Desktop language switcher */
  .lang-switcher {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start;
    margin: 0 !important;
    padding: 0 0 0 1.2rem !important;
    margin-left: 0.6rem !important;
    gap: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }

  .lang-switcher li {
    display: block !important;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .lang-switcher li a {
    display: block;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    margin: 0 !important;
    line-height: 1.3;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color var(--t-fast) var(--ease) !important;
  }

  .lang-switcher li a:hover { background: none !important; color: var(--accent); }

  .lang-switcher .current-lang a {
    background: none !important;
    color: white !important;
    font-weight: 700 !important;
  }

  /* Header logo */
  .site-logo-link {
    display: inline-flex;
    align-items: center;
    margin-right: 0;
  }

  .site-logo {
    height: 64px;
    width: auto;
    vertical-align: middle;
    transition: height var(--t-fast) var(--ease);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  }

  header.scrolled .site-logo { height: 48px; }
}

/* =====================================================================
   INTERIOR PAGE CLEARANCE UNDER FIXED HEADER
   (home hero is full-bleed and intentionally sits under the header)
   ===================================================================== */
main:has(.glass-section) { padding-top: calc(var(--header-h) + 1.5rem); }
main.program-page:has(.glass-section) { padding-top: 0; }

/* =====================================================================
   CONTACT PAGE
   ===================================================================== */
.contact-content-area { text-align: left; }
.contact-content-area .container { display: block; }

.contact-details-area h2,
.contact-map-area h2 {
  color: var(--forest);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 1.25rem;
}

.contact-info-item {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-md);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.contact-info-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.contact-info-item strong {
  display: block;
  font-family: 'Sora', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--accent-600);
  margin-bottom: 0.45rem;
}

.contact-info-item address { font-style: normal; color: var(--ink-soft); line-height: 1.65; }
.contact-info-item p { margin: 0; }
.contact-info-item a { color: var(--forest); font-weight: 600; text-decoration: none; }
.contact-info-item a:hover { color: var(--accent-600); }

.social-media-links p { display: inline-block; margin: 0.3rem 0.4rem 0 0; }
.social-media-links a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(26, 92, 47, 0.08);
  font-weight: 600;
  transition: all var(--t-fast) var(--ease);
}
.social-media-links a:hover {
  background: var(--grad-accent);
  color: #1a1a1a;
  transform: translateY(-2px);
}

.map-responsive {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--glass-border);
}
.map-responsive iframe { display: block; width: 100%; }

.contact-image {
  width: 100%;
  height: auto;
  margin-top: 1.5rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

.contact-additional-content { color: var(--ink-soft); line-height: 1.7; margin: 1rem 0 2rem; }
