/* Data For Good Theme - Main Styles */

/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&display=swap');

@font-face {
    font-family: 'TCJimmySansPro';
    src: url('../fonts/TCJimmySansPro.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TCJimmySansPro';
    src: url('../fonts/TCJimmySansPro.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables for Custom Fonts and Colors */
:root {
    --gh-font-heading: 'TCJimmySansPro', system-ui, sans-serif;
    --gh-font-body: 'DM Sans', system-ui, sans-serif;

    /* Data For Good Color Palette */
    --color-dark: hsl(0, 0%, 0%);
    --color-light: hsl(0, 0%, 100%);
    --color-blue: hsl(187, 67%, 53%);
    --color-alive: hsl(67, 72%, 56%);
    --color-resistance: hsl(37, 98%, 53%);
    --color-violet-light: hsl(270, 77%, 91%);
    --color-building: #721CE2;
    --color-building-light: hsl(265, 80%, 90%);
    --color-alive-light: hsl(68, 78%, 84%);
    --color-back-green: hsl(92, 14%, 81%);
    --color-grey-text: hsl(0, 0%, 40%);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--gh-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 20px 0;
    font-weight: 700;
    font-family: var(--gh-font-heading);
    color: var(--color-dark);
}

/* Headings with block outline effect */
.post-content h1,
.post-content h2,
.post-content h3 {
    display: inline-block;
    position: relative;
    transform: rotate(-2.47deg);
    -webkit-font-smoothing: antialiased;
    margin-top: 45px;
    margin-bottom: 30px;
    padding: 8px 16px;
    background-color: var(--color-light);
    font-family: var(--gh-font-heading);
    font-weight: 700;
    box-shadow: 8px 8px 0 rgb(0, 0, 0);
}

.post-content h1 {
    font-size: 42px;
    line-height: 1.2;
}

.post-content h2 {
    font-size: 48px;
    line-height: 1.3;
    background-color: var(--color-building);
    color: var(--color-light);
}

.post-content h3 {
    font-size: 28px;
    line-height: 1.4;
    background-color: var(--color-alive);
    color: var(--color-dark);
    transform: rotate(0deg);
    margin-top: 22.5px;
}

h4 {
    font-size: 22px;
    line-height: 1.4;
}

p {
    margin: 0 0 20px 0;
}

a {
    color: var(--color-building);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* Site Header with Logo */
.site-header {
    padding: 20px 24px;
}

.back-link {
    font-family: var(--gh-font-body);
    font-size: 14px;
    color: var(--color-building);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--color-dark);
}

.site-logo {
    display: inline-block;
}

.site-logo img {
    height: 40px;
    width: auto;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 15px;
}

.content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 4px;
}

/* Article Styles */
article {
    margin-bottom: 30px;
}

.post-header {
    margin-bottom: 30px;
}

.post-title {
    margin-bottom: 10px;
}

.post-meta {
    font-size: 14px;
    color: #858588;
    margin-bottom: 20px;
}

.post-content {
    font-size: 16px;
    line-height: 1.6;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px auto;
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Feature image at top of page - 20% wider than body */
.post-feature-image {
    width: 100vw;
    max-width: 960px;
    margin: 10px auto 20px;
    text-align: center;
    display: block;
}

.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    margin: 0;
}

.post-content figure {
    margin: 30px auto;
    text-align: center;
}

.post-content figure img {
    margin: 0 auto;
}

.post-content figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--color-grey-text);
    font-style: italic;
    text-align: center;
}

/* Ghost Width Classes */
.kg-width-wide {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.post-content blockquote {
    font-family: 'DM Mono', monospace;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    padding: 20px 20px;
    margin: 15px 0;
    background-color: var(--color-light);
    background-image: url('../images/bg-paper.jpg');
    background-size: cover;
    display: inline-block;
    box-shadow: .25rem .25rem 0 rgb(0, 0, 0);
}

.post-content blockquote em,
.post-content blockquote i {
    font-style: normal;
}

.post-content ul,
.post-content ol {
    margin: 0 0 15px 30px;
}

.post-content li {
    margin-bottom: 5px;
}

/* Highlight Box */
.highlight-box {
    background-color: var(--color-alive-light);
    padding: 24px;
    border-radius: 8px;
    margin: 30px 0;
    border-left: 4px solid var(--color-alive);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* TL;DR Block - Custom HTML block for multi-line summaries */
.tldr {
    background-color: var(--color-alive-light);
    background-image: url('../images/bg-paper.jpg');
    background-size: cover;
    background-blend-mode: multiply;
    border-left: 4px solid var(--color-alive);
    padding: 24px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
    transform: rotate(-1deg);
}

.tldr-title {
    font-family: var(--gh-font-heading);
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-dark);
    background-color: var(--color-alive);
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.tldr::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/scratch.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.3;
}

.tldr p,
.tldr ul,
.tldr ol {
    color: var(--color-dark);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.tldr p:last-child,
.tldr ul:last-child,
.tldr ol:last-child {
    margin-bottom: 0;
}

.tldr ul,
.tldr ol {
    padding-left: 20px;
}

.tldr li {
    margin-bottom: 8px;
}

.tldr li:last-child {
    margin-bottom: 0;
}

.tldr strong {
    font-weight: 700;
}

/* Ghost Callout Blocks */
.kg-callout-card {
    padding: 24px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* TL;DR Callout: Green with no emoji - with paper texture and mask */
.kg-callout-card.kg-callout-card-green:not(:has(.kg-callout-emoji)) {
    background-color: var(--color-alive-light);
    background-image: url('../images/bg-paper.jpg');
    background-size: cover;
    background-blend-mode: multiply;
    border-left: 4px solid var(--color-alive);
    position: relative;
    overflow: hidden;
    transform: rotate(-2.47deg);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.kg-callout-card.kg-callout-card-green:not(:has(.kg-callout-emoji))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/scratch.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.3;
}

.kg-callout-card.kg-callout-card-green:not(:has(.kg-callout-emoji)) .kg-callout-text {
    color: var(--color-dark);
    font-weight: 500;
}

.kg-callout-card.kg-callout-card-green:not(:has(.kg-callout-emoji)) .kg-callout-text::before {
    content: "TL;DR";
    display: block;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--color-dark);
}

/* Default callout styles */
.kg-callout-card .kg-callout-emoji {
    font-size: 24px;
    margin-right: 12px;
}

.kg-callout-card .kg-callout-text {
    font-size: 16px;
    line-height: 1.5;
}

/* Button Styles */
.button,
.btn,
.kg-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--color-light) !important;
    background-color: var(--color-building) !important;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.button:hover,
.btn:hover,
.kg-btn:hover {
    background-color: var(--color-building) !important;
    color: var(--color-light) !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ghost Button Card */
.kg-button-card {
    display: flex;
    justify-content: flex-start;
    margin: 30px 0;
}

.kg-button-card.kg-align-center {
    justify-content: center;
}

.button-secondary {
    background-color: var(--color-blue);
}

.button-secondary:hover {
    background-color: var(--color-blue);
    transform: translateY(-2px);
}

/* Article List (for debug-articles page) */
.articles-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-item {
    padding: 20px 0;
    border-bottom: 1px solid #e8e8e8;
}

.article-item:last-child {
    border-bottom: none;
}

.article-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.article-excerpt {
    color: #666666;
    margin-bottom: 10px;
}

.article-meta {
    font-size: 14px;
    color: #858588;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    h4 {
        font-size: 16px;
    }

    .container {
        padding: 15px 10px;
    }

    .content {
        padding: 20px 15px;
    }
}
