/* ====== SECTION 3 — Dalles des sociétés présentes ====== */

/* Overlay ivoire plus opaque (dalles denses) au-dessus du panorama global */
#section-3 {
  position: relative;
}
#section-3::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(250, 247, 242, 0.90) 0%,
    rgba(250, 247, 242, 0.94) 100%
  );
  pointer-events: none;
  z-index: 0;
}
#section-3 > .section-inner {
  position: relative;
  z-index: 1;
}

.s3-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.floor-switch {
  display: flex;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0;
}
.floor-switch button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--line);
  transition: all 0.18s ease;
  touch-action: manipulation; /* iOS : pas de délai 300ms, pas de double-tap-zoom */
}
.floor-switch button:last-child { border-right: none; }
.floor-switch button:hover { color: var(--burgundy); }
.floor-switch button .area {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--burgundy);
  font-size: var(--fs-sm);
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 8px;
  background: var(--burgundy-bg);
  min-width: 28px;
  text-align: center;
}
.floor-switch button.active {
  background: var(--burgundy);
  color: white;
}
.floor-switch button.active:hover { color: white; }
.floor-switch button.active .area {
  background: rgba(255,255,255,0.2);
  color: white;
}

.side-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0;
  min-width: 320px;
  transition: border-color 0.2s ease;
}
.side-search:focus-within { border-color: var(--burgundy); }
.side-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-sm);
  flex: 1;
  color: var(--ink);
}
.side-search svg { color: var(--grey); }

/* Side panel */
.side-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
}
.side-header {
  padding: 4px 4px 16px;
  border-bottom: 2px solid var(--burgundy);
  margin-bottom: var(--space-3);
}
.side-header h3 {
  font-family: var(--font-display);
  font-size: var(--fs-display-s);
  color: var(--burgundy);
  letter-spacing: 0;
}
.side-header .sub {
  font-size: var(--fs-eyebrow);
  color: var(--grey);
  margin-top: 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Grid of company rows (dalles) */
.side-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.company-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1),
              border-color 0.3s ease,
              box-shadow 0.4s cubic-bezier(.2,.8,.2,1);
}

/* Diagonal burgundy wash that sweeps in from top-left */
.company-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
    var(--burgundy) 0%,
    var(--burgundy) 40%,
    var(--burgundy-soft) 100%);
  z-index: -1;
  transform: translate(-101%, -101%);
  transition: transform 0.55s cubic-bezier(.2,.9,.25,1);
}

/* Corner accent lines that draw in */
.company-row::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-top: 2px solid var(--burgundy);
  border-right: 2px solid var(--burgundy);
  transition: width 0.35s ease 0.05s, height 0.35s ease;
  z-index: 1;
}

.company-row:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(117, 32, 49, 0.28),
              0 2px 6px rgba(0,0,0,0.06);
}
.company-row:hover::before {
  transform: translate(0, 0);
}
.company-row:hover::after {
  width: 16px; height: 16px;
  border-color: rgba(255,255,255,0.85);
}
.company-row:hover .info .name { color: white; }
.company-row:hover .info .domain { color: rgba(255,255,255,0.72); }
.company-row:hover .loc-tag {
  color: white;
  border-color: rgba(255,255,255,0.6);
}
.company-row:hover .num-badge {
  transform: rotate(-8deg) scale(1.08);
  background: white;
  color: var(--burgundy);
  border-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@media (hover: none) {
  .company-row:active .num-badge {
    transform: rotate(-4deg) scale(1.12);
  }
}

.company-row.no-link { cursor: default; }

/* Staggered micro-delays so hovering the grid feels alive in motion */
.company-row:nth-child(3n+1)::before { transition-duration: 0.5s; }
.company-row:nth-child(3n+2)::before { transition-duration: 0.6s; }
.company-row:nth-child(3n+3)::before { transition-duration: 0.55s; }

.company-row .num-badge {
  width: 62px; height: 62px;
  background: white;
  color: var(--burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--fs-body);
  flex-shrink: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 6px;
  transition: transform 0.45s cubic-bezier(.3,1.4,.5,1),
              background 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.35s ease;
}
.company-row .num-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.company-row .info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.company-row .info .name {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}
.company-row .info .domain {
  font-size: var(--fs-eyebrow);
  color: var(--grey);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  transition: color 0.3s ease;
}

.company-row .loc-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  color: var(--burgundy);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 3px 0 3px 12px;
  background: transparent;
  border-left: 1px solid var(--burgundy);
  position: relative;
  z-index: 1;
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* Responsive */
@media (max-width: 1100px) {
  .side-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .side-list { grid-template-columns: 1fr; }
  .s3-toolbar { flex-direction: column; align-items: stretch; }
  .side-search { min-width: 0; }
}

/* Phones */
@media (max-width: 600px) {
  .s3-toolbar { gap: var(--space-2); margin-bottom: var(--space-3); }

  .floor-switch {
    flex-wrap: wrap;
    width: 100%;
  }
  .floor-switch button {
    flex: 1 1 0;
    padding: 10px 8px;
    font-size: 10px;
    letter-spacing: 0.04em;
    gap: 6px;
    justify-content: center;
    min-width: 0;
    border-right: 1px solid var(--line);
    text-align: center;
  }
  .floor-switch button .area {
    font-size: 10px;
    padding: 2px 6px;
    min-width: 22px;
  }

  .side-search {
    min-width: 0;
    width: 100%;
    padding: 9px 12px;
  }
  .side-search input,
  input[type="search"] {
    font-size: 16px; /* iOS : <16px déclenche auto-zoom au focus */
  }
  .side-panel { padding: var(--space-2); }
  .side-header { padding: 4px 4px 12px; margin-bottom: var(--space-2); }
  .side-header h3 { font-size: 18px; }

  .company-row { gap: 10px; padding: 12px 10px; }
  .company-row .num-badge {
    width: 48px;
    height: 48px;
    padding: 4px;
    font-size: 12px;
  }
  .company-row .info .name { font-size: 13px; }
  .company-row .info .domain { font-size: 9px; }
  .company-row .loc-tag {
    font-size: 9px;
    padding-left: 8px;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .floor-switch button {
    padding: 9px 4px;
    font-size: 9px;
    gap: 4px;
  }
  .floor-switch button .area { font-size: 9px; padding: 1px 4px; }
  .company-row .info .name { font-size: 12px; }
}
