/* ========================================
   ARTICLE-CARDS.CSS
   Styles for article cards components
======================================== */

/* ----------------------------------------
   ARTICLES CONTAINER & LAYOUT
---------------------------------------- */

.articles-container {
    padding: 30px 40px;
}

.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Alternative list view (if needed) */
.articles-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ----------------------------------------
   ARTICLE CARD BASE
---------------------------------------- */

.article-card {
    background: white;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #8B4513;
}

/* ----------------------------------------
   ARTICLE IMAGE SECTION
---------------------------------------- */

.article-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #D2691E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

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

/* Optional: Add a subtle icon when no image is present */
.article-image:not(:has(img))::before {
    content: '📄';
    font-size: 3rem;
    opacity: 0.3;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* Alternative for browsers that don't support :has() */
.article-image.no-image::before {
    content: '📄';
    font-size: 3rem;
    opacity: 0.3;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* ----------------------------------------
   ARTICLE TYPE BADGE
---------------------------------------- */

.article-type {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    backdrop-filter: blur(5px);
}

.type-blog {
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.type-press {
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.type-both {
    background: rgba(139, 69, 19, 0.9);
    color: white;
    border: 1px solid rgba(139, 69, 19, 0.3);
}

/* ----------------------------------------
   ARTICLE CONTENT SECTION
---------------------------------------- */

.article-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between; /* Distribute space evenly */
}

/* Category label */
.article-category {
    color: #8B4513;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Article title */
.article-title {
    margin: 0 0 20px 0; /* Increased bottom margin since no description */
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.4;
    color: #2c1810;
    flex-grow: 1; /* Take up available space */
}

.article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: #8B4513;
}

/* Remove description styles since we no longer use them */
.article-description {
    display: none; /* Hide if any description is accidentally rendered */
}

/* ----------------------------------------
   ARTICLE FOOTER
---------------------------------------- */

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    margin-top: auto; /* Push to bottom */
}

/* Publication date - Now with more prominent styling since it's more visible */
.article-date {
    color: #8B4513;
    font-weight: 600; /* Slightly bolder */
    font-size: 14px;
    opacity: 0.9; /* More visible */
}

.article-date time {
    color: inherit;
}

/* Read more link */
.read-more {
    color: #8B4513;
    font-weight: bold;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #8B4513;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more:hover {
    background: #8B4513;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(139, 69, 19, 0.3);
}

/* ----------------------------------------
   NO ARTICLES STATE
---------------------------------------- */

.no-articles {
    text-align: center;
    padding: 60px 20px;
    color: #4a2c17;
    grid-column: 1 / -1; /* Span full width in grid */
}

.no-articles h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c1810;
}

.no-articles p {
    font-size: 1rem;
    opacity: 0.8;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ----------------------------------------
   RESPONSIVE DESIGN
---------------------------------------- */

@media (max-width: 768px) {
    .articles-container {
        padding: 20px;
    }
    
    .articles-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-image {
        height: 180px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.2rem;
        margin-bottom: 15px; /* Adjusted for mobile */
    }
    
    .article-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
    
    .read-more {
        display: block;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .articles-container {
        padding: 15px;
    }
    
    .article-content {
        padding: 15px;
    }
    
    .article-type {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .article-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .article-date {
        font-size: 13px; /* Slightly smaller on mobile */
    }
}

/* ----------------------------------------
   LOADING STATES (for future AJAX)
---------------------------------------- */

.articles-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.article-card.loading {
    opacity: 0.7;
    transform: none;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-top: 3px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ----------------------------------------
   HOVER EFFECTS & ANIMATIONS
---------------------------------------- */

.article-card {
    animation: fadeInUp 0.5s ease-out;
}

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

/* ----------------------------------------
  RESPONSIVE DESIGN
---------------------------------------- */

/* Large tablets and medium screens */
@media (max-width: 1024px) {
   .articles-container {
       padding: 25px 35px;
   }
   
   .articles-list {
       grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
       gap: 22px;
       margin-top: 18px;
   }
   
   .articles-list.list-view {
       gap: 18px;
   }
   
   .article-image {
       height: 200px;
   }
   
   .article-content {
       padding: 22px;
   }
   
   .article-category {
       font-size: 12px;
       margin-bottom: 8px;
   }
   
   .article-title {
       font-size: 1.25rem;
       margin-bottom: 18px;
   }
   
   .article-footer {
       padding-top: 12px;
   }
   
   .article-date {
       font-size: 13px;
   }
   
   .read-more {
       padding: 7px 14px;
       font-size: 12px;
   }
   
   .no-articles {
       padding: 50px 18px;
   }
   
   .no-articles h3 {
       font-size: 1.4rem;
       margin-bottom: 12px;
   }
   
   .no-articles p {
       font-size: 0.95rem;
   }
}

/* Tablets */
@media (max-width: 768px) {
   .articles-container {
       padding: 20px;
   }
   
   .articles-list {
       grid-template-columns: 1fr;
       gap: 20px;
   }
   
   .article-image {
       height: 180px;
   }
   
   .article-content {
       padding: 20px;
   }
   
   .article-category {
       font-size: 11px;
       margin-bottom: 6px;
   }
   
   .article-title {
       font-size: 1.2rem;
       margin-bottom: 15px;
   }
   
   .article-footer {
       flex-direction: column;
       gap: 15px;
       align-items: stretch;
       text-align: center;
       padding-top: 10px;
   }
   
   .article-date {
       font-size: 12px;
       text-align: center;
   }
   
   .read-more {
       display: block;
       text-align: center;
       padding: 6px 12px;
       font-size: 11px;
   }
   
   .article-type {
       top: 12px;
       right: 12px;
       padding: 5px 10px;
       font-size: 10px;
   }
   
   .no-articles {
       padding: 40px 15px;
   }
   
   .no-articles h3 {
       font-size: 1.3rem;
       margin-bottom: 10px;
   }
   
   .no-articles p {
       font-size: 0.9rem;
       line-height: 1.5;
   }
}

/* Small tablets and large phones */
@media (max-width: 600px) {
   .articles-container {
       padding: 18px 16px;
   }
   
   .articles-list {
       gap: 18px;
       margin-top: 15px;
   }
   
   .article-card {
       border-radius: 12px;
   }
   
   .article-image {
       height: 160px;
   }
   
   .article-content {
       padding: 18px;
   }
   
   .article-category {
       font-size: 10px;
       margin-bottom: 5px;
   }
   
   .article-title {
       font-size: 1.15rem;
       margin-bottom: 12px;
       line-height: 1.3;
   }
   
   .article-footer {
       gap: 12px;
       padding-top: 8px;
   }
   
   .article-date {
       font-size: 11px;
   }
   
   .read-more {
       padding: 5px 10px;
       font-size: 10px;
       border-radius: 4px;
   }
   
   .article-type {
       top: 10px;
       right: 10px;
       padding: 4px 8px;
       font-size: 9px;
       border-radius: 15px;
   }
   
   .no-articles {
       padding: 35px 12px;
   }
   
   .no-articles h3 {
       font-size: 1.2rem;
       margin-bottom: 8px;
   }
   
   .no-articles p {
       font-size: 0.85rem;
       line-height: 1.4;
   }
}

/* Mobile phones */
@media (max-width: 480px) {
   .articles-container {
       padding: 15px;
   }
   
   .articles-list {
       gap: 15px;
       margin-top: 12px;
   }
   
   .article-card {
       border-radius: 10px;
   }
   
   .article-image {
       height: 140px;
   }
   
   .article-image:not(:has(img))::before,
   .article-image.no-image::before {
       font-size: 2.5rem;
   }
   
   .article-content {
       padding: 15px;
   }
   
   .article-category {
       font-size: 9px;
       margin-bottom: 4px;
   }
   
   .article-title {
       font-size: 1.1rem;
       margin-bottom: 10px;
       line-height: 1.2;
   }
   
   .article-footer {
       gap: 10px;
       padding-top: 6px;
   }
   
   .article-date {
       font-size: 10px;
   }
   
   .read-more {
       padding: 4px 8px;
       font-size: 9px;
       letter-spacing: 0.3px;
   }
   
   .article-type {
       top: 8px;
       right: 8px;
       padding: 3px 6px;
       font-size: 8px;
   }
   
   .no-articles {
       padding: 30px 10px;
   }
   
   .no-articles h3 {
       font-size: 1.1rem;
       margin-bottom: 6px;
   }
   
   .no-articles p {
       font-size: 0.8rem;
       line-height: 1.3;
   }
   
   .loading-spinner {
       padding: 40px 15px;
   }
   
   .loading-spinner::after {
       width: 30px;
       height: 30px;
       border-width: 2px;
   }
}

/* Very small screens */
@media (max-width: 320px) {
   .articles-container {
       padding: 12px;
   }
   
   .articles-list {
       gap: 12px;
       margin-top: 10px;
   }
   
   .article-image {
       height: 120px;
   }
   
   .article-content {
       padding: 12px;
   }
   
   .article-title {
       font-size: 1.05rem;
       margin-bottom: 8px;
   }
   
   .article-footer {
       gap: 8px;
       padding-top: 4px;
   }
   
   .article-date {
       font-size: 9px;
   }
   
   .read-more {
       padding: 3px 6px;
       font-size: 8px;
   }
   
   .article-type {
       top: 6px;
       right: 6px;
       padding: 2px 4px;
       font-size: 7px;
   }
   
   .no-articles {
       padding: 25px 8px;
   }
   
   .no-articles h3 {
       font-size: 1rem;
       margin-bottom: 4px;
   }
   
   .no-articles p {
       font-size: 0.75rem;
   }
}