/* ========= ZOUBIDA AHMANE — IMPROVED + RESPONSIVE CSS ========= */

/* If you already load Poppins in HTML, you can remove this @import. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

*{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

:root{
  --primary-color: #eddcd9;
  --secondary-color: rgb(230,147,157);
  --third-color: rgb(242,242,242);
  --forth-color: rgb(68,68,68);

  --header-h: 60px;
  --pad-desktop: 50px;
  --pad-mobile: 16px;
  --radius: 14px;
}

.dark-theme{
  --primary-color: rgb(30,30,32);
  --secondary-color: rgb(204,60,27);
  --third-color: rgb(35,35,35);
  --forth-color:#fff;
}

body{
  background-color: var(--primary-color);
  color: var(--forth-color);
  overflow-x: hidden;
}

/* Optional helpers (used if your HTML includes them) */
.skip-link{
  position:absolute;
  top:-100px;
  left: 10px;
  background: var(--third-color);
  color: var(--secondary-color);
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  z-index: 9999;
}
.skip-link:focus{ top: 10px; }

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  border:0;
}

/* ================= HEADER / NAV ================= */

header{
  width:100%;
  height: var(--header-h);
  background-color: var(--third-color);
  position:fixed;
  top:0;
  left:0;
  z-index:50;

  display:flex;
  align-items:center;
  gap: 18px;
  padding: 0 var(--pad-desktop);
}

/* Logo */
.logo{
  font-style: oblique;
  font-size: 28px;
  font-weight: 900;
  cursor:pointer;
  font-family: serif;
  white-space: nowrap;
}
.lo{ color:var(--secondary-color); }

/* Dark mode icon/button */
#icon{
  width:30px;
  height:30px;
  cursor:pointer;
}

/* Nav desktop */
nav{
  margin-left: auto;
}

nav > ul{
  list-style: none;
  display:flex;
  align-items:center;
  gap: 18px;
}

nav > ul > li{
  display:inline-block;
}

nav > ul > li > a{
  text-decoration: none;
  color: var(--secondary-color);
  position: relative;
  font-size: 15px;
  font-weight: bold;
  padding: 6px 2px;
}

/* Contact button */
.contact{
  border:2px var(--secondary-color) solid;
  color: var(--primary-color);
  background-color:var(--secondary-color);
  padding:6px 10px;
  border-radius: 10px;
}

.contact:hover{
  background-color:rgba(236,203,54,0.1);
  color:var(--secondary-color);
}

a:hover{ color:black; }

/* underline hover */
nav .aa::before{
  content: '';
  display:block;
  height: 2px;
  background-color: var(--secondary-color);
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0%;
  transition: width 250ms ease-in-out;
}

nav .aa:hover::before{
  width: 100%;
}

/* Hamburger (only for mobile/tablet if you added it in HTML) */
.hamburger{
  display:none;
  margin-left: auto;
  width: 34px;
  height: 28px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.hamburger span{
  display:block;
  height: 3px;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 3px;
  margin: 5px 0;
  transition: 0.25s ease;
}
.hamburger.active span:nth-child(1){ transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2){ opacity: 0; }
.hamburger.active span:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

/* ================= SECTION BASE ================= */
/* KEY FIX: remove fixed heights; use padding + min-height so content can grow */
#home,#about,#teaching,#research,#blog,#contact{
  width:100%;
  min-height: 520px;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 90px; /* prevents overlap into next section */
  position: relative;
}

/* ================= HOME ================= */








#home{
  background-color: var(--primary-color);
}

#beg{
  width:100%;
  min-height: 520px;
  position: relative;
}

/* keep your desktop layout */
.p1{
  padding-top: 60px;
  padding-left: 100px;
  color:var(--secondary-color);
  font-weight: 700;
}

.p2{
  position: absolute;
  top: 120px;
  left: 0;
  padding-left: 100px;
  color: var(--forth-color);
  font-size: 20px;
  font-weight: 300;
  line-height: 1.05;
}

.p3{
  color: var(--forth-color);
  width: 430px;
  position:absolute;
  top: 150px;
  left: 0;
  padding-left: 100px;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
}

.boxphoto{
  border:var(--secondary-color) 2px solid;
  width: 400px;
  height: 400px;
  background-color: var(--secondary-color);
  border-top-left-radius: 200px;
  border-top-right-radius: 200px;
  overflow: hidden;

  position: absolute;
  top: 90px;
  right: 120px;

  transition: transform .2s;
}

.img1{
  width: 400px;
  height:390px;
  object-fit: cover;
  margin-left: 0px;
  margin-top:30px;
  border-top-left-radius: 200px;
  border-top-right-radius: 200px;
}

.boxphoto:hover{ transform: scale(1.06); }





/* Hero CV button - Prominent */
.hero-btn {
  position: absolute;
  top: 300px;
  left: 0;
  padding-left: 100px;
  width: 430px;
  animation: slideInUp 0.8s ease-out 0.5s both;
}

.hero-cv {
  padding: 16px 32px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 25px rgba(230,147,157,0.4);
  background: var(--secondary-color) !important;
  color: white !important;
  border-radius: 12px;
  text-decoration: none !important;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-cv:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(230,147,157,0.6) !important;
  background: #d67a89 !important;
}

.hero-cv:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 25px rgba(230,147,157,0.5) !important;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
/* MOBILE - Photo JUST under CV */
@media (max-width: 768px) {
  /* CV BUTTON */
  .hero-btn { 
    position: absolute !important;
    top: 255px !important;
    left: 20px !important;
    right: 20px !important;
    width: auto !important;
    padding-left: 0 !important;
  }
  
  .hero-cv { 
    padding: 14px 28px !important; 
    font-size: 16px !important;
    display: block !important;
    text-align: center;
    margin: 0 auto;
  }
  
  /* PHOTO - JUST UNDER CV (300px gap) */
  .boxphoto {
    position: absolute !important;
    top: 315px !important;     /* CV@280px + 80px = 360px */
    left: 50% !important;      /* CENTERED */
    transform: translateX(-50%) !important;
    right: auto !important;
    width: 200px !important;
    height: 280px !important;
  }
  
  .img1 {
    width: 200px !important;
    height: 280px !important;
    margin-left: -45px !important;
    margin-top: 28px !important;
  }
  
  /* Text */
  .p2 { top: 100px !important; font-size: 20px !important; }
  .p3 { top: 220px !important; width: 90% !important; padding-left: 20px !important; }
}






/* ================= ABOUT ================= */
#about{
  background-color: var(--third-color);
}

.about{
  width:100%;
  min-height:500px;
  /* IMPORTANT FIX: remove top:80px so it doesn't overlap other sections */
  margin-top: 0;
  position: relative;
}

.card{
  width: 250px;
  height: 350px;
  margin-left:100px;
  margin-top:40px;
  background: #fff;
  box-shadow: 0 0px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
}

.dots{
  background-color: var(--primary-color);
  background-image: radial-gradient(white 15%, transparent 16%),
                    radial-gradient(white 15%, transparent 16%);
  background-size:60px 60px;
  background-position: 0 0, 30px 30px;
}

.image2{
  position:absolute;
  width:250px;
  height:350px;
  margin-left:100px;
  margin-top:-5px;
  transform: rotate(-10deg);
  object-fit: cover;
}

.pabt{
  position:absolute;
  width:520px;
  margin-top:-270px;
  margin-left:600px;
  font-size: 15px;
  color:var(--forth-color);
  line-height: 1.7;
}

.btn{
  position:absolute;
  margin-top:-120px;
  margin-left:600px;
  width:520px;
  height:auto;
  display:flex;
  gap: 14px;
  align-items:center;
}

.bt1,.bt2{
  display:inline-block;
  text-align: center;
  border: 2px var(--secondary-color) solid;
  padding:10px 14px;
  border-radius: 10px;
  cursor:pointer;
  width:170px;
}

.bt1{
  background-color: var(--secondary-color);
  color:var(--third-color);
}

.bt2{
  color: var(--secondary-color);
  background-color:var(--third-color);
  text-decoration: none;
}

.bt1:hover{
  color:var(--secondary-color);
  background-color: rgba(236,203,54,0.1);
}
.bt2:hover{
  color: var(--third-color);
  background-color: var(--secondary-color);
}

/* ================= TEACHING ================= */
#teaching{
  background-color: var(--primary-color);
}

.teaching{
  width:100%;
  min-height:500px;
  margin-top: 0; /* remove top:80 */
  position: relative;
}

.pt{
  color:var(--secondary-color);
  font-size: 20px;
  text-align: center;
  margin-top:10px;
}

.pt1{
  color:var(--forth-color);
  font-size:25px;
  text-align: center;
  margin-top:12px;
}

.parent{
  margin: 30px auto 0;
  width: min(1100px, 92vw);

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 30px;
  text-align: center;
}

.child1{
  padding: 18px 14px;
  border:2px var(--third-color) solid;
  background-color: var(--third-color);
  color:var(--forth-color);
  transition: transform .2s;
  border-radius: var(--radius);
}

.child1:hover{ transform: scale(1.03); }

.e{
  margin-top: 12px;
  width:120px;
  height:120px;
  object-fit: cover;
  border-radius: 12px;
}

.get{
  margin: 14px auto 0;
  border: 2px solid var(--secondary-color);
  background-color: var(--secondary-color);
  color:var(--third-color);
  width:180px;
  padding:7px 10px;
  font-size: 15px;
  border-radius: 10px;
  cursor:pointer;
}

.get a{ color: inherit; text-decoration:none; }

.get:hover{
  color:var(--secondary-color);
  background-color:var(--third-color);
}

/* ================= RESEARCH ================= */
#research{
  background-color: var(--third-color);
}

.research{
  width:100%;
  min-height:500px;
  margin-top: 0; /* remove top:80 */
  position: relative;
}

.v1,.v2{
  display:inline-block;
  width: min(520px, 92vw);
  margin: 20px 12px 0;
  vertical-align: top;
}

.research video,
video{
  width: 100%;
  height: auto;          /* IMPORTANT FIX */
  border-radius: 12px;
}

.paper{
  margin: 20px auto 0;
  width: min(950px, 92vw);
  text-align: center;
  color:var(--forth-color);
  font-size: 15px;
  line-height: 1.75;
}

.ref{
  color:var(--secondary-color);
  font-weight: 700;
}

/* ================= BLOG ================= */
#blog{
  background-color: var(--primary-color);
}

/* IMPORTANT FIX: remove top:80 and fixed width padding that causes overlap */
.blog{
  width:100%;
  min-height:500px;
  margin-top: 0;
  position: relative;
}

.triangle-right{
  margin: 20px auto 0;
  width: 0;
  height: 0;
  border-top: 80px solid transparent;
  border-left: min(92vw, 1100px) solid var(--secondary-color);
  border-bottom: 80px solid transparent;
}

.blogwriting{
  margin: 18px auto 0;
  width: min(950px, 92vw);
  padding: 18px 16px;
  font-size: 22px;
  color:var(--forth-color);
  line-height: 1.6;
}

/* ================= CONTACT ================= */
#contact{
  background-color: var(--third-color);
}

/* The main cause of collapse here was absolute positioning + negative margins.
   This layout uses normal flow + a two-column grid on desktop. */
#contact > div{
  width: min(1200px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px 40px;
  align-items: start;
}

/* Title full width */
.barH{
  grid-column: 1 / -1;
  color: var(--secondary-color);
  font-size: 35px;
  margin: 0;
  position: static; /* IMPORTANT FIX */
}

.barH::before{
  content: '';
  display: block;
  height: 2px;
  background-color: var(--secondary-color);
  width: 140px;
  margin-top: 10px;
}

/* Left text */
.fm1{
  grid-column: 1 / 2;
  width: 100%;
  position: static; /* IMPORTANT FIX */
  margin: 0;
  padding: 0;
  color: var(--forth-color);
}

/* Form on right */
.pp{
  grid-column: 2 / 3;
  border:2px solid var(--secondary-color);
  background-color: white;
  padding: 20px;
  width: 100%;
  min-height: 420px;
  position: static; /* IMPORTANT FIX */
  margin: 0;
  border-radius: 18px;
}

.m1{
  color:var(--secondary-color);
  text-align:center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.m2{
  color:var(--secondary-color);
  margin: 10px 0 6px;
  font-size: 18px;
}

/* Inputs */
#email,#name,#message{
  width: 100%;
  border:1px var(--secondary-color) solid;
  border-radius: 10px;
  padding: 8px 10px;
}
#email{ margin-top: 10px; height: 36px; }
#name{ margin-top: 10px; height: 36px; }
#message{ margin-top: 6px; }

#submit{
  margin-top: 12px;
  color:var(--primary-color);
  border-radius: 10px;
  border:2px solid var(--secondary-color);
  background-color:var(--secondary-color);
  width:100%;
  height:38px;
  cursor:pointer;
  font-weight: 700;
}
#submit:hover{
  color:var(--secondary-color);
  background-color: var(--primary-color);
}

/* Hide the old separate icon column to avoid layout conflicts */
.coordinates{ display:none; }

/* Contact lines with labels (replaces the icon column cleanly) */
.coordinate{
  grid-column: 1 / 2;
  width: 100%;
  position: static;
  margin: 0;
  color: var(--forth-color);
  font-size: 18px;
}
.coordinate > div{ margin: 10px 0; }
.coordinate > div:nth-child(1)::before{ content: "Tel: "; color: var(--secondary-color); font-weight: 700; }
.coordinate > div:nth-child(2)::before{ content: "Email: "; color: var(--secondary-color); font-weight: 700; }
.coordinate > div:nth-child(3)::before{ content: "Address: "; color: var(--secondary-color); font-weight: 700; }

.coordinate a{ color: var(--secondary-color); text-decoration:none; }

/* Social */
.emoji{
  grid-column: 1 / -1;
  position: static;
  margin: 10px 0 0;
}

.emo{
  list-style:none;
  display:flex;
  justify-content:center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 0;
  margin: 0;
}

/* Works for BOTH your old spans and new <i> icons */
.emo li{
  width: 60px;
  height: 60px;
}
.emo li a{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.25);
}
.emo li a i{
  font-size: 28px;
  color: var(--secondary-color);
}
.emo li a:hover{
  transform: translateY(-3px);
  transition: 0.2s;
}

/* If you still have the old span layers, hide them to prevent weird stacking */
.emo li span{ display:none !important; }

/* Footer: NOT absolute (absolute footer is a classic overlap cause) */
.foot{
  grid-column: 1 / -1;
  background-color: var(--primary-color);
  width:100%;
  position: static;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 12px;
}

.copyright{
  color:var(--secondary-color);
  text-align:center;
  font-size: 15px;
}

.coeur{ color:red; }

/* ================= RESPONSIVE ================= */

/* Tablet */
@media (max-width: 1024px){
  header{ padding: 0 var(--pad-mobile); }

  /* hamburger mode (if your HTML has it + JS toggles nav.active) */
  .hamburger{ display:block; }
  nav{
    display:none;
    position:absolute;
    top: var(--header-h);
    left:0;
    width:100%;
    background: var(--third-color);
    padding: 12px var(--pad-mobile);
  }
  nav.active{ display:block; }
  nav > ul{
    flex-direction:column;
    align-items:stretch;
    gap: 8px;
  }
  nav > ul > li > a{
    padding: 10px 12px;
    border-radius: 12px;
  }

  /* Home: stop absolute layout from breaking on tablet */
  .p1,.p2,.p3{ position: static; padding-left: var(--pad-mobile); width: auto; }
  .p2{ font-size: 48px; margin-top: 8px; }
  .p3{ max-width: 92vw; margin-top: 10px; }
  .boxphoto{ position: static; margin: 22px auto 0; }

  /* About: stack */
  .card{ margin: 20px auto 0; }
  .image2{ position: static; margin: 12px auto 0; transform: none; display:block; }
  .pabt,.btn{ position: static; margin: 18px auto 0; width: min(92vw, 650px); }
  .btn{ justify-content:center; flex-wrap: wrap; }

  /* Teaching: 2 columns */
  .parent{ grid-template-columns: repeat(2, minmax(0,1fr)); }

  /* Blog text size */
  .blogwriting{ font-size: 18px; }

  /* Contact becomes 1 column */
  #contact > div{
    grid-template-columns: 1fr;
  }
  .pp{ grid-column: 1 / -1; max-width: 520px; }
  .fm1,.coordinate{ grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 600px){
  .p2{ font-size: 40px; }
  .parent{ grid-template-columns: 1fr; }
}
