/* ============================================================
   FOSSATI CONSULTING SAGL — style.css
   Colors: Ticino flag — Blue #268BCC + Red #E8423F
   Single page scrollable, mobile-first, 7 languages + RTL
   ============================================================ */

@import url('fonts/fonts.css');

/* ---- Variables -------------------------------------------- */
:root {
  --blue:       #268BCC;
  --blue-dark:  #1a6399;
  --blue-deeper:#0f3d5c;
  --red:        #E8423F;
  --red-dark:   #c43330;
  --white:      #FFFFFF;
  --off-white:  #F8F6F2;
  --gray-light: #E8E4DE;
  --gray:       #8A8275;
  --text:       #1A1614;
  --text-light: #5A5249;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Barlow', sans-serif;
  --font-logo:    'Agency FB', 'Arial Narrow', Arial, sans-serif;

  --max-w:  1100px;
  --radius: 2px;
  --shadow: 0 4px 24px rgba(38,139,204,0.15);
  --trans:  0.3s ease;
  --nav-h:  70px;
}

/* ---- Reset ------------------------------------------------- */
*, *::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); background: var(--white); line-height: 1.7; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
strong { font-weight: 600; }
em { font-style: italic; }

/* ---- RTL --------------------------------------------------- */
body.rtl { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; text-align: right; }
body.rtl .nav-links { flex-direction: row-reverse; }
body.rtl .lang-switcher { margin-right: auto; margin-left: 0; }
body.rtl .hero-content { text-align: right; }
body.rtl .hero-eyebrow { border-left: none; border-right: 3px solid var(--red); padding-left: 0; padding-right: 0.75rem; }
body.rtl .hero-divider { margin-right: 0; }
body.rtl .section-divider { margin-right: 0; }
body.rtl .step-item { border-left: none; border-right: 3px solid var(--red); flex-direction: row-reverse; }
body.rtl .step-item:hover { transform: translateX(-4px); }
body.rtl .bullet-item { flex-direction: row-reverse; }
body.rtl .bullet-item::before { content: '◂'; }
body.rtl .footer-inner { flex-direction: row-reverse; }

/* ---- Navbar ----------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--blue-deeper);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
  transition: background var(--trans);
}
.navbar.scrolled { background: var(--blue-deeper); }

/* Logo */
.nav-brand {
  font-family: var(--font-logo);
  line-height: 1.15;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand .logo-name { font-size: 1.43rem; font-weight: bold; letter-spacing: 0.05em; }
.nav-brand .logo-grey  { color: #aaa; }
.nav-brand .logo-red   { color: var(--red); }
.nav-brand .logo-blue  { color: var(--blue); }
.nav-brand .logo-sub   { font-size: 0.9rem; color: #aaa; letter-spacing: 0.04em; display: block; }
.nav-brand .logo-addr  { font-size: 0.66rem; color: #aaa; display: block; letter-spacing: 0.02em; line-height: 1.3; }

.nav-links {
  display: flex;
  list-style: none;
  margin: 0 auto 0 2rem;
  align-items: center;
}
.nav-links a {
  display: block;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  border-bottom: 2px solid transparent;
  transition: color var(--trans), border-color var(--trans);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); border-bottom-color: var(--red); }

/* Language switcher */
.lang-switcher {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.lang-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
  opacity: 0.65;
  transition: opacity var(--trans), transform var(--trans);
  display: flex;
  align-items: center;
}
.lang-btn:hover { opacity: 1; transform: scale(1.15); }
.lang-btn.active { opacity: 1; }
.lang-flag-svg {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.lang-btn .lang-tooltip {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue-deeper);
  color: var(--white);
  font-size: 0.65rem;
  font-family: var(--font-body);
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(255,255,255,0.15);
}
.lang-btn:hover .lang-tooltip { opacity: 1; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  background: none;
  border: none;
  flex-shrink: 0;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: all var(--trans); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero -------------------------------------------------- */
.hero {
  position: relative;
  height: 100svh;
  height: 100vh; /* fallback */
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 5rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: transform 8s ease;
}
.hero.loaded .hero-bg { transform: scale(1); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15,61,92,0.25) 0%, rgba(15,61,92,0.5) 50%, rgba(15,61,92,0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
  border-left: 3px solid var(--red);
  padding-left: 0.75rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  max-width: 550px;
}
.hero-divider { width: 60px; height: 2px; background: var(--red); margin: 1.5rem 0; }

/* ---- Sections --------------------------------------------- */
.section { padding: 5rem 2rem; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-alt   { background: var(--off-white); }
.section-dark  { background: var(--blue-deeper); color: var(--white); }

.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 1rem;
}
.section-dark .section-label { color: var(--red); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--blue-deeper);
}
.section-dark .section-title { color: var(--white); }

.section-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-light);
  max-width: 780px;
}
.section-body + .section-body { margin-top: 1.25rem; }
.section-dark .section-body { color: rgba(255,255,255,0.82); }

.section-divider { width: 40px; height: 2px; background: var(--red); margin: 1rem 0 2rem; }
.section-dark .section-divider { background: var(--red); }

/* two-col */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.col-img { border-radius: var(--radius); overflow: hidden; }
.col-img img { width: 100%; height: 340px; object-fit: cover; display: block; transition: transform 0.6s ease; }
.col-img:hover img { transform: scale(1.04); }

/* ---- Framework cards -------------------------------------- */
.fw-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 3rem; }
.fw-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  padding: 2rem 1.75rem;
  position: relative;
  transition: box-shadow var(--trans), transform var(--trans);
  border-top: 3px solid var(--red);
}
.fw-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.fw-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--blue-deeper);
  margin-bottom: 0.75rem;
}
.fw-card p { font-size: 0.92rem; color: var(--text-light); line-height: 1.75; }

/* ---- Team cards ------------------------------------------- */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 2rem; }
.team-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  padding: 1.75rem 1.5rem;
  border-top: 3px solid var(--blue);
  transition: box-shadow var(--trans), transform var(--trans);
}
.team-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.team-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; color: var(--blue-deeper); margin-bottom: 0.2rem; }
.team-role { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--red); margin-bottom: 0.75rem; }
.team-bio  { font-size: 0.88rem; color: var(--text-light); line-height: 1.65; font-style: italic; }

/* Collaborators */
.collab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 2rem; }
.collab-card {
  padding: 1.5rem;
  background: var(--off-white);
  border-left: 3px solid var(--red);
}
body.rtl .collab-card { border-left: none; border-right: 3px solid var(--red); }
.collab-role { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-deeper); margin-bottom: 0.4rem; }
.collab-bio  { font-size: 0.88rem; color: var(--text-light); line-height: 1.65; }

/* External / Network */
.ext-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 2rem; }
.ext-card {
  padding: 1.5rem;
  background: rgba(255,255,255,0.07);
  border-left: 3px solid var(--red);
}
body.rtl .ext-card { border-left: none; border-right: 3px solid var(--red); }
.ext-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.9); margin-bottom: 0.4rem; }
.ext-body  { font-size: 0.88rem; color: rgba(255,255,255,0.7); line-height: 1.65; }

.country-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.country-list li {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ---- Contact section -------------------------------------- */
.contact-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.contact-block h3 { text-align: center; }
.contact-block p,
.contact-block address { text-align: center; }
.email-reveal { margin: 0.5rem auto 0; }
.contact-block { margin-bottom: 2rem; }
.contact-block h3 {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.contact-block p, .contact-block address { font-size: 0.97rem; color: var(--text-light); line-height: 1.7; font-style: normal; }

.email-reveal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--blue-deeper);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--trans);
  margin-top: 0.5rem;
}
.email-reveal:hover { background: var(--red); }
.email-reveal::before { content: '✉'; font-size: 1rem; }

.contact-map { height: 360px; border-radius: var(--radius); overflow: hidden; }
.contact-map iframe { width: 100%; height: 100%; border: none; }

/* ---- Footer ----------------------------------------------- */
.footer {
  background: var(--blue-deeper);
  color: rgba(255,255,255,0.55);
  padding: 3rem 2rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand {
  font-family: var(--font-logo);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.footer-brand .logo-name { font-size: 1.2rem; font-weight: bold; }
.footer-brand .logo-grey  { color: #aaa; }
.footer-brand .logo-red   { color: var(--red); }
.footer-brand .logo-blue  { color: var(--blue); }
.footer-brand .logo-sub   { font-size: 0.8rem; color: #888; display: block; }
.footer-legal {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.7;
  margin-top: 0.5rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.5); transition: color var(--trans); }
.footer-links a:hover { color: var(--red); }
.footer-copy {
  font-size: 0.68rem;
  max-width: var(--max-w);
  margin: 1.25rem auto 0;
  text-align: center;
  color: rgba(255,255,255,0.25);
}

/* ---- Cookie banner ---------------------------------------- */
#cookie-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2000;
  background: var(--blue-deeper);
  color: rgba(255,255,255,0.85);
  padding: 1.25rem 2rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  border-top: 2px solid var(--red);
}
#cookie-banner p { font-size: 0.82rem; line-height: 1.6; flex: 1; min-width: 200px; }
#cookie-banner a { color: var(--blue); text-decoration: underline; }
.cookie-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.cookie-btn {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--trans);
  border: none;
}
.cookie-btn-accept { background: var(--red); color: var(--white); }
.cookie-btn-accept:hover { background: var(--red-dark); }
.cookie-btn-close { background: transparent; color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.3); }
.cookie-btn-close:hover { color: var(--white); border-color: var(--white); }

/* ---- Scroll animations ------------------------------------ */
.animate { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate.delay-1 { transition-delay: 0.1s; }
.animate.delay-2 { transition-delay: 0.2s; }
.animate.delay-3 { transition-delay: 0.3s; }
.animate.delay-4 { transition-delay: 0.4s; }
.animate.visible { opacity: 1; transform: none; }

/* ---- Utility ---------------------------------------------- */
.text-center { text-align: center; }
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--red);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background var(--trans), transform var(--trans);
  margin-top: 1.5rem;
}
.btn:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 1050px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--blue-deeper);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  .nav-links.open { max-height: 500px; }
  .nav-links a { padding: 0.85rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.88rem; }

  .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .col-img { order: 2; }
  .col-img img { height: 240px; }

  .fw-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .collab-grid { grid-template-columns: 1fr; }
  .ext-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .footer-inner { flex-direction: column; }

  #cookie-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  :root { --nav-h: 60px; }
  .navbar { padding: 0 1rem; }
  .nav-brand .logo-addr { display: none; }
  .lang-switcher select { font-size: 0.7rem; padding: 0.25rem 1.5rem 0.25rem 0.5rem; }

  .hero { min-height: 440px; max-height: none; height: 88vh; }
  .hero-content { padding: 0 1.25rem; }

  .section { padding: 3.5rem 1.25rem; }
  .team-grid { grid-template-columns: 1fr; }
  .footer { padding: 2rem 1.25rem 1.25rem; }
  #cookie-banner { padding: 1rem 1.25rem; }
  .cookie-actions { width: 100%; }
  .cookie-btn { flex: 1; text-align: center; }
}
