.sw5, .sw5 *{ box-sizing:border-box; }
html, body{ overflow-x:hidden; }

/* Full width breakout */
.sw5-full{
  width:100vw;
  position:relative;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;
}

/* Theme-aware vars */
.sw5{
  --bg: var(--td_body_bg, var(--td_background_color, #0B1220));
  --text: #F9FAFB;
  --muted: var(--td_text_color_secondary, rgba(249,250,251,.72));
  --accent: var(--td_theme_color, var(--td_theme_color_main, #0A7674));
  --stroke: rgba(255,255,255,.10);

  background: var(--bg);
  padding: 56px 0 62px;
}

.sw5-container{
  max-width:1180px;
  margin:0 auto;
  padding:0 16px;
}

.sw5-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
  margin-bottom: 16px;
}

.sw5-title{
  margin:0 0 8px;
  color: var(--text);
  font-size: 32px;
  font-weight: 1000;
  line-height: 1.2;
}

.sw5-sub{
  margin:0;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 2;
  max-width: 820px;
}

.sw5-all{
  text-decoration:none;
  font-weight: 1000;
  color: rgba(249,250,251,.92);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  padding: 10px 14px;
  border-radius: 12px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  white-space: nowrap;
}
.sw5-all:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, rgba(255,255,255,.03));
}
@supports not (color: color-mix(in srgb, red 50%, white)){
  .sw5-all:hover{ border-color: rgba(10,118,116,.30); background: rgba(10,118,116,.08); }
}

/* ===== 5 per row ===== */
.sw5-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

/* ===== Compact + Pro cards ===== */
.sw5-card{
  position:relative;
  display:block;
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.02);

  aspect-ratio: 16 / 11;
  min-height: 165px;

  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  text-decoration:none;
  transform: translateZ(0);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  will-change: transform;
}

.sw5-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,.12));
  box-shadow: 0 14px 40px rgba(0,0,0,.38);
}
@supports not (color: color-mix(in srgb, red 50%, white)){
  .sw5-card:hover{ border-color: rgba(10,118,116,.32); }
}

.sw5-card:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, white 0%);
  outline-offset: 3px;
}
@supports not (color: color-mix(in srgb, red 50%, white)){
  .sw5-card:focus-visible{ outline: 3px solid rgba(10,118,116,.75); }
}

.sw5-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform: scale(1.01);
  transition: transform .45s ease;
}
.sw5-card:hover img{ transform: scale(1.06); }

.sw5-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(600px 220px at 80% 12%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.02) 0%, rgba(0,0,0,.82) 92%);
}

/* Badge top-right */
.sw5-badge{
  position:absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, rgba(11,18,32,.78));
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(249,250,251,.92);
  font-weight: 900;
  font-size: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
@supports not (color: color-mix(in srgb, red 50%, white)){
  .sw5-badge{ background: rgba(11,18,32,.78); }
}

/* Info inside image (bottom) */
.sw5-info{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  display:flex;
  flex-direction:column;
  gap: 4px;
}

.sw5-h{
  color:#fff;
  font-weight: 1000;
  font-size: 14px;
  line-height: 1.35;
  text-shadow: 0 10px 24px rgba(0,0,0,.45);
}

.sw5-p{
  color: rgba(255,255,255,.86);
  font-weight: 800;
  font-size: 12.2px;
  line-height: 1.6;
  max-width: 98%;
}

/* Footer button */
.sw5-foot{
  display:flex;
  justify-content:center;
  margin-top: 18px;
}

.sw5-mainbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--accent);
  color:#fff;
  text-decoration:none;
  font-weight: 1000;
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
  transition: transform .16s ease, filter .16s ease;
  min-width: 240px;
}
.sw5-mainbtn:hover{ transform: translateY(-1px); filter: brightness(1.02); }

/* ===== Responsive ===== */
@media (max-width: 1200px){
  .sw5-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sw5-card{ aspect-ratio: 16 / 10; min-height: 175px; }
}
@media (max-width: 860px){
  .sw5-head{ justify-content:center; text-align:center; }
  .sw5-all{ width:100%; text-align:center; }
  .sw5-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sw5-card{ aspect-ratio: 16 / 11; min-height: 170px; }
}
@media (max-width: 520px){
  .sw5-grid{ grid-template-columns: 1fr; }
  .sw5-card{ aspect-ratio: 16 / 10; min-height: 210px; }
  .sw5-title{ font-size: 26px; }
  .sw5-mainbtn{ width:100%; min-width:0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .sw5-card, .sw5-card img, .sw5-all, .sw5-mainbtn{ transition:none !important; }
}
