/*
 Theme Name:   GeneratePress Child - Marginalian Style
 Theme URI:    https://generatepress.com
 Description:  A literary, elegant theme inspired by The Marginalian
 Author:       Custom
 Template:     generatepress
 Version:      1.0
*/

/* ==========================================================================
   CSS VARIABLES - The Marginalian Color Palette
   ========================================================================== */

:root {
    /* Colors */
    --tm-cream: #f7f5f0;
    --tm-cream-light: #fdfcfa;
    --tm-cream-dark: #ebe8e0;
    --tm-text: #333333;
    --tm-text-light: #666666;
    --tm-text-muted: #888888;
    --tm-coral: #c06868;
    --tm-coral-hover: #a85555;
    --tm-coral-light: #d88888;
    --tm-border: #e0ddd5;
    --tm-border-light: #ebe8e0;
    
    /* Typography */
    --tm-font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --tm-font-body: Georgia, 'Times New Roman', serif;
    --tm-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Spacing */
    --tm-content-width: 680px;
    --tm-sidebar-width: 320px;
    --tm-gutter: 60px;
}

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--tm-cream);
    color: var(--tm-text);
    font-family: var(--tm-font-body);
    font-size: 18px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--tm-font-serif);
    font-weight: 400;
    line-height: 1.3;
    color: var(--tm-text);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.6em;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2em;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.25em;
}

/* Entry Title - Article Headers */
.entry-title,
.single .entry-title {
    font-family: var(--tm-font-serif);
    font-size: 2.4em;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--tm-text);
    margin-bottom: 0.3em;
}

/* Links */
a {
    color: var(--tm-coral);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Entry Content Links */
.entry-content a {
    color: var(--tm-coral);
    text-decoration: underline;
    text-decoration-color: rgba(192, 104, 104, 0.4);
    text-underline-offset: 2px;
}

.entry-content a:hover {
    text-decoration-color: var(--tm-coral);
}

/* Paragraphs */
p {
    margin-bottom: 1.5em;
}

/* Blockquotes - Literary Style */
blockquote {
    font-family: var(--tm-font-serif);
    font-style: italic;
    font-size: 1.1em;
    line-height: 1.7;
    color: var(--tm-text);
    margin: 2em 0;
    padding: 0 2em;
    border-left: 3px solid var(--tm-coral);
    background: transparent;
}

blockquote p {
    margin-bottom: 1em;
}

blockquote cite,
blockquote footer {
    font-style: normal;
    font-size: 0.9em;
    color: var(--tm-text-muted);
    display: block;
    margin-top: 0.5em;
}

/* Drop Cap - First Letter of Articles */
.entry-content > p:first-of-type::first-letter,
.has-drop-cap:not(:focus)::first-letter {
    float: left;
    font-family: var(--tm-font-serif);
    font-size: 4em;
    line-height: 0.8;
    font-weight: 400;
    margin: 0.05em 0.15em 0 0;
    color: var(--tm-coral);
}

/* ==========================================================================
   HEADER / SITE BRANDING
   ========================================================================== */

.site-header {
    background-color: var(--tm-cream);
    border-bottom: 1px solid var(--tm-border);
    padding: 30px 0;
}

.site-branding {
    text-align: center;
}

.site-title {
    font-family: var(--tm-font-serif);
    font-size: 2.2em;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin: 0;
}

.site-title a {
    color: var(--tm-text);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--tm-coral);
    text-decoration: none;
}

.site-description {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    color: var(--tm-text-muted);
    margin-top: 5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Custom Logo */
.custom-logo-link img,
.site-logo img {
    max-height: 80px;
    width: auto;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.main-navigation {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.main-navigation a {
    color: var(--tm-text);
    padding: 10px 15px;
}

.main-navigation a:hover {
    color: var(--tm-coral);
    text-decoration: none;
}

.menu-toggle {
    font-family: var(--tm-font-sans);
    background: transparent;
    border: 1px solid var(--tm-border);
    color: var(--tm-text);
}

/* ==========================================================================
   LAYOUT - Content & Sidebar
   ========================================================================== */

.site-content {
    background-color: var(--tm-cream);
}

.content-area {
    max-width: var(--tm-content-width);
}

.widget-area,
.sidebar {
    max-width: var(--tm-sidebar-width);
}

/* Container */
.site-main {
    padding: 40px 0;
}

/* Single Post Layout */
.single .entry-header {
    text-align: center;
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid var(--tm-border);
}

.single .entry-meta {
    font-family: var(--tm-font-sans);
    font-size: 0.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tm-text-muted);
    margin-top: 1em;
}

/* ==========================================================================
   FEATURED IMAGE
   ========================================================================== */

.post-image,
.featured-image,
.wp-post-image {
    border-radius: 0;
    box-shadow: none;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 2em 0;
}

/* Image Captions */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text,
figcaption {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    font-style: italic;
    color: var(--tm-text-muted);
    text-align: center;
    padding: 10px 0;
}

/* ==========================================================================
   SIDEBAR WIDGETS
   ========================================================================== */

.widget {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--tm-border);
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-family: var(--tm-font-sans);
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tm-text);
    margin-bottom: 1.5em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--tm-coral);
}

/* Sidebar Links */
.widget a {
    color: var(--tm-text);
}

.widget a:hover {
    color: var(--tm-coral);
}

/* Sidebar Lists */
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--tm-border-light);
}

.widget ul li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   DONATION / CTA BOX (Custom Widget Style)
   ========================================================================== */

.donation-box,
.widget_custom_html .textwidget {
    background: var(--tm-cream-light);
    border: 1px solid var(--tm-border);
    padding: 25px;
    text-align: center;
}

.donation-box h3,
.cta-title {
    font-family: var(--tm-font-serif);
    font-size: 1.4em;
    font-weight: 400;
    color: var(--tm-text);
    margin-bottom: 15px;
}

.donation-box p {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--tm-text-light);
    margin-bottom: 20px;
}

/* Donation Buttons */
.donate-button,
.cta-button,
a.button,
button,
input[type="submit"],
.wp-block-button__link {
    font-family: var(--tm-font-sans);
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--tm-coral);
    color: #fff !important;
    padding: 12px 25px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.donate-button:hover,
.cta-button:hover,
a.button:hover,
button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    background: var(--tm-coral-hover);
    color: #fff !important;
    text-decoration: none;
}

/* ==========================================================================
   NEWSLETTER SIGNUP
   ========================================================================== */

.newsletter-box {
    background: var(--tm-text);
    color: var(--tm-cream);
    padding: 30px;
    text-align: center;
}

.newsletter-box h3 {
    color: var(--tm-cream);
    font-family: var(--tm-font-serif);
    font-size: 1.3em;
    margin-bottom: 15px;
}

.newsletter-box p {
    color: rgba(247, 245, 240, 0.8);
    font-size: 0.9em;
}

.newsletter-box input[type="email"] {
    width: 100%;
    padding: 12px;
    border: none;
    margin-bottom: 10px;
    font-family: var(--tm-font-body);
}

.newsletter-box input[type="submit"] {
    width: 100%;
    background: var(--tm-coral);
}

/* ==========================================================================
   BOOK COVERS / RELATED POSTS GRID
   ========================================================================== */

.book-grid,
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.book-item,
.related-post-item {
    text-align: center;
}

.book-item img,
.related-post-item img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.book-item img:hover,
.related-post-item img:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.book-item h4,
.related-post-item h4 {
    font-family: var(--tm-font-serif);
    font-size: 0.95em;
    font-weight: 400;
    margin-top: 12px;
    line-height: 1.4;
}

/* ==========================================================================
   ENTRY CONTENT STYLES
   ========================================================================== */

.entry-content {
    font-family: var(--tm-font-body);
    font-size: 1.05em;
    line-height: 1.9;
}

/* Lists */
.entry-content ul,
.entry-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

/* Horizontal Rule */
.entry-content hr {
    border: none;
    border-top: 1px solid var(--tm-border);
    margin: 3em 0;
}

/* Code */
.entry-content code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
    background: var(--tm-cream-dark);
    padding: 2px 6px;
    border-radius: 3px;
}

.entry-content pre {
    background: var(--tm-cream-dark);
    padding: 20px;
    overflow-x: auto;
    border-left: 3px solid var(--tm-coral);
    margin: 2em 0;
}

/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */

.author-box {
    background: var(--tm-cream-light);
    border-top: 1px solid var(--tm-border);
    border-bottom: 1px solid var(--tm-border);
    padding: 30px;
    margin: 3em 0;
}

.author-box .author-avatar {
    float: left;
    margin-right: 20px;
}

.author-box .author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.author-box .author-name {
    font-family: var(--tm-font-serif);
    font-size: 1.2em;
    font-weight: 400;
    margin-bottom: 5px;
}

.author-box .author-bio {
    font-size: 0.95em;
    color: var(--tm-text-light);
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.comments-area {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid var(--tm-border);
}

.comments-title {
    font-family: var(--tm-font-serif);
    font-size: 1.5em;
    font-weight: 400;
}

.comment-body {
    padding: 25px 0;
    border-bottom: 1px solid var(--tm-border-light);
}

.comment-author {
    font-family: var(--tm-font-sans);
    font-weight: 600;
}

.comment-content {
    margin-top: 10px;
}

/* Comment Form */
.comment-form label {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tm-border);
    background: var(--tm-cream-light);
    font-family: var(--tm-font-body);
    font-size: 1em;
}

.comment-form textarea {
    min-height: 150px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--tm-text);
    color: var(--tm-cream);
    padding: 50px 0 30px;
    margin-top: 60px;
}

.site-footer a {
    color: var(--tm-coral-light);
}

.site-footer a:hover {
    color: var(--tm-cream);
}

.site-info {
    font-family: var(--tm-font-sans);
    font-size: 0.8em;
    text-align: center;
    color: rgba(247, 245, 240, 0.6);
    letter-spacing: 0.05em;
}

/* Footer Widgets */
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widgets .widget-title {
    color: var(--tm-cream);
    border-bottom-color: var(--tm-coral);
}

.footer-widgets .widget {
    border-bottom: none;
}

.footer-widgets ul li {
    border-bottom-color: rgba(247, 245, 240, 0.1);
}

/* ==========================================================================
   ARCHIVE / BLOG LISTING
   ========================================================================== */

.archive .entry-header,
.blog .entry-header {
    margin-bottom: 1em;
}

.archive .entry-title,
.blog .entry-title {
    font-size: 1.6em;
}

.archive .entry-summary,
.blog .entry-summary {
    font-size: 1em;
    color: var(--tm-text-light);
}

.archive article,
.blog article {
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--tm-border);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination,
.nav-links {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    margin-top: 40px;
    text-align: center;
}

.pagination a,
.nav-links a {
    color: var(--tm-text);
    padding: 8px 12px;
    margin: 0 2px;
}

.pagination a:hover,
.nav-links a:hover {
    color: var(--tm-coral);
    text-decoration: none;
}

.pagination .current,
.nav-links .current {
    background: var(--tm-coral);
    color: #fff;
    padding: 8px 12px;
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.search-form {
    display: flex;
}

.search-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--tm-border);
    border-right: none;
    font-family: var(--tm-font-body);
}

.search-submit {
    padding: 10px 20px;
}

/* ==========================================================================
   SPECIAL ELEMENTS
   ========================================================================== */

/* "We Are Alive" styled header */
.alive-header,
.section-header {
    font-family: var(--tm-font-serif);
    font-size: 0.9em;
    font-style: italic;
    color: var(--tm-text-muted);
    text-align: center;
    margin-bottom: 2em;
    letter-spacing: 0.1em;
}

/* Surprise Me Link */
.surprise-link {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--tm-coral);
    border: 1px solid var(--tm-coral);
    padding: 8px 20px;
    display: inline-block;
}

.surprise-link:hover {
    background: var(--tm-coral);
    color: #fff;
    text-decoration: none;
}

/* Category Browse Dropdown Style */
.category-dropdown select {
    font-family: var(--tm-font-sans);
    font-size: 0.85em;
    padding: 10px 15px;
    border: 1px solid var(--tm-border);
    background: var(--tm-cream-light);
    width: 100%;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --tm-gutter: 40px;
    }
    
    .entry-title,
    .single .entry-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 17px;
    }
    
    :root {
        --tm-gutter: 25px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .entry-title,
    .single .entry-title {
        font-size: 1.7em;
    }
    
    blockquote {
        padding: 0 1em;
        margin: 1.5em 0;
    }
    
    .entry-content > p:first-of-type::first-letter {
        font-size: 3em;
    }
    
    .book-grid,
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }
    
    .entry-title,
    .single .entry-title {
        font-size: 1.5em;
    }
    
    .entry-content > p:first-of-type::first-letter {
        font-size: 2.5em;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    body {
        font-size: 12pt;
        background: #fff;
        color: #000;
    }
    
    .site-header,
    .site-footer,
    .sidebar,
    .widget-area,
    .comments-area,
    .navigation {
        display: none;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .entry-content {
        max-width: 100%;
    }
}

/* ==========================================================================
   GENERATEPRESS SPECIFIC OVERRIDES
   ========================================================================== */

/* Override GP defaults */
.grid-container {
    max-width: 1200px;
}

.separate-containers .inside-article {
    padding: 40px;
    background: var(--tm-cream);
    border: none;
    box-shadow: none;
}

.separate-containers .site-main > article,
.separate-containers .site-main > section {
    margin-bottom: 0;
}

/* Navigation alignment */
.main-navigation .main-nav ul li a {
    font-family: var(--tm-font-sans);
    font-size: 0.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Remove GP borders */
.generate-columns .inside-article {
    border: none;
}

.post-image-above-header .inside-article > .featured-image {
    margin-bottom: 2em;
}

/* Entry Meta styling */
.entry-meta {
    font-family: var(--tm-font-sans);
    font-size: 0.75em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tm-text-muted);
}

.entry-meta a {
    color: var(--tm-text-muted);
}

.entry-meta a:hover {
    color: var(--tm-coral);
}

/* Read More link */
.read-more {
    font-family: var(--tm-font-sans);
    font-size: 0.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tm-coral);
}

/* Back to top */
.generate-back-to-top {
    background: var(--tm-coral);
    color: #fff;
}

.generate-back-to-top:hover {
    background: var(--tm-coral-hover);
}
