/*
Theme Name: OnionPress
Theme URI: https://github.com/brewsterkahle/onionpress
Author: OnionPress
Author URI: https://github.com/brewsterkahle/onionpress
Description: Clean, privacy-first theme for OnionPress sites. Light design with purple accents, built-in hit counter, blogroll, and My Creations gallery.
Version: 1.0.0
License: AGPL-3.0
License URI: https://www.gnu.org/licenses/agpl-3.0.html
Text Domain: onionpress
*/

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #2c2c2c;
    background: #fafafa;
}

a {
    color: #7c3aed;
    text-decoration: none;
}

a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* === Layout === */
.site-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* === Header === */
.site-header {
    position: relative;
    background: #e9e0f5;
    overflow: hidden;
}

.header-cover {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.header-cover-placeholder {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #e9e0f5 0%, #c4b5e0 50%, #a78bdb 100%);
}

.header-inner {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-profile {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-top: -50px;
    position: relative;
    z-index: 1;
    padding-bottom: 20px;
}

.header-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: #e9e0f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

.header-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: linear-gradient(135deg, #c4b5e0, #7c3aed);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
}

.header-info {
    padding-bottom: 8px;
}

.site-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-title a:hover {
    color: #7c3aed;
}

.site-onionname {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #7c3aed;
    letter-spacing: 0.01em;
}

.site-description {
    margin: 2px 0 0;
    font-size: 15px;
    color: #666;
}

.header-follow {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #7c3aed;
    border: 1px solid #c4b5e0;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    transition: all 0.15s;
}

.header-follow:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    text-decoration: none;
}

/* === Navigation === */
.site-nav {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-nav li a {
    display: block;
    padding: 12px 18px;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
}

.site-nav li a:hover,
.site-nav li.current-menu-item a {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    text-decoration: none;
}

/* === Posts === */
.post {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 24px;
}

.post-title {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.3;
}

.post-title a {
    color: #1a1a1a;
}

.post-title a:hover {
    color: #7c3aed;
}

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

.post-meta a {
    color: #888;
}

.post-meta a:hover {
    color: #7c3aed;
}

.post-content {
    color: #333;
}

.post-content p {
    margin: 0 0 1em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 1.5em 0 0.5em;
    color: #1a1a1a;
}

.read-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    color: #7c3aed;
}

.read-more:hover {
    color: #5b21b6;
}

/* === Single Post === */
.single .post {
    padding: 40px;
}

.single .post-title {
    font-size: 32px;
}

/* === Sidebar === */
.sidebar-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7c3aed;
    font-weight: 600;
}

.sidebar-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-section li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-section li:last-child {
    border-bottom: none;
}

.sidebar-section li a {
    font-size: 15px;
}

/* === Blogroll / Follows === */
.blogroll-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.blogroll-item img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* === Blogroll Feed === */
.blogroll-feed-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}

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

.blogroll-feed-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}

.blogroll-feed-source {
    color: #7c3aed;
    font-weight: 600;
}

.blogroll-feed-title {
    font-size: 20px;
    margin: 0 0 8px;
    line-height: 1.3;
}

.blogroll-feed-title a {
    color: #2c2c2c;
    text-decoration: none;
}

.blogroll-feed-title a:hover {
    color: #7c3aed;
}

.blogroll-feed-excerpt {
    color: #555;
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
}

.sidebar-feed-source {
    display: block;
    font-size: 12px;
    color: #999;
}

.sidebar-more-link {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* === My Creations === */
.creations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.creation-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.creation-item:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}

.creation-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0ecf7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creation-icon {
    font-size: 48px;
    color: #c4b5e0;
}

.creation-info {
    padding: 12px;
}

.creation-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    word-break: break-word;
}

.creation-meta {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.creations-list {
    margin-top: 20px;
}

.creations-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}

.creations-list-item:hover {
    border-color: #c4b5e0;
}

.creations-list-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.creations-list-name {
    flex: 1;
    font-weight: 500;
    color: #1a1a1a;
}

.creations-list-name a {
    color: inherit;
}

.creations-list-name a:hover {
    color: #7c3aed;
}

.creations-list-size {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

.creations-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.creations-view-toggle button {
    padding: 6px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.15s;
}

.creations-view-toggle button.active,
.creations-view-toggle button:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.creations-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.creations-empty p {
    font-size: 15px;
}

.creations-empty code {
    background: #f0ecf7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* === Follow Page === */
.follow-section {
    margin-bottom: 30px;
}

.follow-section h2 {
    font-size: 20px;
    margin: 0 0 10px;
    color: #1a1a1a;
}

.follow-address-box {
    background: #f0ecf7;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 14px 0;
    text-align: center;
    overflow-x: auto;
}

.follow-address {
    font-size: 14px;
    word-break: break-all;
    color: #333;
    user-select: all;
}

.follow-address-inline {
    font-size: 13px;
    background: #f0ecf7;
    padding: 3px 8px;
    border-radius: 4px;
    word-break: break-all;
    user-select: all;
}

.follow-qr-row {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

.follow-qr-card {
    text-align: center;
}

.follow-qr {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    display: inline-block;
}

.follow-qr svg {
    display: block;
}

.follow-qr-label {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.follow-steps {
    margin: 20px 0;
}

.follow-step {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.follow-step-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #7c3aed;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.follow-step p {
    margin: 4px 0 0;
    font-size: 15px;
    color: #555;
}

.follow-direct-link {
    margin-top: 20px;
    padding: 14px 18px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.follow-direct-note {
    font-size: 12px;
    color: #999;
}

/* === Footer === */
.site-footer {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid #e5e5e5;
    text-align: center;
    background: #fff;
}

.footer-counter {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.footer-text {
    font-size: 13px;
    color: #999;
}

.footer-text a {
    color: #999;
}

.footer-text a:hover {
    color: #7c3aed;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    font-size: 14px;
    color: #555;
}

.pagination a:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    text-decoration: none;
}

.pagination .current {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

/* === Responsive === */
@media (max-width: 768px) {
    .content-area {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .header-cover,
    .header-cover-placeholder {
        height: 160px;
    }

    .header-profile {
        margin-top: -35px;
    }

    .header-avatar,
    .header-avatar-placeholder {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .site-title {
        font-size: 20px;
    }

    .post {
        padding: 20px;
    }

    .single .post {
        padding: 20px;
    }

    .single .post-title {
        font-size: 24px;
    }

    .site-nav ul {
        flex-wrap: wrap;
    }

    .site-nav li a {
        padding: 10px 14px;
        font-size: 14px;
    }

    .creations-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}
