/* ============================================================
   Data Science Africa Reveal.js Theme
   Matches the visual language of https://www.datascienceafrica.org/

   Usage in frontmatter:
     talktheme: white
     talkcss:   dsa.css

   Brand palette (from https://www.datascienceafrica.org/scheme):
     Panafrican Green : #008542
     DSA Black        : #231F20
     DSA Blue         : #183A63
     DSA Light Green  : #7DC24C
     Mint wash        : #F4FFF9
     Page white       : #FFFFFF
   ============================================================ */

/* -- Fonts ----------------------------------------------------------------
   The site uses Nexa for brand headings (proprietary). Montserrat is the
   closest open geometric substitute; Poppins is used on the site for body. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Poppins:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* -- Base slides ---------------------------------------------------------- */
.reveal {
    font-family: Poppins, Montserrat, 'Helvetica Neue', Arial, sans-serif;
    /* CIP-0014: deck size comes from talkfontsize via slide-fonts.css */
    color: #231F20;
    background-color: #ffffff;
}

.reveal .slides {
    text-align: left !important;
}

.reveal .slides > section {
    text-align: left !important;
    background: transparent;
}

/*
 * Full-page colour + brand chrome live on .slide-background (outside the
 * scaled slide; see https://revealjs.com/backgrounds/). That layer does not
 * receive Reveal's scale transform, so sizes use --slide-scale (set from
 * Reveal.getScale() in slides-header.html).
 *
 * Top 5px Panafrican Green bar matches the site header accent. Lockup is
 * the official DSA wordmark + Africa network map (white-background social
 * share artwork, cropped).
 */
.reveal .slide-background {
    background-color: #ffffff !important;
    background-image:
        url('diagrams/logos/dsa-logo.png'),
        linear-gradient(#008542, #008542) !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position:
        left calc(1.35rem * var(--slide-scale, 1)) top calc(1.45rem * var(--slide-scale, 1)),
        left top !important;
    background-size:
        calc(152px * var(--slide-scale, 1)) auto,
        100% calc(5px * var(--slide-scale, 1)) !important;
}

/* Reveal white theme sets ul/ol to inline-block, which centres them when
   the parent is text-align:center. Force block so lists sit left. */
.reveal ol,
.reveal dl,
.reveal ul {
    display: block !important;
    text-align: left !important;
    margin: 0.2em 0 0.6em 0 !important;
}

/* -- Headings ------------------------------------------------------------- */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
    font-family: Montserrat, Poppins, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.02em;
    color: #183A63;
}

.reveal h1 {
    font-size: 1.85em;
    font-weight: 700;
}

.reveal h2 {
    font-size: 1.35em;
    font-weight: 600;
    color: #183A63;
    margin-top: 0;
    margin-bottom: 0.55em;
}

.reveal h3 {
    font-size: 1.05em;
    color: #231F20;
}

/* -- Title slide ---------------------------------------------------------- */
.reveal section#title-slide {
    text-align: left !important;
}

.reveal section#title-slide h1.title {
    font-size: 2.1em;
    font-weight: 700;
    font-family: Montserrat, Poppins, 'Helvetica Neue', Arial, sans-serif;
    color: #183A63;
    text-align: left;
    line-height: 1.15;
    margin: 2.6rem 0 0.5rem 0;
}

.reveal section#title-slide p.subtitle {
    font-size: 0.95em;
    font-weight: 500;
    color: #231F20;
    text-align: left !important;
    margin: 0.2rem 0 1.2rem 0;
}

.reveal section#title-slide p.author,
.reveal section#title-slide p.date,
.reveal section#title-slide p.venue {
    font-size: 0.72em;
    color: #6A6A6A;
    text-align: left !important;
    margin: 0.15rem 0;
}

.reveal section#title-slide p.author {
    font-weight: 600;
    color: #231F20;
    margin-top: 1.4rem;
}

.reveal section#title-slide p.venue {
    color: #008542;
    font-weight: 500;
}

/* -- Cover slide (when cover-image is set; reuses Trent template markup) -- */
.reveal section#title-slide.trent-cover {
    display: grid !important;
    grid-template-columns: 58% 42%;
    align-items: stretch;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    text-align: left;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    background: transparent;
}

.reveal section#title-slide.trent-cover::after {
    content: none;
}

.reveal section#title-slide.trent-cover .trent-title-content {
    background: linear-gradient(155deg, #F4FFF9 0%, #ffffff 55%, #E8F5EC 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 2rem 2.5rem 2.5rem;
    position: relative;
    min-height: 100%;
}

.reveal section#title-slide.trent-cover .trent-logo {
    display: none;
}

.reveal section#title-slide.trent-cover h1.title {
    font-size: 2.0em;
    font-weight: 700;
    color: #183A63;
    line-height: 1.18;
    text-align: left;
    text-shadow: none;
    margin: 2.5rem 0 0.55rem 0;
}

.reveal section#title-slide.trent-cover p.subtitle {
    font-size: 0.85em;
    font-weight: 600;
    color: #231F20;
    opacity: 0.85;
    text-align: left;
    margin: 0.2rem 0 0.5rem 0;
}

.reveal section#title-slide.trent-cover p.date,
.reveal section#title-slide.trent-cover p.venue {
    font-size: 0.68em;
    color: #6A6A6A;
    text-align: left;
    margin: 0.15rem 0;
}

.reveal section#title-slide.trent-cover .trent-cover-photo {
    background: #183A63;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.8rem;
}

.reveal section#title-slide.trent-cover .trent-photo-card {
    width: 78%;
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    margin-bottom: 0.9rem;
    border: 3px solid #008542;
}

.reveal section#title-slide.trent-cover .trent-photo-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.reveal section#title-slide.trent-cover .trent-speaker-name {
    font-size: 0.75em;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin: 0.2rem 0 0 0;
}

.reveal section#title-slide.trent-cover .trent-speaker-role {
    font-size: 0.62em;
    color: #D0E8D8;
    text-align: center;
    margin: 0.1rem 0;
}

/* -- Lists ---------------------------------------------------------------- */
.reveal ul,
.reveal ol {
    margin-left: 0 !important;
    padding-left: 0;
    line-height: 1.55;
}

.reveal ul {
    list-style: none;
}

.reveal ul li {
    position: relative;
    padding-left: 0;
    margin-bottom: 0.4em;
}

.reveal ul li::before {
    content: '';
    display: inline-block;
    width: 0.42em;
    height: 0.42em;
    margin-right: 0.55em;
    border-radius: 50%;
    background: #008542;
    vertical-align: 0.12em;
}

/* -- Blockquotes ---------------------------------------------------------- */
.reveal blockquote {
    border-left: 4px solid #008542;
    background: #F4FFF9;
    color: #231F20;
    padding: 0.55em 1em;
    font-style: italic;
    font-weight: 400;
    width: 92%;
    box-shadow: none;
    font-size: 0.92em;
    margin: 0.5em 0;
}

/* -- Inline code & code blocks -------------------------------------------- */
.reveal code {
    background: #F4FFF9;
    color: #183A63;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.82em;
    border: 1px solid #E8F5EC;
}

.reveal pre {
    box-shadow: none;
    border-radius: 3px;
    border: 1px solid #E8F5EC;
    border-left: 4px solid #008542;
    background: #F4FFF9;
}

.reveal pre code {
    background: #F4FFF9;
    color: #183A63;
    font-size: 0.75em;
    padding: 0.8em 1em;
    border: 0;
}

/* -- Links ---------------------------------------------------------------- */
.reveal a {
    color: #183A63;
    text-decoration: none;
}

.reveal a:hover {
    color: #008542;
    text-decoration: underline;
}

/* -- Progress bar --------------------------------------------------------- */
.reveal .progress {
    background: rgba(24, 58, 99, 0.12);
    color: #008542;
}

.reveal .progress span {
    background: #008542;
    transition: width 0.8s cubic-bezier(0.26, 0.86, 0.44, 0.985);
}

/* -- Controls ------------------------------------------------------------- */
.reveal .controls {
    color: #183A63;
}

/* -- Tables --------------------------------------------------------------- */
.reveal table {
    border-collapse: collapse;
    font-size: 0.8em;
    color: #231F20;
}

.reveal table th {
    background: #183A63;
    color: #ffffff;
    padding: 0.4em 0.8em;
    font-weight: 600;
    border: 1px solid #183A63;
}

.reveal table td {
    padding: 0.35em 0.8em;
    border: 1px solid #E8F5EC;
}

.reveal table tr:nth-child(even) td {
    background: #F4FFF9;
}

/* -- Utility classes ------------------------------------------------------ */
.reveal .slides section.scrollable {
    overflow-y: auto !important;
    height: 100% !important;
    top: 0 !important;
    text-align: left;
}

.reveal p {
    text-align: left;
}

.reveal li {
    text-align: left;
}

.reveal .dsa-panel {
    background: #F4FFF9;
    color: #231F20;
    padding: 0.8em 1em;
    border-radius: 0.2rem;
    border-left: 4px solid #008542;
    font-weight: 500;
}

.reveal .dsa-green {
    color: #008542;
}

.reveal .dsa-blue {
    color: #183A63;
}

.reveal .dsa-light-green {
    color: #7DC24C;
}
