/* Security BSides Kerala branding for the PUBLIC site at cfp.bsideskerala.in
   Loaded from the overridden common/includes/favicon.html, on every page.

   Public pages only. Everything here keys off #top-bg, #main-card or
   .event-hero, none of which exist in the organiser UI, so the file is inert
   there. The organiser UI is themed separately by admin-ui.css, which that
   same include emits only inside the "orga" URL namespace — keep the two
   apart, and do not put an #page-wrapper or nav.navbar rule in this file. */

/* NOTE ON SPECIFICITY: this file is injected via the overridden
   common/includes/favicon.html, which sits at the TOP of <head> -- so it
   loads BEFORE pretalx's own stylesheets. Any rule here that ties on
   specificity with a pretalx rule will LOSE. pretalx declares
   `#top-bg { height: 240px }` in public.css, so the selector below is
   `body #top-bg` (id + element) to outrank it regardless of order.
   Keep that in mind for any future override of a pretalx selector. */
body #top-bg {
    /* taller than pretalx's 240px so more of the artwork is visible;
       380px + 30% = 494px */
    height: 494px;
    /* kept as the fallback fill while the image loads, and behind its edges */
    background-color: var(--color-primary);
    background-image:
        linear-gradient(rgba(12, 14, 22, 0.42), rgba(12, 14, 22, 0.42)),
        url("/branding/kathakali.jpg");
    background-size: cover;
    background-position: center 33%;
    background-repeat: no-repeat;
}

/* The card sits directly under <header>, whose height pretalx fixes at 180px
   and never varies responsively. Raising that height is what moves the white
   card down the page; the "login" link rides with it because header is
   justify-content: flex-end. The band grew 380 -> 494 (+114), so the card
   moves down the same 114px (180 -> 294) and the overlap is unchanged. */
body header {
    height: 294px;
}

/* 494px of artwork would swallow a phone screen, so scale the band and the
   card offset together below the tablet breakpoint, keeping the ratio. */
@media (max-width: 768px) {
    body #top-bg { height: 330px; }
    body header  { height: 196px; }
}

@media (max-width: 480px) {
    body #top-bg { height: 260px; }
    body header  { height: 155px; }
}

/* ---------------------------------------------------------------------
   Baloo Chettan 2 (SIL Open Font License), self-hosted so visitors make no
   request to Google. Variable weight 400-800, Latin subsets only - the text
   that uses it is Latin. Add the malayalam subset from Google Fonts if
   Malayalam copy is ever needed.
   --------------------------------------------------------------------- */

@font-face {
    font-family: 'Baloo Chettan 2';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/branding/baloo-chettan2-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Baloo Chettan 2';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/branding/baloo-chettan2-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- dedicated event hero on the public index -------------------------
   The whole hero is a single <a>, so logo and text both lead to the event.
   Logo and text sit centred as a group in the white card; no dark panel.
   --------------------------------------------------------------------- */

/* the card otherwise reserves 300px and leaves dead space under the hero;
   :has() is already used by pretalx's own public.css, so it is safe here */
#main-card:has(.event-hero) {
    min-height: 0;
}

a.event-hero,
a.event-hero:hover,
a.event-hero:focus {
    text-decoration: none;
    color: inherit;
}

.event-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    padding: 2.5rem 1.5rem;
}

.event-hero__logo {
    flex: 0 0 auto;
    display: block;
}

.event-hero__logo img {
    display: block;
    width: 340px;          /* native width - no upscaling blur */
    max-width: 100%;
    height: auto;
}

.event-hero__meta {
    flex: 0 1 auto;
    min-width: 0;
}

.event-hero__name {
    font-family: 'Baloo Chettan 2', system-ui, -apple-system, sans-serif;
    font-weight: 800;      /* top of the variable font's wght axis */
    font-size: clamp(1.5rem, 2.6vw, 2.3rem);
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

a.event-hero:hover .event-hero__name,
a.event-hero:focus-visible .event-hero__name {
    text-decoration: underline;
}

.event-hero__desc {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-muted, #6c757d);
    margin: 0;
    max-width: 52ch;
}

/* only space the follow-on list when there actually is one */
.event-hero__other:empty {
    display: none;
}

.event-hero__other {
    margin-top: 2rem;
}

@media (max-width: 720px) {
    .event-hero {
        gap: 1.5rem;
        padding: 2rem 1.25rem;
        text-align: center;
    }
    .event-hero__logo img { width: 260px; }
    .event-hero__desc { margin-inline: auto; }
}



/* ============================================================
   THE LOGIN AND PASSWORD-RESET PAGES  --  the page colour
   ------------------------------------------------------------
   Asked for: #eff0f1 in place of pretalx's own page colour, which comes
   from orga/css/auth.css as `body { background: var(--color-primary) }`
   and resolves to the pretalx green #3aa57c.

   Reached through `body.bsk-auth`, set in the orga/auth/base.html
   override, so this stays off the public site. It is written here and
   not in a console stylesheet on purpose: these pages load no console
   CSS at all, and that is the arrangement that keeps them out of the
   organiser theme. See common/includes/favicon.html.

   The card needs the shadow. pretalx's card is white with a 1px
   rgb(0 0 0 / 0.125) border, which composites to #dfdfdf -- against
   #eff0f1 that edge measures 1.18:1 and the white face 1.14:1, so the
   form would have no discernible shape on the grey. The shadow is what
   separates them; the border is left exactly as pretalx draws it.
   ============================================================ */

body.bsk-auth {
    background: #eff0f1;
}

body.bsk-auth .card {
    box-shadow: 0 10px 30px rgba(17, 20, 24, 0.10);
}


/* ============================================================
   BUTTONS  --  black, flipping to BSides yellow
   ------------------------------------------------------------
   Every filled button on the public site and on the login and
   password-reset pages rests BLACK with white bold text and flips to
   #fdf220 with black text on hover, focus and press. White on black is
   21:1, black on the yellow is 17.9:1. The inversion IS the effect, so
   nothing is layered on top of it -- no fade, no lift.

   This replaces pretalx's own palette for these controls: green
   (--color-pretalx #3aa57c) for .btn-success, blue (#4697c9) for .btn-info.

   SCOPE -- two hooks, because the pages in question have no single marker:
     * `body:has(#top-bg)` -- the public site. #top-bg is the header band,
       present on every public page and on none of /orga/.
     * `body.bsk-auth` -- the login and password-reset pages. They live in
       the "orga" namespace but carry none of the organiser UI's markup, so
       neither #top-bg nor #page-wrapper identifies them. The class is set
       in the overrides/templates/orga/auth/base.html override.
   The organiser UI proper is reached by neither, and keeps its own theme.

   TWO KINDS OF BUTTON ARE DELIBERATELY EXCLUDED:
     * `.btn-link` / `.link` -- "Reset password", "Log out", "Back". pretalx
       gives these `--highlight-color: transparent` precisely so they read as
       text. Filling them black would turn each into a second button of equal
       weight and flatten the hierarchy on every page they appear.
     * `.btn-danger` / `.btn-outline-danger` -- withdrawing or deleting a
       proposal. Painting a destructive action the same as Submit removes the
       only signal that it is destructive. These stay red.
   Remove the matching :not() clauses to fold either group in.

   HOW. pretalx derives a button from --highlight-color, but `background` and
   `color` are set here outright rather than through the token, because the
   .btn-outline-* rule overrides the background with var(--color-bg)
   regardless of the token, and because pretalx's hover is
   `color-mix(in hsl, var(--highlight-color), black 10%)` -- pointing the
   token at #fdf220 would land on #e4da1d, a muddied yellow. The tokens are
   still set, so anything else deriving from them follows.
   ============================================================ */

body:has(#top-bg) .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger),
body.bsk-auth    .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger) {
    --highlight-color: #000000;
    --color-on-highlight: #ffffff;
    --highlight-color-text: #ffffff;

    background: #000000;
    color: #ffffff;

    /* carried in BOTH states so the box never changes size on hover, and so
       the yellow has an edge: #fdf220 on the white card measures 1.17:1 and
       would otherwise float with no discernible shape. Black at 21:1 does
       not need the help, but dropping it only at rest would make the button
       jump. */
    border: 1px solid #000000;
    font-weight: 700;
}

body:has(#top-bg) .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):hover,
body:has(#top-bg) .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):active,
body:has(#top-bg) .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):focus,
body.bsk-auth    .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):hover,
body.bsk-auth    .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):active,
body.bsk-auth    .btn:not(.btn-link):not(.link):not(.btn-danger):not(.btn-outline-danger):focus {
    background: #fdf220;
    color: #000000;
    border-color: #000000;
}

/* pretalx's focus ring is `color-mix(--highlight-color, white 55%)`, which
   against black is mid-grey and against the yellow is a pale cream -- weak
   either way. It also sets `box-shadow: none !important` on :focus, so a
   box-shadow here could not win; outline is the way in, and that rule does
   not touch it. The offset puts the ring on the white card, where black
   reads at 21:1 whichever state the button is in. */
body:has(#top-bg) .btn:focus-visible,
body.bsk-auth    .btn:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}
