/**
 * Affiliate Links Styles
 *
 * Styles for affiliate links in blog posts with dotted underline
 * and superscript "i" indicator.
 */

/* --- Affiliate Link Wrapper --- */
.aff-wrap {
    white-space: nowrap;
}

/* --- Affiliate Link Styles --- */
.aff {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--natgeo-green, #22c55e);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.aff:hover,
.aff:focus {
    color: var(--natgeo-green-dark, #16a34a);
    text-decoration-color: var(--natgeo-green-dark, #16a34a);
}

/* --- Superscript Info Indicator --- */
.aff-i {
    display: inline;
    font-size: 0.6em;
    font-weight: 600;
    font-style: italic;
    color: var(--natgeo-green, #22c55e);
    margin-left: 1px;
    vertical-align: super;
    line-height: 1;
    user-select: none;
}

/* --- Legacy Support --- */
.affiliate-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--natgeo-green, #22c55e);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* --- Affiliate Disclosure Info Box --- */
.affiliate-disclosure {
    margin: clamp(2rem, 4vw, 3rem) 0 0;
    padding: 1rem 1.25rem;
    background: var(--natgeo-cloud, #faf8f2);
    border-left: 3px solid var(--natgeo-green, #22c55e);
    border-radius: 0 0.375rem 0.375rem 0;
    font-family: var(--natgeo-sans, system-ui, sans-serif);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--natgeo-muted, #6f7376);
}

.affiliate-disclosure__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--natgeo-green, #22c55e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.affiliate-disclosure__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.affiliate-disclosure__text {
    margin: 0;
}

.affiliate-disclosure__text--de {
    color: var(--natgeo-ink, #1f2326);
}

.affiliate-disclosure__text--en {
    font-style: italic;
    opacity: 0.85;
}

/* Alternative single-language display based on page language */
html[lang="de"] .affiliate-disclosure__text--en {
    display: none;
}

html[lang="en"] .affiliate-disclosure__text--de {
    display: none;
}

/* Show both languages if no lang attribute */
html:not([lang]) .affiliate-disclosure__text--de,
html:not([lang]) .affiliate-disclosure__text--en {
    display: block;
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    .affiliate-disclosure {
        padding: 0.875rem 1rem;
        font-size: 0.75rem;
    }

    .affiliate-disclosure__icon {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* --- Print styles --- */
@media print {
    .aff-i {
        content: "";
    }

    .aff-wrap::after {
        content: " (Affiliate)";
        font-size: 0.75em;
        font-style: normal;
    }

    .affiliate-disclosure {
        background: #f5f5f5;
        border-left-color: #666;
        page-break-inside: avoid;
    }
}
