/* ============================================
   Our Work Category - Professional Modern Design
   Version 3.2 - Portrait Cards & Fixed Title Hover
   ============================================ */

/* ========== SECTION WRAPPER ========== */
.our-work-wrapper {
    width: 100%;
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #f8faf7 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.our-work-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(53, 78, 43, 0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.our-work-wrapper::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.our-work-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ========== CATEGORY HEADER ========== */
.category-header {
    text-align: center;
    margin-bottom: 70px;
    position: relative;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ff6b35, transparent);
    margin: 25px auto 0;
    border-radius: 2px;
    animation: expandWidth 1s ease-out 0.3s both;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100px;
    }
}

.category-subtitle {
    font-size: 0.95rem;
    color: #ff6b35;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.category-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: #354e2b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    display: inline-block;
    line-height: 1.2;
}

.category-title::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -25px;
    width: 50px;
    height: 50px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
}

.category-description {
    font-size: 1.15rem;
    color: #5a7a4d;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 400;
}

/* ========== WORK GRID ========== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
    justify-content: center;
    padding: 0 20px;
}

/* Stagger animation for grid items */
.work-tile {
    animation: fadeInUp 0.6s ease-out backwards;
}

.work-tile:nth-child(1) {
    animation-delay: 0.1s;
}

.work-tile:nth-child(2) {
    animation-delay: 0.2s;
}

.work-tile:nth-child(3) {
    animation-delay: 0.3s;
}

.work-tile:nth-child(4) {
    animation-delay: 0.4s;
}

.work-tile:nth-child(5) {
    animation-delay: 0.5s;
}

.work-tile:nth-child(6) {
    animation-delay: 0.6s;
}

.work-tile:nth-child(7) {
    animation-delay: 0.7s;
}

.work-tile:nth-child(8) {
    animation-delay: 0.8s;
}

.work-tile:nth-child(9) {
    animation-delay: 0.9s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== WORK TILE - PORTRAIT RECTANGLE ========== */
.work-tile {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(53, 78, 43, 0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    height: 380px; /* Increased height for portrait */
    border: 1px solid rgba(53, 78, 43, 0.06);
}

.work-tile:hover {
    transform: translateY(-20px) scale(1.03);
    box-shadow: 0 30px 70px rgba(53, 78, 43, 0.2);
    border-color: rgba(255, 107, 53, 0.3);
}

.tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
}

/* ========== TILE IMAGE ========== */
.tile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #e8efe5 0%, #d4e0cf 100%);
}

.tile-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
                transparent 0%, 
                rgba(0,0,0,0.05) 50%,
                rgba(0,0,0,0.15) 100%);
    z-index: 1;
    transition: opacity 0.5s ease;
}

.work-tile:hover .tile-image::after {
    opacity: 0.7;
}

.tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-tile:hover .tile-image img {
    transform: scale(1.15) rotate(1deg);
}

/* ========== TILE CONTENT - TITLE AT BOTTOM (TRANSPARENT TOP) ========== */
.tile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 28px 32px;
    background: linear-gradient(to top, 
                rgba(53, 78, 43, 0.96) 0%,
                rgba(53, 78, 43, 0.85) 40%,
                rgba(53, 78, 43, 0.6) 70%,
                transparent 100%); /* Transparent at top - no blur */
    z-index: 5;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* On hover - title stays at top, visible, doesn't go outside */
.work-tile:hover .tile-content {
    top: 0;
    bottom: auto;
    background: linear-gradient(to bottom, 
                rgba(53, 78, 43, 0.96) 0%,
                rgba(53, 78, 43, 0.85) 50%,
                transparent 100%);
    padding: 28px 28px 24px;
}

.tile-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    /*line-height: 1.4;*/
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
}

/* Title on hover - stays visible at top */
.work-tile:hover .tile-title {
    font-size: 1.55rem;
    margin-bottom: 0;
    -webkit-line-clamp: 3; /* Allow more lines if needed */
}

/* ========== TILE OVERLAY (Slides from bottom) ========== */
.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, 
                rgba(53, 78, 43, 0.98) 0%, 
                rgba(53, 78, 43, 0.96) 100%);
    padding: 28px 28px 36px;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    max-height: 70%;
    overflow: hidden;
}

.work-tile:hover .tile-overlay {
    transform: translateY(0);
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.2s;
}

.work-tile:hover .overlay-content {
    opacity: 1;
    transform: translateY(0);
}

.tile-excerpt {
    font-size: 1.05rem;
    color: #ffffff;
    line-height: 1.85;
    margin: 0;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 5; /* More lines for portrait */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.96;
}

/* ========== READ MORE BUTTON ========== */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8555 100%);
    color: #ffffff;
   /* padding: 16px 38px;*/
    border-radius: 50px;
    font-weight: 700;
    /*font-size: 1rem;*/
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    align-self: flex-start;
    text-transform: uppercase;
    /*letter-spacing: 1.5px;*/
    padding: 12px 24px; /* Changed from 16px 38px - smaller padding */
    font-size: 0.85rem; /* Changed from 1rem - smaller font */
    letter-spacing: 1px; /* Changed from 1.5px - tighter spacing */
    border: none;
    position: relative;
    overflow: hidden;
}

.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.read-more-btn:hover::before {
    left: 100%;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #ff8555 0%, #ffa575 100%);
    transform: translateY(-3px) translateX(3px); /* Changed from -4px and 5px - less movement */
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.read-more-btn svg {
    transition: transform 0.3s ease;
}

.read-more-btn:hover svg {
    transform: translateX(5px);
}

/* ========== PAGINATION ========== */
.work-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.work-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    background: #ffffff;
    color: #354e2b;
    border: 2px solid #d4e0cf;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(53, 78, 43, 0.08);
}

.work-pagination .page-numbers:hover {
    background: #354e2b;
    color: #ffffff;
    border-color: #354e2b;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(53, 78, 43, 0.2);
}

.work-pagination .page-numbers.current {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8555 100%);
    color: #ffffff;
    border-color: #ff6b35;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.work-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.work-pagination .prev,
.work-pagination .next {
    background: #354e2b;
    color: #ffffff;
    border-color: #354e2b;
    font-size: 1.1rem;
}

.work-pagination .prev:hover,
.work-pagination .next:hover {
    background: #ff6b35;
    border-color: #ff6b35;
}

/* ========== NO POSTS MESSAGE ========== */
.no-posts {
    text-align: center;
    padding: 100px 40px;
    background: linear-gradient(135deg, #f8faf7 0%, #eef3ec 100%);
    border-radius: 24px;
    border: 2px dashed #d4e0cf;
    animation: fadeInUp 0.8s ease-out;
    grid-column: 1 / -1;
}

.no-posts h2 {
    font-size: 2.2rem;
    color: #354e2b;
    margin-bottom: 16px;
    font-weight: 700;
}

.no-posts p {
    font-size: 1.15rem;
    color: #5a7a4d;
    max-width: 500px;
    margin: 0 auto;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Large Desktop */
@media (min-width: 1400px) {
    .work-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .our-work-wrapper {
        padding: 120px 0 70px; /* Adjusted */
    }
    
    .work-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 35px;
    }
    
    .category-title {
        font-size: 2.8rem;
    }
    
    .work-tile {
        height: 360px;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .our-work-wrapper {
        padding: 110px 0 60px; /* Adjusted */
    }
    
    .work-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
        padding: 0 10px;
    }
    
    .category-header {
        margin-bottom: 60px;
    }
    
    .category-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .category-description {
        font-size: 1.1rem;
    }
    
    .work-tile {
        height: 340px;
    }
    
    .tile-title {
        font-size: 1.55rem;
    }
    
    .work-tile:hover .tile-title {
        font-size: 1.45rem;
    }
    
    .tile-excerpt {
        font-size: 1.02rem;
        -webkit-line-clamp: 4;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .our-work-wrapper {
          padding: 200px 0 50px; /* Adjusted */
    }
    
    .our-work-container {
        padding: 0 16px;
    }
    
    .work-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 0;
    }
    
    .category-header {
        margin-bottom: 50px;
    }
    
    .category-title {
        font-size: 2.2rem;
        letter-spacing: 1.5px;
    }
    
    .category-subtitle {
        font-size: 0.9rem;
        letter-spacing: 2.5px;
    }
    
    .category-description {
        font-size: 1.05rem;
        padding: 0 10px;
    }
    
    .work-tile {
        height: 360px;
        border-radius: 16px;
    }
    
    .work-tile:hover {
        transform: translateY(-12px) scale(1.02);
    }
    
    .tile-content {
        padding: 24px 24px 28px;
    }
    
    .work-tile:hover .tile-content,
    .work-tile.active .tile-content {
        padding: 24px 24px 20px;
    }
    
    .tile-title {
        font-size: 1.45rem;
    }
    
    .work-tile:hover .tile-title,
    .work-tile.active .tile-title {
        font-size: 1.35rem;
    }
    
    /* Mobile: Show overlay on tap */
    .tile-overlay {
        padding: 20px 24px 30px;
        max-height: 65%;
    }
    
    .work-tile.active .tile-overlay {
        transform: translateY(0);
    }
    
    .work-tile.active .overlay-content {
        opacity: 1;
        transform: translateY(0);
    }
    
    .work-tile.active .tile-content {
        top: 0;
        bottom: auto;
        background: linear-gradient(to bottom, 
                    rgba(53, 78, 43, 0.96) 0%,
                    rgba(53, 78, 43, 0.85) 50%,
                    transparent 100%);
    }
    
    .tile-excerpt {
        font-size: 1.02rem;
        line-height: 1.75;
        -webkit-line-clamp: 4;
    }
    
    .read-more-btn {
        padding: 11px 22px;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Pagination mobile adjustments */
    .work-pagination .page-numbers {
        min-width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }
}

/* Mobile Medium */
@media (max-width: 576px) {
    .our-work-wrapper {
        padding: 200px 0 40px;
    }
    
    .category-title {
        font-size: 1.9rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .work-grid {
        gap: 24px;
    }
    
    .work-tile {
        height: 340px;
    }
    
    .tile-content {
        padding: 22px 22px 26px;
    }
    
    .tile-title {
        font-size: 1.35rem;
    }
    
    .work-tile:hover .tile-title,
    .work-tile.active .tile-title {
        font-size: 1.25rem;
    }
    
    .tile-excerpt {
        font-size: 1rem;
    }
    
    .read-more-btn {
        padding: 10px 20px;
        font-size: 0.75rem;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .our-work-wrapper {
        padding: 200px 0 35px;
    }
    
    .category-title {
        font-size: 1.7rem;
        letter-spacing: 1px;
    }
    
    .category-subtitle {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }
    
    .work-grid {
        gap: 22px;
    }
    
    .work-tile {
        height: 320px;
    }
    
    .tile-content {
        padding: 20px 20px 24px;
    }
    
    .tile-title {
        font-size: 1.25rem;
    }
    
    .work-tile:hover .tile-title,
    .work-tile.active .tile-title {
        font-size: 1.15rem;
    }
    
    .tile-excerpt {
        font-size: 0.95rem;
        line-height: 1.7;
        -webkit-line-clamp: 3;
    }
    
    .tile-overlay {
        padding: 18px 20px 26px;
        max-height: 60%;
    }
    
    .read-more-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
        border-radius: 40px;
        letter-spacing: 0.5px;
    }
    
    .work-pagination .page-numbers {
        min-width: 38px;
        height: 38px;
        font-size: 0.9rem;
        padding: 0 12px;
    }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */

/* Use will-change for animations */
.work-tile,
.tile-image img,
.tile-overlay,
.tile-content,
.overlay-content {
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .work-tile:hover {
        transform: none;
    }
    
    .work-tile:hover .tile-image img {
        transform: none;
    }
    
    .work-tile:hover .tile-content {
        transform: none;
    }
    
    .tile-overlay {
        transform: none;
    }
    
    .category-title::before {
        animation: none;
    }
}

/* ========== LOADING STATES ========== */
.work-tile.loading {
    pointer-events: none;
    opacity: 0.6;
}

.work-tile.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 107, 53, 0.3);
    border-top-color: #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== PRINT STYLES ========== */
@media print {
    .our-work-wrapper {
        padding: 20px 0;
    }
    
    .work-tile {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .tile-overlay,
    .read-more-btn,
    .work-pagination {
        display: none;
    }
}