/* This style is based off Tufte CSS */

@import url("fonts.css");
@import url("site-tokens.css");

html {
    font-size: 18px;
}

body {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0%;
    font-family: var(--site-serif);
    background-color: var(--site-background);
    color: var(--site-text);
    max-width: 670px;
    counter-reset: sidenote-counter;
}

h1 {
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    font-size: 3.2rem;
    padding: 1em;
    line-height: 1;
    text-align: center;
    font-variant: small-caps;
    background: var(--site-background);
}

/* Hide all h2 elements initially (assuming you toggle this elsewhere) */
h2 {
    font-weight: 400;
    margin-top: 4rem;
    margin-bottom: 0.5rem;
    font-size: 2.5em;
    line-height: 1;
    text-align: left;
    background: var(--site-background);
}

/* Ensure the container for h2 is positioned relative to enable sticky positioning */
.container {
    position: relative;
}

/* Make the most recent h2 sticky */
h2.sticky {
    opacity: 1;
    position: -webkit-sticky; /* Fixed invalid -webkit-fixed to sticky */
    position: sticky;
    top: 0;
    z-index: 1;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    font-size: 3.2rem;
    padding: 0.5em;
    line-height: 1;
    text-align: center;
    font-variant: small-caps;
    background: #0a0d0a;
}
  
h3 {
    margin-bottom: 0;
    font-size: 1.5rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
    font-style: italic;
}

hr {
    display: block;
    height: 1px;
    width: 55%;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

p.subtitle {
    font-style: italic;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    display: block;
    line-height: 1;
}

p,
dl,
ol,
ul {
    font-size: 1.4rem;
    line-height: 2rem;
}

p {
    text-indent: 0em;
    margin-block-start: 0;
    margin-block-end: 0;
}

p + p {
    margin-top: 0rem;
    margin-bottom: 0rem;
    padding-right: 0;
    vertical-align: baseline;
    text-indent: 1em;
    text-align: justify;
    hyphens: auto;
}

b {
    font-weight: 700; /* Fixed from weight: 700 */
    color: var(--site-accent);
}
  
code {
    font-family: "Maple Mono NF";
    padding-right: 0.2em;
    font-size: 0.8em;
}

blockquote {
    font-size: 1.4rem;
}

blockquote p {
    width: 80%;
    margin-right: 40px;
    font-style: italic;
    border-left: 2px solid #ccc; /* Added missing value */
    padding-left: 1rem;
}

/* Base Notes Styling (Supports both Org divs and spans) */
.notes {
    float: right;
    clear: right;
    margin-right: -53.65%;
    width: 45%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.95em;
    font-style: italic;
    border-left: 2px solid #ccc;
    padding-left: 1em;
}

/* Reset Org-Mode's auto-generated paragraph tags inside notes */
.notes p {
    margin: 0;
    padding: 0;
    text-indent: 0;
    font-size: 1em;
    border: none;
    line-height: 1;
}

/* Base Blockquote */
blockquote {
    font-size: 1.4rem;
    width: 80%;
    margin-right: 0;
    padding-left: 1rem;
    border-left: 2px solid #ccc;
    font-style: italic;
}

/* Stop paragraphs inside blockquotes from inheriting weird borders/widths */
blockquote p {
    width: 100%;
    border-left: none;
    padding-left: 0;
    margin-right: 0;
    text-indent: 0;
}

/* The Blockquote Notes Fix */
blockquote .notes {
    margin-right: -81.25%;
    width: 56.25%;
}

/* Hard-stop inheritance for paragraphs inside blockquote notes */
blockquote .notes p {
    width: 100%;
    border-left: none;
    padding-left: 0;
    margin-right: 0;
    font-size: 0.8em;
}

/* stops indent after notes block */
.notes + p {
    text-indent: 0em;
}

sup {
    color: #FF9eaa;
}

span.newthought {
    font-variant: small-caps;
    font-size: 1.2em;
}

.drop {
    color: #FF8080;
    float: left;
    font-family: Crimson Pro;
    font-size: 75px;
    line-height: 55px;
    padding-top: 3px;
    padding-right: 10px;
    padding-left: 20px;
    margin-left: -22px;
}

p:has(span.drop){
    text-indent: 0em;
}

/* Link styling */
a {
    color: #dcdedc; /* Slightly darker than #f5fff5 */
    padding: 0.2em 0.5em;
    text-decoration: none; /* No underline by default */
    background-color: #1d2021;
    border-radius: 6px;
}

a:hover {
    color: #ffffff; /* Change color to white on hover */
    text-decoration: underline; /* Underline on hover */
}

.org-center {
      max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Media Queries */
@media only screen and (max-width: 1000px) {
    html { font-size: 13px; }
    body { margin-right: 17%; }
}

@media only screen and (max-width: 768px) {
    html { font-size: 11px; width: 98%; }
    body { margin-right: 15%;  }
}

@media only screen and (max-width: 680px) {
    html { font-size: 11px; width: 96%; }
    body { margin-right: 15%;  }
}

@media only screen and (max-width: 550px) {
    html { font-size: 11px; width: 94%; }
    body { margin-right: 15%;  }
}

@media only screen and (max-width: 480px) {
    html { font-size: 10px; width: 92%; }
    body { margin-right: 14%; }  
}

@media only screen and (max-width: 445px) {
    html { font-size: 8.5px; width: 90%; }
    body { margin-right: 16%; }  
}

@media only screen and (max-width: 375px) {
    html { font-size: 8px; width: 88%; }
    body { margin-right: 14%; }  
}
