/**
 * GcodeA Theme - Pages Styles
 * All page-specific styles (single, archive, home, blog)
 * Version: 1.0
 */

/* ==========================================================================
   Global Styles
   ========================================================================== */

body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* RTL Support */
.rtl-layout {
    direction: rtl;
}

.ltr-layout {
    direction: ltr;
}

/* ==========================================================================
   Header Container (Shared across all pages)
   ========================================================================== */

.header-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 2;
}

.header-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.header-content h1 {
    font-size: 65px;
    font-weight: 500;
    margin: 0 0 20px;
}

.header-links {
    font-size: 25px;
    font-weight: 400;
}

.header-links a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s;
}

.header-links a:hover {
    opacity: 0.8;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 42px;
    }
    .header-links {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 32px;
    }
    .header-links {
        font-size: 16px;
    }
}

/* ==========================================================================
   Archive Info Badge
   ========================================================================== */

.archive-info-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
    letter-spacing: 0.5px;
}

.archive-info-badge i {
    margin-right: 8px;
}

.rtl-layout .archive-info-badge i {
    margin-right: 0;
    margin-left: 8px;
}

.archive-description {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    color: #555;
    font-size: 16px;
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Blog Layout
   ========================================================================== */

.blog-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
}

.ltr-layout .blog-container {
    flex-direction: row;
}

.rtl-layout .blog-container {
    flex-direction: row-reverse;
}

.blog-main-content {
    flex: 1;
    min-width: 0;
}

.blog-sidebar {
    width: 350px;
    flex-shrink: 0;
}

/* ==========================================================================
   Blog Post Item
   ========================================================================== */

.blog-post-item {
    margin-bottom: 50px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 139, 153, 0.1);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    animation: fadeInUp 0.6s ease-out;
}

.blog-post-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(26, 139, 153, 0.2);
    border-color: #2596be;
}

.blog-post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 400px;
    background: linear-gradient(135deg, #2596be 0%, #972424 100%);
}

.blog-post-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s;
}

.blog-post-item:hover .blog-post-thumbnail::before {
    opacity: 1;
}

.blog-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-post-item:hover .blog-post-thumbnail img {
    transform: scale(1.15) rotate(2deg);
}

.blog-post-content {
    padding: 35px;
}

.blog-post-category {
    display: inline-block;
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
    transition: all 0.3s;
}

.blog-post-category:hover {
    background: linear-gradient(135deg, #972424 0%, #8a2515 100%);
    box-shadow: 0 6px 20px rgba(164, 44, 25, 0.4);
    transform: translateY(-2px);
}

.blog-post-title {
    font-size: 32px;
    margin: 15px 0;
    line-height: 1.4;
    font-weight: 800;
}

.blog-post-title a {
    color: #1a1a1a;
    text-decoration: none;
    background: linear-gradient(to right, #2596be 0%, #2596be 100%);
    background-size: 0 3px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: all 0.4s ease;
}

.blog-post-title a:hover {
    color: #2596be;
    background-size: 100% 3px;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #777;
    font-size: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rtl-layout .blog-post-meta {
    direction: rtl;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s;
}

.blog-post-meta span:hover {
    background: #2596be;
    color: #fff;
}

.blog-post-meta span:hover i {
    color: #fff;
}

.blog-post-meta i {
    color: #2596be;
    font-size: 15px;
    transition: color 0.3s;
}

.blog-post-excerpt {
    line-height: 1.9;
    color: #555;
    margin-bottom: 25px;
    font-size: 16px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #972424 0%, #8a2515 100%);
    transition: left 0.4s ease;
    z-index: 0;
}

.read-more:hover::before {
    left: 0;
}

.read-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(164, 44, 25, 0.4);
}

.read-more span,
.read-more i {
    position: relative;
    z-index: 1;
}

.rtl-layout .read-more i {
    transform: scaleX(-1);
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

.sidebar-widget {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(26, 139, 153, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s;
    animation: fadeInUp 0.6s ease-out;
}

.sidebar-widget:hover {
    border-color: #2596be;
    box-shadow: 0 8px 30px rgba(26, 139, 153, 0.15);
}

.widget-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 3px solid #2596be;
    color: #1a1a1a;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    width: 60px;
    height: 3px;
    background: #972424;
}

.ltr-layout .widget-title::after {
    left: 0;
}

.rtl-layout .widget-title::after {
    right: 0;
}

/* Search Widget */
.blog-search-form {
    display: flex;
    gap: 10px;
    position: relative;
}

.blog-search-form input[type="search"] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.blog-search-form input[type="search"]:focus {
    outline: none;
    border-color: #2596be;
    background: #fff;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.1);
}

.blog-search-form button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
}

.blog-search-form button:hover {
    background: linear-gradient(135deg, #972424 0%, #8a2515 100%);
    box-shadow: 0 6px 20px rgba(164, 44, 25, 0.4);
    transform: translateY(-2px);
}

/* Categories Widget */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 14px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 12px;
    color: #333;
    text-decoration: none;
    transition: all 0.4s ease;
    font-weight: 600;
    border: 2px solid transparent;
}

.category-list a:hover {
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    border-color: #2596be;
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
}

.ltr-layout .category-list a:hover {
    transform: translateX(8px);
}

.rtl-layout .category-list a:hover {
    transform: translateX(-8px);
}

.category-count {
    background: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 700;
    color: #2596be;
    border: 2px solid #2596be;
    transition: all 0.3s;
}

.category-list a:hover .category-count {
    background: #972424;
    color: #fff;
    border-color: #972424;
}

/* Recent Posts Widget */
.recent-post {
    display: flex;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 2px solid #f1f3f5;
    transition: all 0.3s;
}

.rtl-layout .recent-post {
    direction: rtl;
}

.recent-post:hover {
    padding-left: 10px;
    border-bottom-color: #2596be;
}

.rtl-layout .recent-post:hover {
    padding-left: 0;
    padding-right: 10px;
}

.recent-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-post-thumb {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #f8f9fa;
    transition: all 0.3s;
}

.recent-post:hover .recent-post-thumb {
    border-color: #2596be;
    transform: scale(1.05);
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.recent-post:hover .recent-post-thumb img {
    transform: scale(1.1);
}

.recent-post-info {
    flex: 1;
}

.recent-post-info h4 {
    font-size: 15px;
    margin: 0 0 10px 0;
    line-height: 1.5;
    font-weight: 700;
}

.recent-post-info h4 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s;
}

.recent-post-info h4 a:hover {
    color: #2596be;
}

.recent-post-date {
    font-size: 13px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-post-date i {
    color: #2596be;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-item {
    display: inline-block;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    color: #555;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tag-item:hover {
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    border-color: #2596be;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 60px 0;
}

.pagination a,
.pagination span {
    padding: 12px 20px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.pagination a:hover {
    background: linear-gradient(135deg, #2596be 0%, #1b6f8d 100%);
    color: #fff;
    border-color: #2596be;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 139, 153, 0.3);
}

.pagination .current {
    background: linear-gradient(135deg, #972424 0%, #8a2515 100%);
    color: #fff;
    border-color: #972424;
    box-shadow: 0 4px 15px rgba(164, 44, 25, 0.3);
}

/* ==========================================================================
   No Posts Message
   ========================================================================== */

.no-posts-message {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(26, 139, 153, 0.08);
}

.no-posts-message i {
    font-size: 80px;
    color: #2596be;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-posts-message h3 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 800;
}

.no-posts-message p {
    color: #777;
    font-size: 16px;
}

/* ==========================================================================
   Contact Form 7 Styling
   ========================================================================== */

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-column {
    flex: 1;
    min-width: calc(50% - 20px);
    margin-right: 20px;
}

.form-column:last-child {
    margin-right: 0;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.wpcf7 textarea {
    height: 100px;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 textarea:focus {
    border-bottom: 2px solid #4e54c8;
    outline: none;
}

.wpcf7 ::placeholder {
    color: #999;
    opacity: 1;
}

.wpcf7 input[type="submit"] {
    width: auto;
    background-color: #4e54c8;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus {
    background-color: #3c3c94;
    outline: none;
}

.wpcf7-response-output {
    margin: 20px 0;
    color: red;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .blog-container {
        flex-direction: column !important;
    }

    .blog-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .blog-post-title {
        font-size: 24px;
    }

    .blog-post-thumbnail {
        height: 250px;
    }

    .blog-post-content {
        padding: 25px;
    }

    .sidebar-widget {
        padding: 25px;
    }

    .widget-title {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }

    .form-column {
        flex: none;
        min-width: 100%;
        margin-right: 0;
    }

    .wpcf7 input[type="text"],
    .wpcf7 input[type="email"],
    .wpcf7 input[type="tel"],
    .wpcf7 input[type="url"],
    .wpcf7 textarea {
        margin-bottom: 16px;
    }
}

/* ==========================================================================
   RTL Specific Adjustments
   ========================================================================== */

.rtl-layout .blog-post-meta,
.rtl-layout .category-list,
.rtl-layout .tags-cloud {
    direction: rtl;
}
