/*
 * Make IT STEM — shared styles, loaded on every page (both languages).
 *
 * Page-specific rules live in assets/css/pages/<name>.css and are listed at the
 * top of each page template (src/pages/<lang>/<page>.html) via `styles`.
 * Anything used by more than one page belongs here.
 */

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

:root {
  --green: #1CAA5A;
  --blue: #1B3A7D;
  --yellow: #FFD700;
  --cyan: #00D4FF;
  --navy: #162242;
  --navy-mid: #1e3060;
  --off-white: #f5f4f0;
  --card-white: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #52556a;
  --text-light: #8b8ea0;
  --border: #e2e3e8;
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --nav-height: 64px;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--body);
  color: var(--text-primary);
  background: var(--off-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* ── SKIP LINK (keyboard users jump past the nav) ── */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 300;
  background: var(--yellow); color: var(--navy);
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
  padding: 0.6rem 1rem; border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(22, 34, 66, 0.97);
  backdrop-filter: blur(10px);
  padding: 0 2rem;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center;
  color: #fff;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--green); }
.nav-logo svg { display: block; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a svg { flex-shrink: 0; opacity: 0.85; }
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: #fff; }
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: inline-flex; align-items: center; gap: 0.3rem; }
.nav-dropdown > a::after {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
}
.dropdown-menu {
  position: absolute; top: 100%; left: 0;
  min-width: 210px;
  background: var(--navy-mid);
  border-radius: 8px;
  padding: 0.5rem 0;
  margin-top: 0.6rem;
  list-style: none;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 200;
}
/* Invisible bridge so the menu doesn't close while the pointer crosses the gap. */
.dropdown-menu::before {
  content: '';
  position: absolute; left: 0; right: 0; top: -0.6rem;
  height: 0.6rem;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu a {
  display: inline-flex;
  width: 100%;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.dropdown-menu a:hover { background: rgba(255,255,255,0.08); }
.nav-cta {
  color: var(--green) !important;
  font-weight: 600 !important;
}
.nav-cta:hover { color: #fff !important; }
.nav-gift {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--yellow) !important;
}
.nav-gift:hover { color: #fff !important; }

/* Language switcher: a small EN | IT segmented control at the end of the nav. */
.nav-lang {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  overflow: hidden;
}
.nav-lang a {
  padding: 0.2rem 0.55rem;
  font-family: var(--display);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
}
.nav-lang a + a { border-left: 1px solid rgba(255,255,255,0.25); }
.nav-lang a[aria-current="true"] {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── SHARED SECTION PIECES ── */
.section-inner { max-width: 1100px; margin: 0 auto; }
.content-section { background: var(--card-white); }

/* Navy banner at the top of inner pages (blog, testimonials, legal, …). */
.page-header {
  background: var(--navy);
  padding: 8rem 2rem 4rem;
  text-align: center;
  margin-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; top: -40%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(28,170,90,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.page-header h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.page-header p {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.page-header .meta {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* ── SECTION HEADINGS (home, testimonials) ── */
.section-label {
  font-family: var(--display);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 3rem;
}

/* ── TESTIMONIAL CARDS (home, testimonials) ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}
.testimonial-card {
  background: var(--off-white);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--border);
}
.testimonial-stars {
  color: var(--yellow);
  font-size: 1rem;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}
.testimonial-card blockquote {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.2rem;
  font-style: italic;
}
.testimonial-author {
  display: flex; align-items: center; gap: 0.75rem;
}
.author-avatar {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700; font-size: 0.85rem;
  color: var(--yellow);
  overflow: hidden;
}
.testimonial-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 8px;
  margin-bottom: 1.2rem;
}
.author-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.author-info strong {
  display: block;
  font-size: 0.88rem; font-weight: 600;
}
.author-info span {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Two form fields side by side; stacks on narrow screens. */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

/* ── FOOTER ── */
footer {
  background: var(--navy);
  padding: 3rem 2rem 2rem;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: center;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-links { display: flex; gap: 0.6rem 1.5rem; list-style: none; flex-wrap: wrap; justify-content: center; }
.footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none; font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-legal { display: block; margin-top: 0.6rem; }
.footer-legal a { color: rgba(255,255,255,0.62); text-decoration: underline; }
.footer-policies { display: block; margin-top: 0.6rem; }
.footer-policies a { color: rgba(255,255,255,0.62); text-decoration: none; transition: color 0.2s; }
.footer-policies a:hover { color: #fff; }

/* ── RESPONSIVE ── */
/* The inline script in src/templates/partials/nav.html adds .is-tight when the
   links only fit with less spacing, and .is-compact when they don't fit at all. */
nav.is-tight { padding: 0 1.25rem; }
nav.is-tight .nav-links { gap: 1rem; }

nav.is-compact .nav-links { display: none; }
nav.is-compact .hamburger { display: flex; }
nav.is-compact .nav-links.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: var(--nav-height); left: 0; right: 0;
  background: var(--navy);
  padding: 1.5rem 2rem;
  gap: 1rem;
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
nav.is-compact .dropdown-menu {
  position: static;
  opacity: 1; visibility: visible; transform: none;
  background: rgba(255,255,255,0.05);
  box-shadow: none;
  margin-top: 0.5rem;
  padding-left: 0.5rem;
}
nav.is-compact .dropdown-menu::before { display: none; }
nav.is-compact .nav-lang { align-self: flex-start; }

@media (max-width: 992px) {
  .page-header { padding: 6rem 1.5rem 3rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
