/* Base Reset & Variables */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --text-muted: #aaa;
    --accent-cyan: #00bcd4;
    --accent-yellow: #ffeb3b;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --grid-gap: 4px;
    --header-height: 60px;
}

/* Base Styles */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: var(--bg-color);
    z-index: 100;
}

.site-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-color);
}

/* Hamburger Menu Button */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 200;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

.nav-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.nav-menu {
    list-style: none;
    text-align: center;
}

.nav-menu li {
    margin: 1.5rem 0;
}

.nav-menu a {
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-color);
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--accent-cyan);
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    padding-top: var(--header-height);
}

/* Post Card */
.post-card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.post-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.post-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.post-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.post-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 15px;
    z-index: 1;
    text-align: center;
}

.post-date {
    display: block;
    font-size: 0.7rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-transform: uppercase;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-title {
        font-size: 1rem;
    }

    .post-title {
        font-size: 1.1rem;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-title {
        font-size: 1.1rem;
    }

    .post-info {
        padding: 25px;
    }

    .post-date {
        font-size: 0.8rem;
    }

    .post-title {
        font-size: 1.2rem;
    }
}

/* Hover tint effect */
.post-card a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-cyan);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    mix-blend-mode: overlay;
}

.post-card:hover a::before {
    opacity: 0.3;
}

/* Footer */
.site-footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Utility: Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Post Page Styles
   ========================================================================== */

/* Post Article */
.post {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 40px;
}

/* Post Header */
.post-header {
    text-align: center;
    padding: 0 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.post-header-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.post-header-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

@media (min-width: 768px) {
    .post-header {
        padding: 0 40px 60px;
    }

    .post-header-title {
        font-size: 2.5rem;
    }
}

/* Post Content */
.post-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

@media (min-width: 768px) {
    .post-content {
        padding: 0 40px;
        font-size: 1.1rem;
    }
}

/* Content Elements */
.post-content p {
    margin-bottom: 1.5em;
}

.post-content a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: #fff;
}

.post-content strong,
.post-content b {
    font-weight: 600;
}

.post-content em,
.post-content i {
    font-style: italic;
}

/* Headings in content */
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.5rem;
}

.post-content h3 {
    font-size: 1.25rem;
}

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

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

/* Blockquotes */
.post-content blockquote {
    margin: 2em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--accent-cyan);
    background-color: rgba(255, 255, 255, 0.05);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images */
.post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    border-radius: 2px;
}

/* WordPress captions - override inline width styles and break out of column */
.post-content > figure,
.post-content > .wp-caption {
    width: calc(100% + 40px) !important;
    max-width: calc(100% + 40px) !important;
    margin: 2em 0;
    margin-left: -20px;
    margin-right: -20px;
}

@media (min-width: 768px) {
    .post-content > figure,
    .post-content > .wp-caption {
        width: calc(100% + 200px) !important;
        max-width: calc(100% + 200px) !important;
        margin-left: -100px;
        margin-right: -100px;
    }
}

@media (min-width: 1200px) {
    .post-content > figure,
    .post-content > .wp-caption {
        width: 1000px !important;
        max-width: 1000px !important;
        margin-left: calc((700px - 1000px) / 2);
        margin-right: calc((700px - 1000px) / 2);
    }
}

.post-content figure img,
.post-content .wp-caption img {
    width: 100%;
    height: auto;
    margin: 0;
}

.post-content figcaption,
.post-content .wp-caption-text {
    padding: 0.75em 1em;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
}

/* Standalone landscape images: max-height with breakout width */
.post-content img.img-landscape {
    max-height: 60vh;
    width: auto;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* Constrain landscape images to viewport width on small screens */
@media (max-width: 767px) {
    .post-content img.img-landscape {
        max-width: 100vw;
        margin-left: -20px;
        margin-right: -20px;
        transform: none;
        width: calc(100% + 40px);
        height: auto;
        max-height: none;
    }
}

/* Standalone portrait images: stay within text column */
.post-content img.img-portrait {
    max-width: 100%;
    width: auto;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

/* WordPress Tiled Galleries - Preserve row/group structure */
.post-content .tiled-gallery {
    margin: 2em 0;
    max-width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
}

@media (min-width: 768px) {
    .post-content .tiled-gallery {
        max-width: calc(100% + 200px);
        margin-left: -100px;
        margin-right: -100px;
        width: calc(100% + 200px);
    }
}

/* Gallery rows - horizontal flex container */
.post-content .tiled-gallery .gallery-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    width: 100% !important;
    height: auto !important;
}

/* Gallery groups - flex items using WordPress-calculated proportions */
.post-content .tiled-gallery .gallery-group {
    flex: var(--flex-grow, 1) 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: auto !important;
    height: auto !important;
}

/* Gallery items - contain image + caption */
.post-content .tiled-gallery .tiled-gallery-item {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Images - fill container, use WordPress aspect ratio */
.post-content .tiled-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-content .tiled-gallery img:hover {
    opacity: 0.85;
}

/* Captions - hidden by default, show on hover */
.post-content .tiled-gallery .tiled-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.post-content .tiled-gallery .tiled-gallery-item:hover .tiled-gallery-caption {
    opacity: 1;
}

/* Lightbox link styling in galleries */
.post-content .tiled-gallery a.glightbox {
    display: block;
    width: 100%;
    height: 100%;
}

/* Mobile: stack into simpler 2-column grid */
@media (max-width: 480px) {
    .post-content .tiled-gallery .gallery-row {
        flex-wrap: wrap;
    }
    .post-content .tiled-gallery .gallery-group {
        flex: 1 1 calc(50% - 2px);
        min-width: calc(50% - 2px);
    }
}

/* Hide WordPress cruft */
.post-content .sharedaddy,
.post-content .sd-sharing-enabled,
.post-content .jp-relatedposts,
.post-content .jetpack-likes-widget-wrapper {
    display: none !important;
}

/* Strip WordPress span classes but keep text - only reset font/color, not layout */
.post-content .s1 {
    all: unset;
}

/* Dual-author colored text */
.post-content .tyler,
.post-content [style*="color: #00bcd4"],
.post-content [style*="color:#00bcd4"] {
    color: var(--accent-cyan);
}

.post-content .kristina,
.post-content [style*="color: #ffeb3b"],
.post-content [style*="color:#ffeb3b"] {
    color: var(--accent-yellow);
}

/* Post Navigation */
.post-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    max-width: 900px;
    margin: 60px auto 0;
    padding: 0 20px;
    gap: 20px;
}

.post-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.post-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

.post-nav-disabled {
    visibility: hidden;
}

.post-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.post-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
}

.post-nav-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
    transition: color 0.2s;
    flex-shrink: 0;
}

.post-nav-home:hover {
    color: var(--accent-cyan);
}

@media (max-width: 600px) {
    .post-nav {
        flex-direction: column;
    }

    .post-nav-prev,
    .post-nav-next {
        text-align: center;
    }

    .post-nav-home {
        order: -1;
        padding: 10px;
    }

    .post-nav-disabled {
        display: none;
    }
}

/* ==========================================================================
   Static Page Styles (About, etc.)
   ========================================================================== */

.page {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 40px;
}

.page-header {
    text-align: center;
    padding: 0 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

@media (min-width: 768px) {
    .page-header {
        padding: 0 40px 60px;
    }

    .page-title {
        font-size: 2.5rem;
    }
}

.page-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

@media (min-width: 768px) {
    .page-content {
        padding: 0 40px;
        font-size: 1.1rem;
    }
}

/* Reuse post-content styles for page-content */
.page-content p {
    margin-bottom: 1.5em;
}

.page-content a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-content a:hover {
    color: #fff;
}

/* Hide WordPress cruft in pages too */
.page-content .sharedaddy,
.page-content .sd-sharing-enabled,
.page-content .jp-relatedposts,
.page-content .jetpack-likes-widget-wrapper {
    display: none !important;
}

/* Make all post images clickable */
.post-content img {
    cursor: pointer;
}

/* Lightbox link styling */
.post-content a.glightbox {
    display: block;
    text-decoration: none;
}

/* GLightbox description styling */
.gslide-description {
    background: rgba(0, 0, 0, 0.8) !important;
    text-align: center;
}

.gslide-description .gdesc-inner {
    padding: 15px 20px;
}

.gslide-description .gslide-title {
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
}

.gslide-description .gslide-desc {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}
