/*
Theme Name: ProductiveBoy
Theme URI: https://productiveboy.com
Author: ProductiveBoy
Description: A Stratechery-inspired theme for productivity, featuring a clean text-first layout and side-notes.
Version: 1.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: two-columns, right-sidebar, custom-colors
*/

/* --- BRAND VARIABLES --- */
:root {
    --color-navy: #112960;
    --color-king-blue: #1E50EF;
    --color-grey: #B3BBCE;
    --color-light-bg: #F8F9FA;
    --color-text-main: #2c2c2c;
    --color-text-light: #666;
    --color-white: #ffffff;
    
    /* FONT: Roboto Slab for that "Modern + Classic" crossover */
    --font-primary: 'Roboto Slab', serif;
    
    --container-width: 1100px;
    --content-width: 740px; 
    --sidebar-width: 300px;
}

/* --- GLOBAL RESET & TYPOGRAPHY --- */
* { box-sizing: border-box; }

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    color: var(--color-text-main);
    background-color: var(--color-white);
    line-height: 1.7; 
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Custom Text Selection */
::selection {
    background: var(--color-king-blue);
    color: white;
}

a {
    color: var(--color-king-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--color-navy);
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-weight: 700;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

h1 { font-size: 2.5rem; line-height: 1.1; margin-top: 0; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

p { margin-bottom: 1.5em; font-size: 1.125rem; }

blockquote {
    margin: 20px 0 20px 20px;
    padding-left: 15px;
    border-left: 4px solid var(--color-king-blue);
    font-style: italic;
    color: #555;
    max-width: 100%;
}

.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 20px; }
.alignright { float: right; margin-left: 20px; }

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; 
    overflow: hidden;
}

.btn {
    display: inline-block;
    background-color: var(--color-king-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.btn:hover { background-color: var(--color-navy); color: white; }

/* --- HEADER --- */
header {
    border-bottom: 1px solid #eaeaea;
    padding: 15px 0;
    background: white;
    position: sticky;
    top: 0;
    left: 0; 
    width: 100%;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

.logo-img {
    max-height: 50px; 
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

nav ul li { margin: 0; }

nav a {
    color: var(--color-navy);
    font-weight: 500;
    font-size: 0.95rem;
}

/* --- MAIN LAYOUT GRID --- */
.main-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 60px;
    padding: 40px 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.content-column {
    width: 100%;
    min-width: 0;
}

.pinned-post {
    background-color: #f0f4ff;
    border-left: 5px solid var(--color-king-blue);
    padding: 30px;
    margin-bottom: 50px;
    border-radius: 0 8px 8px 0;
    width: 100%;
}

.pinned-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-king-blue);
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.pinned-post h2 { margin-top: 0; font-size: 2rem; }

article {
    margin-bottom: 60px;
    border-bottom: 1px solid #eee;
    padding-bottom: 60px;
    width: 100%;
    max-width: 100%;
}

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

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-title a {
    color: var(--color-navy);
}

.entry-content,
.post-excerpt,
.pinned-post p,
.pinned-post h2,
.post-title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.entry-content pre, 
.entry-content table,
.entry-content iframe,
.post-excerpt pre {
    max-width: 100%;
    overflow-x: auto; 
    display: block;
}

/* --- CALLOUT BOX (Native Block Style) --- */
/* Works automatically when you select "Blue Callout" style in Gutenberg on a Group OR Paragraph Block */
.wp-block-group.is-style-blue-callout,
.wp-block-paragraph.is-style-blue-callout,
.callout {
    background: #f0f4ff;
    border: 1px solid var(--color-king-blue);
    border-radius: 6px;
    padding: 20px;
    margin: 30px 0;
}

.wp-block-group.is-style-blue-callout h1,
.wp-block-group.is-style-blue-callout h2,
.wp-block-group.is-style-blue-callout h3,
.wp-block-group.is-style-blue-callout h4,
.callout h4 { margin-top: 0; font-size: 1.1rem; }

.wp-block-group.is-style-blue-callout p:last-child,
.callout p:last-child { margin-bottom: 0; }

/* --- NATIVE FOOTNOTES STYLING --- */
/* Styles the native Gutenberg footnote block */
.wp-block-footnotes {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
}

.wp-block-footnotes ol {
    padding-left: 20px;
}

.wp-block-footnotes a {
    color: var(--color-king-blue);
    text-decoration: none;
}

/* The tiny number in the text body */
a[data-fn] {
    vertical-align: super;
    font-size: 0.7em;
    color: var(--color-king-blue);
    margin-left: 2px;
    text-decoration: none;
    font-weight: bold;
}

/* --- PAGINATION STYLING --- */
.pagination {
    margin: 40px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #eee;
    border-radius: 4px;
    color: var(--color-navy);
    font-weight: 600;
}

.pagination .current {
    background: var(--color-navy);
    color: white;
    border-color: var(--color-navy);
}

.pagination a.page-numbers:hover {
    background: var(--color-king-blue);
    color: white;
    border-color: var(--color-king-blue);
}

/* --- SIDEBAR --- */
aside {
    padding-top: 10px;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-navy);
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 0;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}
.widget ul li a {
    color: #666;
    font-size: 0.95rem;
}

/* EMAIL CAPTURE WIDGET STYLES */
.email-widget {
    background-color: var(--color-navy);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.email-widget h4 {
    color: white;
    margin-top: 0;
    font-size: 1.2rem;
}

.email-widget p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.email-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: inherit;
}

.email-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--color-king-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.email-btn:hover { background-color: #3b66f5; }

/* PODCAST WIDGET */
.podcast-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.podcast-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    transition: transform 0.2s;
}

.podcast-item:hover {
    transform: translateX(5px);
}

.podcast-icon {
    width: 50px;
    height: 50px;
    background: #f0f4ff;
    color: var(--color-king-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 900;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.podcast-details a {
    font-weight: bold;
    color: var(--color-navy);
    display: block;
    line-height: 1.2;
    margin-bottom: 4px;
}

.podcast-meta {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* RESPONSIVE */
@media (max-width: 800px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .container {
        width: 100%;
        overflow-x: hidden;
    }
    
    .pinned-post {
        padding: 20px;
        border-left-width: 3px;
    }
}

@media print {
    header, aside, .btn, .post-navigation, .pagination {
        display: none !important;
    }
    
    .main-grid {
        display: block;
        padding: 0;
    }
    
    body, p, h1, h2, h3 {
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    article {
        border-bottom: none;
    }
}