/* Masjid Walls — uncluttered wallpaper cards (test version only).
   Keep the existing preview modal and both one-click download formats. */
.collection-section .mw-simple-card{
  container-type:inline-size;
}
.collection-section .mw-simple-card .card-body{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px;
}
.collection-section .mw-simple-card .card-heading{
  display:flex;
  align-items:center;
  gap:9px;
  justify-content:space-between;
  margin:0;
}
.collection-section .mw-simple-card .card-heading h3{
  min-width:0;
  min-height:0;
  margin:0;
  line-height:1.35;
}
.collection-section .mw-simple-card .favorite-button{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  flex-shrink:0;
}
.collection-section .mw-simple-card .tags,
.collection-section .mw-simple-card .device-icons{
  display:none!important;
}
.collection-section .mw-simple-card .preview-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:46px;
  margin:0;
  padding:11px 9px;
  border:1px solid #c49a60;
  border-radius:12px;
  background:#fffaf2;
  color:#68451e;
  font-size:12px;
  font-weight:750;
  line-height:1.35;
  text-align:center;
}
.collection-section .mw-simple-card .mw-download-options,
.collection-section .mw-simple-card .price-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  width:100%;
  margin:0;
}
.collection-section .mw-simple-card .price-row:has(> :only-child)>*{
  grid-column:1/-1;
}
.collection-section .mw-simple-card .mw-download-options .download,
.collection-section .mw-simple-card .price-row .download{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  width:100%;
  min-width:0;
  min-height:55px;
  margin:0!important;
  padding:7px 5px;
  border:1px solid #dfb567;
  border-radius:12px;
  background:linear-gradient(126deg,#eac77c,#f5dea6);
  color:#453014;
  text-align:center;
  line-height:1.2;
  box-shadow:none;
}
.collection-section .mw-simple-card .mw-format-download>svg{
  width:18px;
  height:18px;
  min-width:18px;
  flex-shrink:0;
  stroke-width:1.7;
}
.collection-section .mw-simple-card .mw-download-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
  align-items:center;
  justify-content:center;
  font-size:11px;
  line-height:1.2;
}
.collection-section .mw-simple-card .mw-download-copy strong{
  font-size:11px;
  font-weight:750;
}
.collection-section .mw-simple-card .mw-download-copy small{
  font-size:10px;
  font-weight:500;
}
.collection-section .mw-simple-card .card-body>.unavailable{
  display:none;
}
/* In a two-column phone gallery each card becomes narrow: stack the formats
   instead of squeezing two unreadable 70px-wide buttons together. */
@container (max-width:265px){
  .mw-simple-card .mw-download-options,
  .mw-simple-card .price-row{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .mw-simple-card .mw-download-options .download,
  .mw-simple-card .price-row .download{
    min-height:44px;
  }
  .mw-simple-card .mw-download-copy{
    flex-direction:row;
    flex-wrap:wrap;
    gap:5px;
  }
  .mw-simple-card .mw-download-copy small{
    font-size:9px;
  }
}
@media (prefers-reduced-motion:reduce){
  .collection-section .mw-simple-card,
  .collection-section .mw-simple-card *{
    transition:none!important;
  }
}

/* The ten portrait cards are original WEBP vertical images, not two-format exports. */
#portraits .portrait-item.mw-simple-card{
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #e4d2b7;
  border-radius:20px;
  background:linear-gradient(150deg,#fffdfa,#f9efe1);
  box-shadow:0 10px 28px rgba(86,55,28,.08);
}
#portraits .mw-simple-card .portrait-art{
  display:block;
  width:100%;
  overflow:hidden;
}
#portraits .mw-simple-card .portrait-art img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
#portraits .mw-simple-card .portrait-item-caption{
  display:flex;
  flex-direction:column;
  flex:1;
  gap:10px;
  padding:13px 14px 16px;
  position:relative;
}
#portraits .mw-simple-card .portrait-item-caption h3{
  margin:0;
  padding-right:48px;
  min-height:44px;
  line-height:1.35;
  display:flex;
  align-items:center;
}
#portraits .mw-simple-card .portrait-price{display:none}
#portraits .mw-simple-card .portrait-favorite{
  position:absolute;
  top:12px;
  right:12px;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  margin:0;
}
#portraits .mw-simple-card .portrait-item-caption .preview-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:46px;
  margin:0;
  border:1px solid #c49a60;
  border-radius:12px;
  background:#fffaf2;
  color:#68451e;
  font-weight:750;
  font-size:12px;
}
#portraits .mw-simple-card .portrait-item-caption a.mw-format-download{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:48px;
  margin-top:auto;
  padding:9px 6px;
  border-radius:12px;
  border:1px solid #dfb567;
  background:linear-gradient(126deg,#eac77c,#f5dea6);
  color:#453014;
  box-shadow:none;
  font-size:12px;
  font-weight:700;
  text-align:center;
}

/* The five existing hourly files follow the same direct-preview/direct-download UX. */
#hourlyGrid .mw-simple-card{
  container-type:inline-size;
}
#hourlyGrid .mw-simple-card .card-body{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  padding:13px;
}
#hourlyGrid .mw-simple-card .card-body>h3{
  grid-column:1/-1;
  min-height:44px;
  margin:0;
  line-height:1.35;
}
#hourlyGrid .mw-simple-card .tags{display:none!important}
#hourlyGrid .mw-simple-card .mw-card-enlarge{
  display:flex;
  grid-column:1/-1;
  align-items:center;
  justify-content:center;
  margin:0;
  min-height:46px;
  width:100%;
  border-radius:12px;
  border:1px solid #c49a60;
  background:#fffaf2;
  color:#68451e;
  font-size:12px;
  font-weight:750;
  line-height:1.35;
}
#hourlyGrid .mw-simple-card .mw-direct-download{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:48px;
  min-width:0;
  margin:0!important;
  padding:8px 5px;
  border-radius:12px;
  border:1px solid #dfb567;
  background:linear-gradient(126deg,#eac77c,#f5dea6);
  color:#453014;
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  text-align:center;
  box-shadow:none;
}
@container(max-width:265px){
  #hourlyGrid .mw-simple-card .card-body{grid-template-columns:1fr!important}
  #hourlyGrid .mw-simple-card .card-body>h3,
  #hourlyGrid .mw-simple-card .mw-card-enlarge{grid-column:1}
}
@media(max-width:600px){
  #portraits .mw-simple-card .portrait-item-caption{padding:10px;gap:8px}
  #portraits .mw-simple-card .portrait-item-caption h3{font-size:13px}
  #hourlyGrid .mw-simple-card .card-body{padding:10px}
}

#hourlyGrid .mw-simple-card .card-body>.card-heading{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0;
}
#hourlyGrid .mw-simple-card .card-heading>h3{
  flex:1;
  min-width:0;
  min-height:44px;
  display:flex;
  align-items:center;
  line-height:1.35;
  margin:0;
}
#hourlyGrid .mw-simple-card .card-heading .favorite-button{
  flex-shrink:0;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
}

/* Restore a comfortably sized phone in "Voir sur mon écran".
   The older 42svh limit in editorial-2026.css made it too small. */
.preview-dialog .preview-device-phone{
  width:min(310px,78vw,calc(69svh * 9 / 18.5));
}
/* Keep the larger preview on narrow phone screens; the dialog is scrollable. */
@media(max-width:600px){
  .preview-dialog .preview-device-phone{
    width:min(295px,80vw,calc(69svh * 9 / 18.5));
  }
}
