/*
 * Ad Secretary brand layer: white + orange (light, the default), black + orange (dark).
 * Loaded after the application stylesheet, so it only restates colour tokens.
 *
 * Orange scale (one hue, used consistently):
 *   50 #fff7ed  100 #ffedd5  200 #fed7aa  300 #fdba74  400 #f58a45
 *   500 #eb5f16 (brand, the monogram colour)  600 #d4500d (hover)  700 #b3420a (pressed)
 */
:root {
    --adsec-50: #fff7ed;
    --adsec-100: #ffedd5;
    --adsec-200: #fed7aa;
    --adsec-300: #fdba74;
    --adsec-400: #f58a45;
    --adsec-500: #eb5f16;
    --adsec-600: #d4500d;
    --adsec-700: #b3420a;

}

/* The panel picks a named theme on <html>; these selectors outrank it so the brand colours hold. */
:root,
html[data-theme] {
    /* Panel, light */
    --background: hsl(0 0% 100%);
    --foreground: hsl(20 14% 8%);
    --primary: hsl(21 84% 50%);
    --primary-foreground: hsl(0 0% 100%);
    --secondary: hsl(30 25% 94%);
    --muted: hsl(30 20% 96%);
    --accent: hsl(33 100% 96%);
    --accent-foreground: hsl(21 90% 30%);
    --border: hsl(30 12% 89%);
    --input: hsl(30 10% 82%);
    --ring: hsl(21 84% 50%);
    --inertia: hsl(21 84% 50%);
    --chart-1: hsl(21 84% 50%);
    --sidebar-background: hsl(30 30% 98.5%);
    --sidebar: hsl(30 30% 98.5%);
    --sidebar-primary: hsl(21 84% 50%);
    --sidebar-primary-foreground: hsl(0 0% 100%);
    --sidebar-accent: hsl(21 84% 50% / 0.1);
    --sidebar-accent-foreground: hsl(21 90% 40%);
    --sidebar-border: hsl(30 14% 91%);
    --sidebar-ring: hsl(21 84% 50%);
}

.dark,
html[data-theme].dark {
    /* Panel, dark: true black surfaces, orange lifted one step for contrast */
    --background: hsl(0 0% 3.5%);
    --foreground: hsl(30 10% 97%);
    --card: hsl(0 0% 6%);
    --popover: hsl(0 0% 6%);
    --primary: hsl(22 90% 58%);
    --primary-foreground: hsl(0 0% 5%);
    --secondary: hsl(0 0% 13%);
    --muted: hsl(0 0% 13%);
    --accent: hsl(22 90% 58% / 0.14);
    --accent-foreground: hsl(30 100% 78%);
    --border: hsl(0 0% 16%);
    --input: hsl(0 0% 22%);
    --ring: hsl(22 90% 58%);
    --inertia: hsl(22 90% 58%);
    --chart-1: hsl(22 90% 58%);
    --sidebar-background: hsl(0 0% 5.5%);
    --sidebar: hsl(0 0% 5.5%);
    --sidebar-primary: hsl(22 90% 58%);
    --sidebar-primary-foreground: hsl(0 0% 5%);
    --sidebar-accent: hsl(22 90% 58% / 0.14);
    --sidebar-accent-foreground: hsl(30 100% 74%);
    --sidebar-border: hsl(0 0% 14%);
    --sidebar-ring: hsl(22 90% 58%);
}

/* Public website, dark */
.site-theme {
    --ag-page: #070707;
    --ag-sunk: #0b0b0b;
    --ag-panel: #111111;
    --ag-raised: #191919;
    --ag-hover: #222222;
    --ag-text: #f7f5f2;
    --ag-text-2: #a8a39c;
    --ag-text-3: #726d66;
    --ag-live: var(--adsec-400);
}

/* Public website, light */
.site-theme.site-light {
    --ag-page: #ffffff;
    --ag-sunk: #fcf8f3;
    --ag-panel: #ffffff;
    --ag-raised: var(--adsec-50);
    --ag-hover: var(--adsec-100);
    --ag-text: #17120d;
    --ag-text-2: #5f574e;
    --ag-text-3: #8b8379;
    --ag-hair: rgb(23 18 13 / 0.09);
    --ag-hair-strong: rgb(23 18 13 / 0.16);
    --ag-live: var(--adsec-600);
}

/* Primary call to action: orange, white label */
.site-theme .ag-btn {
    background: var(--adsec-500);
    color: #ffffff;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 16px -6px rgb(235 95 22 / 0.5);
}
.site-theme .ag-btn:hover { background: var(--adsec-600); }
.site-theme .ag-btn:active { background: var(--adsec-700); }

.site-theme .ag-eyebrow { color: var(--ag-live); font-weight: 560; }
.site-theme [data-test="hero-word"] { color: var(--adsec-500); }

/* The box where a link or an idea goes */
.site-theme #start {
    border-color: color-mix(in srgb, var(--adsec-500) 55%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--adsec-500) 12%, transparent);
}
.site-theme #start:focus-within {
    border-color: var(--adsec-500);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--adsec-500) 24%, transparent);
}
.site-theme a.ag-link:hover { color: var(--ag-live); }
::selection { background: var(--adsec-200); color: #17120d; }

/* Flags in the language menu */
.adsec-flag {
    display: inline-block;
    width: 20px;
    height: 15px;
    flex: none;
    margin-inline-end: 0.5rem;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: -2px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.12);
}

/* Public website surfaces: pure white in light, true black in dark */
.site-theme {
    --background: #070707;
    --foreground: #f7f5f2;
    --card: #111111;
    --card-foreground: #f7f5f2;
    --popover: #111111;
    --popover-foreground: #f7f5f2;
    --primary: var(--adsec-500);
    --primary-foreground: #ffffff;
    --secondary: #191919;
    --muted: #191919;
    --muted-foreground: #a8a39c;
    --accent: #1f1611;
    --accent-foreground: #ffd9c2;
    --ring: var(--adsec-400);
    --site-accent: var(--adsec-400);
    --site-accent-foreground: #0b0b0b;
}
.site-theme.site-light {
    --background: #ffffff;
    --foreground: #17120d;
    --card: #ffffff;
    --card-foreground: #17120d;
    --popover: #ffffff;
    --popover-foreground: #17120d;
    --primary: var(--adsec-500);
    --primary-foreground: #ffffff;
    --secondary: #f7f1ea;
    --secondary-foreground: #17120d;
    --muted: #f7f1ea;
    --muted-foreground: #645c53;
    --accent: var(--adsec-50);
    --accent-foreground: #7a2e06;
    --border: rgb(23 18 13 / 0.11);
    --input: rgb(23 18 13 / 0.2);
    --ring: var(--adsec-500);
    --site-accent: var(--adsec-500);
    --site-accent-foreground: #ffffff;
}

/* Language button: the flag stands in for the globe and the two-letter code */
.adsec-locale-trigger > svg:first-of-type,
.adsec-locale-trigger > span.uppercase { display: none; }
.adsec-flag-trigger { width: 24px; height: 18px; margin-inline-end: 0; border-radius: 3px; }

/* Monogram in place of the shipped mark */
.adsec-mark { display: inline-block; width: auto; flex: none; object-fit: contain; }

/* Where the shipped mark sat inside a coloured square, the monogram stands alone */
*:has(> img.adsec-mark) {
    background: transparent !important;
    width: auto !important;
    min-width: 0;
    aspect-ratio: auto !important;
    overflow: visible;
    box-shadow: none !important;
}

/* Header call to action in the brand colour */
.site-theme .cta.site-btn { background: var(--adsec-500); color: #ffffff; }
.site-theme .cta.site-btn:hover { background: var(--adsec-600); }

/* Phones: the language flag stays in the header, and everything is sized to fit */
@media (max-width: 639px) {
    .site-theme header [data-test="locale-menu"] { display: flex !important; padding-inline: 0.25rem; }
    .site-theme header [data-test="locale-menu"] > svg:last-of-type { display: none; }
    .site-theme header img.adsec-mark { height: 22px !important; }
    .site-theme header .logo-text { font-size: 14px; }
    .site-theme header .cta.site-btn { padding-inline: 0.7rem; font-size: 13px; }
}

/* "New video ad" in the sidebar: grows with its label, so a longer translation never clips */
[data-test="sidebar-new"] { height: auto !important; min-height: 2.5rem; }
[data-test="sidebar-new-video"] { padding-block: 0.55rem; line-height: 1.25; min-width: 0; text-wrap: balance; }
[data-test="sidebar-new-video"] > svg { flex: none; }

/* Our own images never wait on the fade-in the application gives its pictures */
img.adsec-mark, img.adsec-flag { opacity: 1 !important; transition: none !important; }

/* Phones: the monogram already says the name, so the wordmark makes room for the buttons */
@media (max-width: 479px) {
    .site-theme header .logo-text { display: none; }
}
