/* ==========================================================================
   Vaikom Vartha - Moments Section Custom Styles
   ========================================================================== */

/* Main Container Spacing */
.moments-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Section Header Styling */
.moments-section .section-header {
    border-bottom: 2px solid #e74c3c;
    margin-bottom: 20px;
}

.moments-section .section-title {
    background: #e74c3c;
    color: #fff;
    padding: 5px 15px;
    display: inline-block;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Grid Layout: Forces exactly 2 columns */
.moments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Card Styling */
.moment-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.moment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Link Wrapper */
.moment-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

/* Image Wrapper (4:3 Aspect Ratio) */
.moment-image-wrapper {
    position: relative;
    width: 100%;
    /* 100% makes the card a SQUARE. 
       If you want a taller portrait card, change this to 125% */
    padding-top: 100%; 
    overflow: hidden;
    background-color: #f8f9fa; /* Light gray background for empty space */
    display: flex;
    align-items: center;
    justify-content: center;
}

.moment-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* "contain" ensures the WHOLE image is seen without cropping */
    object-fit: contain; 
    margin: auto;
}

/* Tag Badge (e.g., Wedding/Birthday) */
.moment-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

/* Content Area */
.moment-content {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Headline */
.moment-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.moment-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.2s ease;
}

.moment-title a:hover {
    color: #e74c3c;
}

/* Date */
.moment-date {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-bottom: 15px;
    font-weight: 500;
}

/* --- SHARE BUTTONS CONTAINER --- */
/* Note: Button colors and shapes are handled by your main theme CSS. 
   This just positions them nicely in the center. */
.moment-share-actions {
    margin-top: auto; 
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center; /* Centers the buttons */
    gap: 15px; /* Space between the circular buttons */
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .moments-grid {
        gap: 15px;
    }
    .moment-content {
        padding: 12px;
    }
}
/* =========================================
   Dynamic Badge Colors
   ========================================= */

/* Default Badge Style (Fallback) */
.moment-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333; /* Dark Grey default */
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

/* 1. Wedding (Pink/Red) */
/* The class name must match your tag slug (e.g. tag-wedding) */
.moment-badge.tag-wedding,
.moment-badge.tag-vivaham { /* Malayalam tag support */
    background: #E91E63; 
}

/* 2. Birthday (Blue) */
.moment-badge.tag-birthday,
.moment-badge.tag-pirannal { 
    background: #2196F3; 
}

/* 3. Anniversary (Gold/Orange) */
.moment-badge.tag-anniversary,
.moment-badge.tag-wedding-anniversary {
    background: #FF9800; 
}

/* 4. Obituary/Remembrance (Black) */
.moment-badge.tag-obituary,
.moment-badge.tag-charamam {
    background: #000000; 
}

/* 5. Achievement (Green) */
.moment-badge.tag-achievement {
    background: #4CAF50; 
}