/* ============================================
   BLOG STYLES - Antarctica Voyages
   ============================================ */

/* Container already defined in main.css */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   FIX HEADER FOR BLOG PAGES (no hero image)
   ============================================ */
body.blog-page .header {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%) !important;
    position: absolute !important; /* Explicitly set to absolute for mobile menu to work */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Compensation for absolute header on blog pages */
body.blog-page .main-content {
    margin-top: 128px; /* Header height on mobile */
}

@media (min-width: 768px) {
    body.blog-page .main-content {
        margin-top: 150px; /* Header height on desktop */
    }
}

/* ============================================
   BLOG HEADER SECTION
   ============================================ */
.blog-header {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
    color: #ffffff;
    padding: 5rem 2rem 4rem;
    text-align: center;
    margin-bottom: 0;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.blog-header p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   BLOG CONTENT LAYOUT
   ============================================ */
.blog-content {
    padding: 3rem 0;
    background: #f8f9fa;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}

/* ============================================
   POSTS GRID
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ============================================
   POST CARD
   ============================================ */
.post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.15);
}

.post-card .post-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.post-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.post-card .post-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card .post-category {
    display: inline-block;
    color: #ff6b35;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.post-card .post-category:hover {
    color: #e55a25;
}

.post-card h2 {
    font-size: 1.375rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.post-card h2 a {
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card h2 a:hover {
    color: #0066cc;
}

.post-card .post-excerpt {
    color: #666666;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.post-card .post-meta {
    font-size: 0.875rem;
    color: #999999;
}

/* ============================================
   SIDEBAR
   ============================================ */
.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-widget {
    background: #ffffff;
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #333333;
}

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

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.875rem;
    color: #666666;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.category-list li a:hover {
    background: #f0f8ff;
    color: #0066cc;
}

.category-list li.active a {
    background: #0066cc;
    color: #ffffff;
}

.category-list li a span {
    color: #999999;
    font-size: 0.875rem;
}

.category-list li.active a span {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.625rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #666666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.page-link:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
}

.page-link.active {
    background: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
}

.page-link.prev,
.page-link.next {
    padding: 0.625rem 1.25rem;
}

/* ============================================
   SINGLE POST PAGE
   ============================================ */
.blog-post {
    background: #ffffff;
}

.post-header {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
    color: #ffffff;
    padding: 5rem 2rem 3rem;
    text-align: center;
}

.post-category-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: background 0.2s ease;
}

.post-category-tag:hover {
    background: rgba(255, 255, 255, 0.3);
}

.post-header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: #ffffff;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-meta-header {
    font-size: 1rem;
    opacity: 0.9;
}

.post-featured-image {
    padding: 3rem 2rem 0;
    background: #f8f9fa;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.post-body {
    padding: 3rem 2rem;
    background: #f8f9fa;
}

.post-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Post Author Card */
.post-author-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333333;
}

.author-bio {
    font-size: 0.9375rem;
    color: #666666;
}

/* Post Content */
.post-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #333333;
}

.post-text h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: #0066cc;
}

.post-text h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #004c99;
}

.post-text p {
    margin-bottom: 1.5rem;
}

.post-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.post-text ul {
    list-style: disc;
}

.post-text ol {
    list-style: decimal;
}

.post-text li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.post-text blockquote {
    border-left: 4px solid #0066cc;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666666;
}

/* Tables */
.post-text table,
.post-content-wrapper table,
article table,
.tiptap-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 2rem 0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
}

.post-text table thead,
.post-content-wrapper table thead,
article table thead,
.tiptap-table thead {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%) !important;
    color: #ffffff !important;
}

.post-text table thead th,
.post-content-wrapper table thead th,
article table thead th,
.tiptap-table thead th {
    padding: 1rem 1.25rem !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #ffffff !important;
    background: transparent !important;
    border: none !important;
}

.post-text table tbody tr,
.post-content-wrapper table tbody tr,
article table tbody tr,
.tiptap-table tbody tr {
    border-bottom: 1px solid #e0e0e0 !important;
    transition: background-color 0.2s ease !important;
    background: #ffffff !important;
}

.post-text table tbody tr:last-child,
.post-content-wrapper table tbody tr:last-child,
article table tbody tr:last-child,
.tiptap-table tbody tr:last-child {
    border-bottom: none !important;
}

.post-text table tbody tr:nth-child(even),
.post-content-wrapper table tbody tr:nth-child(even),
article table tbody tr:nth-child(even),
.tiptap-table tbody tr:nth-child(even) {
    background: #f8f9fa !important;
}

.post-text table tbody tr:hover,
.post-content-wrapper table tbody tr:hover,
article table tbody tr:hover,
.tiptap-table tbody tr:hover {
    background: #f0f8ff !important;
}

.post-text table td,
.post-content-wrapper table td,
article table td,
.tiptap-table td {
    padding: 1rem 1.25rem !important;
    color: #333333 !important;
    vertical-align: top !important;
    border: none !important;
    background: transparent !important;
}

.post-text table th:first-child,
.post-text table td:first-child,
.post-content-wrapper table th:first-child,
.post-content-wrapper table td:first-child,
article table th:first-child,
article table td:first-child,
.tiptap-table th:first-child,
.tiptap-table td:first-child {
    padding-left: 1.5rem !important;
}

.post-text table th:last-child,
.post-text table td:last-child,
.post-content-wrapper table th:last-child,
.post-content-wrapper table td:last-child,
article table th:last-child,
article table td:last-child,
.tiptap-table th:last-child,
.tiptap-table td:last-child {
    padding-right: 1.5rem !important;
}

/* Table Wrapper for Mobile Scroll */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-wrapper table {
    margin: 0;
    box-shadow: none;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.share-buttons span {
    font-weight: 600;
    color: #666666;
}

.share-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: #ffffff;
}

.share-btn.twitter:hover {
    background: #1a8cd8;
}

.share-btn.facebook {
    background: #1877F2;
    color: #ffffff;
}

.share-btn.facebook:hover {
    background: #145dbf;
}

/* Related Posts */
.related-posts {
    padding: 3rem 2rem;
    background: #f8f9fa;
}

.related-posts h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    color: #333333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.15);
}

.related-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-card h3 {
    padding: 1.5rem;
    font-size: 1.125rem;
    margin: 0;
}

.related-card h3 a {
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-card h3 a:hover {
    color: #0066cc;
}

/* Back to Blog */
.back-to-blog {
    padding: 2rem;
    background: #f8f9fa;
    text-align: center;
}

.back-link {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: #0066cc;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #004c99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: #666666;
}

.no-posts p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.btn-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #0066cc;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: #004c99;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        order: -1;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .blog-header {
        padding: 4rem 1.5rem 3rem;
    }

    .blog-header h1 {
        font-size: 2.25rem;
    }

    .blog-header p {
        font-size: 1.125rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-body {
        padding: 2rem 1rem; /* Reduced from 3rem 2rem */
    }

    .blog-content {
        padding: 2rem 0; /* Reduced from 3rem 0 */
    }

    .post-featured-image {
        padding: 2rem 1rem 0; /* Reduced from 3rem 2rem 0 */
    }

    .post-header {
        padding: 4rem 1.5rem 2.5rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-content-wrapper {
        padding: 2rem 1.5rem;
    }

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

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

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

    .related-grid {
        grid-template-columns: 1fr;
    }

    .share-buttons {
        flex-wrap: wrap;
    }

    .related-posts h2 {
        font-size: 1.5rem;
    }

    /* Mobile Table Styles */
    .post-text table,
    .post-content-wrapper table,
    article table,
    .tiptap-table {
        font-size: 0.9375rem !important;
    }

    .post-text table thead th,
    .post-content-wrapper table thead th,
    article table thead th,
    .tiptap-table thead th {
        padding: 0.875rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .post-text table td,
    .post-content-wrapper table td,
    article table td,
    .tiptap-table td {
        padding: 0.875rem 1rem !important;
    }

    .post-text table th:first-child,
    .post-text table td:first-child,
    .post-content-wrapper table th:first-child,
    .post-content-wrapper table td:first-child,
    article table th:first-child,
    article table td:first-child,
    .tiptap-table th:first-child,
    .tiptap-table td:first-child {
        padding-left: 1rem !important;
    }

    .post-text table th:last-child,
    .post-text table td:last-child,
    .post-content-wrapper table th:last-child,
    .post-content-wrapper table td:last-child,
    article table th:last-child,
    article table td:last-child,
    .tiptap-table th:last-child,
    .tiptap-table td:last-child {
        padding-right: 1rem !important;
    }

    /* Mobile Table Overflow Fix */
    .post-text table,
    .post-content-wrapper table,
    article table,
    .tiptap-table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem; /* Reduced from 0.75rem for minimal margins */
    }

    .blog-header h1 {
        font-size: 1.75rem;
    }

    .post-header h1 {
        font-size: 1.625rem;
    }

    .post-content-wrapper {
        padding: 1.5rem 0.5rem; /* Reduced from 1rem for wider content area */
    }

    .post-body {
        padding: 1.5rem 0.5rem; /* Even smaller for very small screens */
    }

    .blog-content {
        padding: 1.5rem 0;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
    }

    .post-featured-image {
        padding: 1.5rem 0.5rem 0; /* Reduced padding for minimal margins */
    }

    /* Extra Small Tables */
    .post-text table,
    .post-content-wrapper table,
    article table,
    .tiptap-table {
        font-size: 0.875rem !important;
    }

    .post-text table thead th,
    .post-content-wrapper table thead th,
    article table thead th,
    .tiptap-table thead th {
        padding: 0.75rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    .post-text table td,
    .post-content-wrapper table td,
    article table td,
    .tiptap-table td {
        padding: 0.75rem 0.75rem !important;
    }

    .post-text table th:first-child,
    .post-text table td:first-child,
    .post-content-wrapper table th:first-child,
    .post-content-wrapper table td:first-child,
    article table th:first-child,
    article table td:first-child,
    .tiptap-table th:first-child,
    .tiptap-table td:first-child {
        padding-left: 0.75rem !important;
    }

    .post-text table th:last-child,
    .post-text table td:last-child,
    .post-content-wrapper table th:last-child,
    .post-content-wrapper table td:last-child,
    article table th:last-child,
    article table td:last-child,
    .tiptap-table th:last-child,
    .tiptap-table td:last-child {
        padding-right: 0.75rem !important;
    }
}
