
/* Overrides for main aspects of the site. 
body {
    
} move this to the top to use ->*/

/* Override for secondary headings. (ie. ## in markdown) */
h1, h2{
    text-align: center;
}

.subtext {
    font-size: x-small;
}

/* 
Custom property to make the .iframe-scaled class work.
To use it, set the class and add style="--iframe-scale: 0.5" to 
the HTML. 
*/
@property --iframe-scale {
    syntax: "<number>";
    inherits: true;
    initial-value: 1.0;
}

/* 
Class to make iframes scale on desktop browsers. Doesn't seem
to be possible for mobile browsers unfortunately. Containing the
iframe in a flexbox seems to solve it either way. 
 */
.iframe-scaled {
  width: 100%;
  -moz-transform: scale(var(--iframe-scale)); 
  -webkit-transform: scale(var(--iframe-scale)); 
  -o-transform: scale(var(--iframe-scale));
  -ms-transform: scale(var(--iframe-scale));
  transform: scale(var(--iframe-scale)); 
  -moz-transform-origin: center center;
  -webkit-transform-origin: center center;
  -o-transform-origin: center center;
  -ms-transform-origin: center center;
  transform-origin: center center;
}

/* 
Wrapper for content to be centered. Add a div around the content, make sure
it's HTML formatted, not markdown, and add this class to the div.
*/
.centered {
    display: flex;
    justify-content: center;
    justify-self: center;
    align-self: center;
    align-content: center;
}

/* Class for youtube embeds to take up the full width */
.youtube-embed-full {
    padding: 5px;
    border: 5px dotted #63441f;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Class for centered small youtube video players */
.youtube-embed-mini {
    width: 50%;
    align-items: center;
    justify-items: center;
    aspect-ratio: 16 / 9;
}

/* For centering the tables */
.markdown-preview-view table {
    margin-left: auto;
    margin-right: auto;
    border: 0px hidden;
}

/* Stops obsidian from setting the color of table elements and overriding what I'm trying to do here. */
tbody > tr:hover > td {
    background-color: unset !important;
    color: unset !important;
    pointer-events: none;
}

/* Same thing for the top row of a table, which has its own settings stack. */
thead > tr:hover {
    background-color: unset !important;
    color: unset !important;
    pointer-events: none;
}

/* For hiding table edges and normalizing cell size */
.markdown-preview-view td {
    width: 300px;
    min-height: 60px;
    border: 0px hidden;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* Sets the background color of every EVEN NUMBERED child */
.markdown-preview-view tr:nth-child(2n), tr:hover:nth-child(2n), tr:focus:nth-child(2n) {
    background-image: linear-gradient(to right, rgba(0,0,0,0), var(--color-base-30), rgba(0,0,0,0));
}

/* Sets the background color of every ODD NUMBERED child */
.markdown-preview-view tr:nth-child(2n+1), tr:hover:nth-child(2n+1), tr:focus:nth-child(2n+1) {
    /*background-color: var(--color-base-25);*/
    background-image: linear-gradient(to right, rgba(0,0,0,0), var(--color-base-25), rgba(0,0,0,0));
}