/* ═══════════════════════════════════════════════
   L'atelier iTech — Portfolio styles
   ═══════════════════════════════════════════════ */

/* ── HERO ── */
.portfolio-hero {
  min-height: 38vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  background:
    linear-gradient(rgba(13,13,13,0.88), rgba(13,13,13,0.96)),
    url('images/services-bg.jpg') center / cover no-repeat;
}

.portfolio-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 1rem;
}

.portfolio-hero h1 em { font-style: italic; color: #e8c97b; }

.portfolio-hero p {
  color: #888;
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── FILTRES ── */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  padding: 3rem 2rem 0;
  max-width: 900px;
  margin: 0 auto;
}

.filter-btn {
  background: var(--charcoal);
  border: 1px solid var(--border);
  color: #aaa;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .5rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
}

/* ── GRILLE ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 2.5rem auto 0;
  padding: 0 2rem 5rem;
}

.portfolio-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  cursor: pointer;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
  border-color: rgba(201,168,76,.5);
}

.portfolio-card.hidden { display: none; }

/* ── CARD THUMB ── */
.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.card-thumb-web   { background: linear-gradient(135deg, #0d1b2a, #1a3a5c); }
.card-thumb-pc    { background: linear-gradient(135deg, #1a0d2a, #3a1a5c); }
.card-thumb-nas   { background: linear-gradient(135deg, #0d2a1a, #1a5c3a); }
.card-thumb-depan { background: linear-gradient(135deg, #2a1a0d, #5c3a1a); }

.card-thumb-label {
  position: absolute;
  bottom: .6rem;
  right: .7rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 999px;
}

.label-web   { background: rgba(76,142,207,.2);  color: #4c8ecf; border: 1px solid rgba(76,142,207,.3); }
.label-pc    { background: rgba(156,107,207,.2); color: #9c6bcf; border: 1px solid rgba(156,107,207,.3); }
.label-nas   { background: rgba(76,175,120,.2);  color: #4caf78; border: 1px solid rgba(76,175,120,.3); }
.label-depan { background: rgba(201,168,76,.2);  color: #c9a84c; border: 1px solid rgba(201,168,76,.3); }

/* ── CARD BODY ── */
.card-body { padding: 1.3rem 1.4rem 1.5rem; }

.card-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .4rem;
}

.card-body p { font-size: .83rem; color: #777; line-height: 1.6; margin-bottom: 1rem; }

.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; }

.card-tag {
  font-size: .68rem;
  font-weight: 500;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #888;
}

.card-result {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .9rem;
  font-size: .78rem;
  color: #4caf78;
  font-weight: 500;
}

.card-result::before { content: '✓'; font-weight: 700; }

/* ══════════════════════════════════════
   MODAL — BASE
══════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  position: relative;
  animation: fadeUp .25s ease;
  margin: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
}

.modal-close {
  position: fixed;
  top: .8rem;
  right: .8rem;
  background: rgba(30,30,30,0.95);
  border: 1px solid var(--border);
  color: var(--gold-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all .3s;
  z-index: 3000;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

.modal-close:hover {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
  transform: scale(1.1);
}

.modal-body { padding: 1rem 1.2rem 1.3rem; }

.modal-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .3rem;
}

.modal-cat {
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: .5rem;
}

.modal-body > p {
  font-size: .82rem;
  color: #888;
  line-height: 1.7;
  margin-bottom: .7rem;
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  margin: .7rem 0;
}

.modal-detail {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem .7rem;
}

.modal-detail span {
  display: block;
  font-size: .6rem;
  color: #555;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .15rem;
}

.modal-detail strong { font-size: .82rem; color: var(--cream); }

.modal-result {
  background: rgba(76,175,120,.08);
  border: 1px solid rgba(76,175,120,.25);
  border-radius: 6px;
  padding: .6rem .8rem;
  font-size: .8rem;
  color: #4caf78;
  line-height: 1.5;
  margin-top: .6rem;
}

/* ══════════════════════════════════════
   MODAL WEB — iframe
══════════════════════════════════════ */
.modal-web { max-width: 640px; }

.iframe-bar {
  background: #1a1a1a;
  border-bottom: 1px solid var(--border);
  padding: .4rem .8rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-radius: 12px 12px 0 0;
}

.iframe-dots { display: flex; gap: 4px; }
.iframe-dots span { width: 8px; height: 8px; border-radius: 50%; }
.iframe-dots span:nth-child(1) { background: #ff5f57; }
.iframe-dots span:nth-child(2) { background: #febc2e; }
.iframe-dots span:nth-child(3) { background: #28c840; }

.iframe-url {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  padding: .2rem .6rem;
  font-size: .7rem;
  color: #777;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--gold);
  color: var(--dark);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: .75rem;
  padding: .35rem .8rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background .3s;
  white-space: nowrap;
}

.btn-visit:hover { background: var(--gold-light); }

.iframe-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
  position: relative;
}

.iframe-container iframe { width: 100%; height: 100%; border: none; display: block; }

.iframe-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  background: linear-gradient(135deg, #0d1b2a, #1a3a5c);
}

.iframe-placeholder span { font-size: 2.5rem; }
.iframe-placeholder p { font-size: .8rem; color: #4c8ecf; text-align: center; padding: 0 1.5rem; margin: 0; }

/* ══════════════════════════════════════
   MODAL PC — galerie
══════════════════════════════════════ */
.modal-pc { max-width: 520px; }

.photo-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .4s ease;
  overflow: hidden;
}

.gallery-slide.active { opacity: 1; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
}

.gallery-placeholder span { font-size: 3rem; }
.gallery-placeholder p { font-size: .78rem; color: #555; text-align: center; padding: 0 2rem; margin: 0; font-style: italic; }

.gallery-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .8rem;
  pointer-events: none;
}

.gallery-btn {
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background .3s;
  pointer-events: all;
  line-height: 1;
}

.gallery-btn:hover { background: var(--gold); color: var(--dark); }

.gallery-dots {
  position: absolute;
  bottom: .7rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  transition: background .3s;
}

.gallery-dot.active { background: var(--gold); }

.gallery-counter {
  position: absolute;
  top: .7rem;
  right: .8rem;
  background: rgba(0,0,0,.6);
  color: #aaa;
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 999px;
}

/* ══════════════════════════════════════
   MODAL SIMPLE — 1 ou 2 photos
══════════════════════════════════════ */
.modal-simple { max-width: 480px; }

.simple-photos {
  display: grid;
  gap: 3px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.simple-photos.one { grid-template-columns: 1fr; }
.simple-photos.two { grid-template-columns: 1fr 1fr; }

.simple-photo {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.simple-photo.two-col { aspect-ratio: 4/3; }
.simple-photo img { width: 100%; height: 100%; object-fit: cover; }

.simple-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 2px dashed #2a2a2a;
}

.simple-photo-placeholder span { font-size: 2.2rem; opacity: .4; }
.simple-photo-placeholder p { font-size: .7rem; color: #444; margin: 0; font-style: italic; text-align: center; padding: 0 .5rem; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

/* ── Tablette (≤ 900px) ── */
@media (max-width: 900px) {
  .portfolio-grid  { grid-template-columns: repeat(2, 1fr); }
  .modal-overlay   { padding: 1rem; }

  /* Modal web : réduit l'iframe pour qu'elle tienne à l'écran */
  .modal-web       { max-width: 100%; }
  .iframe-container { aspect-ratio: 4/3; }

  /* Modal PC : galerie moins haute */
  .photo-gallery   { aspect-ratio: 4/3; }

  /* Modal simple */
  .simple-photos.two { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  .portfolio-grid  { grid-template-columns: 1fr; padding: 0 1rem 3rem; }
  .filters         { padding: 2rem 1rem 0; gap: .4rem; }
  .filter-btn      { font-size: .72rem; padding: .4rem .9rem; }

  /* Overlay plein écran sans padding latéral */
  .modal-overlay   { padding: .5rem; }

  /* Modals en plein écran sur mobile */
  .modal           { border-radius: 12px; }
  .modal-body      { padding: 1rem 1rem 1.2rem; }
  .modal-body h2   { font-size: 1.05rem; }
  .modal-details   { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .modal-result    { font-size: .8rem; }

  /* Modal web : iframe encore plus courte sur mobile */
  .iframe-bar      { padding: .4rem .7rem; gap: .5rem; }
  .iframe-url      { display: none; }
  .btn-visit       { font-size: .75rem; padding: .4rem .8rem; }
  .iframe-container { aspect-ratio: 3/2; }

  /* Modal PC galerie */
  .photo-gallery   { aspect-ratio: 1/1; }
  .gallery-btn     { width: 32px; height: 32px; font-size: 1rem; }

  /* Modal simple : photos empilées */
  .simple-photos.two { grid-template-columns: 1fr; }
  .simple-photo,
  .simple-photo.two-col { aspect-ratio: 16/9; }
}

/* ── Très petit (≤ 400px) ── */
@media (max-width: 400px) {
  .modal-details   { grid-template-columns: 1fr; }
  .modal-overlay   { padding: .3rem; }
  .iframe-container { aspect-ratio: 1/1; }
  .photo-gallery   { aspect-ratio: 1/1; }
}
