 /*
Theme Name: Darcy Lab
Author: Darcy Johnson
Description: A clean, engineering-focused portfolio theme (V11).
Version: 1.0
*/

:root {
    --bg: #fdfdfd;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #1a202c;
    --text-muted: #64748b;
    --accent: #0284c7;
    --industrial: #ea580c;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
}

.container { 
    max-width: 1200px; /* Increased from 1000px */
    margin: 0 auto; 
    padding: 0 24px; 
    position: relative; 
    z-index: 2; 
}

/* 2. Home Page Override (Only shrinks the content, not the header) */
/*body.home .container.main-content,
body.blog .container.main-content,
body.front-page .container.main-content {
    max-width: 1000px !important;
}*/

body.blog .container.main-content {
    max-width: 1000px !important;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* --- NAV --- */
nav { 
    width: 100%;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 0; /* Keep this 0 always */
    margin-bottom: 60px; 
    background: rgba(253, 253, 253, 0.95); 
    backdrop-filter: blur(10px);
    position: sticky; 
    top: 0; 
    z-index: 100;
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease; /* Only animate shadow on the wrapper */
}

/* The inner container controls the height/thickness */
nav .container {
    padding: 24px 24px; /* Start tall */
    margin: 0 auto;
    transition: padding 0.3s ease; /* Animate the shrink */
}

/* --- SCROLLED STATE --- */

/* 1. Add shadow to the bar */
nav.scrolled {
    box-shadow: var(--shadow-sm);
}

/* 2. SHRINK the inner container */
nav.scrolled .container {
    padding: 10px 24px; /* Reduces from 24px to 10px */
}

/* --- NAV LINKS (UPDATED) --- */
.brand { 
    font-weight: 900; 
    font-size: 1.25rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: var(--text-main);
    letter-spacing: -0.03em; /* Tighter, cleaner logo text */
}

.site-logo {
    height: 32px; 
    width: auto; 
    border-radius: 4px; 
}

.nav-links { 
    display: flex; 
    gap: 30px; 
    align-items: center;
    /* Removed 'font-family: var(--font-mono)' - this was the culprit! */
}

/* NEW LINK STYLE */
.nav-link {
    font-family: var(--font-main); /* Uses Inter/System Sans-Serif */
    font-size: 0.85rem;            /* Slightly smaller, premium feel */
    font-weight: 700;              /* Bold to match the logo weight */
    text-transform: uppercase;     /* "Engineering" style caps */
    letter-spacing: 0.08em;        /* Spaced out letters */
    color: var(--text-muted);      /* Start Grey */
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link:hover { 
    color: var(--accent);          /* Light up Blue */
    transform: translateY(-1px);   /* Subtle pop */
    text-decoration: none;         /* No underline */
}

/* --- HERO PROFILE --- */
.profile-section {
    display: grid; grid-template-columns: 1fr 300px; gap: 60px; 
    align-items: center; margin-bottom: 100px;
}

.profile-text h1 { 
    font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1.1; 
    font-weight: 800; margin-bottom: 24px; letter-spacing: -0.03em;
}

.highlight { 
    background: linear-gradient(120deg, rgba(2, 132, 199, 0.15) 0%, rgba(2, 132, 199, 0.15) 100%);
    background-repeat: no-repeat; background-size: 100% 40%; background-position: 0 88%;
    color: var(--accent);
}

.profile-bio { 
    font-size: 1.1rem; color: var(--text-muted); max-width: 500px; 
    margin-bottom: 30px; border-left: 3px solid var(--border); padding-left: 20px; 
}

.btn-group { display: flex; gap: 15px; }
.btn {
    padding: 12px 24px; background: var(--text-main); color: #fff;
    font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem;
    border-radius: 6px; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--accent); transform: translateY(-2px); }

.btn-outline {
    background: #fff; color: var(--text-main); border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: #fff; }

/* ID CARD VISUAL */
.id-card {
    background: #fff; padding: 15px; border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-md); position: relative;
    transform: rotate(2deg); transition: 0.3s;
}
.id-card:hover { transform: rotate(0deg) scale(1.02); }

.id-photo { 
    width: 100%; height: 300px; background: #f1f5f9; border-radius: 8px; 
    margin-bottom: 15px; overflow: hidden; position: relative;
}
.id-photo img { width: 100%; height: 100%; object-fit: cover; }

.id-badge {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
    border-top: 1px solid var(--border); padding-top: 10px;
}
.status-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* --- LOGS FEED --- */
.section-header { 
    display: flex; justify-content: space-between; align-items: flex-end; 
    margin-bottom: 30px; border-bottom: 2px solid var(--border); padding-bottom: 10px;
}
.section-title { font-family: var(--font-mono); color: var(--accent); letter-spacing: 1px; font-weight: 700; }
.view-all { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); }

.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-bottom: 100px; }

.log-card {
    background: #fff; border: 1px solid var(--border); padding: 25px;
    border-radius: 8px; transition: 0.3s; cursor: pointer;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.log-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }

.log-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; display: block; }
.log-tag { color: var(--industrial); font-weight: 700; margin-left: 10px; }

.log-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; line-height: 1.4; }
.log-excerpt { font-size: 0.95rem; color: #475569; margin-bottom: 20px; flex-grow: 1; }

.read-more { font-size: 0.85rem; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.read-more::after { content: '\2192'; transition: 0.2s; }
.log-card:hover .read-more::after { transform: translateX(5px); }

/* --- FOOTER --- */
footer { 
    width: 100%;
    text-align: center; 
    padding: 0;
    border-top: 1px solid var(--border); 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    background: #fff;
    margin-top: auto;
}

footer .container {
    padding: 30px 24px;
}

footer p { margin-bottom: 5px; } /* Tighten spacing */

@media(max-width: 768px) {
    .profile-section { grid-template-columns: 1fr; text-align: center; }
    .btn-group { justify-content: center; }
    .id-card { max-width: 320px; margin: 0 auto; transform: rotate(0deg); }
}

/* 1. The Card Container */
.log-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    padding: 0 !important; /* Force remove padding */
}

/* 2. The Image Wrapper */
.log-visual {
    height: 180px !important;    /* Force height limit */
    width: 100% !important;      /* Force full width */
    max-height: 180px !important; /* Double safety */
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden !important; /* Cut off anything outside */
    margin: 0 !important;
}

/* 3. The Image Itself */
.log-visual img {
    width: 100% !important;
    height: 100% !important;
    
    /* 'cover' zooms the image to FILL the box, cropping edges if needed */
    object-fit: cover !important; 
    
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important; /* Remove padding so it touches the edges */
    background: transparent !important;
    transition: transform 0.5s ease;
}

/* 4. Hover Effect */
.log-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

/* --- SINGLE POST: PAPER SHEET --- */
.paper-sheet {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 60px;
    max-width: 1200px; /* Slightly wider reading area */
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

/* Mobile responsive padding */
@media (max-width: 768px) {
    .paper-sheet { padding: 30px; }
}

/* --- TYPOGRAPHY FIXES --- */

/* 1. Paragraph Spacing (No more clumping) */
.post-content p {
    margin-bottom: 1.8em;  /* More space between paragraphs */
    line-height: 1.8;      /* Better readability */
    font-size: 1.05rem;    /* Slightly larger text */
    color: #334155;        /* Soft dark grey (easier on eyes than black) */
}

/* 2. Links (Make them visible!) */
.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: 0.2s;
}
.post-content a:hover {
    background: rgba(2, 132, 199, 0.1); /* Highlight on hover */
    color: var(--industrial);
}

/* 3. Headings (Proper Sizing) */
.post-content h1, 
.post-content h2, 
.post-content h3, 
.post-content h4 {
    color: var(--text-main);
    font-weight: 800;
    margin-top: 2.5em;     /* Space above headings */
    margin-bottom: 0.8em;  /* Space below headings */
    line-height: 1.3;
}

.post-content h2 { font-size: 1.8rem; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.post-content h3 { font-size: 1.4rem; }
.post-content h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

/* 4. Lists (Bullets & Numbers) */
.post-content ul, 
.post-content ol {
    margin-bottom: 2em;
    padding-left: 25px;
    color: #334155;
}
.post-content li {
    margin-bottom: 0.8em;
    padding-left: 5px;
}

/* 5. Images & Captions */
.entry-visual {
    margin-bottom: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);

    padding: 1px; 
    
    /* Flexbox centers the image inside that padding */
    display: flex;
    justify-content: center;
    align-items: center;
}
.entry-visual img { width: 100%; height: auto; display: block; }

/* Images inside the post body */
.post-content img {
    max-width: 85%;
    max-height: 600px;
    width: auto;
    height: auto;

    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 30px auto 10px auto; /* Space above/below */
    display: block;
    box-shadow: var(--shadow-sm);
}

/* The Main Featured Image Itself */
.entry-visual img, 
img.wp-post-image {
    max-width: 100%;       /* Don't overflow width */
    max-height: 600px;     /* CAP THE HEIGHT (The Fix) */
    width: auto;           /* Let width shrink naturally */
    height: auto;          /* Maintain aspect ratio */
    display: block;
    margin: 0 auto;
}

/* CAPTION FIX (Make them small) */
.wp-caption-text, 
figcaption {
    font-family: var(--font-mono);
    font-size: 0.8rem !important; /* Force small size */
    color: var(--text-muted);
    text-align: center;
    margin-top: 5px;
    margin-bottom: 40px;
    display: block;
}

/* 6. Code Blocks (Optional Polish) */
.post-content pre {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-x: auto;
    margin-bottom: 2em;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* --- WORDPRESS BLOCK ALIGNMENTS (FIXED) --- */

/* 1. Center Alignment Class */
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* 2. Fix for Youtube/Video Blocks */
.post-content .wp-block-embed {
    display: block;
    margin: 30px auto; /* Centers the block itself */
    max-width: 100%;
}

.post-content .wp-block-embed__wrapper {
    display: flex;
    justify-content: center; /* Centers the iframe inside the wrapper */
    width: 100%;
}

/* 3. Handle Images */
.post-content .wp-block-image {
    margin: 30px 0; /* Standard margin */
    max-width: 100%;
}
.post-content .wp-block-image.aligncenter {
    margin-left: auto;
    margin-right: auto;
}
.post-content .wp-block-image img {
    display: block;
    height: auto;
    max-width: 100%;
}

/* 4. Responsive iFrames */
.post-content iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
}




/* --- GLOBAL SCROLL RULER --- */
.scroll-ruler {
    position: fixed; top: 0; left: 0; height: 4px; 
    background: var(--accent); z-index: 1000; width: 0%; transition: width 0.1s;
}

/* --- LINKEDIN BUTTON --- */
.linkedin-btn {
    display: flex; align-items: center; gap: 8px;
    background: #fff; color: #0077b5; border: 1px solid #e0e0e0;
    padding: 8px 16px; border-radius: 6px;
    font-size: 0.85rem; font-weight: 600;
    box-shadow: var(--shadow-sm); transition: 0.2s;
    font-family: var(--font-main);
}
.linkedin-btn:hover {
    border-color: #0077b5; box-shadow: var(--shadow-md); transform: translateY(-1px); color: #0077b5;
}
.linkedin-icon { width: 16px; height: 16px; fill: currentColor; }





/* Add this extra line to ensure the admin bar doesn't break your sticky nav */
body.admin-bar nav { top: 32px; }