/* Live HTML5 ads on project pages (works.yaml → campaigns). */

.ad-campaign {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
}

.ad-campaign-name {
  margin-bottom: 20px;
}

.ad-replay {
  font-family: "Red Hat Text", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: inherit;
  background: none;
  cursor: pointer;
  margin-bottom: 30px;
}
.ad-replay:hover {
  color: rgb(255, 142, 142);
}

/* Wide ads (leaderboards) get a row each on top; the rest flow underneath,
   wrapping as the screen narrows. Gap matches AD_GAP in src/_data/works.js. */
.ad-board {
  width: 100%;
  padding: 50px 30px;
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.ad-wide,
.ad-flow {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
}
.ad-wide {
  flex-direction: column;
  align-items: center;
}
.ad-flow {
  flex-wrap: wrap;
}

/* Each ad shows at its real size, or scaled down evenly when it doesn't fit
   (ads.js sets --scale). */
.ad {
  width: min(100%, calc(var(--w) * 1px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ad-frame {
  width: 100%;
  aspect-ratio: var(--ratio);
  position: relative;
  overflow: hidden;
}
.ad-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background-color: white;
  transform: scale(var(--scale, 1));
  transform-origin: 0 0;
  pointer-events: none; /* ads link to the client's landing page */
}
.ad-label {
  color: gray;
  letter-spacing: 0.1em;
}

@media (max-width: 719px) {
  .ad-board {
    padding: 30px 20px;
  }
}

@media (min-width: 720px) {
  .ad-campaign {
    padding: 0px 30px;
  }
}
