blog/content/default.css

471 lines
9.4 KiB
CSS

/* content/default.css */
:root {
--bg-color: #f8f5f0;
--header-bg: #1c1028;
--header-text: #e8e0f0;
--text-color: #2a2a2a;
--text-muted: #6b6570;
--link-color: #7b3f8d;
--accent-color: #c0392b;
--sidebar-bg: #f8f5f0;
--sidebar-border: #d0c8d8;
--precode-bg: #eee8f3;
--precode-color: #4a3660;
--precode-border: #d5c8e4;
--code-bg: #ece4f4;
--code-color: #6b3fa0;
--hr-color: #d0c8d8;
--blockquote-border: #b388cc;
--blockquote-color: #5a4a66;
--font-primary: "Verdana", "Geneva", sans-serif;
--font-heading: "Helvetica Neue", Helvetica, Arial, sans-serif;
--font-mono: "Monaco", "Menlo", "Consolas", monospace;
--content-width: 640px;
}
body.dark-mode {
--bg-color: #1a1520;
--header-bg: #0e0a14;
--header-text: #d8d0e4;
--text-color: #d5d0dc;
--text-muted: #8a8292;
--link-color: #c49dd4;
--accent-color: #e86050;
--sidebar-bg: #221c2c;
--sidebar-border: #3a3048;
--precode-bg: #1e1830;
--precode-color: #b89cd0;
--precode-border: #2e2444;
--code-bg: #2a2040;
--code-color: #c8a8e8;
--hr-color: #3a3048;
--blockquote-border: #7a58a0;
--blockquote-color: #a898b8;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
background-color: var(--bg-color);
color: var(--text-color);
font-family: var(--font-primary);
font-size: 18px;
line-height: 1.7;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Header */
.main-header {
background-color: var(--header-bg);
color: var(--header-text);
padding: 3.5rem 1.5rem;
margin-bottom: 4rem;
border-bottom: 3px solid var(--blockquote-border);
}
.header-content {
max-width: var(--content-width);
margin: 0 auto;
display: flex;
align-items: center;
gap: 1.5rem;
}
.header-logo img {
height: 56px;
width: 56px;
margin: 0;
border: none;
border-radius: 50%;
}
.header-logo {
display: inline-block;
}
.main-header h1 {
margin: 0;
color: var(--header-text);
font-family: var(--font-heading);
font-size: 1.6rem;
font-weight: 600;
letter-spacing: 0.5px;
line-height: 1.3;
}
/* Content Container */
.main-content {
max-width: var(--content-width);
margin: 0 auto;
padding: 0 1.5rem 8rem 1.5rem;
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
color: var(--text-color);
font-family: var(--font-heading);
font-weight: 700;
line-height: 1.25;
margin-top: 2.5em;
margin-bottom: 0.6em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4, h5, h6 {
font-size: 1rem;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
}
/* First paragraph — the lede */
.main-content > p:first-of-type {
font-size: 1.2em;
color: var(--text-color);
line-height: 1.65;
margin-bottom: 2em;
}
p {
margin-bottom: 1.4em;
}
/* Links */
a {
color: var(--link-color);
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 3px;
text-decoration-color: color-mix(in srgb, var(--link-color) 40%, transparent);
transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover {
color: var(--accent-color);
text-decoration-color: var(--accent-color);
}
/* Horizontal rules */
hr {
border: none;
height: 1px;
background: var(--hr-color);
margin: 3rem auto;
max-width: 120px;
}
/* Images */
img {
max-width: 100%;
height: auto;
display: block;
margin: 2.5rem auto;
border-radius: 4px;
}
/* Code — inline */
code {
font-family: var(--font-mono);
font-size: 0.85em;
background: var(--code-bg);
color: var(--code-color);
padding: 2px 6px;
border-radius: 3px;
}
/* Code — blocks */
pre {
background: var(--precode-bg);
border: 1px solid var(--precode-border);
border-radius: 4px;
padding: 1.25rem 1.5rem;
margin: 2rem 0;
overflow-x: auto;
font-size: 0.85em;
line-height: 1.6;
}
pre > code {
background: none;
color: var(--precode-color);
padding: 0;
margin: 0;
border-radius: 0;
}
/* Blockquotes */
blockquote {
border-left: 3px solid var(--blockquote-border);
margin: 2rem 0;
padding: 0.5rem 0 0.5rem 1.5rem;
font-style: italic;
color: var(--blockquote-color);
}
blockquote p:last-child {
margin-bottom: 0;
}
/* Strong / emphasis combos */
strong {
font-weight: 700;
}
/* Indented text blocks (from 4-space indent in markdown) */
.main-content > pre:not([class]) {
background: transparent;
border: none;
border-left: 2px solid var(--hr-color);
padding: 0.5rem 1.5rem;
font-family: var(--font-primary);
font-style: italic;
font-size: 0.95em;
color: var(--text-muted);
}
/* Dark Mode Toggle Button */
#theme-toggle {
background: none;
border: 1px solid var(--sidebar-border);
color: var(--text-color);
padding: 6px 12px;
cursor: pointer;
font-family: var(--font-heading);
font-size: 0.75rem;
margin-top: 1rem;
width: 100%;
text-transform: uppercase;
letter-spacing: 0.5px;
transition: all 0.2s ease;
border-radius: 3px;
}
#theme-toggle:hover {
background-color: var(--link-color);
color: #fff;
border-color: var(--link-color);
}
/* Sidebar */
.sidebar {
position: fixed;
right: 2rem;
bottom: 2rem;
width: 280px;
background: var(--sidebar-bg);
border: 1px solid var(--sidebar-border);
padding: 1.5rem;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
z-index: 100;
border-radius: 6px;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
.sidebar.force-visible {
opacity: 1 !important;
pointer-events: auto !important;
}
#close-sidebar {
position: absolute;
top: 5px;
right: 10px;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
font-weight: bold;
color: var(--text-muted);
transition: color 0.2s ease;
}
#close-sidebar:hover {
color: var(--accent-color);
}
.latest-posts h2 {
margin-top: 0;
font-family: var(--font-heading);
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
border-bottom: 1px solid var(--sidebar-border);
padding-bottom: 0.5rem;
}
.latest-posts ul {
list-style: none;
padding: 0;
margin: 0;
}
.latest-posts li {
margin-bottom: 0.8rem;
font-size: 0.88rem;
display: flex;
flex-direction: column;
}
.latest-posts .date {
font-family: var(--font-heading);
font-size: 0.7rem;
color: var(--text-muted);
margin-bottom: 2px;
}
.latest-posts a {
text-decoration: none;
font-weight: 600;
}
.latest-posts a:hover {
color: var(--accent-color);
}
.directory-link {
margin-top: 1.5rem;
text-align: center;
font-family: var(--font-heading);
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Mobile Trigger */
#read-more-trigger {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: var(--header-bg);
color: var(--header-text);
text-align: center;
padding: 1rem;
font-family: var(--font-heading);
font-weight: 600;
font-size: 0.85rem;
letter-spacing: 0.5px;
cursor: pointer;
transform: translateY(100%);
transition: transform 0.3s ease;
z-index: 90;
display: none;
}
/* Mobile */
@media (max-width: 900px) {
.sidebar {
display: none;
}
.sidebar.force-visible {
display: block;
left: 1rem;
right: 1rem;
bottom: 4rem;
width: auto;
}
#read-more-trigger {
display: block;
}
#read-more-trigger.visible {
transform: translateY(0);
}
.main-header {
padding: 2.5rem 1.25rem;
}
.main-header h1 {
font-size: 1.3rem;
}
.header-logo img {
height: 44px;
width: 44px;
}
}
/* Latest Post Preview Section */
.latest-post-preview {
margin-top: 4rem;
padding-top: 2rem;
border-top: 1px solid var(--hr-color);
}
.latest-post-preview h3 {
margin-top: 0;
margin-bottom: 1.5rem;
font-family: var(--font-heading);
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 1.5px;
color: var(--text-muted);
}
.preview-content {
position: relative;
max-height: 400px;
overflow: hidden;
margin-bottom: 2rem;
-webkit-mask-image: linear-gradient(to bottom,
black 0%,
black 50%,
rgba(0, 0, 0, 0.6) 70%,
rgba(0, 0, 0, 0.2) 85%,
transparent 100%
);
mask-image: linear-gradient(to bottom,
black 0%,
black 50%,
rgba(0, 0, 0, 0.6) 70%,
rgba(0, 0, 0, 0.2) 85%,
transparent 100%
);
}
.read-more-container {
text-align: center;
margin-top: -1rem;
position: relative;
z-index: 10;
}
.read-more-btn {
display: inline-block;
padding: 10px 24px;
border: 1px solid var(--sidebar-border);
text-decoration: none;
text-transform: uppercase;
font-family: var(--font-heading);
font-weight: 600;
font-size: 0.8rem;
letter-spacing: 0.5px;
transition: all 0.2s ease;
background: var(--bg-color);
color: var(--text-color);
border-radius: 3px;
}
.read-more-btn:hover {
background: var(--link-color);
color: #fff;
border-color: var(--link-color);
text-decoration: none;
}