@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-Regular.ttf");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-Bold.ttf");
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-Italic.ttf");
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: "Roboto";
    src: url("./fonts/Roboto-BoldItalic.ttf");
    font-weight: bold;
    font-style: italic;
}

:root {
    --light-pink: hsl(350, 63%, 74%);
    --background-pink: hsl(350, 33%, 94%);
    --dark-pink: hsl(333, 85%, 30%);
    --light-blue: hsl(222, 26%, 62%);
    --background-blue: hsl(222, 26%, 82%);
    --dark-blue: hsl(196, 81%, 35%);
}

/* RESET */

*,
*::after,
*::before {
    box-sizing: border-box;
    margin: 0;
}

input,
button,
textarea,
select {
    font: inherit;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-inline-size: 100%;
    margin-inline: auto;
}

h2,
h3,
h4,
h5,
h6 {
    margin-block-start: 1em;
}

ul {
    margin-block-start: 0.5em;
}

ul ul {
    margin-block-start: 0;
}

h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
blockquote,
table {
    line-height: calc(1em + 0.6rem);
}

p,
img {
    margin-block-start: 0.75em;
}

h1 {
    line-height: 1.2;
    margin-block-start: 1rem;
}

/* TYPOGRAPHY & BASE DESIGN */

html {
    font-family: "Roboto", sans-serif;
    font-size: 1.15rem;
    font-size: clamp(1rem, 0.7rem + 1vw, 1.25rem);
    background: var(--background-blue);
}

h1 em {
    display: block;
    font-size: 0.66em;
    opacity: 0.66;
}

/* LAYOUT */

main {
    max-width: 70ch;
    max-inline-size: 70ch;
    margin-inline: auto;
    padding-inline: 1rem;
    padding-block-end: 5rem;
}

summary h2,
summary h3 {
    display: inline;
    line-height: 2em;
}

table li {
    list-style-type: none;
}

table ul {
    padding-inline-start: 0;
}

/* tables */

table {
    inline-size: 100%;
    margin-block-start: 1em;
}

table details[open] {
    margin-inline-start: -12ch;
    margin-block-end: 1rem;
}
table details[open] summary {
    margin-inline-start: 12ch;
}
th {
    text-align: start;
}

td {
    border-block-end: thin solid var(--light-blue);
}
.table-time {
    text-align: end;
    padding-inline-end: 1ch;
    inline-size: 11ch;
    vertical-align: top;
}

tr:has(~ .is-present) {
    color: gray;
}

tr.is-present {
    color: var(--dark-pink);
}

.table-event {
    padding-inline-start: 1ch;
}

.table-end {
    border-block-end: 3px solid var(--dark-blue);
}

/* starred */

li:has(button.starred) {
    background-color: var(--light-blue);
}

button.starred ~ button {
    color: unset;
}

button {
    background: 0;
    border: 0;
    font-size: 1.1em;
    white-space: normal;
    word-wrap: break-word;
}

/* popups */

dialog {
    border: 3px solid var(--dark-blue);
    border-radius: 1rem;
    background: var(--background-blue);
}

dialog::backdrop {
    background: hsl(0 0 0 / 0.75);
    background: color-mix(in oklch, var(--dark-blue), 80% black);
    opacity: 0.75;
}

dialog[open] {
    inset-block: 2ch;
    inset-inline: 0.5ch;
    margin-inline: auto;
}

dialog img {
    max-inline-size: 15em;
    inline-size: 50%;
    float: left;
    margin-right: 1ch;
}

dialog h2 {
    margin-block-start: 0.5em;
    text-align: center;
    text-wrap: balance;
}

dialog button {
    margin-block-start: 1rem;
    inline-size: 100%;
    border: 2px solid var(--light-blue);
    background: var(--light-blue);
    font-size: 1.5em;
    border-radius: 1rem;
}
/* pink links */

a {
    color: var(--dark-pink);
}

button.open-modal {
    text-decoration: underline;
    font-size: 1em;
    background: 0;
    border: 0;
    padding-inline: 0;
    color: var(--dark-pink);
}

/* NAVIGATION */

#toggle-nav {
    display: none;
}

nav {
    position: fixed;
    background: var(--light-blue);
    inset-block-end: 0;
    inline-size: 100%;
}
nav ul {
    padding: 1ch;
    display: flex;
    place-content: center;
    gap: 2ch;
    margin-block: 0.5ch;
}
nav li {
    width: max-content;
    inline-size: max-content;
    padding-inline: 1ch;
    margin-inline: 0;
}
nav li::marker {
    content: none;
}

nav a {
    font-weight: bold;
    color: unset;
    text-decoration: none;
}

@media (max-width: 800px) {
    #toggle-nav {
        display: unset;
        position: fixed;
        inset-block-end: 0;
        inset-inline: 0;
        font-family: inherit;
        font-size: 120%;
        background: var(--light-pink);
        padding: 0.5ch 1ch;
        border: 0;
        z-index: 100;
    }
    nav {
        transform: translateY(100%);
        transition: transform 300ms ease-in-out;
        z-index: 10;
        box-shadow: 5px 0px 50px var(--lines);
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1ch;
        margin-block-end: 3rem;
    }

    nav[data-visible] {
        transform: translateY(0%);
    }
}
