/**
 * Frontend Styles - "Digital Book" Aesthetic
 * Minimalist, readable design with sepia tones
 */

/* CSS Variables are set inline in header.php */
@import url('https://fonts.googleapis.com/css2?family=Sorts+Mill+Goudy:ital@0;1&display=swap');

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

html {
    font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: inherit;
    margin-bottom: 0;
    color: var(--heading-color, var(--text-color));
    font-family: "Sorts Mill Goudy", serif;
    font-style: italic;
    font-weight: bold;
}

h1 { font-size: var(--h1-size, 2.2rem); }
h2 { font-size: var(--h2-size, 1.8rem); }
h3 { font-size: var(--h3-size, 1.4rem); }
h4 { font-size: var(--h4-size, 1.2rem); }
h5 { font-size: var(--h5-size, 1.1rem); }
h6 { font-size: var(--h6-size, 1.0rem); }

p {
    margin-bottom: 1.25rem;
}

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

a:hover {
    text-decoration: none;
}

/* Page Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header */
.site-header {
    padding: 10px 0 10px 60px;
    text-align: left;
    border-bottom: 1px solid black;
    background: url('bg_header.avif') no-repeat bottom center;
    background-size: cover;
    position: sticky;
    top: 0;
    box-shadow: inset 0 -5px 15px rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.site-header {
    text-transform: lowercase;
}

.site-title {
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1);
    font-weight: 600;
    font-style: italic;
    color: var(--bg-color);
    display: inline;
}

.breadcrumb-dynamic {
    display: inline-block;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.breadcrumb-dynamic.is-changing {
    opacity: 0;
    transform: translateY(-8px);
}

.breadcrumb-dynamic.is-coming-in {
    opacity: 0;
    transform: translateY(8px);
    transition: none;
}

.site-title .breadcrumb-arrow {
    font-size: 0.65rem;
    opacity: 0.7;
    margin: 0 0.25rem;
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 50px 0;
    border-top: 1px solid white;
}

/* Two Column Layout */
.content-wrapper {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

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

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

/* Post Styling */
.post {
    margin-bottom: 60px;
}

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

.post-title {
    font-size: 2rem;
    margin-bottom: 0.3em;
    font-weight: 600;
}

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

.post-title a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.post-meta {
    font-style: italic;
    color: var(--date-line-color, var(--text-color));
    opacity: 0.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.post-date-link {
    color: var(--date-line-color, var(--text-color));
    text-decoration: none;
    transition: color 0.2s;
}

.post-date-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Make links inside post meta match the date link style */
.post-meta a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.post-meta a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.comment-count {
    margin: 0;
    font-style: italic;
}

/* Post Tags */
.post-tags {
    font-style: normal;
}

.post-tags i {
    margin-right: 0.3em;
    opacity: 0.8;
}

.post-footer {
    margin-top: 30px;
    padding-top: 20px;
}

.read-more-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.read-more-link:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.read-more-link i {
    margin-right: 8px;
}

.post-content {
    font-size: 1rem;
}

.post-content p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    line-height: inherit;
    text-indent: 1.5em;
    margin: 0;
}

/* Post Excerpt on Homepage */
.post-excerpt {
    font-size: 1.05rem;
    line-height: inherit;
    color: var(--text-color);
    opacity: 0.9;
}

/* Featured Post (Latest) */
.post-featured {
    margin-bottom: 50px;
    padding-bottom: 50px;
}

.post-featured .post-excerpt {
    font-size: 1.1rem;
}

/* Posts Grid - 2 Columns */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.post-grid-item {
    margin-bottom: 0;
}

.post-grid-item .post-title {
    font-size: 1.4rem;
}

.post-grid-item .post-meta {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.post-grid-item .post-excerpt {
    font-size: 0.95rem;
}

.post-grid-item .post-footer {
    margin-top: 20px;
    padding-top: 15px;
}

.post-grid-item .read-more-link {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 4px;
    border: 5px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.post-content blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 2rem 0;
    padding-left: 1.5rem;
    font-style: italic;
    opacity: 0.9;
}

.post-content pre,
.post-content code {
    font-family: 'Courier New', monospace;
    background: rgba(67, 52, 34, 0.08);
    border-radius: 3px;
}

.post-content code {
    padding: 2px 6px;
}

.post-content pre {
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    padding: 0;
    background: none;
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

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

/* Post Divider - Section Break */
.post-divider,
.post-content p.post-divider {
    display: block;
    text-align: center;
    width: 100%;
    margin: 1.5rem auto;
    font-size: 1.2rem;
    letter-spacing: 0.5em;
    color: var(--text-color);
    opacity: 0.6;
    text-indent: 0;
}

/* Divider in Quill editor */
.ql-divider::before {
    content: '—';
}

.ql-toolbar .ql-divider {
    width: 28px;
}

/* Sidebar Excerpts */
.sidebar-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px dashed rgba(67, 52, 34, 0.2);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 15px;
}

.sidebar-post-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

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

.sidebar-post-title a:hover {
    color: var(--accent-color);
}

.sidebar-excerpt {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: inherit;
}

/* Sidebar Categories List */
.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li {
    margin-bottom: 10px;
}

.sidebar-categories li:last-child {
    margin-bottom: 0;
}

.sidebar-categories a {
    color: var(--text-color);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-categories a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.sidebar-categories .category-count {
    opacity: 0.5;
    font-size: 0.85rem;
}

/* Comments Section */
.comments-section {
    margin-top: 20px;
    padding-top: 40px;
    border-top: 1px solid rgba(67, 52, 34, 0.15);
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.comment {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(67, 52, 34, 0.1);
    line-height: 1.6;
}

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

.comment-author {
    font-weight: 600;
    margin-bottom: 5px;
}

.comment-date {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 10px;
}

.comment-content {
    line-height: inherit;
}

.comment-content p {
    margin: 0 0 0.75em 0;
}

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

.comment-content strong {
    font-weight: 600;
}

.comment-content em {
    font-style: italic;
}

.comment-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.comment-content a:hover {
    opacity: 0.8;
}

.comment-content blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
    margin: 0.75em 0;
    font-style: italic;
    opacity: 0.9;
}

.comment-content ul,
.comment-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

/* Comment Form */
.comment-form-section {
    margin-top: 40px;
    padding-top: 30px;
}

.comment-form-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid rgba(67, 52, 34, 0.2);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.comment-editor-container {
    border: 2px solid rgba(67, 52, 34, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.comment-editor-container .ql-container {
    font-family: var(--font-family);
    font-size: 1rem;
}

.comment-editor-container .ql-editor {
    min-height: 120px;
    padding: 15px;
}

.comment-editor-container .ql-editor.ql-blank::before {
    font-style: italic;
    color: var(--text-color);
    opacity: 0.5;
}

.btn-submit {
    display: inline-block;
    padding: 12px 30px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--accent-color);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
}

.no-posts-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed rgba(67, 52, 34, 0.2);
}

.pagination a {
    padding: 10px 20px;
    background: rgba(67, 52, 34, 0.08);
    border-radius: 4px;
}

.pagination a:hover {
    background: rgba(67, 52, 34, 0.15);
    text-decoration: none;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert-error {
    background: rgba(220, 53, 69, 0.15);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-info {
    background: rgba(23, 162, 184, 0.15);
    color: #0c5460;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Footer */
.site-footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(67, 52, 34, 0.15);
    font-size: 0.9rem;
    background-color: var(--footer-bg-color, transparent);
    color: var(--footer-text-color, var(--text-color));
}

.site-footer p {
    opacity: 1;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 900px) {
    html {
        font-size: 16px;
    }

    h2.post-title {
        font-size: 1.3rem;
    }

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

    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        gap: 30px;
        flex-wrap: wrap;
    }

    .sidebar-section {
        flex: 1;
        min-width: 250px;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .container {
        padding: 0 20px;
    }

    .site-header {
        padding: 10px 0;
    }

    .site-header .container {
        max-width: calc(100vw - 40px);
        padding-left: 0;
    }

    .site-main {
        padding: 30px 0;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 0.85rem;
        margin: 0;
    }

    .site-header .container {
        max-width: calc(100vw - 40px);
        text-align: left;
        padding-left: 0;
    }

    .site-header {
        padding: 20px;
        font-size: 1rem;
    }

    .main-content {
        padding: 0 10px;
    }

    .post-meta {
        font-size: 0.75rem;
    }

    h2.post-title {
        font-size: 1.3rem;
    }
    
    .site-title .breadcrumb-arrow {
        font-size: 0.35rem;
    }

    .gallery-text-item {
        font-size: 0.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .post-grid-item .post-title {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   NAVIGATION MENU SYSTEM
   Modern vertical navigation with icons and hover effects
   Inspired by modern CodePen designs
   ========================================================================== */

/* 
   HOW TO CUSTOMIZE THE NAVIGATION MENU:
   
   1. COLORS: Change --nav-bg, --nav-text, --nav-accent, --nav-hover below
   2. ICON SIZE: Modify the font-size in .nav-menu-link i
   3. MENU WIDTH: Change the width property in .nav-menu (currently 70px, expands to 200px on hover)
   4. ANIMATION SPEED: Modify transition values throughout
   5. ADD NEW ITEMS: Copy a <li> element in the HTML and change the icon/text/link
*/

:root {
    /* Navigation Menu Colors - Use dynamic CSS variables from settings */
    --nav-bg: var(--nav-bg-color, #433422);              /* Dark sepia/brown background */
    --nav-bg-hover: color-mix(in srgb, var(--nav-bg-color, #433422) 80%, white);        /* Slightly lighter on hover */
    --nav-text: var(--nav-link-color, #f4ecd8);            /* Cream/parchment text */
    --nav-text-muted: color-mix(in srgb, var(--nav-link-color, #f4ecd8) 70%, var(--nav-bg-color, #433422));      /* Muted text */
    --nav-accent: var(--accent-color, #8b4513);          /* Accent color (matches site) */
    --nav-hover: rgba(139, 69, 19, 0.2); /* Accent color hover background */
    --nav-shadow: 0 10px 5px rgba(67, 52, 34, 0.2);  /* Subtle shadow */
    --nav-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation Container */
.nav-menu-container {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
}

/* Navigation Menu */
.nav-menu {
    background: var(--nav-bg);
    padding: 20px 0;
    width: 70px;
    height: 100%;
    box-shadow: var(--nav-shadow);
    transition: var(--nav-transition);
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(67, 52, 34, 0.2));
}

.nav-menu:hover {
    width: 200px;
}

.nav-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu-item {
    margin: 0;
    padding: 0;
}

/* Navigation Links */
.nav-menu-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--nav-text-muted);
    text-decoration: none;
    transition: var(--nav-transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--nav-accent);
    transform: scaleY(0);
    transition: var(--nav-transition);
}

.nav-menu-link:hover {
    color: var(--nav-text);
    background: var(--nav-hover);
    text-decoration: none;
}

.nav-menu-link:hover::before {
    transform: scaleY(1);
}

.nav-menu-link.active {
    color: var(--nav-accent);
    background: var(--nav-hover);
}

.nav-menu-link.active::before {
    transform: scaleY(1);
}

/* Navigation Icons */
.nav-menu-link i {
    font-size: 1.3rem;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--nav-transition);
}

.nav-menu-link:hover i {
    color: var(--nav-accent);
    transform: scale(1.1);
}

/* Navigation Text Labels */
.nav-menu-text {
    margin-left: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--nav-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav-menu:hover .nav-menu-text {
    opacity: 1;
    transform: translateX(0);
}

/* Search Button Special Styling */
.nav-menu-link.search-toggle {
    cursor: pointer;
}

/* Menu Divider */
.nav-menu-divider {
    height: 1px;
    background: rgba(244, 236, 216, 0.2);
    margin: 10px 15px;
}

/* ==========================================================================
   SEARCH OVERLAY
   Full-screen search modal with animated input
   ========================================================================== */

/*
   HOW TO CUSTOMIZE THE SEARCH OVERLAY:
   
   1. BACKGROUND: Change the background color/opacity in .search-overlay
   2. INPUT STYLE: Modify .search-input for different input designs
   3. ANIMATION: Adjust transition timings and transforms
*/

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(67, 52, 34, 0.97);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-out;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-content {
    width: 100%;
    max-width: 700px;
    padding: 0 30px;
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.search-overlay.active .search-overlay-content {
    transform: translateY(0);
}

.search-overlay-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2rem;
    color: var(--nav-text-muted);
    cursor: pointer;
    transition: var(--nav-transition);
    background: none;
    border: none;
    padding: 10px;
}

.search-overlay-close:hover {
    color: var(--nav-accent);
    transform: rotate(90deg);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px 60px 20px 25px;
    font-size: 1.5rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--nav-text);
    outline: none;
    transition: var(--nav-transition);
}

.search-input::placeholder {
    color: var(--nav-text-muted);
}

.search-input:focus {
    border-color: var(--nav-accent);
    background: rgba(255, 255, 255, 0.12);
}

.search-submit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-accent);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--nav-transition);
}

.search-submit:hover {
    background: #6d3610;
    transform: translateY(-50%) scale(1.05);
}

.search-hint {
    text-align: center;
    color: var(--nav-text-muted);
    margin-top: 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   SWUP.JS PAGE TRANSITIONS
   Smooth fade animations between pages
   ========================================================================== */

/*
   HOW TO CUSTOMIZE PAGE TRANSITIONS:
   
   1. DURATION: Modify transition times in the .transition-fade classes
   2. ANIMATION TYPE: Adjust opacity and transform values
   3. EASING: Change the ease timing function
   
   Swup.js handles the transition timing. CSS defines the animation style.
*/

/* Content wrapper adjustments for navigation */
/* The page-wrapper no longer has margin - header stays full width */
/* Only the main content area gets the left margin for the nav */
.has-nav-menu .site-main {
    margin-left: 100px;
    transition: margin-left 0.3s ease;
}

@media (max-width: 900px) {
    .has-nav-menu .site-main {
        margin-left: 0;
        margin-bottom: 100px;
    }
}

/* ==========================================================================
   PAGE-SPECIFIC STYLES
   Styles for About, Photography, Works, Contact pages
   ========================================================================== */

/* Page Hero Section */
.page-hero {
    text-align: center;
    padding: 60px 0;
    margin-bottom: 50px;
}

.page-hero-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.page-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.7;
    font-style: italic;
}

/* About Page */
.about-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: start;
}

.about-image {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.about-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #433422 0%, #5a4730 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text-muted);
    font-size: 4rem;
}

.about-text h2 {
    margin-bottom: 20px;
}

.about-text p {
    line-height: inherit;
    margin-bottom: 1.5rem;
}

.about-social {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.about-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--nav-bg);
    color: var(--nav-text);
    border-radius: 50%;
    font-size: 1.1rem;
    transition: var(--nav-transition);
}

.about-social a:hover {
    background: var(--nav-accent);
    transform: translateY(-3px);
}

/* Photography Page - Gallery */

/* Full-width wrapper - edge to edge */
.full-width-gallery {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden; /* prevent horizontal scrollbar on page (more compatible than clip) */
}

/* Gallery header: intro text + navigation arrows */
.gallery-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding: 0 30px 20px;
    flex-wrap: wrap;
}

.gallery-intro {
    max-width: 60ch;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.85;
}

.gallery-intro p {
    margin: 0;
}

/* Horizontal scroller */
.gallery-scroller {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 40px;
    padding: 30px max(30px, calc(50vw - 450px)) 70px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

/* ==========================================================================
   PHOTOGRAPHY (MASONRY GRID + MODAL)
   ==========================================================================
*/

.photo-gallery {
    position: relative;
}

.photo-intro {
    max-width: 70ch;
    margin: 0 auto;
    padding: 24px max(20px, calc(50vw - 520px)) 6px;
    line-height: 1.7;
    opacity: 0.9;
}

.photo-text-card {
    background: #ffffff;
    padding: 18px 18px 16px;
    border-radius: 6px;
    cursor: default;
}

/* .photo-card sets background: transparent later; ensure text cards stay white */
.photo-card.photo-text-card {
    background: #ffffff;
}

.photo-text-card > *:first-child {
    margin-top: 0;
}

.photo-text-card > *:last-child {
    margin-bottom: 0;
}

.photo-text-card h1,
.photo-text-card h2,
.photo-text-card h3,
.photo-text-card h4,
.photo-text-card h5,
.photo-text-card h6 {
    font-family: var(--font-family, serif);
    line-height: 1.2;
    margin: 0 0 10px;
    letter-spacing: 0.01em;
}

.photo-text-card h1 { font-size: 1.6rem; }
.photo-text-card h2 { font-size: 1.4rem; }
.photo-text-card h3 { font-size: 1.2rem; }
.photo-text-card h4 { font-size: 1.05rem; }

.photo-text-card p {
    margin: 0 0 10px;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.78);
}

.photo-text-card a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Masonry-ish layout using columns (widely supported) */
.photo-grid {
    column-count: 3;
    column-gap: 26px;
    padding: 18px max(20px, calc(50vw - 520px)) 70px;
}

@media (max-width: 1000px) {
    .photo-grid {
        column-count: 2;
    }
}

@media (max-width: 620px) {
    .photo-grid {
        column-count: 1;
        column-gap: 0;
    }
}

.photo-card {
    width: 100%;
    display: inline-block;
    margin: 0 0 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.06) 0 8px 18px;
    break-inside: avoid;
    cursor: zoom-in;
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
}

.photo-card.is-placeholder {
    cursor: default;
}

.photo-placeholder {
    aspect-ratio: 4 / 3;
    display: flex;

/* Use the site's existing staggerFadeIn animation for masonry grid items */
#swup .photo-grid .photo-card {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease-in-out forwards;
    will-change: transform, opacity;
}

#swup .photo-grid .photo-card:nth-child(1) { animation-delay: 0.25s; }
#swup .photo-grid .photo-card:nth-child(2) { animation-delay: 0.4s; }
#swup .photo-grid .photo-card:nth-child(3) { animation-delay: 0.55s; }
#swup .photo-grid .photo-card:nth-child(4) { animation-delay: 0.7s; }
#swup .photo-grid .photo-card:nth-child(5) { animation-delay: 0.85s; }
#swup .photo-grid .photo-card:nth-child(6) { animation-delay: 1.0s; }
#swup .photo-grid .photo-card:nth-child(7) { animation-delay: 1.15s; }
#swup .photo-grid .photo-card:nth-child(8) { animation-delay: 1.3s; }
#swup .photo-grid .photo-card:nth-child(9) { animation-delay: 1.45s; }
#swup .photo-grid .photo-card:nth-child(10) { animation-delay: 1.6s; }
#swup .photo-grid .photo-card:nth-child(11) { animation-delay: 1.75s; }
#swup .photo-grid .photo-card:nth-child(12) { animation-delay: 1.9s; }
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5a4730 0%, #433422 100%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 34px;
}

.photo-card:focus-visible {
    outline: 2px solid rgba(193, 154, 107, 0.85);
    outline-offset: 3px;
}

/* Modal viewer */
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.photo-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.photo-modal-body {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(70px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.photo-modal-image {
    max-width: min(1200px, 92vw);
    max-height: min(82vh, 82dvh);
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: rgba(0, 0, 0, 0.35) 0 18px 60px;
    cursor: zoom-in;
    transform: scale(1);
    transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
    transition: transform 160ms ease;
}

.photo-modal.is-zoomed .photo-modal-image {
    transform: scale(2);
    cursor: zoom-out;
}

.photo-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
}

.photo-modal-close:hover {
    background: rgba(0, 0, 0, 0.55);
}

.photo-modal-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    user-select: none;
}

.gallery-scroller::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Carousel dots */
.gallery-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 5;
    pointer-events: none;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
}

.gallery-dot.is-active {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

/* Single gallery item */
.gallery-item {
    position: relative;
    flex-shrink: 0;
    width: min(900px, 85vw);
    aspect-ratio: 4/3;
    border-radius: 4px;
    box-shadow:rgba(0, 0, 0, 0.05) 0 4px 6px;
    overflow: hidden;
    background: linear-gradient(135deg, #5a4730 0%, #433422 100%);
    border: 5px solid #fff;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

/* Orientation variants */
.gallery-item.is-portrait {
    aspect-ratio: 3/4;
    width: min(500px, 70vw);
}

.gallery-item.is-square {
    aspect-ratio: 1/1;
    width: min(700px, 80vw);
}

.gallery-item.is-panoramic {
    aspect-ratio: 16/9;
    width: min(1000px, 90vw);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text-muted);
    font-size: 3rem;
}

/* Optional small title below item (inside the card) */
.gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

/* Text card item */
.gallery-text-item {
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
}

.gallery-text-content {
    padding: 60px 50px;
    text-align: center;
    color: var(--text-color);
    max-width: 65ch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.gallery-text-content > * {
    font-size: 1.15rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.gallery-text-content > *:last-child {
    margin-bottom: 0;
}

/* Legacy grid (kept for other pages if needed) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Works Page - Portfolio Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.work-item {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--nav-transition);
}

.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.work-image {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #5a4730 0%, #433422 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-text-muted);
    font-size: 3rem;
}

.work-content {
    padding: 25px;
}

.work-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.work-content p {
    opacity: 0.8;
    line-height: inherit;
    margin-bottom: 15px;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-tag {
    padding: 5px 12px;
    background: var(--nav-bg);
    color: var(--nav-text);
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Contact Page */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h2 {
    margin-bottom: 25px;
}

.contact-info p {
    line-height: inherit;
    margin-bottom: 30px;
}

.contact-details {
    list-style: none;
    padding: 0;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.contact-details i {
    width: 45px;
    height: 45px;
    background: var(--nav-bg);
    color: var(--nav-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-form-wrapper h2 {
    margin-bottom: 25px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input[type="text"],
.contact-form input,
.contact-form textarea {
    width: 100%;
    max-width: none;
    padding: 15px 20px;
    border: 2px solid rgba(67, 52, 34, 0.15);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    transition: var(--nav-transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form .btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

/* ==========================================================================
   RESPONSIVE NAVIGATION
   Mobile-friendly navigation adjustments
   ========================================================================== */

@media (max-width: 900px) {
    /* Move navigation to bottom on mobile */
    .nav-menu-container {
        left: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%);
        height: auto;
    }
    
    .nav-menu {
        display: flex;
        width: auto !important;
        height: auto;
        padding: 10px 15px;
        border-radius: 5px;
    }
    
    .nav-menu-list {
        display: flex;
        gap: 5px;
    }
    
    .nav-menu-link {
        padding: 12px 15px;
        border-radius: 5px;
    }
    
    .nav-menu-link::before {
        display: none;
    }
    
    .nav-menu-text {
        display: none !important;
    }
    
    .nav-menu-divider {
        display: none;
    }
    
    /* Page layouts on mobile */
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image-placeholder {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .works-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .nav-menu-link {
        padding: 10px 12px;
    }
    
    .nav-menu-link i {
        font-size: 1.1rem;
    }
    
    .search-input {
        font-size: 1.1rem;
        padding: 15px 50px 15px 20px;
    }
    
    .search-submit {
        width: 40px;
        height: 40px;
    }
    
    .page-hero-title {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   SWUP.JS PAGE TRANSITIONS
   CSS-based fade + slide transitions for smooth page navigation
   
   Swup v4 adds classes directly to the container element:
   - .is-leaving: during the leave animation (fade out + slide up)
   - .is-rendering: during the enter animation (fade in + slide down)
   ========================================================================== */

/* The main content container - always has transition ready */
#swup {
    transition: opacity .4s ease-in-out, transform .4s ease-in-out;
}

/* When leaving (fading out + sliding up) */
#swup.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
}

/* When rendering new content (starts hidden + below, fades/slides in) */
#swup.is-rendering {
    opacity: 0;
    transform: translateY(10px);
}

/* ==========================================================================
   STAGGERED CONTENT ANIMATION
   Each content element animates in with a delay after the previous
   ========================================================================== */

/* Base animation for staggered elements */
#swup .main-content,
#swup .sidebar,
#swup .page-hero,
#swup .post,
#swup .post-featured,
#swup .posts-grid,
#swup .about-content,
#swup .gallery-grid,
#swup .works-grid,
#swup .contact-content,
#swup .comments-section,
#swup .gallery-item,
#swup .work-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s ease forwards;
}

/* Stagger delays - each element after the previous */
#swup .page-hero { animation-delay: 0s; }
#swup .main-content,
#swup .post-featured { animation-delay: 0.15s; }
#swup .about-content,
#swup .gallery-grid,
#swup .works-grid,
#swup .contact-content { animation-delay: 0.2s; }
#swup .posts-grid,
#swup .post:not(.post-featured) { animation-delay: 0.4s; }
#swup .sidebar { animation-delay: 0.6s; }
#swup .comments-section { animation-delay: 0.7s; }

/* Individual post items in grid get staggered */
#swup .post-grid-item:nth-child(1) { animation-delay: 0.3s; }
#swup .post-grid-item:nth-child(2) { animation-delay: 0.45s; }
#swup .post-grid-item:nth-child(3) { animation-delay: 0.6s; }
#swup .post-grid-item:nth-child(4) { animation-delay: 0.75s; }

/* Gallery items staggered - more noticeable delays */
#swup .gallery-item:nth-child(1) { animation-delay: 0.25s; }
#swup .gallery-item:nth-child(2) { animation-delay: 0.4s; }
#swup .gallery-item:nth-child(3) { animation-delay: 0.55s; }
#swup .gallery-item:nth-child(4) { animation-delay: 0.7s; }
#swup .gallery-item:nth-child(5) { animation-delay: 0.85s; }
#swup .gallery-item:nth-child(6) { animation-delay: 1.0s; }
#swup .gallery-item:nth-child(7) { animation-delay: 1.15s; }
#swup .gallery-item:nth-child(8) { animation-delay: 1.3s; }
#swup .gallery-item:nth-child(9) { animation-delay: 1.45s; }

/* Work items staggered - more noticeable delays */
#swup .work-item:nth-child(1) { animation-delay: 0.25s; }
#swup .work-item:nth-child(2) { animation-delay: 0.45s; }
#swup .work-item:nth-child(3) { animation-delay: 0.65s; }
#swup .work-item:nth-child(4) { animation-delay: 0.85s; }
#swup .work-item:nth-child(5) { animation-delay: 1.05s; }
#swup .work-item:nth-child(6) { animation-delay: 1.25s; }

/* Keyframe animation */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation icon hover effect (CSS-only) */
.nav-menu-link i {
    transition: transform 0.1s cubic-bezier(.92,.5,0,1.48);
}

.nav-menu-link:hover i {
    transform: scale(1.15);
}

/* Post Tags Bottom */
.post-tags-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed rgba(67, 52, 34, 0.2);
    font-size: 0.95rem;
}

.post-tags-bottom strong {
    margin-right: 10px;
    color: var(--text-color);
}

.tag-link {
    display: inline-block;
    margin-right: 10px;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
}

.tag-link:hover {
    border-bottom-style: solid;
}

/* Post Navigation Grid */
.post-navigation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(67, 52, 34, 0.15);
}

.nav-previous, .nav-middle, .nav-next {
    display: flex;
    flex-direction: column;
}

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

.nav-middle {
    text-align: center;
    border-left: 1px dashed rgba(67, 52, 34, 0.2);
    border-right: 1px dashed rgba(67, 52, 34, 0.2);
    padding: 0 20px;
}

.nav-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.6;
}

.nav-link {
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-excerpt {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Category Dropdown */
.category-dropdown-container {
    position: relative;
}

.category-dropdown {
    width: 100%;
    padding: 10px 15px;
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(67, 52, 34, 0.2);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23433422%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.category-dropdown:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.8);
}

/* Category Filter Styles */
.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-note {
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Full Post Content on Homepage */
.post-featured .post-content {
    margin-bottom: 1.5rem;
}

.post-featured .post-content img {
    max-width: 100%;
    height: auto;
}

/* Category Posts List */
.category-posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-excerpt-item {
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(67, 52, 34, 0.1);
}

.post-excerpt-item:last-child {
    border-bottom: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(67, 52, 34, 0.1);
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(67, 52, 34, 0.05);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.pagination-link:hover {
    background-color: rgba(67, 52, 34, 0.1);
}

.pagination-info {
    font-size: 0.9rem;
    opacity: 0.7;
}
