/* =========================================
   1. VARIABLES & THEME COLORS
   ========================================= */
:root {
    --mha-primary: #0f4c81;        /* Main Blue */
    --mha-secondary: #d4a017;      /* Gold/Accent */
    --mha-text-dark: #2c3e50;
    --mha-text-gray: #6c757d;
    --mha-bg-light: #f8f9fa;
    --mha-bg-card: #ffffff;
    --mha-radius: 12px;
    
    /* Status Colors */
    --status-standing: #198754;    /* Green */
    --status-demolished: #dc3545;  /* Red */
    --status-renovated: #fd7e14;   /* Orange */
}

/* =========================================
   2. LANDMARKS GRID (Archive View)
   ========================================= */
.malkiya-landmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
    direction: rtl; 
}

/* Card Container */
.landmark-card {
    background: var(--mha-bg-card);
    border-radius: var(--mha-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landmark-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.landmark-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image Wrapper */
.landmark-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

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

/* Status Badges */
.landmark-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}

.landmark-status.status-standing { background-color: var(--status-standing); }
.landmark-status.status-demolished { background-color: var(--status-demolished); }
.landmark-status.status-renovated { background-color: var(--status-renovated); }

/* Card Content */
.landmark-info {
    padding: 20px;
    text-align: right;
}

.landmark-area {
    color: var(--mha-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.landmark-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: var(--mha-text-dark);
    line-height: 1.4;
}

.landmark-desc {
    color: var(--mha-text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Button */
.landmark-btn {
    display: inline-block;
    color: var(--mha-primary);
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.landmark-card:hover .landmark-btn {
    color: var(--mha-secondary);
}

/* =========================================
   3. VERTICAL TIMELINE (Single View)
   ========================================= */
.mha-timeline-container {
    margin-top: 40px;
    padding: 30px;
    background: var(--mha-bg-light);
    border-radius: 20px;
    direction: rtl; 
}

.mha-section-title { 
    margin-bottom: 30px; 
    font-size: 1.5rem; 
    color: var(--mha-text-dark);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

/* Timeline Wrapper (The Vertical Line) */
.mha-timeline-wrapper {
    position: relative;
    padding-right: 20px; 
    border-right: 3px solid #dee2e6;
}

.mha-timeline-node {
    position: relative;
    margin-bottom: 40px;
    padding-right: 30px; 
}

/* The Dot - FIXED positioning */
.mha-timeline-point {
    position: absolute;
    right: -28px; /* Adjusted slightly to align better */
    top: 5px;
    width: 16px; 
    height: 16px;
    background: var(--mha-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--mha-primary);
    z-index: 2; /* Ensure it sits on top of the line */
}

.mha-timeline-date {
    display: inline-block;
    background: var(--mha-text-dark);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.mha-timeline-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
}

.mha-node-title { 
    margin: 0 0 10px 0; 
    font-size: 1.2rem; 
    color: var(--mha-text-dark); 
}

.mha-node-desc { 
    font-size: 0.95rem; 
    color: var(--mha-text-gray); 
    line-height: 1.6; 
    margin-bottom: 15px; 
}

/* Gallery Grid */
.mha-node-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); 
    gap: 10px;
    margin-top: 15px;
}

.mha-gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s;
    cursor: zoom-in;
    border: 1px solid #eee;
}

.mha-gallery-item:hover img {
    transform: scale(1.05);
    border-color: var(--mha-primary);
}




/* =========================================
   4. LIGHTBOX STYLES (NEW)
   ========================================= */
#mha-lightbox-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 99999; /* On top of everything */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark overlay */
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* The Image */
#mha-lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    border: 2px solid #fff;
    
    /* Center the image vertically/horizontally */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Close Button */
#mha-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100000;
}

#mha-lightbox-close:hover {
    color: var(--mha-secondary);
}


/* --- Related Archive Gallery Grid --- */
.mha-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Creates the responsive grid */
    gap: 15px;
    margin-top: 20px;
}

.mha-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.mha-gallery-item:hover {
    transform: translateY(-3px);
}

.mha-gallery-item img {
    width: 100%;
    height: 150px; /* Fixed height for uniformity */
    object-fit: cover; /* Ensures image covers the box without stretching */
    display: block;
}

/* Lightbox Trigger Cursor */
.mha-lightbox-trigger {
    cursor: zoom-in;
    display: block;
}