/* === BASE === */
*, html, body { margin: 0; padding: 0; }
body {
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.5;
  background: #fff;
  min-width: 774px;
}
a { text-decoration: none; color: #000; }

/* === LOGO DESKTOP === */
#desktop-logo {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 840px;
  margin: 15px auto 20px;
}
#desktop-logo img {
  width: 160px;
  height: auto;
}
#desktop-nav {
  display: flex;
  gap: 0;
  font-size: 11.7px;
  align-items: center;
}
#desktop-nav a + a::before,
#desktop-nav a + .has-submenu::before,
#desktop-nav .has-submenu + a::before {
  content: '|';
  margin: 0 10px;
  color: #ccc;
}
#desktop-nav a {
  color: #666;
  text-decoration: none;
}
#desktop-nav a:hover { color: #000; }

/* Dropdown PROJETS */
.has-submenu {
  position: relative;
  color: #666;
  font-size: 11.7px;
  cursor: default;
}
.has-submenu:hover { color: #000; }
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 0.5px solid #ddd;
  min-width: 140px;
  z-index: 200;
  flex-direction: column;
  padding: 6px 0;
}
.has-submenu:hover .submenu { display: flex; }
.submenu a {
  display: block;
  padding: 4px 14px;
  color: #666;
  font-size: 10.5px;
  font-weight: normal;
  white-space: nowrap;
}
.submenu a::before { display: none !important; }
.submenu a:hover { color: #000; background: #f5f5f5; }

@media (max-width: 860px) {
  #desktop-logo { display: none; }
}

/* === NAV BAR === */
#nav_container {
  font-size: 14px;
  margin: 15px auto;
  width: 860px;
  overflow: hidden;
}
#nav_container .site-name {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.02em;
  margin-right: 30px;
  float: left;
}
#nav_container .site-name a { color: #000; }
#nav_container .filter-links {
  float: left;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
#nav_container .filter-links a {
  color: #666;
  font-size: 13px;
  margin-right: 18px;
  text-decoration: none;
  cursor: pointer;
}
#nav_container .filter-links a:hover { background: #ff0; color: #000; }
#nav_container .filter-links a.active { color: #000; }
#nav_container .contact-link { float: right; color: #666; font-size: 13px; }
#nav_container .contact-link:hover { color: #000; }

/* === CONTENT CONTAINER === */
#content_container {
  clear: both;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  width: 860px;
}

/* === HOME: THUMBNAIL GRID === */
.project_thumb {
  background: transparent;
  cursor: pointer;
  float: left;
  margin: 0 2px 2px 0;
  padding: 5px;
  position: relative;
  width: 202px;
  height: 251px; /* hauteur fixe */
  overflow: hidden;
}
.project_thumb:hover { opacity: 0.8; }

.pr_contain {
  height: 100%;
  position: relative;
}

.project_thumb a.nohover {
  display: block;
  overflow: hidden;
  max-height: calc(100% - 20px);
  text-decoration: none;
  color: #000;
}

.thumb_tag {
  position: absolute;
  bottom: 0;
  left: 0;
}

.cardimgcrop {
  margin: 0;
  overflow: hidden;
  position: relative;
  height: 150px;
  width: 202px;
  flex-shrink: 0;
  background: #f0f0f0;
}
.cardimgcrop img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb_title {
  font-size: 11px;
  margin-top: 5px;
  margin-bottom: 4px;
  color: #000;
  flex-shrink: 0;
}
.thumb_title span {
  font-weight: bold;
  font-size: 11px;
}

.thumb_desc {
  font-size: 10px;
  color: #888;
  line-height: 1.4;
  margin-top: 2px;
  overflow: hidden;
}

.thumb_tag {
  font-size: 10px;
  color: #555;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif;
}
.thumb_tag a { color: #555; text-decoration: none; }
.thumb_tag a:hover { color: #000; }

/* === CLEARFIX === */
#content_container::after {
  content: '';
  display: table;
  clear: both;
}

/* === PROJECT PAGE === */
#maincontainer {
  width: 840px;
  position: relative;
  margin: 0 auto;
  padding: 0;
}

.project_header {
  position: absolute;
  top: 0;
  right: 2px;
  height: 65px;
}
.project_header a {
  color: #666;
  font-size: 11px;
}
.project_header a:hover { color: #000; }

.project_title {
  color: rgb(220, 185, 55);
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: bold;
  padding: 0 0 10px;
  width: 840px;
}

.project_content {
  color: rgb(85, 85, 85);
  font-family: Arial, Times, serif;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  text-align: left;
}

.project_content .project_subtitle {
  font-size: 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.project_subtitle_top {
  font-size: 12px;
  line-height: 1.5;
  color: rgb(85, 85, 85);
  margin-bottom: 8px;
}
.project_subtitle_bottom {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: rgb(85, 85, 85);
  margin-top: 8px;
  margin-bottom: 8px;
}

.project_content img {
  display: block;
  float: left;
  width: 840px;
  height: auto;
  margin: 10px 0 10px 0;
  clear: both;
}

.project_content .clearfix {
  clear: both;
  height: 1px;
}

.project_footer { display: none; }

/* === SITE FOOTER === */
#site_footer {
  clear: both;
  text-align: right;
  color: #999;
  font-size: 10px;
  padding: 10px 0;
  cursor: pointer;
  width: 860px;
  margin: 0 auto;
}
#site_footer:hover { color: #000; }

/* === FILTER HIDDEN === */
.project_thumb.hidden { display: none; }

/* === CONTACT === */
.contact_content {
  padding: 10px;
  color: #555;
  font-size: 11px;
  line-height: 2;
}

/* === CONTACT PAGE === */
.contact-section {
  color: rgb(220, 185, 55);
  font-weight: bold;
  font-size: 14.6667px;
  margin-top: 18px;
  margin-bottom: 4px;
  text-align: left;
}
.project_content p {
  margin-bottom: 8px;
  line-height: 1.7;
  text-align: left;
}
.project_content a {
  color: rgb(85, 85, 85);
}
.project_content a:hover {
  color: #000;
}

/* === SPECIAL VIGNETTES (contact, nav, haut) === */
.special-thumb .cardimgcrop {
  height: 266px !important;
}
.excerpt {
  font-size: 11px;
  color: #000;
  line-height: 1.6;
  margin-top: 5px;
}
.excerpt .nav-filter {
  display: inline-block;
  cursor: pointer;
  color: #666;
}
.excerpt .nav-filter:hover {
  background: #ff0;
  color: #000;
}

/* =============================================
   HAMBURGER MENU (mobile uniquement)
   ============================================= */
#mobile-logo {
  display: none;
}
#hamburger-btn {
  display: none;
}
#mobile-menu {
  display: none;
}
#mobile-overlay {
  display: none;
}
@media (max-width: 860px) {
  #mobile-logo {
    display: block;
    position: fixed;
    top: 14px;
    left: 20px;
    height: 50px;
    width: auto;
    object-fit: contain;
    z-index: 999;
  }
  #hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 15px;
    right: 14px;
    z-index: 999;
    width: 38px;
    height: 38px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #000;
    border-radius: 3px;
  }
  #mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 998;
    padding: 70px 24px 24px;
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
  }
  #mobile-menu.open { display: flex; }
  #mobile-menu a {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    letter-spacing: 0.05em;
    border-right: 3px solid transparent;
    padding-right: 10px;
  }
  #mobile-menu a.active {
    border-right: 3px solid rgb(220, 185, 55);
    color: rgb(220, 185, 55);
  }
  #mobile-menu a.mobile-sub {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    padding-right: 14px;
  }
  #mobile-menu a.mobile-sub.active {
    color: rgb(220, 185, 55);
    border-right: 3px solid rgb(220, 185, 55);
  }
  #mobile-menu a:hover { color: rgb(220, 185, 55); }

  /* Barre blanche derrière logo + hamburger */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: #fff;
    z-index: 995;
  }
  #mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 997;
  }
  #mobile-overlay.open { display: block; }
}

/* =============================================
   RESPONSIVE — IPHONE / MOBILE
   ============================================= */
@media (max-width: 860px) {

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  /* Cache le bouton HAUT */
  #site_footer { display: none; }

  /* Conteneurs fluides */
  #content_container {
    width: 100vw;
    max-width: 100%;
    box-sizing: border-box;
    padding: 75px 10px 0;
    margin: 0;
  }

  /* Cards mobiles */
  .project_thumb {
    width: calc(50% - 4px);
    height: auto;
    float: left;
    margin: 0 4px 8px 0;
    box-sizing: border-box;
  }
  .project_thumb a.nohover {
    max-height: none;
  }
  .thumb_desc {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cardimgcrop {
    width: 100%;
  }
  .thumb_tag {
    position: static;
    margin-top: 3px;
  }
  .pr_contain {
    height: auto;
  }

  /* Vignettes références cachées sur iPhone */
  .ref-thumb {
    display: none;
  }

  /* Pages références */
  .ref-entry {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
  }
  .ref-year {
    min-width: 28px;
    font-size: 11px;
  }
  .ref-thumb {
    width: 80px !important;
    flex-shrink: 0;
  }
  .ref-thumb img {
    width: 80px !important;
    height: auto !important;
    object-fit: cover;
  }
  .ref-tables {
    flex-direction: column !important;
    gap: 0 !important;
  }
  .ref-table {
    width: 100%;
  }

  /* Page publications */
  .pub-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pub-grid img {
    max-width: 100%;
  }

  /* Pages projet */
  #maincontainer {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
  }
  .project_title {
    width: 100%;
    font-size: 15px;
  }
  .project_content img {
    width: 100% !important;
    height: auto !important;
    margin: 6px 0;
    clear: both;
  }
  .project_header {
    position: static;
    margin-bottom: 6px;
  }
  .proj-nav {
    font-size: 10px;
  }

}

/* === TABLET (iPad portrait) === */
@media (min-width: 600px) and (max-width: 860px) {
  .project_thumb {
    width: calc(25% - 4px);
  }
  #mobile-logo {
    height: 70px;
    top: 14px;
  }
  #hamburger-btn {
    top: 22px;
  }
  body::before {
    height: 98px;
  }
  #content_container {
    padding-top: 105px;
  }
  .ref-thumb {
    display: block;
    width: 160px !important;
    flex-shrink: 0;
  }
  .ref-thumb img {
    width: 160px !important;
    height: 107px !important;
    object-fit: cover;
  }
}

/* === NAV ACTIVE === */
#desktop-nav a.active,
#desktop-nav .has-submenu.active {
  color: rgb(220, 185, 55) !important;
  font-weight: bold;
}
