/* General Body Styles */

body {
  font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-1);
  color: var(--tx-1);
  line-height: 1.6;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

/* ===== Page Wrapper ===== */
.page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    --branding-height: calc(2rem + 50px + 2rem);
    --column-gap: 3rem;
    --col-side: 160px;
}

/* ===== Two-Column Grid ===== */
/* align-items: stretch (default) — right-column must stretch to full row height
   so its sticky nav can travel the content and pin on screen */
.layout-columns {
    display: grid;
    grid-template-columns: var(--col-side) minmax(0, 1fr) var(--col-side);
    gap: var(--column-gap);
    margin-top: 3rem;
}

.center-column {
    min-width: 0; /* prevent overflow */
}

/* Empty spacer column — no special styling needed */
.left-column {
}



.right-column nav {
    position: sticky;
    top: 2rem;
}

.nav-spacer {
    height: var(--branding-height);
}

/* ===== Site Branding (title + gif) ===== */
.site-branding {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.site-branding h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.site-branding h1 a {
    text-decoration: none;
    color: var(--tx-1);
}

.fireworks {
    width: 50px;
    cursor: pointer;
}

/* ===== Content Area ===== */
.content-area {
    text-align: justify;
}

.content-area article {
    background: none;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Daily chess puzzle image */
#puzzleLink {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    filter: grayscale(100%);
}

#puzzleLink::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #FFFCF0;
    opacity: 0.15;
    pointer-events: none;
}

#puzzleLink > img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ===== Navigation (right column) ===== */
.right-column nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.right-column nav ul li {
    margin-bottom: 0.75rem;
}

.right-column nav ul li a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.right-column nav ul li a:hover {
    text-decoration: underline;
}

/* ===== Post Header (inside article) ===== */
.post-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.post-date {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

/* List Styles */
ol {
  list-style-type: upper-roman;
  list-style-position: outside;
}


a {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
  color: var(--accent)
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em; /* Subtle tightening for a modern look */
  margin-top: 1.5rem;       /* Large gap from previous section */
  margin-bottom: 1rem;    /* Close proximity to its content */
  line-height: 1.2;
}

h2 + p {
  text-indent: 1rem; /* Adjust the 2rem to match your visual preference */
  
}

h3 + p {
  text-indent: 1rem; /* Adjust the 2rem to match your visual preference */
  
}

/* Asterism Styles */
p + h2::before,
table + h2::before {
  /* The Unicode for the asterism */
  content: "\2042"; 
  
  /* Layout: Centers the symbol and puts it on its own line */
  display: block;
  text-align: center;
  
  /* Spacing: Adjust these to fit your design verticality */
  margin-top: 3rem;
  margin-bottom: 4rem;
  
  /* Styling */
  font-size: 1.5rem;
  color: var(--tx-1); /* Muted gray for a clean look */
  font-weight: normal;
}


/* Footer Styles */
footer {
  background-color: var(--bg-1);
  color: var(--tx-1);
  text-align: center;
  padding: 20px 40px;
}

footer p {
  margin: 8px 0;
}

.mydearbot {
  display: none;
}

/* Code blocks — boxed layout */
pre {
  background-color: var(--bg-2);
  border: 1px solid var(--ui-1);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--tx-2);
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9em;
}

/* Inline code */
:not(pre) > code {
  background-color: var(--ui-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--tx-1);
}

/*Blockquote Styles*/
blockquote {
  margin: 20px 0;
  padding: 10px 20px;
  border-left: 5px solid var(--accent); /* Accent color */
  background-color: var(--bg2);
  color: var(--tx-2);
  font-style: italic;
  line-height: 1.3;
}

/*Table Styles*/
table {
  table-layout: fixed;
  width: 90%;
  margin: 10px auto;
  border-collapse: collapse;
  border-top: 1px solid var(--ui-2);
  border-bottom: 1px solid var(--ui-2);
}

th,
td {
  padding: 0.6em;
}

tfoot {
  border-top: 1px solid var(--tx-2);
}

tbody tr:nth-child(odd) { /* Zebra Striping for Table Rows */
  background-color: var(--ui-2);
}

/* ===== Responsive: Mobile (< 768px) ===== */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 1rem;
    }

    .layout-columns {
        grid-template-columns: 1fr;
        grid-template-areas:
            "branding"
            "nav"
            "content";
        --column-gap: 1.5rem;
        gap: var(--column-gap);
        margin-top: 1.5rem;
    }

    .center-column {
        display: contents; /* flatten so child grid areas work */
    }

    .left-column {
        display: none; /* hide empty spacer on mobile */
    }

    .nav-spacer {
        display: none;
    }

    .site-branding {
        grid-area: branding;
        justify-content: flex-start;
    }

    .right-column {
        grid-area: nav;
        position: static;
    }

    .content-area {
        grid-area: content;
    }

    .right-column nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .right-column nav ul li {
        margin-bottom: 0;
    }

    article {
        padding: 20px 15px;
        margin: 20px 10px;
    }
}

/* ===== Reading list ===== */
#reading-controls {
    margin-bottom: 1rem;
}

#reading-controls button {
    border: 1px solid var(--ui-1);
    background: none;
    color: var(--tx-2);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
    margin: 0 0.4rem 0.4rem 0;
}

#reading-controls button.active {
    border-color: var(--bl);
    color: var(--bl);
    font-weight: 600;
}

#load-more {
    border: none;
    background: none;
    padding: 0;
    color: var(--bl);
    text-decoration: underline;
    text-underline-offset: 5px;
    cursor: pointer;
    font: inherit;
}

.reading-item small {
    display: block;
    color: var(--tx-3);
}
