:root {
    --primary-blue: #00a6fb;
    --text-dark: #1a1a1a;
    --text-gray: #4a4a4a;
    --text-light: #666;
    --background: #ffffff;
    --border-color: #e0e0e0;
}

figure {
    margin: 0;
    padding: 0;
    margin-block: 3rem;
}

.media {
  width: 100%;    /* Fills the width of the column */
  height: auto;   /* Maintains aspect ratio */
  display: block; /* Removes tiny bottom margin/gap */
  margin-block: 3rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--color-shadow);;
}

.media-with-caption {
    width: 100%;    /* Fills the width of the column */
    height: auto;   /* Maintains aspect ratio */
    display: block; /* Removes tiny bottom margin/gap */
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px var(--color-shadow);;
}

.media-caption {
    max-width: 80%;
    margin-inline: auto;
    font-size: 1rem;
    font-style: italic;
}

/* Article Container */
article {
    padding: 3rem 2rem;
    overflow-x: clip;
    display: grid;
  grid-template-columns: 
    [full-start] minmax(1rem, 1fr) 
    [breakout-start] minmax(0, 100px) 
    [content-start] min(800px, 100% - 2rem) [content-end]
    minmax(0, 100px) [breakout-end] 
    minmax(1rem, 1fr) [full-end];
}
article > * {
    grid-column: content;
}

.breakout {
    grid-column: breakout;
}

/* Title Section */

.article-title {
    margin-bottom: 2rem;
}

.article-subtitle {
    color: var(--text-light);
    font-style: italic;
    margin: 0;
}

.article-divider {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--primary-blue);
}

.article-meta {
    color: var(--text-light);
    font-size: 0.95rem;
    font-style: italic;
}

h1 {
    font-family: 'Space Mono', monospace;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
}

/* Typography */
h2 {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    margin: 4rem 0 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

h3 {
    font-family: 'Space Mono', monospace;
    font-size: 1.6rem;
    margin: 4rem 0 1rem;
    color: var(--text-dark);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
}

p {
    margin-block: 0.5rem;
    color: var(--text-gray);
    font-size: 1.05rem;
}

strong {
    font-weight: 600;
    color: var(--text-dark);
}

em {
    font-style: italic;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.75rem;
    color: var(--text-gray);
    font-size: 1.05rem;
}

/* Code and Special Text */
code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.text-orange {
    color: #FFB347;
}

.text-blue {
    color: #77DDFF;
}

.code-block {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-blue);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    overflow-x: auto;
}

.code-block pre {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-gray);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Tables */
.table-wrapper {
    margin: 2rem 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dark);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-gray);
}

tr:hover {
    background: #f8f9fa;
}

/* Footnote References */
.footnote-ref {
    color: var(--primary-blue);
    cursor: help;
    position: relative;
    text-decoration: none;
    font-size: 0.85em;
    vertical-align: super;
}

.footnote-ref:hover {
    text-decoration: underline;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.emphasized-quote {
    font-family: 'Space Mono', monospace;
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 700;
    color: var(--text-dark);
    margin: 2.5rem 0;
    padding: 1.5rem 0;
    text-align: center;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .article-references {
        word-break: break-all;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.9rem;
    }

    article {
        padding: 2rem 1.5rem;
    }

    .tooltip .tooltiptext {
        width: 250px;
        margin-left: -125px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .table-wrapper {
        margin: 1.5rem -1.5rem;
        padding: 0 1.5rem;
    }

    video {
        margin-block: 2rem;
    }

    .emphasized-quote {
        font-size: 1.2rem;
        font-style: italic;
        font-weight: 600;
        margin: 0.7rem 0;
        padding: 0.5rem 0;
        text-align: center;
        line-height: 1.6;
    }

    .media {
        margin-block: 1rem;
    }

    .media-caption {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    p, li {
        font-size: 1rem;
    }
}