/**** -*- mode: css -*- ****/

:root {
    font-family: "IBM Plex Sans", sans-serif;
    
    /* font-size: 14pt; */

    --bg-0: #070707;
    --bg-1: #0f0f0f;
    --bg-2: #151515;

    --fg-1: #ffffff;
    --fg-2: #d0d0d0;
    --fg-3: #9f9f9f;

    --mid-1: #4f4f4f;

    --accent-1: #00cd00;
    --accent-2: #4d9905;
}

body {
    margin: 0;
    
    color: var(--fg-1);
    
    background-color: var(--bg-1);
    background-image: var(--topography-accented);
    background-attachment: fixed;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/*** Misc. ***/

/** Links **/
a:link, a:visited {
    color: inherit;
}

a:hover {
    color: var(--fg-2);
}

a:active {
    color: var(--fg-3);
}

/** Widgets **/

button, .buttonish {
    display: block;
    
    background-color: var(--bg-1);
    color: var(--fg-1);

    font-family: inherit;
    text-decoration: none;
    text-align: center;
    font-size: 95%;
    white-space: nowrap;

    padding: 0.25em 1em;
    border: 1px solid var(--accent-2);
    border-radius: 50em;
    box-shadow: 2px 2px 0 var(--accent-2);
}

.buttonish:hover, .buttonish:active {
    /* avoids a.buttonish having a darker face when hovered/active */
    color: var(--fg-1);
}

button:hover, .buttonish:hover {
    background-color: var(--bg-2);
}

button:active, .buttonish:active {
    background-color: var(--bg-0);
    box-shadow: initial;
    transform: translate(2px, 2px);
}

/** Markup **/

strong {
    font-weight: bold;
    color: var(--accent-2);
}

li {
    margin: 0.25em 0;
}

article h1 {
    font-size: 150%;
}

p {
    text-align: justify;
}

/** Blocks **/

body > section:not(.bare) {
    background-color: var(--bg-1);
    background-image: var(--topography-mute);
    background-attachment: fixed;

    padding: 0.5em 2em;
    display: flex;
    flex-direction: column;
}

body > section > * {
    width: 100%;
    max-width: 60em;
    margin: 0 auto;
}

/** Icons **/

.icon span {
    display: none;
}


/*** Header ***/

:root {
    /* see styles for the banner below */
    /* perhaps we should just have the header as fixed instead? */
    --header-height: 2em;
    --header-v-padding: 1em;
}

header {
    min-height: var(--header-height);
    height: var(--header-height);
    
    padding: var(--header-v-padding) 1.5em;

    position: sticky;
    top: 0;
    z-index: 1;

    background-color: var(--bg-1);
    background-image: var(--topography-mute);
    background-attachment: fixed;

    mask-image: linear-gradient(black, black 75%, transparent);
    overflow: clip;
}

header, header ul {
    display: flex;
}

header img {
    height: var(--header-height);
}

header nav {
    margin: 0.25em auto;
    margin-right: 0;
}

header a {
    font-weight: bold;
    text-decoration: none;
}

header ul {
    margin: 0 0.5em;
    gap: 2em;

    min-height: 100%;

    align-items: center;
    flex-wrap: wrap;
    justify-content: end;

    text-align: end;
}

header li {
    list-style-type: none;
    margin: 0;
}

/** Collapsible navigation, CSS-only! **/
/** Couldn't figure out a way to do it without the label element, though :( **/

label[for="expand-nav"] .hide-expand {
    display: none;
}

header:has(#expand-nav:checked) {
    height: initial;
    mask-image: initial;

    box-shadow: 0 1px 0 var(--accent-2);
}

#expand-nav {
    display: none;
}

label[for="expand-nav"] {
    /* totally eyeballed */
    padding: 0.25em;
}

#expand-nav + label[for="expand-nav"]:after {
    content: "▼";
}

#expand-nav:checked + label[for="expand-nav"]:after {
    content: "▲";
}


/*** Banner ***/

#banner {
    font-size: 110%;

    box-shadow: 4px 4px 0 var(--bg-1);
    
    margin: 0.5em;
    border: 1px solid var(--accent-2);
    border-radius: 0.25em;
    padding: 2em;

    display: flex;
    flex-direction: column;

    background-color: var(--bg-1);
    background-image: var(--topography-mute);
    background-attachment: fixed;    
}

div:has(#banner) {
    min-height: calc(100vh - var(--header-height) - 2*var(--header-v-padding)); /* bleh */
    
    display: flex;
    align-items: center;
    justify-content: center;

    border-bottom: 1px solid var(--accent-2);
}

#banner {
    max-width: 32em;
}

#banner .date {
    display: block;
    font-weight: bold;
    margin: 0 auto;
    font-size: 150%;
}

#banner p {
    text-align: justify;
}

#banner img {
    padding: 1em 2em;
}

#banner button, #banner .buttonish {
    margin: 0.5em auto;
}


/*** Location ***/

#location img {
    width: 100%;
    max-width: 28em;
    height: 100%;
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.spurious {
    opacity: 0;
}

.spurious:hover {
    opacity: initial;
}


/*** Schedule ***/

.event-schedule {
    font-size: 95%;
}

table {
    border-collapse: collapse;
}

tr {
    border-bottom: 1px dashed var(--mid-1);
}

.event-schedule tr:last-child {
    border-bottom: 2px solid white;
}

.event-schedule tr td:first-child {
    font-style: italic;
    vertical-align: top;
    text-align: right;
}

td, th {
    padding: 0.5em 1em;
    vertical-align: center;
    
    border-left: 1px solid var(--mid-1);
}

th {
    border-left-style: dashed;
}

td:first-child, th:first-child {
    border-left: none;
}

.talk-title {
    font-weight: bold;
}


/*** Galleries (about, sponsors) ***/

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    margin: 2em;
    margin-top: 0;
    gap: 1em;
}

.gallery > * {
    max-width: 18em; /* section max-width / 3 - margins */
}

.polaroid.gallery {
    float: right;
    max-width: 25em;
    gap: 0;
}

.polaroid.gallery > * {
    margin: 1em;
    width: calc(33% - 0.5em);
    margin: 0.25em;
}

.polaroid.gallery > * {
    aspect-ratio: 35/42;
    transform: rotate(-5deg);
    filter: drop-shadow(2px 2px 16px black);
}

.polaroid.gallery svg {
    width: 100%;
}

.polaroid.gallery > a[href] {
    --img: attr(href url);
}

.polaroid.gallery > *:nth-child(odd) {
    transform: rotate(7deg);
}

.polaroid.gallery > *:nth-child(1) {
    transform: rotate(3deg);
}

/* .gallery.polaroid > * { */
/*     aspect-ratio: 1/1; */
/*     /\* width: 31px; *\/ */
/*     /\* height: 31px; *\/ */
/*     border: 2px solid #E0E2DC; */
/*     border-bottom: 9px solid #E0E2DC; */
/* } */

figure {
    text-align: center;
}

figure img {
    max-width: 100%;
}

figcaption {
    font-style: italic;
}

#sponsors figure.capybara {
    max-width: 30em;
    margin-left: auto;
    margin-right: auto;
}


/*** Footer ***/

footer {
    display: flex;
    
    background-color: var(--bg-1);
    background-image: var(--topography-mute);
    background-attachment: fixed;

    padding: 1em 0;

    margin-top: auto;
}

/** totally cursed, but it seems to work **/
/** though it renders blurry at 75% scale, as pixel-perfect would make the bird too big :( **/

footer article::before {
    background-image: url("../image/andorinha-only.svg");
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    margin-left: 40px; /* 54px */
    content: "";
    height: 169px; /* 226px */
    width: 139px; /* 186px */
}

footer article {
    width: 100%;
    min-height: 169px; /* 226px */
    
    background-image: url("../image/pattern-only.svg");
    background-repeat: repeat-x;
    background-position: center 87px; /* 116px */
    background-size: 45px 34px; /* 60px 45px */
}

footer article > div {
    display: inline-flex;
    width: calc(100% - 184px);
    /* right beside the bird's tail */
    transform: translate(-96px, -14px);
    font-size: 80%;
}


/*** RSS Feed ***/

.publication-date {
    font-size: 0.8em;
    font-style: italic;
}

#feed article {
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
}

#feed h3 {
    color: var(--accent-2);
    margin-bottom: 0.5em;
}

#feed article object {
    max-height: 24em;
    max-width: calc(100vw - 4em);
    margin: 1em auto;
}


/*** Mobile ***/

@media (max-width: 40em) {
    body {
        background-image: var(--topography-mute);
    }

    div:has(#banner) {
        display: initial;
        min-height: initial;
        border-bottom: initial;
    }
    
    #banner {
        max-width: initial;
        border: 0;
    }

    .polaroid.gallery {
        margin: 1em;
        max-width: initial;
        float: initial;
    }
}
