/* Reset and Base Styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #ffffff;
    color: #000000;
    font-size: 18px;
    line-height: 1.6;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

html, body {
    height: 100%;
    margin: 0;
}

/* === START: STICKY FOOTER SOLUTION === */

body {
    /* Set a minimum height of 100% of the viewport height */
    min-height: 100vh;

    /* Use flexbox to lay out the children (site-content and footer) */
    display: flex;
    flex-direction: column;
}

.site-content {
    /* Tell this wrapper to grow and fill all available vertical space */
    flex-grow: 1;
}

/* === END: STICKY FOOTER SOLUTION === */

/* Layout Structure */
.main-content {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-width {
    max-width: 650px;
    margin: 0 auto;
}

figure {
    margin: 0;
}

figure img {
    width: 100% !important;
    margin: 0px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: "Source Serif Pro", serif;
    font-weight: 700;
}

h1 {
    /* font-size: clamp(36px, 6vw, 42px); */
    font-weight: 300;
    line-height: 1.3;
    margin-top: 10px;
    /* margin-bottom: 40px; */
}

.welcome-title {
    font-size: 36px;
}

.page-title {
    font-size: 40px;
}

.post-title {
    font-family: "Source Serif Pro", serif;
    font-size: clamp(42px, 6vw, 52px);
    font-weight: 200;
    line-height: 1.2;
    margin-top: 5px;
    word-break: break-word;
    box-sizing: border-box;
}

h2 {
    font-size: 38px;
    font-weight: 600;
    margin-bottom: 0px;
    margin-top: 50px;
}

.post-header h2 {
    font-weight: 700;
}

h2.heading {
    font-size: 32px;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.2;
}

h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    margin-top: 30px;
}

h3.heading {
    font-size: 28px;
    margin-bottom: 0px;
    margin-top: 50px;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight:600;
}

h4 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 0px;
    margin-top: 50px;
}

h4.heading {
    font-size: 28px;
    line-height: 1.5;
}


/* Links */
a {
    color: #000000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover, a:focus {
    text-decoration-style: dashed;
}

a:active {
    text-decoration: none;
}

/* Lists */
ul {
    box-sizing: border-box;
    margin-top: 20px;
    margin-bottom: 30px;
    padding-inline-start: 20px;
}

li {
    /* margin-top: 10px; */
}

.post-list {
    list-style: none;
    padding-left: 0;
}

/* Two-column layout for full list when shown */
@media screen and (min-width: 700px) {
    .menu-full.post-list {
        columns: 2;
    }
}

/* Separators */
.separator {
    border: none;
    border-bottom: 2px solid;
    margin-left: auto;
    margin-right: auto;
}

.separator.has-opacity {
    opacity: 0.4;
}

/* Spacers */
.spacer {
    clear: both;
}

.spacer-top {
    height: 50px;
}

/* Images */
.image-block {
    margin: 20px 0 50px 0;
}

.image-block img {
    box-sizing: border-box;
    height: auto;
    max-width: 100%;
    vertical-align: bottom;
}

.image-block figcaption {
    color: #555;
    font-size: 13px;
    text-align: center;
    margin-bottom: 1em;
    margin-top: 0.5em;
}

.image-block figure {
    margin: 0;
}

.image-block.align-center {
    text-align: center;
}

.image-block.align-left {
    float: left;
    margin: 0.5em 1em 0.5em 0;
}

.image-block.align-right {
    float: right;
    margin: 0.5em 0 0.5em 1em;
}

/* Tables */
.table-block {
    margin: 30px 0 40px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

thead {
    border-bottom: 2px solid #000;
}

th {
    font-family: "Source Serif Pro", serif;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    color: #111;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
    color: #222;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Inline Tetris board miniatures (article diagrams) */
.tetris-board {
    display: inline-block;
    vertical-align: middle;
    margin: 8px 0 12px;
    line-height: 0;
}

.tetris-board--inline {
    margin: 0 0 0 6px;
}

.tetris-row {
    display: flex;
    gap: 2px;
    margin-bottom: 2px;
}

.tetris-row:last-child {
    margin-bottom: 0;
}

.tetris-board .cell {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d8dce0;
}

.tetris-board .cell.filled {
    background: #5c6570;
    border-color: #454c55;
}

.tetris-board .cell.empty {
    background: #fff;
}

.tetris-board .cell.well {
    background: #fef3eb;
    border-color: #c8562c;
}

.tetris-board .cell.well-blocked {
    background: #c8562c;
    border-color: #a8451f;
}

/* Buttons */
button {
    -webkit-appearance: button;
    background-color: #8b8b8b;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-family: "Noto Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 9.5px 24px;
}

button:hover, button:focus {
    background-color: rgba(51, 51, 51, 0.7);
    outline: 0;
}

/* Inputs */
input {
    background-color: #f7f7f7;
    border-radius: 0;
    border: 1px solid rgba(51, 51, 51, 0.1);
    color: rgba(51, 51, 51, 0.7);
    font-family: "Noto Serif", serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    max-width: 100%;
    vertical-align: baseline;
}

input:focus {
    background-color: #fff;
    /* border: 1px solid rgba(51, 51, 51, 0.3); */
    color: #333;
    outline: 2px solid rgba(51, 51, 51, 0.3);
}

input[type="text"] {
    /* padding: 6px; */
    width: 100%;
}

input[type="text"]:focus {
    outline: 0;
}

.newsletter-input {
    border: none;
    width: 220px !important;
    height: 32px;
    padding: 8px;
    padding-left: 10px;
    text-align: left;
    outline: none;
    border-radius: 2px;
    font-family: "Source Serif Pro", serif;
    color: #000;
    background-color: #f7f7f7;
}

.newsletter-input:focus {
    outline: none !important;
    background-color: #fff;
    /* border: 1px solid rgba(51, 51, 51, 0.3); */
}

/* Navigation Links */
.link-show-all, .link-show-less {
    cursor: pointer;
    text-underline-offset: 3px;
    text-decoration: underline;
    font-weight: bold;
}

.link-show-all:hover, .link-show-less:hover {
    text-decoration-thickness: 1px;
    text-decoration-style: dashed;
}

.menu-full, #show-less {
    display: none;
}

/* Header */
header {
    background-color: #565656;
    width: 100%;
}

header a {
    color: #e1e1e1;
    text-decoration: none;
}

header a:hover, header a:active {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25ch;
    text-decoration-style: dashed;
}

.site-title {
    font-family: 'Source Serif Pro', serif;
    font-weight: 300;
    font-size: 22px;
    line-height: 40px;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: none;
    color: #e9e9e9;
}

.header-grid {
    display: grid;
    grid-template-columns: auto 1fr 25px;
    max-width: 755px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.logo-container {
    display: grid;
    grid-template-columns: 40px 15px 1fr;
    height: 40px;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

#menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 16px;
    width: 22px;
    padding: 0;
    position: relative;
    z-index: 10;
}

#menu-toggle span {
    display: block;
    height: 2px;
    width: 22px;
    background-color: #e1e1e1;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

#menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    width: 22px;
}

#menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

#menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    width: 22px;
}

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    background-color: #565656;
    transition: max-height 0.4s ease-in-out;
}

.mobile-menu.active {
    max-height: 500px;
}

.menu-content {
    padding: 15px 20px 20px 20px;
    border-top: 1px solid #777;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-items {
    max-width: 745px;
    margin: 0 auto;
    text-align: right;
    line-height: 180%;
}

.mobile-menu.active .menu-content {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    margin-top: 80px;
    background-color: #565656;
    width: 100%;
}

footer a {
    color: #e1e1e1;
    text-decoration: none;
}

footer a:hover, footer a:active {
    text-decoration: underline;
}

.footer-content {
    max-width: 755px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.footer-column-right {
    text-align: right;
}

footer::after {
    content: "";
    display: table;
    clear: both;
}

/* Social Sharing */
.social-share-container {
    max-width: 650px;
    margin: 40px auto 20px;
    text-align: center;
    border-top: 1px solid #eaeaea;
    padding-top: 30px;
}

.share-text {
    font-family: "Source Serif Pro", serif;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    color: #222;
}

.social-share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background-color: #f5f5f5;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #333;
    text-decoration: none;
}

.twitter-button:hover {
    background-color: #1DA1F2;
    color: white;
}

.facebook-button:hover {
    background-color: #4267B2;
    color: white;
}

.linkedin-button:hover {
    background-color: #0077B5;
    color: white;
}

.reddit-button:hover {
    background-color: #FF4500;
    color: white;
}

.email-button:hover {
    background-color: #EA4335;
    color: white;
}

.whatsapp-button:hover {
    background-color: #25D366;
    color: white;
}

.copy-button:hover {
    background-color: #6B7280;
    color: white;
}

.share-button.copy-button {
    padding: 0;
}

.share-button:hover .share-icon path {
    fill: white;
}

.share-icon {
    width: 18px;
    height: 18px;
}

.share-icon path {
    fill: #333;
    transition: fill 0.2s ease;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

.toast.visible {
    opacity: 1;
    visibility: visible;
}

/* Post-specific styles */
.post-header {
    min-height: 100px;
    margin-top: -48px;
}

.article-credits {
    border-top: 1px solid #e5e5e5;
    color: #444;
    font-size: 16px;
    line-height: 1.5;
    margin-top: 56px;
    padding-top: 24px;
}

.article-credits p {
    margin: 0 0 8px 0;
}

.article-credits-title {
    color: #111;
    font-family: "Source Serif Pro", serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.article-byline {
    color: #222;
}

.article-byline a {
    color: inherit;
    text-decoration: none;
}

.article-byline a:hover,
.article-byline a:focus {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.article-dates span + span::before {
    color: #999;
    content: "/";
    margin-right: 14px;
}

.article-disclosure {
    color: #555;
    font-size: 15px;
    margin-top: 14px !important;
}

/* Quotes */
.author-profile {
    scroll-margin-top: 24px;
}

.author-quote {
    margin: 22px 0 0;
}

.author-quote blockquote {
    margin: 0;
}

.quotes-list {
    list-style: none;
    margin: 64px 0 0;
    padding: 0;
}

.quote-item {
    margin-bottom: 60px;
    scroll-margin-top: 24px;
}

.quote-item blockquote {
    margin: 0;
}

.quote-item blockquote p,
.author-quote blockquote p {
    font-family: "Source Serif Pro", serif;
    font-size: 25px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.45;
    margin: 0 0 12px;
}

.quote-author {
    align-items: center;
    color: #444;
    display: inline-flex;
    flex-wrap: nowrap;
    font-size: 14px;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.quote-author img {
    border-radius: 50%;
    display: block;
    flex: 0 0 24px;
    height: 24px !important;
    max-width: 24px;
    object-fit: cover;
    width: 24px !important;
}

.quote-author span {
    white-space: nowrap;
}

.quote-author:hover,
.quote-author:focus {
    text-decoration: underline;
    text-decoration-style: dashed;
}

/* Press kit styles */
.press-element {
    border: 1px solid #d4d4d4;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    word-wrap: normal;
    border: 0;
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.screen-reader-text:focus {
    clip: auto;
    background-color: #ddd;
    -webkit-clip-path: none;
    clip-path: none;
    color: #444;
    display: block;
    font-size: 1em;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
    .site-title {
        font-size: 20px;
        white-space: nowrap;
    }
    
    h1 {
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .spacer-top {
        height: 30px;
    }
    
    .footer-grid {
        display: block;
        float: left;
    }
    
    .footer-column-right {
        text-align: left;
        padding-left: 50px;
        margin-top: 50px;
        margin-bottom: 60px;
    }
    
    .share-button {
        width: 38px;
        height: 38px;
    }
    
    .share-icon {
        width: 16px;
        height: 16px;
    }

    .article-dates {
        display: block;
    }

    .article-dates span {
        display: block;
    }

    .article-dates span + span::before {
        content: "";
        margin-right: 0;
    }
}

@media screen and (max-width: 400px) {
    .site-title {
        font-size: 18px;
    }
    
    h1 {
        font-size: 26px;
    }
}