@import url("./colors.css");
@import url("./fonts.css");
@import url("./themes.css");

/* General Layout */

* {
    padding: 0;
    border: 0;
    margin: 0;
    outline: 0;
    box-sizing: border-box;
    transition: all var(--transition-normal);

    &::selection {
        border-radius: 0.5rem;
        background-color: var(--accent);
        color: var(--background);
    }
}

:root,
body,
.app {
    width: 100%;
    height: 100%;
    gap: 0;
}

:root {
    background-color: var(--background);
    color: var(--text);
    font-size: 16px;
    transition: background-color var(--transition-normal);
    scroll-behavior: smooth;
    --icon-color: var(--text);
    --icon-stroke-width: 0.125rem;

    --max-width: 85rem;
    --column-width: 12.5rem;

    --transition-quick-time: 100ms;
    --transition-normal-time: 200ms;
    --transition-slow-time: 500ms;
    --transition-really-slow-time: 2000ms;

    --transition-quick: 100ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 500ms ease-out;
    --transition-really-slow: 2000ms ease-out;

    --skeletoon-shine-offset: 0ms;
}

@media screen and (width <= 60rem) {
    :root {
        font-size: 14px;
    }
}

@media screen and (width <= 40rem) {
    :root {
        font-size: 12px;
    }
}

body {
    display: grid;
    place-items: start center;
}

main {
    gap: 2rem;
    width: 100%;

    &.content {
        grid-area: 2 / 2 / 3 / 6;
    }

    section {
        margin-bottom: 2rem;
    }
}

ul,
ol {
    list-style-position: inside;
}

/* Headers */

:root {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    line-height: 150%;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.15rem;
}

h6 {
    font-size: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    scroll-margin-top: 8rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
.fancy {
    font-family: "Rowan", serif;
    line-height: 150%;
}

* {
    transition: color ease-in-out var(--transition-normal-time);
}

/* Other text styles */

.tag {
    text-transform: uppercase;
    font-weight: bold;
    transition: color ease-in-out var(--transition-quick-time);
}

.tag.small {
    font-size: 0.85rem;
}

/* Layout classes */

.max-width-wrapper {
    width: 100%;
    max-width: var(--max-width);
}

.main-content {
    display: grid;
    place-items: start center;
    padding: 6rem 1rem;
    min-height: 100vh;
    flex: 1;
    height: fit-content;
}

.row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-aside {
    grid-area: 2 / 1 / 2 / 2;
    gap: 0.5rem;
}

/* Style override */

button,
input {
    background: unset;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    align-items: center;
}

/* Anchor */

a {
    color: var(--accent);
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: 8%;
    text-underline-offset: 12.5%;
    text-underline-position: from-font;
    font-weight: bold;

    &.no-accent {
        color: var(--text);
    }

    &.no-decoration {
        text-decoration: none;
    }
}

/* Button */

.button {
    min-width: 2.5rem;
    width: auto;
    height: 2.5rem;
    display: flex;
    flex-direction: row;
    padding: 0.5rem 1rem;
    font-weight: bold;
    transition: all var(--transition-normal);
    --icon-color: var(--text-off);

    &.primary {
        background-color: var(--accent);
        color: var(--background);
        --icon-color: var(--background);
    }

    &.secondary {
        background-color: var(--background-off);
        --icon-color: var(--text-off);

        &:hover {
            --icon-color: var(--text);
        }
    }

    &.icon {
        padding: 0.5rem;
    }
}

/* Table */

.table-inner {
    max-height: 35rem;
    overflow-x: hidden;
}

.table {
    position: relative;
    background-color: var(--background-off);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead,
tr,
th,
td {
    height: 2.5rem;
    transition: background-color var(--transition-quick);
}

thead,
tr {
    width: 100%;
}

thead {
    position: sticky;
    left: 0;
    top: 0;
    width: 100%;
}

th {
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: var(--text);
    padding: 0.5rem;
    text-align: start;
    cursor: pointer;
    user-select: none;
    color: var(--background);
    font-weight: bold;

    .overlay {
        position: absolute;
        left: calc(100% - 0.5rem);
        top: 0.5rem;
        transform: translate(-100%, 0%);
        width: 1.5rem;
        height: 1.5rem;

        --icon-color: var(--background);
    }

    &:hover {
        background: var(--text-off);
    }

    &.active {
        color: var(--background);
        background: var(--accent);
    }
}

tr {
    background-color: var(--background-off);
}

td {
    padding: 0.5rem;
    height: 2.5rem;

    &.fill {
        width: 100%;
        min-width: 12rem !important;
        overflow: hidden;
    }

    & > .row {
        gap: 0.125rem;
    }

    & * {
        white-space: nowrap;
    }
}

/* Sections */

.description {
    color: var(--text-off);
}
