/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-media-detective
 */
/* media-detective — spot the persuasion tricks in a pretend ad.
 * Warm, gentle, teacher-led: no scoring chrome anywhere.
 * Ad chrome varies by format: poster | social-post | packaging.
 * All inner ad sizes are in em so the whole ad scales from one font-size. */

.md-stage { font-family: 'Nunito', system-ui, sans-serif; color: #3d2f25; }
.md-stage [hidden] { display: none !important; }

/* ---- Ad navigation (progress, never a score) ----------------------------- */
.md-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.md-nav-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid #e3d5bd; background: #fff; color: #7c5e3c;
    font-size: 14px; cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.md-nav-btn:hover:not(:disabled) { background: #fdf6e9; border-color: #caa86d; transform: scale(1.06); }
.md-nav-btn:disabled { opacity: .35; cursor: default; }
.md-counter { font-weight: 800; font-size: 14px; color: #8a6d46; min-width: 84px; text-align: center; }
.md-dots { display: flex; gap: 7px; }
.md-dot {
    width: 11px; height: 11px; border-radius: 50%; border: none; padding: 0;
    background: #ead9bd; cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.md-dot.is-active { background: #e58f3f; transform: scale(1.3); }
.md-dot:disabled { cursor: default; }

/* ---- Layout: the ad + the detective side panel --------------------------- */
.md-layout {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px; align-items: start; max-width: 1100px; margin: 0 auto;
}
@media (max-width: 760px) { .md-layout { grid-template-columns: 1fr; } }

.md-ad-wrap { display: flex; flex-direction: column; }
.md-ad {
    border-radius: 18px; overflow: hidden;
    box-shadow: 0 8px 26px rgba(96, 64, 22, .16);
    display: flex; flex-direction: column;
    font-size: clamp(14px, 2vw, 20px);
}
.md-ad-tag { margin-top: 9px; text-align: center; font-size: 11.5px; font-weight: 700; color: #a8895f; }
.md-ad-tag i { margin-right: 5px; }

/* ---- Tappable zones ------------------------------------------------------- */
.md-zone {
    position: relative; display: block; width: 100%;
    border: none; background: transparent; color: inherit;
    font-family: inherit; font-size: inherit; line-height: 1.3; text-align: center;
    padding: .45em 1em; cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}
.md-zone:hover { transform: scale(1.015); filter: brightness(1.03); }
.md-zone:focus-visible { outline: 3px solid #2a9d8f; outline-offset: -3px; border-radius: 12px; z-index: 1; }

/* A spotted trick: soft amber ring + a little magnifying-glass badge. */
.md-zone.is-found { box-shadow: inset 0 0 0 3px rgba(244, 169, 27, .6); border-radius: 12px; }
.md-found-badge {
    position: absolute; top: .3em; right: .4em;
    width: 1.7em; height: 1.7em; border-radius: 50%;
    background: #fff; color: #c77b1c; border: 2px solid #f4a91b;
    display: flex; align-items: center; justify-content: center;
    font-size: .8em; box-shadow: 0 2px 6px rgba(96, 64, 22, .25);
    pointer-events: none;
    animation: md-pop .35s ease;
}
@keyframes md-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Trickless tap: a soft, friendly shimmer — never a penalty. */
.md-zone.is-shimmer::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .7) 50%, transparent 68%);
    background-size: 240% 100%;
    animation: md-shimmer 1.2s ease;
}
@keyframes md-shimmer { from { background-position: 130% 0; } to { background-position: -60% 0; } }
.md-whisper {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: rgba(61, 47, 37, .88); color: #fff8ed;
    font-size: 12.5px; font-weight: 800; white-space: nowrap;
    padding: .4em 1.1em; border-radius: 999px;
    pointer-events: none; z-index: 2;
    animation: md-whisper 1.5s ease forwards;
}
@keyframes md-whisper { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* Shared zone furniture */
.md-zone-image .md-image-emoji {
    display: inline-block; font-size: 4.4em; line-height: 1.1;
    filter: drop-shadow(0 6px 8px rgba(96, 64, 22, .25));
}
.md-zone-crowd { font-style: italic; font-weight: 700; color: #6f5430; font-size: .92em; }
.md-zone-crowd i { font-style: normal; margin-right: .35em; }
.md-zone-stars { color: #f4a91b; font-size: 1.35em; letter-spacing: .18em; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.md-price-tag {
    display: inline-block; background: #ffd234; color: #7a3b00; font-weight: 800;
    border: 2px dashed #d99a1b; border-radius: .7em; padding: .3em 1em;
    transform: rotate(-2deg);
}
.md-zone-smallprint { font-size: .6em; font-weight: 600; color: #85714f; padding: .6em 4em 2em; }

/* ====== Format: poster ===================================================== */
.md-format-poster {
    background:
        repeating-conic-gradient(from 0deg at 50% 28%, rgba(255, 255, 255, .4) 0deg 8deg, rgba(255, 255, 255, 0) 8deg 16deg),
        radial-gradient(circle at 50% 28%, #fff4c8 0%, #ffe18d 55%, #ffce63 100%);
    padding: .7em 0 0;
}
.md-format-poster .md-zone-brand { padding-bottom: .15em; }
.md-format-poster .md-brand-name {
    display: inline-block; background: #3d2f25; color: #ffe9b8;
    font-weight: 800; font-size: .78em; letter-spacing: .12em; text-transform: uppercase;
    border-radius: 999px; padding: .3em 1.2em;
}
.md-format-poster .md-zone-headline {
    font-size: 1.55em; font-weight: 800; line-height: 1.12; color: #a3320f;
    transform: rotate(-1.2deg);
}
.md-format-poster .md-zone-headline:hover { transform: rotate(-1.2deg) scale(1.015); }
.md-format-poster .md-claim-text {
    display: inline-block; background: #e2543e; color: #fff; font-weight: 800; font-size: 1.05em;
    padding: .32em 1.1em; border-radius: .6em; transform: rotate(1deg);
    box-shadow: 0 3px 0 rgba(122, 32, 14, .35);
}

/* ====== Format: social post ================================================ */
.md-format-social-post { background: #fff; border: 1px solid #e9e0d2; }
.md-format-social-post .md-zone { text-align: left; }
.md-format-social-post .md-zone-brand { display: flex; align-items: center; gap: .6em; padding: .7em .9em .45em; }
.md-avatar {
    width: 2.2em; height: 2.2em; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, #f59e0b, #ef6351); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1em;
}
.md-brand-meta { display: flex; flex-direction: column; line-height: 1.2; }
.md-format-social-post .md-brand-name { font-weight: 800; font-size: .95em; color: #33271d; }
.md-sponsored { font-size: .66em; font-weight: 700; color: #a09380; text-transform: uppercase; letter-spacing: .06em; }
.md-format-social-post .md-zone-headline { font-size: 1.05em; font-weight: 700; color: #3d2f25; padding: .1em .95em .5em; line-height: 1.35; }
.md-format-social-post .md-zone-image { background: linear-gradient(135deg, #fdeed3, #fbd9bd); padding: .85em 0; text-align: center; }
.md-format-social-post .md-claim-text {
    display: inline-block; background: #fef3d7; border: 1.5px solid #f3d68f; color: #9c6210;
    font-weight: 800; font-size: .95em; border-radius: .6em; padding: .3em .9em;
}
.md-format-social-post .md-zone-claim { padding: .5em .95em .15em; }
.md-format-social-post .md-zone-crowd { font-style: normal; font-weight: 800; color: #cf4f63; font-size: .9em; padding: .45em .95em .2em; }
.md-format-social-post .md-zone-stars { padding: .2em .95em; font-size: 1.15em; text-shadow: none; }
.md-format-social-post .md-zone-price { padding: .3em .95em .35em; }
.md-format-social-post .md-zone-smallprint { color: #9a8b75; padding: .3em 1.6em 1.4em; }

/* ====== Format: packaging ================================================== */
.md-format-packaging {
    background: linear-gradient(168deg, #7a4fbe 0%, #53309c 78%);
    color: #fff; border: .42em solid #f9c74f; padding: .25em 0 0;
}
.md-format-packaging .md-zone-brand { padding: .45em 0 .25em; }
.md-format-packaging .md-brand-name {
    display: inline-block; background: #f9c74f; color: #5b3b11;
    font-weight: 800; font-size: .95em; letter-spacing: .1em; text-transform: uppercase;
    padding: .28em 1.4em; border-radius: .45em; transform: rotate(-1deg);
    box-shadow: 0 3px 0 rgba(83, 48, 12, .3);
}
.md-format-packaging .md-zone-headline {
    font-size: 1.4em; font-weight: 800; line-height: 1.15; color: #fff;
    text-shadow: 0 2px 0 rgba(50, 24, 98, .5);
}
.md-format-packaging .md-zone-image { padding: .5em 0 .35em; }
.md-format-packaging .md-image-emoji {
    background: radial-gradient(circle, #ffffff 60%, #ffe9b8 100%);
    border-radius: 50%; padding: .16em .22em; font-size: 3.6em;
    box-shadow: 0 5px 14px rgba(40, 20, 80, .4);
}
.md-format-packaging .md-claim-text {
    display: inline-block; background: #ff5d8f; color: #fff; font-weight: 800; font-size: 1em;
    border-radius: 999px; padding: .32em 1.1em; transform: rotate(1.5deg);
    box-shadow: 0 3px 0 rgba(141, 18, 60, .4);
}
.md-format-packaging .md-zone-stars { color: #ffd234; text-shadow: none; }
.md-format-packaging .md-zone-crowd { color: #eadcff; }
.md-format-packaging .md-zone-smallprint {
    background: #f4ecdf; color: #6b5a3e; margin-top: .5em;
    padding: .9em 2.5em 1.1em;
}

/* ---- The detective's notebook (a collection, not a score) ----------------- */
.md-side { display: flex; flex-direction: column; gap: 14px; }
.md-tray { background: #fffdf6; border: 1.5px solid #f0e2c8; border-radius: 14px; padding: 13px 15px; }
.md-tray-label { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; color: #7c5e3c; }
.md-tray-count { font-weight: 700; color: #bca47c; font-size: 12.5px; }
.md-tray-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.md-tray-badges:empty { margin-top: 0; }
.md-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; border: 1.5px solid #f4a91b; color: #8a5a14;
    border-radius: 999px; padding: 6px 13px;
    font-family: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer;
    animation: md-pop .35s ease;
    transition: background .18s ease, transform .18s ease;
}
.md-badge:hover { background: #fff7e4; transform: scale(1.04); }
.md-tray-empty { margin-top: 8px; font-weight: 600; font-size: 12.5px; color: #bca47c; }

/* ---- The trick reveal (a discussion deepener, not a verdict) -------------- */
.md-reveal {
    background: linear-gradient(180deg, #fff8ec, #ffeecd);
    border: 1.5px solid #f3ce8e; border-radius: 14px; padding: 14px 16px;
}
.md-reveal.is-in { animation: md-slide-in .4s ease; }
@keyframes md-slide-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.md-reveal-head { display: flex; align-items: center; gap: 10px; }
.md-reveal-badge {
    width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%;
    background: #f4a91b; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; box-shadow: 0 3px 8px rgba(170, 109, 11, .35);
}
.md-reveal-label { font-weight: 800; font-size: 16px; color: #8a5a14; }
.md-reveal-explain { margin: 9px 0 0; font-weight: 600; font-size: 14.5px; line-height: 1.5; color: #6b5234; }

/* ---- Talking prompts (display-only; nothing typed or saved) ---------------- */
.md-discuss {
    background: linear-gradient(180deg, #f1faf6, #ddf2e9);
    border: 1.5px solid #a9d8c6; border-radius: 14px; padding: 13px 15px;
}
.md-discuss-btn {
    border: none; border-radius: 999px; background: #2a9d8f; color: #fff;
    font-family: inherit; font-weight: 800; font-size: 14px; padding: 9px 18px; cursor: pointer;
    transition: background .18s ease, transform .18s ease, opacity .18s ease;
}
.md-discuss-btn:hover:not(:disabled) { background: #268d80; transform: scale(1.03); }
.md-discuss-btn:disabled { opacity: .55; cursor: default; }
.md-discuss-btn i { margin-right: 6px; }
.md-discuss-hint { margin-top: 9px; font-weight: 700; font-size: 12.5px; color: #33705f; }
.md-discuss-list { margin: 11px 0 0; padding-left: 20px; animation: md-slide-in .4s ease; }
.md-discuss-list li { font-weight: 700; font-size: 14.5px; color: #1f5c4d; margin: 6px 0; line-height: 1.4; }

/* ---- Empty state ----------------------------------------------------------- */
.md-empty { text-align: center; padding: 46px 18px; font-weight: 800; font-size: 16px; color: #a8895f; }

/* ---- Display mode: the ad fills the IWB, huge type ------------------------- */
/* (Shared maths-activity.css hides the header + collapses min-height.) */
body.display-mode .md-dots { display: none; }
body.display-mode .md-layout { max-width: 1500px; gap: 26px; }
body.display-mode .md-ad { font-size: clamp(18px, 2.7vw, 30px); }
body.display-mode .md-counter { font-size: 18px; min-width: 110px; }
body.display-mode .md-nav-btn { width: 48px; height: 48px; font-size: 18px; }
body.display-mode .md-ad-tag { font-size: 14px; }
body.display-mode .md-tray-label { font-size: 17px; }
body.display-mode .md-tray-count { font-size: 15px; }
body.display-mode .md-tray-empty { font-size: 15px; }
body.display-mode .md-badge { font-size: 16px; padding: 8px 17px; }
body.display-mode .md-reveal-badge { width: 46px; height: 46px; font-size: 19px; }
body.display-mode .md-reveal-label { font-size: 22px; }
body.display-mode .md-reveal-explain { font-size: 19px; }
body.display-mode .md-discuss-btn { font-size: 18px; padding: 11px 22px; }
body.display-mode .md-discuss-hint { font-size: 15px; }
body.display-mode .md-discuss-list li { font-size: 19px; }
body.display-mode .md-whisper { font-size: 16px; }
body.display-mode .md-empty { font-size: 20px; }

/* ---- Accessibility ---------------------------------------------------------- */
.md-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
    .md-zone, .md-nav-btn, .md-badge, .md-discuss-btn, .md-dot { transition: none; }
    .md-zone:hover, .md-nav-btn:hover:not(:disabled), .md-badge:hover,
    .md-discuss-btn:hover:not(:disabled) { transform: none; }
    .md-found-badge, .md-badge, .md-reveal.is-in, .md-discuss-list,
    .md-zone.is-shimmer::after { animation: none; }
    .md-whisper { animation: none; opacity: 1; }
}
