/* style.css — doom-one-light inspired theme for pedro.help */

/* ── Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #fafafa;
    color: #383a42;
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Mode-line (top bar) ───────────────────────────────────────────── */
#preamble {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 2.5rem;
    background-color: #e7e7e7;
    border-bottom: 2px solid #dfdfdf;
    border-radius: 4px 4px 0 0;
    color: #383a42;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#preamble a {
    color: #4078f2;
    text-decoration: none;
    font-weight: 500;
}

#preamble a:hover {
    text-decoration: underline;
}

/* ── Content ───────────────────────────────────────────────────────── */
#content {
    padding: 0;
}

/* ── Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

h1.title {
    font-size: 1.8rem;
    color: #a626a4;
    margin-top: 0;
    margin-bottom: 0.3rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e7e7e7;
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #9ca0a4;
    font-style: italic;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.35rem;
    color: #4078f2;
}

h3 {
    font-size: 1.15rem;
    color: #0184bc;
}

h4 {
    font-size: 1rem;
    color: #986801;
}

p {
    margin-bottom: 1.2rem;
}

/* ── Links ─────────────────────────────────────────────────────────── */
a {
    color: #4078f2;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

a:hover {
    border-bottom-color: #4078f2;
}

/* ── Lists ─────────────────────────────────────────────────────────── */
ul, ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.4rem;
}

li::marker {
    color: #9ca0a4;
}

/* ── Code ──────────────────────────────────────────────────────────── */
code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    background-color: #f0f0f0;
    color: #e45649;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background-color: #f0f0f0;
    border: 1px solid #dfdfdf;
    border-left: 3px solid #4078f2;
    border-radius: 4px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    line-height: 1.5;
}

pre code {
    background: none;
    color: #383a42;
    padding: 0;
}

/* Syntax highlighting — doom-one-light palette */
.org-keyword,
.org-builtin      { color: #a626a4; }
.org-string        { color: #50a14f; }
.org-comment,
.org-comment-delimiter { color: #9ca0a4; font-style: italic; }
.org-function-name { color: #a626a4; }
.org-variable-name { color: #e45649; }
.org-type          { color: #986801; }
.org-constant      { color: #b751b6; }
.org-preprocessor  { color: #4078f2; }
.org-warning       { color: #986801; font-weight: bold; }

/* ── Blockquotes ───────────────────────────────────────────────────── */
blockquote {
    border-left: 3px solid #a626a4;
    margin: 1.5rem 0;
    padding: 0.5rem 1.2rem;
    background-color: #f0f0f0;
    border-radius: 0 4px 4px 0;
    color: #383a42;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ── Emphasis ──────────────────────────────────────────────────────── */
em {
    color: #0184bc;
}

strong {
    font-weight: 600;
    color: #383a42;
}

/* ── Horizontal rule ───────────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid #dfdfdf;
    margin: 2rem 0;
}

/* ── Images & Figures ──────────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

figure {
    margin: 1.5rem 0;
}

figcaption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #9ca0a4;
    margin-top: 0.5rem;
}

/* ── Tables ────────────────────────────────────────────────────────── */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

th {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid #dfdfdf;
    color: #4078f2;
}

td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

tr:hover td {
    background-color: #f0f0f0;
}

/* ── Postamble (footer) ────────────────────────────────────────────── */
#postamble {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e7e7e7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #9ca0a4;
}

#postamble a {
    color: #4078f2;
}

/* ── Org-mode specific ─────────────────────────────────────────────── */
.todo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #e45649;
}

.done {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #50a14f;
}

.tag span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background-color: #e7e7e7;
    color: #9ca0a4;
    padding: 0.1em 0.5em;
    border-radius: 3px;
}

.timestamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: #986801;
}

/* ── Table of contents ─────────────────────────────────────────────── */
#table-of-contents {
    background-color: #f0f0f0;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

#table-of-contents h2 {
    font-size: 0.9rem;
    color: #9ca0a4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0;
}

#table-of-contents ul {
    list-style: none;
    padding-left: 0;
}

#table-of-contents li {
    margin-bottom: 0.2rem;
}

#table-of-contents a {
    color: #383a42;
    font-size: 0.9rem;
}

#table-of-contents a:hover {
    color: #4078f2;
}

/* ── Contact form ──────────────────────────────────────────────────── */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #383a42;
    width: 100%;
    max-width: 400px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #4078f2;
}

.contact-form textarea {
    resize: vertical;
    line-height: 1.5;
}

.contact-form button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    background-color: #4078f2;
    color: #fafafa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.contact-form button:hover {
    background-color: #a626a4;
}

/* ── Newsletter form ───────────────────────────────────────────────── */
.newsletter-form input[type="email"] {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #383a42;
    width: 260px;
    max-width: 100%;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #4078f2;
}

.newsletter-form button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    background-color: #4078f2;
    color: #fafafa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.newsletter-form button:hover {
    background-color: #a626a4;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    body {
        padding: 1rem 1rem 3rem;
    }

    h1.title {
        font-size: 1.5rem;
    }

    pre {
        font-size: 0.8rem;
        padding: 0.8rem;
    }

    #preamble {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
}
