:root {
  --main-bg-color: #E0C2A2;
  --main-inner-color: #F5E9CE;
}

/* Alternate box model: width/height include padding & border */
html {
    box-sizing: border-box;
}

body {
    margin: 0px;
}

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

/* header styling */

.header-top {
    padding: 10px;
    display: grid;
    grid-template-columns: auto 1fr;
}

.title-container {
    text-align: center;
}

.title-container > a {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 20px;
    align-items: center;

    text-decoration: none;
    color: black;
}

.login-box {
    justify-self: end;
    text-align: right;
}

.site-title {
    font-family: 'Zelda Oracles';
    font-size: 60px;
}

.site-subtitle {
    font-family: 'Zelda Oracles';
    font-size: 18px;
}

.ribbon {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    justify-content: center;
    background-color: var(--main-inner-color);
    border-top: 1px black solid;
    border-bottom: 1px black solid;
    margin-bottom: 20px;
}

.ribbon a {
    font-family: 'Zelda Oracles';
    font-size: 20px;
    padding: 10px 20px;
    border-right: 1px black solid;
    text-decoration: none;
}

.ribbon a:first-child {
    border-left: 1px black solid;
}

/* General styling */

.main-grid {
    padding-bottom: 20px;
}

.pane {
    width: 100%;
    display: grid;
    grid-auto-rows: max-content;
}

.pane > h1 {
    text-align: center;
    background-image: linear-gradient(#F5CA6E, #F5eA9E);
    font-family: 'Zelda Oracles';
    padding-top:    4px;
    padding-bottom: 4px;
    border: solid black 1px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* Link underlines in headings with oracles font don't look right, just turn off underlines. */
h1 a {
    text-decoration-line: none;
}

.pane > * {
    margin: 0px; /* No gaps between grid elements making up the pane */
    background-color: var(--main-inner-color);
    border: solid black 1px;
    border-top: none;
    width: 100%;
    padding: 10px;
}
.pane p:first-child {
    margin-top: 0px; /* We already have padding in the div */
}

/* Spacing between blocks, where each block starts with <h1> */
.pane > h1:nth-child(n+2) {
    margin-top: 20px;
}

.pane ul {
    margin: 0;
    padding-left: 20px;
}

main {
    max-width: 1000px;
    margin: 0 auto;
}

html {
    background-color: var(--main-bg-color);
}

.table_heading {
    background-image: linear-gradient(#F5CA6E, #F5eA9E);
}

/* Romhack cards (frontpage, search page) */

.primary-hack-image-thumbnail-container {
    width: 240px;
    height: 216px;
}
.primary-hack-image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.frontpage-romhack-card-container {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: max-content 2fr;
    grid-gap: 20px;
}

/* Description, version, & updated section */
.frontpage-romhack-card-right-column {
    display: grid;
    grid-auto-flow: row;
    grid-template-rows: 1fr 0fr 0fr;
    justify-items: end;
    align-items: end;
}
/* Description */
.frontpage-romhack-card-right-column > p:nth-child(1) {
    justify-self: start;
    align-self: start;
}

/* Reduce spacing around version, author, updated text */
.frontpage-romhack-card-right-column p {
    margin: 0;
}


/* Search page */

.search-form-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-gap: 8px 12px;
    max-width: 800px;
}

.search-form-buttons {
    margin-top: 12px;
    display: flex;
    grid-gap: 12px;
    align-items: center;
}

/* hackdetail.html table styling */

.primary-hack-image-container {
    width: 320px;
    height: 288px;
}

.primary-hack-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.h2-romhack-upload {
    text-align: center;
}

.romhack-submit-button {
    display: block;
    margin: 0 auto;
    margin-top: 10px;
}

table {
    border-collapse: collapse;
}

/* Configure the width of the columns by setting just one column */
#version-heading {
    width: 110px;
}

#version-info {
    width: 150px;
}

.description-cell {
    vertical-align: text-top;
    border-left: 1px solid black;
}

.description-cell h2 {
    padding: 10px;
    margin: 0px auto;
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    text-align: center;
}

.description-cell h2:first-child {
    border-top: none
}

.description-cell ul {
    margin: 10px 10px;
}

/* Also used by frontpage */
.description {
    margin: 10px;
    white-space: pre-line;
}

.pane th, .pane td {
    padding: 3px 5px;
    border: 1px black solid;
}
.pane > table > tbody > tr > td {
    border-top: none;
}
