/**
 * Paid placements, in the shape of the space they occupy.
 *
 * Every format shares the same promise: a label, and a look nothing organic uses,
 * so a reader can tell at a glance what has been bought.
 *
 * banner   wide, image beside the words, for the top of a page
 * native   a card in a feed; paid, and honest about it
 * compact  one line, for the narrow ward and constituency pages
 */

/* The same container as the rest of the page - 1180px, centred, with the same side
   padding - so a sponsored card lines up with the content above and below it. It was
   running to the viewport edge, outside the container entirely, which is what made it
   look like it belonged to the browser rather than to the page. */
.ad-slot {
    display: grid;
    gap: 0.85rem;
    max-width: 1180px;
    margin: 1.5rem auto;
    padding: 0 1.25rem;
}

.ad-unit {
    border: 1px solid rgba(180, 83, 9, 0.28);
    background: #fffbeb;
}

.ad-unit-tag {
    margin: 0;
    color: #b45309;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ad-unit-headline {
    margin: 0 0 0.3rem;
    color: #10231c;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Two lines is a sponsored card; three is a paragraph nobody asked for. */
.ad-unit-copy {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.7rem;
    color: #4b5a53;
    font-size: 0.9rem;
    line-height: 1.6;
}

.ad-unit-copy-wrap {
    min-width: 0;
}

/* ---------- banner ---------- */

.ad-unit--banner {
    padding: 1.1rem 1.25rem;
    border-radius: 1rem;
}

.ad-unit--banner .ad-unit-tag {
    margin-bottom: 0.6rem;
}

.ad-unit--banner .ad-unit-body {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

/* Sized for the space it is in, not for a page header. At 13rem x 8.5rem it dominated
   a one-line card in a list, and the copy beside it stopped halfway across. */
.ad-unit-image {
    flex: 0 0 auto;
    width: clamp(7rem, 17%, 11rem);
    height: 6.2rem;
    border-radius: 0.75rem;
    object-fit: cover;
}

/* The words take the room that is left, and the button sits at the far end rather than
   floating in the middle of an empty row. */
.ad-unit-copy-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.ad-unit-cta { margin-left: auto; align-self: center; flex: none; }

.ad-unit-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #b45309;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.ad-unit-cta:hover {
    background: #92400e;
}

/* ---------- native (in a feed) ---------- */

.ad-unit--native {
    padding: 1rem 1.15rem;
    border-radius: 1rem;
}

.ad-unit--native .ad-unit-tag {
    margin-bottom: 0.55rem;
}

.ad-unit--native .ad-unit-body {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.ad-unit-thumb {
    flex: none;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.75rem;
    object-fit: cover;
}

.ad-unit-link {
    color: #b45309;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.ad-unit-link:hover {
    text-decoration: underline;
}

/* ---------- compact (narrow local pages) ---------- */

.ad-unit--compact {
    padding: 0.7rem 0.95rem;
    border-radius: 0.8rem;
}

.ad-unit-compact-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.ad-unit--compact .ad-unit-tag {
    flex: none;
    padding-right: 0.6rem;
    border-right: 1px solid rgba(180, 83, 9, 0.25);
}

.ad-unit-thumb-sm {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    object-fit: cover;
}

.ad-unit-compact-headline {
    min-width: 0;
    color: #10231c;
    font-size: 0.92rem;
    font-weight: 800;
}

.ad-unit-compact-cta {
    flex: none;
    margin-left: auto;
    color: #b45309;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .ad-unit--banner .ad-unit-body {
        flex-direction: column;
        align-items: stretch;
    }

    .ad-unit-image {
        width: 100%;
        max-width: none;
        height: 8rem;
    }
}
