/* georgy.life - Optimized CSS */

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

/* Base */
html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    color: #000;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

main {
    min-height: calc(100vh - 400px);
}

/* Header */
header {
    border-bottom: 1px solid #dbdbdb;
    padding: 40px 0 20px;
    margin-bottom: 10px;
    min-height: 240px;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
}

.header-left { min-width: 0; }
.header-right { width: 150px; }

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 12px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #666;
}

.header-info a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
}

.header-info a:hover { opacity: 0.6; }
.separator { color: #ccc; }

/* Coptic Cross */
.coptic-cross {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cross-image {
    width: 150px;
    height: auto;
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #000;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    margin: 0;
    padding: 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: #536471;
    padding: 16px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 4px solid transparent;
    margin-bottom: -1px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tab-btn:hover {
    background: none;
}

.tab-btn:focus {
    outline: none;
    box-shadow: none;
    background: none;
}

.tab-btn:active {
    outline: none;
    box-shadow: none;
    background: none;
}

.tab-btn.active {
    color: #0f1419;
    font-weight: 700;
    border-bottom-color: #000;
}

/* Feed */
.feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
}

/* Post Card */
.post {
    border: 1px solid #dbdbdb;
    border-left: none;
    border-right: none;
    background: #fff;
    cursor: pointer;
    transition: none;
    transform: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}

.post:hover {
    transform: none;
    transition: none;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-date {
    font-size: 0.9rem;
    color: #666;
}

.post-content {
    font-size: 1.1rem;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.post-media {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.post-media img,
.post-media video {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #dbdbdb;
    image-orientation: from-image;
    object-fit: contain;
}

/* Blog Post Preview Styles */
.post-preview {
    padding: 60px 20px;
    cursor: default;
    margin-bottom: 40px;
    border-bottom: none !important;
}

.post-preview:first-child {
    border-top: none !important;
}

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

.post-preview .post-header {
    display: block;
    margin-bottom: 12px;
}

.post-category {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.post-preview .post-date {
    display: block;
    font-size: 0.9rem;
    color: #999;
    margin-top: 4px;
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 16px 0;
    color: #000;
}

.post-excerpt {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    margin: 16px 0 24px 0;
}

.read-more {
    display: inline-block;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.read-more:hover {
    opacity: 0.6;
}

/* Full-width Blog Post (for Faith, Fitness, Finance) */
.blog-post-full {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.blog-post-header {
    margin-bottom: 40px;
}

.blog-post-header .post-category {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.blog-post-header .post-date {
    display: block;
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 24px;
}

.blog-post-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #000;
}

.blog-post-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}

/* List View */
.feed-list {
    display: flex;
    flex-direction: column;
}

.feed-list .post {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.feed-list .post-media {
    margin: 0;
}

.feed-list .post-media img,
.feed-list .post-media video {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.feed-list .post-content {
    padding: 20px;
    margin-bottom: 0;
}

/* Grid View */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-bottom: 40px;
}

.feed-grid .post {
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 1px solid #efefef;
    background: #fff;
    aspect-ratio: 1 / 1;
}

.feed-grid .post-media {
    margin: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.feed-grid .post-media img,
.feed-grid .post-media video {
    border: none;
    object-fit: cover;
    height: 100%;
    width: 100%;
    display: block;
    background: #262626;
}

.feed-grid .post-media video[poster] {
    object-fit: cover;
}

.feed-grid .post-content {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Video indicator */
.video-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    pointer-events: none;
    z-index: 10;
}

/* Video thumbnail fallback */
.video-thumb.thumb-error {
    background: #262626;
}

.video-thumb.thumb-error img {
    opacity: 0;
}

/* Lazy loading images */
img.lazy {
    background: #f5f5f5;
    min-height: 100px;
}

/* Post Detail - Instagram Style */
.post-detail {
    max-width: 700px;
    margin: 0 auto;
}

.post-single {
    cursor: default;
    will-change: auto;
    border: 1px solid #dbdbdb;
}

.post-single:hover {
    transform: none;
}

.post-single .post-media {
    margin: 0;
    overflow: hidden;
}

.post-single .post-media img,
.post-single .post-media video {
    border: none;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    image-orientation: from-image;
}

.post-single .post-actions-bar {
    padding: 6px 16px;
    margin: 0;
    border-top: none;
    border-bottom: none;
    display: flex;
    gap: 16px;
}

.post-single .post-buttons {
    display: flex;
    gap: 16px;
}

.post-single .action-btn {
    padding: 8px 0;
}

.post-single .action-btn svg {
    width: 24px;
    height: 24px;
}

.post-likes {
    padding: 0 16px 8px 16px;
    font-size: 0.875rem;
}

.post-likes strong {
    font-weight: 600;
}

.post-single .post-content {
    padding: 0 16px 8px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.post-single .post-content-main {
    padding: 16px;
    font-size: 1.0625rem;
    line-height: 1.6;
    border-bottom: 1px solid #efefef;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.post-single .post-date {
    padding: 0 16px 16px 16px;
    font-size: 0.625rem;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: block;
}

/* Action Buttons */
.post-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.post-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 4px;
    color: #000;
}

.action-btn:hover { opacity: 0.6; }

/* Share Menu */
.share-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #dbdbdb;
    padding: 10px;
    min-width: 150px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-menu button {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #000;
    margin: 0;
}

.share-menu button:hover { background: #f0f0f0; }

#copy-msg {
    margin-top: 8px;
    padding: 5px;
    background: #f0f0f0;
    font-size: 0.85rem;
    text-align: center;
}

/* Comments Section - Instagram Style */
#comments-section {
    border: 1px solid #dbdbdb;
    border-top: none;
    padding: 0;
}

.view-comments {
    padding: 16px 16px 4px 16px;
    color: #8e8e8e;
    font-size: 0.875rem;
    cursor: pointer;
}

.view-comments:hover {
    color: #262626;
}

.comment {
    padding: 4px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.comment strong {
    font-weight: 600;
    margin-right: 6px;
}

.comment-form {
    padding: 16px;
    border-top: 1px solid #efefef;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form input,
.comment-form textarea {
    border: 1px solid #dbdbdb;
    padding: 8px 12px;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.comment-form input {
    height: 40px;
}

.comment-form textarea {
    min-height: 60px;
    resize: none;
}

.comment-form button {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    align-self: flex-end;
}

.no-comments {
    padding: 16px;
    color: #8e8e8e;
    font-size: 0.875rem;
    text-align: center;
}

/* Forms */
.auth-form, .post-form {
    max-width: 500px;
    margin: 40px auto;
    border: 1px solid #dbdbdb;
    padding: 30px;
    background: #fff;
}

.auth-form h2, .post-form h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dbdbdb;
    font-size: 1rem;
    font-family: inherit;
}

input[type="file"] { margin-bottom: 15px; }

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

button:hover {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}

button[type="button"] {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}

button[type="button"]:hover {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}

/* Admin Buttons */
.post-actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete, .btn-save, .btn-cancel {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-edit:hover, .btn-save:hover { background: #000; color: #fff; }
.btn-delete:hover { background: #f00; color: #fff; border-color: #f00; }

.edit-form { margin: 10px 0; }
.edit-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dbdbdb;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 10px;
}

/* Messages */
.error { color: #f00; margin-top: 10px; font-weight: 500; }
.success { color: #080; margin-top: 10px; font-weight: 500; }
.loading { text-align: center; padding: 40px; font-size: 1.1rem; color: #666; }

/* Media Preview */
#mediaPreview img,
#mediaPreview video {
    max-width: 100%;
    margin-top: 10px;
    border: 1px solid #dbdbdb;
}

/* Utility */
.hidden { display: none !important; }

/* Footer */
footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid #dbdbdb;
    text-align: center;
    color: #666;
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    header {
        padding: 20px 0 15px;
        min-height: auto;
    }

    .header-content {
        grid-template-columns: 1fr 70px;
        gap: 15px;
        align-items: start;
    }

    .header-right { width: 70px; }
    .cross-image { width: 70px; height: 70px; object-fit: contain; }

    header h1 { font-size: 1.25rem; margin-bottom: 8px; }
    .tagline { font-size: 0.85rem; margin-bottom: 8px; }
    .header-info { font-size: 0.75rem; gap: 5px; flex-wrap: wrap; }

    .tab-btn { padding: 12px 16px; font-size: 0.85rem; }

    .post:not(.post-single) { padding: 15px; }
    .auth-form, .post-form { padding: 20px; }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-actions { width: 100%; justify-content: flex-end; }

    .feed-grid .post-content {
        font-size: 0.7rem;
        padding: 8px;
    }

}

/* Sidebar Icons Navigation */
.sidebar-icons {
    position: absolute;
    left: 55px;
    top: 290px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.icon-link {
    color: #536471;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.icon-link:hover {
    color: #000;
}

.icon-link.active {
    color: #000;
}

.icon-link svg {
    display: block;
    width: 28px;
    height: 28px;
}

.icon-link.active svg {
    stroke-width: 2.5;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
}

/* Hide sidebar on smaller screens where it would overlap */
@media (max-width: 1100px) {
    .sidebar-icons {
        display: none;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #dbdbdb;
        padding: 12px 0;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
    }

    .mobile-bottom-nav .icon-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 16px;
        color: #536471;
        text-decoration: none;
    }

    .mobile-bottom-nav .icon-link.active {
        color: #000;
    }

    .mobile-bottom-nav .icon-link svg {
        width: 24px;
        height: 24px;
    }

    /* Add padding to body to prevent content from hiding behind bottom nav */
    body {
        padding-bottom: 70px;
    }
}
