/**
 * Unlimited Text Ads — site.css
 * Shared layout for the homepage + "how it works" doc pages.
 * Relies on the CSS variables defined in main.css (--primary, --black, etc.)
 */

body {
    background:
        radial-gradient(circle at 12% -8%, rgba(220,53,69,.20), transparent 42%),
        radial-gradient(circle at 92% 6%, rgba(255,217,61,.09), transparent 38%),
        var(--black);
    background-attachment: fixed;
    color: var(--white); font-family: var(--font-family); margin: 0; line-height: 1.6;
}
a { color: inherit; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ── Top nav ─────────────────────────────────────────── */
.site-nav { border-bottom: 1px solid rgba(255,255,255,.07); position: sticky; top: 0; background: rgba(0,0,0,.9); backdrop-filter: blur(6px); z-index: 50; }
.site-nav .nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 20px; position: relative; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--white); text-decoration: none; flex-shrink: 0; }
.logo img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 24px; flex: 1; }
.nav-links a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; font-weight: 800; }
.nav-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.btn-go { background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 6px; text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }

/* Hamburger toggle (mobile only) */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(0,0,0,.97);
        border-bottom: 1px solid rgba(255,255,255,.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }
    .nav-links.open { max-height: 260px; }
    .nav-links a { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 15px; }
    .btn-go { padding: 9px 14px; font-size: 12px; }
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary { background: var(--primary); color: #fff; padding: 16px 34px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 16px; display: inline-block; transition: transform .2s, box-shadow .2s; box-shadow: 0 8px 24px rgba(220,53,69,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(220,53,69,.4); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: #fff; padding: 14px 32px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 16px; display: inline-block; transition: background .2s; }
.btn-outline:hover { background: rgba(220,53,69,.1); }

/* ── Hero (homepage) ─────────────────────────────────── */
.hero { text-align: center; padding: 70px 0 50px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(220,53,69,.12); border: 1px solid rgba(220,53,69,.35); color: #ff8787; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 7px 16px; border-radius: 30px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); font-weight: 800; line-height: 1.12; margin: 0 0 18px; letter-spacing: -.01em; }
.hero h1 span { color: var(--primary); }
.hero p.lead { font-size: 18px; color: rgba(255,255,255,.7); max-width: 620px; margin: 0 auto 30px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.trust-row { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.55); margin-top: 14px; }

/* ── Trade flow diagram ───────────────────────────────── */
.trade-flow { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 44px 0 6px; }
.flow-node { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 18px 24px; text-align: center; backdrop-filter: blur(8px); min-width: 128px; transition: transform .25s, border-color .25s; }
.flow-node:hover { transform: translateY(-3px); border-color: rgba(220,53,69,.4); }
.flow-node.accent { border-color: rgba(255,217,61,.4); background: rgba(255,217,61,.07); }
.flow-icon { font-size: 26px; margin-bottom: 8px; }
.flow-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85); line-height: 1.4; }
.flow-arrow { font-size: 20px; color: rgba(255,255,255,.25); }
@media (max-width: 640px) { .trade-flow { flex-direction: column; } .flow-arrow { transform: rotate(90deg); } }

/* ── Generic section ─────────────────────────────────── */
.section { padding: 54px 0; border-top: 1px solid rgba(255,255,255,.07); }
.section h2.section-title { font-size: 28px; font-weight: 800; text-align: center; margin: 0 0 10px; }
.section p.section-lead { text-align: center; color: rgba(255,255,255,.65); max-width: 560px; margin: 0 auto 34px; font-size: 15px; }

/* ── Card grid ────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: rgba(255,255,255,.035); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 22px; text-decoration: none; display: block; transition: border-color .2s, transform .2s, box-shadow .2s; }
a.card:hover { border-color: rgba(220,53,69,.4); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(220,53,69,.15); }
.card .icon { font-size: 24px; margin-bottom: 10px; }
.card h3 { font-size: 16px; margin: 0 0 8px; color: #fff; }
.card p { font-size: 13px; color: rgba(255,255,255,.6); margin: 0; }

/* Fixed 4-column layout for the "How Ad Share Works" steps — stays on one
   line at desktop/tablet widths instead of auto-fit's unpredictable wraps
   (e.g. 3 cards + one stretched-out orphan), with explicit breakpoints. */
.cards.four-up { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .cards.four-up { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cards.four-up { grid-template-columns: 1fr; } }

.step-card { position: relative; overflow: visible; }
.step-number {
    position: absolute; top: -12px; right: -12px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 14px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(220,53,69,.45);
}

/* ── Live example ad (homepage) ──────────────────────── */
.live-ads-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.live-ads-grid.single { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
@media (max-width: 720px) { .live-ads-grid { grid-template-columns: 1fr; } }
.live-ad-panel {
    background: linear-gradient(160deg, rgba(220,53,69,.10), rgba(255,217,61,.04));
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}
.live-ad-panel-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.5); margin-bottom: 14px; }
.live-ad-panel-label .dot { width: 7px; height: 7px; border-radius: 50%; background: #51cf66; box-shadow: 0 0 0 0 rgba(81,207,102,.6); animation: uta-live-pulse 1.6s ease-in-out infinite; }
@keyframes uta-live-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(81,207,102,.5); } 50% { box-shadow: 0 0 0 6px rgba(81,207,102,0); } }
.live-ad-frame { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; overflow: hidden; flex: 1; display: flex; align-items: stretch; min-height: 130px; }
.live-ad-frame > div { width: 100%; }

/* ── Alert box ────────────────────────────────────────── */
.alert-box {
    background: rgba(255,217,61,.08);
    border: 1px solid rgba(255,217,61,.3);
    border-radius: 10px;
    padding: 14px 20px;
    margin: 0 auto 26px;
    max-width: 520px;
    text-align: center;
}
.alert-box p { margin: 0; font-size: 14px; color: #ffe17d; font-weight: 600; }

/* ── Share box (homepage) ────────────────────────────── */
.share-box { background: linear-gradient(135deg, rgba(220,53,69,.15), rgba(220,53,69,.05)); border: 1px solid rgba(220,53,69,.3); border-radius: 16px; padding: 40px; text-align: center; }
.share-box h2 { margin-top: 0; }
.share-socials { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.share-socials a { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; padding: 10px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.share-socials a:hover { background: rgba(255,255,255,.15); }

/* ── Article / content pages ─────────────────────────── */
.article { padding: 44px 0 20px; max-width: 760px; }
.breadcrumb { font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 20px; }
.breadcrumb a { color: rgba(255,255,255,.5); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.article h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; margin: 0 0 20px; line-height: 1.25; }
.article h2 { font-size: 22px; font-weight: 800; margin: 40px 0 14px; color: var(--primary-light); }
.article p { font-size: 16px; color: rgba(255,255,255,.85); margin: 0 0 16px; }
.article ol, .article ul { margin: 0 0 20px; padding-left: 22px; }
.article li { font-size: 16px; color: rgba(255,255,255,.85); margin-bottom: 10px; }
.article code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: 'Courier New', monospace; color: #ffd93d; }
.article table { width: 100%; border-collapse: collapse; margin: 10px 0 26px; font-size: 14px; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.article th { color: rgba(255,255,255,.5); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.article .callout { background: rgba(220,53,69,.08); border: 1px solid rgba(220,53,69,.25); border-radius: 10px; padding: 18px 20px; margin: 0 0 20px; }
.article .callout p:last-child { margin-bottom: 0; }
.article .cta-box { text-align: center; background: var(--dark-gray); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 34px; margin: 40px 0 10px; }
.article .cta-box p { margin-bottom: 20px; }

/* ── Prev / next pager ────────────────────────────────── */
.page-pager { display: flex; justify-content: space-between; padding: 30px 0; gap: 16px; }
.pager-link { text-decoration: none; color: rgba(255,255,255,.8); font-weight: 600; font-size: 14px; border: 1px solid rgba(255,255,255,.1); padding: 12px 18px; border-radius: 8px; }
.pager-link:hover { border-color: var(--primary); color: #fff; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { border-top: 1px solid rgba(255,255,255,.07); padding: 44px 0 24px; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 30px; }
.footer-grid p { color: rgba(255,255,255,.55); font-size: 14px; margin: 12px 0 18px; max-width: 380px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.4); margin: 0 0 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid ul a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 14px; }
.footer-grid ul a:hover { color: #fff; }
.footer-bottom { text-align: center; color: rgba(255,255,255,.4); font-size: 13px; border-top: 1px solid rgba(255,255,255,.07); padding-top: 20px; }
.footer-bottom a { color: rgba(255,255,255,.6); }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
