/* ================================================================
   AMC Display — Native Ad Unit Styles
   Served by the plugin AND directly from the ad server for
   non-WordPress publishers (/css/display.css on the ad server).
   ================================================================ */

/* ── Container ─────────────────────────────────────────────────── */
.amc-display-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    margin: 1.25em 0;
    max-width: 100%;
}
.amc-display-wrap *,
.amc-display-wrap *::before,
.amc-display-wrap *::after {
    box-sizing: inherit;
}

/* ── Sponsored label ───────────────────────────────────────────── */
.amc-display-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 6px;
    padding-left: 2px;
}

/* ── The clickable card ────────────────────────────────────────── */
.amc-display-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}
.amc-display-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

/* ── Image ─────────────────────────────────────────────────────── */
.amc-display-img {
    display: block;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

/* ── Text block ────────────────────────────────────────────────── */
.amc-display-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}
.amc-display-headline {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 5px;
    line-height: 1.3;
    color: inherit;
}
.amc-display-desc {
    font-size: 13px;
    margin: 0 0 8px;
    color: #64748b;
    line-height: 1.45;
}
.amc-display-cta {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    background: #2563eb;
    color: #fff;
    align-self: flex-start;
    transition: background .15s;
}
.amc-display-card:hover .amc-display-cta { background: #1d4ed8; }

/* ================================================================
   LAYOUT: card (default) — horizontal, image inside text block
   ================================================================ */
.amc-display-layout-card .amc-display-card {
    border: 1px solid #e2e8f0;
    padding: 12px;
    background: #fff;
    gap: 0;
}
.amc-display-layout-card .amc-display-text {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}
.amc-display-layout-card .amc-display-img {
    width: 100px;
    height: 76px;
    border-radius: 5px;
    flex-shrink: 0;
}
.amc-display-layout-card .amc-display-text > .amc-display-img {
    /* image is inside .amc-display-text for card layout */
}
.amc-display-layout-card .amc-display-text > div,
.amc-display-layout-card .amc-display-text > .amc-display-headline {
    /* inner text group */
}
/* When image is placed inside text block for card layout */
.amc-display-layout-card .amc-display-card .amc-display-text {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: flex-start;
}
.amc-display-layout-card .amc-display-headline,
.amc-display-layout-card .amc-display-desc,
.amc-display-layout-card .amc-display-cta {
    grid-column: 2;
}
.amc-display-layout-card .amc-display-img {
    grid-column: 1;
    grid-row: 1 / 4;
}

/* ================================================================
   LAYOUT: bar — image on top, text below
   ================================================================ */
.amc-display-layout-bar .amc-display-card {
    flex-direction: column;
    border: 1px solid #e2e8f0;
    padding: 0;
    background: #fff;
    gap: 0;
    overflow: hidden;
}
.amc-display-layout-bar .amc-display-img {
    width: 100%;
    height: 180px;
    border-radius: 0;
    object-fit: cover;
}
.amc-display-layout-bar .amc-display-text {
    padding: 12px 14px 14px;
    gap: 0;
}
.amc-display-layout-bar .amc-display-headline { font-size: 15px; }
.amc-display-layout-bar .amc-display-desc     { margin-bottom: 10px; }

/* ================================================================
   LAYOUT: widget — narrow, for sidebar use
   ================================================================ */
.amc-display-layout-widget .amc-display-card {
    flex-direction: column;
    border: 1px solid #e2e8f0;
    padding: 0;
    background: #fff;
    gap: 0;
    overflow: hidden;
    border-radius: 8px;
}
.amc-display-layout-widget .amc-display-img {
    width: 100%;
    height: 160px;
    border-radius: 0;
    object-fit: cover;
}
.amc-display-layout-widget .amc-display-text {
    padding: 10px 12px 14px;
}
.amc-display-layout-widget .amc-display-headline { font-size: 14px; }
.amc-display-layout-widget .amc-display-desc     { font-size: 12px; margin-bottom: 8px; }
.amc-display-layout-widget .amc-display-cta      { font-size: 11px; padding: 4px 11px; }

/* ================================================================
   THEME: dark
   ================================================================ */
.amc-display-dark .amc-display-label { color: #64748b; }
.amc-display-dark .amc-display-card  {
    background: #1e293b;
    border-color: #334155;
}
.amc-display-dark .amc-display-headline { color: #f1f5f9; }
.amc-display-dark .amc-display-desc     { color: #94a3b8; }
.amc-display-dark .amc-display-cta      { background: #3b82f6; }
.amc-display-dark .amc-display-card:hover .amc-display-cta { background: #2563eb; }
.amc-display-dark .amc-display-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.4); }

/* ================================================================
   SKELETON loading state
   ================================================================ */
.amc-display-loading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}
.amc-display-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: amc-shimmer 1.4s infinite;
    border-radius: 4px;
}
@keyframes amc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.amc-sk-img      { width: 100px; height: 76px; flex-shrink: 0; border-radius: 5px; }
.amc-display-skeleton-text { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.amc-sk-headline { height: 16px; width: 80%; }
.amc-sk-desc     { height: 13px; width: 95%; }
.amc-sk-cta      { height: 26px; width: 90px; border-radius: 5px; margin-top: 4px; }

/* Fade in when ready */
.amc-display-inner { transition: opacity .3s ease; }
.amc-display-inner.amc-display-ready { opacity: 1; }

/* ================================================================
   Admin config error (shown only to admins when not configured)
   ================================================================ */
.amc-display-config-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: .7rem 1rem;
    font-size: .85rem;
    color: #856404;
}
.amc-display-config-error a { color: #856404; font-weight: 700; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 480px) {
    /* card layout falls back to bar on very small screens */
    .amc-display-layout-card .amc-display-card .amc-display-text {
        grid-template-columns: 1fr;
    }
    .amc-display-layout-card .amc-display-img {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        height: 150px;
        border-radius: 5px 5px 0 0;
    }
    .amc-display-layout-card .amc-display-headline,
    .amc-display-layout-card .amc-display-desc,
    .amc-display-layout-card .amc-display-cta {
        grid-column: 1;
    }
    .amc-display-layout-bar .amc-display-img { height: 140px; }
    .amc-sk-img { width: 72px; height: 56px; }
}
