/**
 * TGL Ads — ad unit styling.
 *
 * Uses TGL design tokens: Libre Franklin, site colors.
 */

.tgl-ad {
    position: relative;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 16px;
    font-family: var(--tgl-font-body, 'Open Sans', 'Libre Franklin', sans-serif);
    box-sizing: border-box;
    text-align: center;
}

/* "Sponsored" label */
.tgl-ad__label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--tgl-green-dark, #122806);
    margin-bottom: 8px;
}

/* Link wrapper */
.tgl-ad__link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

.tgl-ad__link:hover {
    opacity: 0.92;
}

/* Ad image — never wider than its intrinsic size */
.tgl-ad__image {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 24px;
    margin-bottom: 8px;
}

/* Ad text content */
.tgl-ad__content {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.tgl-ad__content p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------
   Placement variants
   ------------------------------------------------------------------- */

/* Header banner — full-width bar above site content */
.tgl-ad--header {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 10px 24px;
    text-align: center;
    background: #1f2937;
    color: #fff;
}

.tgl-ad--header .tgl-ad__label {
    display: inline;
    color: var(--tgl-green-dark, #122806);
    margin-right: 12px;
    margin-bottom: 0;
}

.tgl-ad--header .tgl-ad__link {
    display: inline;
    color: #fff;
}

.tgl-ad--header .tgl-ad__content {
    display: inline;
    color: #fff;
    font-size: 14px;
}

.tgl-ad--header .tgl-ad__image {
    display: inline;
    width: auto;
    max-height: 40px;
    border-radius: 24px;
    margin-bottom: 0;
    vertical-align: middle;
    margin-right: 8px;
}

/* Inline — spacing within post content */
.tgl-ad--inline {
    margin: 32px auto;
}

/* Between-posts — used in archive/homepage loops */
.tgl-ad--between-posts {
    margin: 24px auto;
}

/* Sidebar */
.tgl-ad--sidebar {
    margin-bottom: 24px;
}

/* -------------------------------------------------------------------
   Embed code ads
   ------------------------------------------------------------------- */

.tgl-ad--code .tgl-ad__embed {
    overflow: hidden;
}

.tgl-ad--code .tgl-ad__embed iframe {
    max-width: 100%;
}

/* -------------------------------------------------------------------
   Carousel ads
   ------------------------------------------------------------------- */

.tgl-ad--carousel {
    position: relative;
    overflow: hidden;
}

.tgl-ad__carousel-track {
    position: relative;
    min-height: 100px;
}

.tgl-ad__slide {
    display: none;
    animation: tgl-ad-fade-in 0.4s ease;
}

.tgl-ad__slide--active {
    display: block;
}

@keyframes tgl-ad-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tgl-ad__slide .tgl-ad__image {
    margin-bottom: 0;
}

.tgl-ad__slide-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-top: 6px;
    text-align: center;
}

/* Arrows */
.tgl-ad__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
}

.tgl-ad__arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tgl-ad__arrow--prev { left: 8px; }
.tgl-ad__arrow--next { right: 8px; }

/* Dots */
.tgl-ad__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.tgl-ad__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.tgl-ad__dot--active {
    background: #374151;
}

.tgl-ad__dot:hover {
    background: #9ca3af;
}
