/*
Theme Name: COSY-IFAC
Theme URI: https://cosy-ifac.org
Author: DSFG e.V.
Description: Custom theme reproducing the COSY-IFAC static site design.
Version: 1.1
Text Domain: cosy-ifac
*/

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

:root {
  --navy:   #1e3264;
  --navy2:  #162854;
  --teal:   #3dbfa0;
  --teal2:  #2ea88a;
  --gold:   #e8a020;
  --light:  #f4f7fb;
  --white:  #ffffff;
  --text:   #1a1a2e;
  --muted:  #5a6a8a;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(30,50,100,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
  height: 68px;
}
nav .brand img { height: 38px; display: block; }
nav ul { list-style: none; display: flex; gap: 2rem; }
nav ul a {
  text-decoration: none; font-size: 0.85rem; font-weight: 500;
  color: var(--navy); letter-spacing: 0.04em; text-transform: uppercase;
  transition: color 0.2s;
}
nav ul a:hover { color: var(--teal); }
nav ul a.active { color: var(--teal); }
nav .nav-cta {
  background: var(--navy); color: var(--white);
  border: none; border-radius: 4px;
  padding: 0.5rem 1.2rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.05em; text-transform: uppercase;
  transition: background 0.2s;
}
nav .nav-cta:hover { background: var(--teal); }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 32px; height: 32px; background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: var(--navy);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile-extra { display: none; }
.lang-switch { margin-left: 1.5rem; }
.lang-switch select {
  background: var(--white); border: 1px solid rgba(30,50,100,0.2);
  color: var(--navy); font-size: 0.72rem; font-weight: 600;
  padding: 0.35rem 1.6rem 0.35rem 0.7rem; border-radius: 4px; cursor: pointer;
  letter-spacing: 0.04em; text-transform: uppercase; transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%231e3264' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 10px 6px;
}
.lang-switch select:hover, .lang-switch select:focus { border-color: var(--teal); outline: none; }

/* ── RTL (Arabic) ── */
html[dir="rtl"] body { font-family: 'Tahoma', 'Inter', sans-serif; }
html[dir="rtl"] nav ul { direction: rtl; }
html[dir="rtl"] .btn-outline { margin-left: 0; margin-right: 1rem; }
html[dir="rtl"] .contact-row { text-align: right; }
html[dir="rtl"] .aud-card, html[dir="rtl"] .c-label { text-align: right; }
html[dir="rtl"] .lang-switch { margin-left: 0; margin-right: 1.5rem; }
html[dir="rtl"] .lang-switch select {
  padding: 0.35rem 0.7rem 0.35rem 1.6rem;
  background-position: left 0.6rem center;
}

/* ── HERO ── */
#hero {
  margin-top: 68px;
  background: var(--navy);
  min-height: 88vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 5% 5rem;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(61,191,160,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(61,191,160,0.07) 0%, transparent 50%);
}
#hero .tag {
  display: inline-block;
  background: rgba(61,191,160,0.18);
  color: var(--teal);
  border: 1px solid rgba(61,191,160,0.35);
  border-radius: 30px;
  padding: 0.35rem 1.1rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 2rem;
}
#hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  color: var(--white);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  position: relative;
}
#hero h1 span { color: var(--teal); }
#hero .subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.72);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
}
#hero .arabic {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
  margin-bottom: 3rem;
  direction: rtl;
}
.btn {
  display: inline-block; text-decoration: none;
  padding: 0.85rem 2rem; border-radius: 4px;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  transition: all 0.2s; cursor: pointer; border: none;
}
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal2); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--white);
  border: 2px solid rgba(255,255,255,0.35);
  margin-left: 1rem;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
#hero .scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.35); font-size: 0.72rem; letter-spacing: 0.08em;
}
#hero .scroll-hint::after {
  content: "";
  display: block; width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ── SECTIONS generic ── */
section { padding: 6rem 5%; }
.section-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--navy); line-height: 1.15; margin-bottom: 1.25rem;
}
.section-lead { font-size: 1.05rem; color: var(--muted); max-width: 700px; font-weight: 300; }
.container { max-width: 1160px; margin: 0 auto; }

/* ── PAGE HEADER (inner pages) ── */
#page-header {
  margin-top: 68px;
  background: var(--navy);
  padding: 5rem 5% 4rem;
  text-align: center;
}
#page-header .section-label { color: var(--teal); }
#page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--white); margin-top: 0.75rem;
}

/* ── PILLARS / CARDS (home: mission) ── */
#mission { background: var(--white); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.card {
  border: 1px solid rgba(30,50,100,0.1);
  border-radius: 8px; padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(30,50,100,0.1); }
.card-icon {
  width: 48px; height: 48px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1.25rem;
}
.card-icon.teal { background: rgba(61,191,160,0.12); }
.card-icon.navy { background: rgba(30,50,100,0.1); }
.card-icon.gold { background: rgba(232,160,32,0.12); }
.card h3 { font-size: 1.05rem; font-weight: 600; color: var(--navy); margin-bottom: 0.6rem; }
.card p { font-size: 0.88rem; color: var(--muted); font-weight: 300; }

/* ── AUDIENCE (home) ── */
#audience { background: var(--navy); }
#audience .section-title { color: var(--white); }
#audience .section-label { color: var(--teal); }
#audience .section-lead { color: rgba(255,255,255,0.6); }
.audience-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3rem; }
.aud-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 2rem;
  border-top: 3px solid;
  transition: background 0.2s;
}
.aud-card:hover { background: rgba(255,255,255,0.09); }
.aud-card.c1 { border-top-color: var(--teal); }
.aud-card.c2 { border-top-color: var(--gold); }
.aud-card.c3 { border-top-color: #c97be8; }
.aud-card h3 { font-size: 1.05rem; font-weight: 600; color: var(--white); margin-bottom: 0.5rem; }
.aud-card .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.aud-card .tag-pill { font-size: 0.72rem; font-weight: 500; padding: 0.2rem 0.6rem; border-radius: 20px; letter-spacing: 0.03em; }
.c1 .tag-pill { background: rgba(61,191,160,0.2); color: var(--teal); }
.c2 .tag-pill { background: rgba(232,160,32,0.2); color: var(--gold); }
.c3 .tag-pill { background: rgba(201,123,232,0.2); color: #c97be8; }
.aud-card p { font-size: 0.85rem; color: rgba(255,255,255,0.55); font-weight: 300; }

/* ── AI AGENT (page) ── */
#ai-agent { background: var(--white); }
#ai-agent .status-pill {
  display: inline-block; margin-bottom: 1rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.75rem; border-radius: 20px;
  background: rgba(232,160,32,0.15); color: #b37a10;
}
#ai-agent .cta-box {
  margin-top: 3rem; padding: 2rem;
  background: var(--light); border-radius: 8px;
  border-left: 3px solid var(--teal);
}
html[dir="rtl"] #ai-agent .cta-box { border-left: 0; border-right: 3px solid var(--teal); }
#ai-agent .cta-box p { font-size: 0.95rem; color: var(--muted); font-weight: 300; margin-bottom: 1.25rem; max-width: 700px; }

/* ── TIMELINE (home) ── */
#timeline { background: var(--light); }
.timeline-track { display: flex; margin-top: 3.5rem; position: relative; }
.timeline-track::before {
  content: "";
  position: absolute; top: 32px; left: 0; right: 0; height: 2px;
  background: linear-gradient(to right, var(--teal) 50%, rgba(30,50,100,0.15) 50%);
}
.tl-item { flex: 1; padding: 0 1rem; }
.tl-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid; background: var(--white);
  margin: 0 auto 1.5rem; position: relative; z-index: 1;
}
.tl-item.done .tl-dot { background: var(--teal); border-color: var(--teal); }
.tl-item.active .tl-dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232,160,32,0.25); }
.tl-item.future .tl-dot { border-color: rgba(30,50,100,0.25); }
.tl-box { background: var(--white); border: 1px solid rgba(30,50,100,0.1); border-radius: 8px; padding: 1.5rem; text-align: center; }
.tl-item.done .tl-box { border-top: 3px solid var(--teal); }
.tl-item.active .tl-box { border-top: 3px solid var(--gold); }
.tl-item.future .tl-box { border-top: 3px solid rgba(30,50,100,0.2); }
.tl-phase { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.25rem; }
.tl-name { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--navy); margin-bottom: 0.5rem; }
.tl-item.done .tl-name { color: var(--teal); }
.tl-item.active .tl-name { color: var(--gold); }
.tl-desc { font-size: 0.82rem; color: var(--muted); font-weight: 300; }

/* ── PROGRAM (schedule) ── */
#program-day1, #program-day2 { padding: 3.5rem 5%; }
#program-day2 { background: var(--light); }
.day-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.day-num {
  flex: 0 0 auto;
  width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--white);
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.25rem;
  border-radius: 50%;
}
.day-heading .section-title { margin-bottom: 0; }

.schedule-list { display: flex; flex-direction: column; gap: 1rem; position: relative; }
.sched-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid rgba(30,50,100,0.08);
  border-inline-start: 4px solid var(--teal);
  border-radius: 10px;
  padding: 1.1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(30,50,100,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sched-item:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30,50,100,0.1); }

.sched-icon {
  flex: 0 0 auto;
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  background: rgba(61,191,160,0.12);
  border-radius: 50%;
}
.sched-item.type-break .sched-icon,
.sched-item.type-meal .sched-icon,
.sched-item.type-travel .sched-icon { background: rgba(232,160,32,0.14); }

.sched-body { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 auto; }
.sched-time {
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--teal);
  background: rgba(61,191,160,0.1);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sched-item.type-break .sched-time,
.sched-item.type-meal .sched-time,
.sched-item.type-travel .sched-time { color: var(--gold); background: rgba(232,160,32,0.14); }

.sched-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--navy); font-weight: 700; }
.sched-item.type-break .sched-title,
.sched-item.type-meal .sched-title,
.sched-item.type-travel .sched-title { font-family: 'Inter', sans-serif; font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.sched-item.type-break, .sched-item.type-meal, .sched-item.type-travel { border-inline-start-color: var(--gold); }

@media (max-width: 640px) {
  .sched-item { align-items: flex-start; }
  .sched-time { font-size: 0.68rem; }
}

/* ── CONTACT (home) ── */
#contact { background: var(--navy); text-align: center; padding: 6rem 5%; }
#contact .section-title { color: var(--white); }
#contact .section-lead { color: rgba(255,255,255,0.6); margin: 0 auto 2.5rem; }
.contact-box {
  max-width: 620px; margin: 0 auto;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 2.5rem;
}
.contact-row { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; text-align: left; }
.contact-row:last-child { margin-bottom: 0; }
.c-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); min-width: 120px; padding-top: 0.1rem; }
.c-val { font-size: 0.9rem; color: rgba(255,255,255,0.8); }
.c-val a { color: var(--teal); text-decoration: none; }
.c-val a:hover { text-decoration: underline; }

/* ── ABOUT COSY-IFAC (about page) ── */
#about-cosy { background: var(--white); }
#about-cosy .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; margin-top: 3.5rem; }
#about-cosy .right { background: var(--navy); border-radius: 8px; padding: 2.5rem; color: var(--white); }
#about-cosy .right blockquote { font-family: 'Playfair Display', serif; font-size: 1.45rem; line-height: 1.5; color: var(--white); margin-bottom: 1.5rem; }
#about-cosy .right blockquote span { color: var(--teal); }
#about-cosy .right p { font-size: 0.9rem; color: rgba(255,255,255,0.65); font-weight: 300; }
#about-ifac { background: var(--light); }

/* ── PARTNERS-style cards (about + team) ── */
.partners-row { display: flex; gap: 3rem; flex-wrap: wrap; align-items: stretch; margin-top: 2.5rem; }
.partner-card {
  flex: 1; min-width: 260px;
  background: var(--white); border: 1px solid rgba(30,50,100,0.1);
  border-radius: 8px; padding: 2rem;
}
.partner-card .ptag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin-bottom: 1rem; }
.partner-card .pname { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--navy); margin-bottom: 0.5rem; }
.partner-card p { font-size: 0.85rem; color: var(--muted); font-weight: 300; }
.partner-card .visit { color: var(--teal); font-weight: 600; font-size: 0.85rem; text-decoration: none; }
.partner-card .visit:hover { text-decoration: underline; }

/* ── TEAM (team page) ── */
#team { background: var(--white); }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.team-card { border: 1px solid rgba(30,50,100,0.1); border-radius: 8px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.team-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(30,50,100,0.1); }
.team-card .avatar { padding: 2rem 1rem 0.5rem; background: transparent; display: flex; align-items: center; justify-content: center; }
.team-card .avatar img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; object-position: center 25%; display: block; background: #fff; border: 3px solid rgba(30,50,100,0.08); }
.team-card .avatar .initials { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--teal); font-weight: 700; }
.team-card .info { padding: 1rem 1.5rem 1.75rem; text-align: center; }
.team-card h3 { font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 0.2rem; }
#partners { background: var(--light); }

/* ── FOOTER ── */
footer {
  background: var(--navy2);
  padding: 2rem 5%;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
footer img { height: 28px; }
footer p { font-size: 0.78rem; color: rgba(255,255,255,0.4); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .cards, .audience-cards, .team-grid { grid-template-columns: 1fr; }
  .timeline-track { flex-direction: column; }
  .timeline-track::before { display: none; }
  .tl-item { padding: 0; margin-bottom: 1.5rem; }
  .tl-dot { margin: 0 0 1rem 0; }
  .nav-toggle { display: flex; }
  .nav-cta-desktop { display: none; }
  .nav-mobile-extra { display: block; margin-top: 0.5rem; }
  nav ul {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--white);
    border-bottom: 1px solid rgba(30,50,100,0.08);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    padding: 1rem 5%;
  }
  nav ul.open { display: flex; }
  nav ul li { width: 100%; }
  nav ul a { display: block; padding: 0.75rem 0; }
  nav .nav-cta { display: inline-block; }
  #about-cosy .grid { grid-template-columns: 1fr; }
  .partners-row { flex-direction: column; }
}
