*,
::before,
::after {
    box-sizing: border-box;
}

:root {
    /* Font Sizes */
    --font-small: 16px;
    --font-regular: 22px;
    --font-large: 26px;
    --font-xlarge: 28px;
    --font-xxlarge: 32px;
    --font-xxxlarge: 38px;

    /* Primary Theme Colour */
    --color-primary: #711681;
    --color-primary-rgb: 113, 22, 129;

    /* Secondary Theme Colour */
    --color-secondary: #f6d2fd;
    --color-secondary-rgb: 246, 210, 253;

    /* Box Shadows */
    --box-shadow: 0 4px 6px rgba(113, 22, 129, .3);
    --box-shadow-hover: 0 8px 12px rgba(113, 22, 129, .4);

    /* Text Colours for Theme Colours */
    --color-text-primary: white;
    --color-text-primary-hover: black;
    --color-text-secondary: black;
    --color-text-secondary-hover: black;
}

/* For Debugging */
pre {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    border-radius: 20px;
    padding: 10px;
    margin: 10px;
    width: max-content;
    background-color: rgba(var(--color-secondary-rgb), .2);
}

pre h1 {
    font-size: var(--font-xlarge);
    margin: 0 0 20px;
}

.mt10 {
    margin-top: 10px;
}

.mt20 {
    margin-top: 20px;
}

.mt30 {
    margin-top: 30px;
}

.mt40 {
    margin-top: 40px;
}

.mr5 {
    margin-right: 5px;
}

.mr10 {
    margin-right: 10px;
}

.mb20 {
    margin-bottom: 20px;
}

.ml5 {
    margin-left: 5px;
}

.ml10 {
    margin-left: 10px;
}

.float-right {
    float: right;
}

/* Main Layout */

@font-face {
    font-display: swap;
    font-family: 'VCR OSD Mono';
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/VCR_OSD_MONO_1.001.ttf) format('truetype');
}

@font-face {
    font-display: swap;
    font-family: 'Century Gothic';
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/GOTHIC.TTF) format('truetype');
}

@font-face {
    font-display: swap;
    font-family: 'Century Gothic';
    font-style: italic;
    font-weight: 400;
    src: url(../fonts/GOTHICI.TTF) format('truetype');
}

@font-face {
    font-display: swap;
    font-family: 'Century Gothic';
    font-style: bold;
    font-weight: 700;
    src: url(../fonts/GOTHICB.TTF) format('truetype');
}

@font-face {
    font-display: swap;
    font-family: 'Century Gothic';
    font-style: bold italic;
    font-weight: 700;
    src: url(../fonts/GOTHICBI.TTF) format('truetype');
}

body {
    font-family: "Century Gothic", sans-serif;
    padding: 10px;
    background: #eafbfb;
    font-size: var(--font-regular);

    background-image: url(/img/rbtvn-polka-loop.gif);
    background-repeat: repeat;
    background-color: var(--color-primary);
}

.header {
    padding: 20px;
    text-align: center;

    display: flex;
    justify-content: center;
    align-items: center;

    background: var(--color-secondary);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.header h1 {
    font-size: 42px;
    margin: 0;
}

.header a {
    text-decoration: none;
    font-family: "VCR OSD Mono", sans-serif;
    font-weight: 700;
    font-size: 42px;
    color: var(--color-primary) !important;
}

.topnav a:hover {
    background-color: #d5f6f6;
    color: black;
}

.maincolumn {
    float: left;
    width: 50%;
}

/* Add a card effect for articles */
.card {
    background-color: white;
    padding: 10px 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: inline-block;
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    overflow-x: auto;
}

.card h1 {
    width: 100%;
    text-align: center;
    font-family: "VCR OSD Mono", sans-serif;
    font-size: 42px;
    font-weight: 400;
}

.card h2 {
    width: 100%;
    text-align: center;
    font-family: "VCR OSD Mono", sans-serif;
    font-size: 21px;
    font-weight: 400;
}

/* Side navigation */
.sidenav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Post Subheading */
.subheading {
    font-size: var(--font-large);
    margin-bottom: -10px;
}

/* Image Wrapper */
.imagewrapper {
    display: inline-block;
    padding-left: 10px;
}

/* Image */
.image {
    max-height: 200px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-block;
    margin-top: 10px;
}

.image:hover {
    opacity: 0.7;
}

/* Image Caption */
.imagecaption {
    font-size: var(--font-small);
    color: gray;
    margin-top: -3px;
    text-align: center;
}

/* Normal List */
ul {
    list-style-type: circle;
}

/* flex */
.flex {
    display: flex;
}

.flex.centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.flex.justified {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.flex.justified.col {
    height: 100%;
    justify-content: center;
    align-items: space-between;
    text-align: center;
}

.flex.col {
    flex-direction: column;
}

.grid {
    display: grid;
    gap: 10px;
}

.grid.bordered {
    padding: 1px;
    gap: 1px;
    background-color: var(--color-primary);
}

.grid.bordered>* {
    background-color: white;
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

.grid.col2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.col3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.row1 {
    grid-template-rows: repeat(1, minmax(0, 1fr));
}

.grid>.span2 {
    grid-column: span 2;
}

.grid>.span3 {
    grid-column: span 3;
}

input,
textarea {
    display: inline-block;
    padding: 0.47rem 0.75rem;

    text-align: center;
    vertical-align: middle;

    border-radius: 5px;
    line-height: 1.5;

    outline: none !important;
    text-decoration: none;
    overflow: hidden;

    border: 1px solid grey;
    background: white;
    color: black;
}

textarea {
    resize: vertical;
}

.search-input-container {
    position: relative;
    margin-bottom: 20px;
    cursor: text;
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: white;
    background-clip: padding-box;
    border: 1px solid lightgray;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

a.search-input-clear {
    display: none;

    position: absolute;
    top: 5px;
    right: 5px;

    height: calc(100% - 10px);

    font-size: var(--font-small);
    line-height: normal;
}

/* Buttons */
.btn {
    display: flex;
    padding: 0.47rem 0.75rem;

    cursor: pointer;

    text-align: center;
    vertical-align: middle;
    align-items: center;
    justify-content: center;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    border-radius: 5px;
    line-height: 1.5;

    outline: none !important;
    text-decoration: none;
    overflow: hidden;

    transition: 0.15s ease-in-out;

    border: 1px solid grey;
    background: white;
    color: black;
    font-weight: 700;
}

.btn:hover,
.btn:focus,
.btn:active,
.btn:disabled {
    box-shadow: none;
}

.btn.primary {
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: var(--color-text-primary);
}

.btn.primary:hover,
.btn.primary:focus,
.btn.primary:active,
.btn.primary:disabled {
    background: rgba(var(--color-primary-rgb), .5);
    color: var(--color-text-primary-hover);
}

select.btn.primary:focus {
    color: var(--color-text-primary);
}

.btn.secondary {
    border: 1px solid var(--color-secondary);
    background: var(--color-secondary);
    color: var(--color-text-secondary);
}

.btn.secondary:hover,
.btn.secondary:focus,
.btn.secondary:active,
.btn.secondary:disabled {
    background: rgba(var(--color-secondary-rgb), .5);
    color: var(--color-text-secondary-hover);
}

select.btn.secondary:focus {
    color: var(--color-text-secondary);
}

.subcolumn .btn {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 10px;
    padding: 0 10%;
}

.form-grid * {
    width: 100%;
    font-family: "Century Gothic", sans-serif;
    font-size: var(--font-regular);
}

.form-grid>div {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-grid>div:nth-of-type(odd) * {
    text-align: right;
}

.form-grid>div:nth-of-type(even) * {
    text-align: left;
}

/* Tables */
table,
tr,
th,
td {
    border: 1px solid black;
    border-collapse: collapse;
    padding: 5px;
}

.table-container {
    width: 100%;
    overflow-x: scroll;
}

table {
    min-width: max-content;
    width: 100%;
}

table:not(:last-child) {
    margin-bottom: 20px;
}

th,
.th {
    background-color: var(--color-primary);
    color: var(--color-text-primary);
}

tr:nth-child(odd):not(.th) {
    background-color: var(--color-secondary);
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
}

.pagination>.page-item:not(.active)>.page-link {
    border: 1px solid var(--color-primary) !important;
    color: var(--color-primary);
}

.pagination .page-item,
.pagination .page-link {
    height: 40px;
}

.page-item:first-child .page-link {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.page-link {
    padding: 0.375rem 0.75rem;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.page-item:not(:first-child) .page-link {
    margin-left: -1px;
}

.pagination>.active {
    z-index: 1;
}

.page-link {
    position: relative;
    display: block;
    color: #0d6efd;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

a:active,
a:focus,
a:hover,
a:visited {
    outline: none;
    -moz-outline-style: none;
    box-shadow: none !important;
}

a {
    transition: 0.2s;
    text-decoration: none !important;
}

.pagination>.active>.page-link {
    border: 1px solid var(--color-primary) !important;
    background: var(--color-primary);
}

.page-link:hover {
    z-index: 2;
    color: #0a58ca;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

a:hover {
    border: none;
    outline: none;
}

a:active,
a:focus,
a:hover,
a:visited {
    outline: none;
    -moz-outline-style: none;
    box-shadow: none !important;
}

@media screen and (max-width: 1079px) {

    /* Reduce the size of the titles */
    .header h1 {
        font-size: var(--font-xxlarge);
        margin-bottom: 5px;
    }

    /* Move the sub column */
    .maincolumn {
        width: 100%;
        margin: 0px;
        margin-top: 10px;
    }

    .subcolumn {
        width: 100%;
        margin: 0px;
        padding: 0px;
        margin-top: 10px;
    }

    .grid.col2 {
        grid-template-columns: 1fr;
    }

    table,
    tr,
    th,
    td {
        font-size: var(--font-small);
        padding: 1px;
    }
}
