/* Fonts - MosesText */
@font-face {
    font-family: 'MosesText';
    src: url('fonts/MosesText_1.03VF.woff2') format('woff2-variations'),
         url('fonts/MosesText_1.03VF.woff2') format('woff2'),
         url('fonts/MosesText_1.03VF.woff') format('woff'),
         url('fonts/MosesText_1.03VF.ttf') format('truetype');
    font-weight: 100 1000;
    font-style: normal;
}

@font-face {
    font-family: 'MosesDisplay';
    src: url('fonts/MosesText_1.03VF.woff2') format('woff2-variations'),
         url('fonts/MosesText_1.03VF.woff2') format('woff2'),
         url('fonts/MosesText_1.03VF.woff') format('woff'),
         url('fonts/MosesText_1.03VF.ttf') format('truetype');
    font-weight: 100 1000;
    font-style: normal;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MosesText', Arial, sans-serif;
    direction: ltr; /* LTR for English */
    background-color: #ffffff;
}

/* Memorial Widget Container */
.memorial-widget {
    width: 610px;
    height: 224px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Section Headers (Top & Bottom Bars) */
.section-header {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
}

.section-header-top {
    background-color: #0c1c3a;
    color: #ffffff;
}

.section-header-bottom {
    display: none; /* Hide bottom bar */
}

/* Header Left/Right */
.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* More Link */
.more-link {
    font-family: 'MosesText', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: inherit;
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-position: from-font;
}

.text-mobile {
    display: none;
}

/* Title & Count */
.title-count {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
    line-height: 20px;
    text-align: left; /* LTR */
    white-space: nowrap;
}

.title-text {
    font-family: 'MosesText', sans-serif;
    font-weight: 670;
}

.count-number {
    font-family: 'MosesDisplay', sans-serif;
    font-weight: 670;
}

/* Icon Group */
.icon-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

.header-icon {
    width: 13px;
    height: 22px;
    /* transform: scaleY(-1); Remove flip if icon is directional? Or keep it? 
       The icon is a candle/flame usually. Flipping Y is vertical. 
       Let's keep it as is. */
    transform: scaleY(-1);
}

/* Chevron Icon */
.chevron-icon {
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chevron-icon img {
    width: 100%;
    height: 100%;
}

/* Main Container */
.main-container {
    height: 131px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    overflow: hidden;
}

/* Image Container (Slider) */
.image-container {
    background-color: #ffffff;
    height: 131px;
    overflow: hidden;
    flex: 1;
    position: relative;
    padding: 15px 0 9px 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: block; 
}

.slider-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    height: 107px;
    transition: transform 0.5s ease;
    will-change: transform;
    direction: ltr; /* Always LTR for slider logic */
}

.slider-image {
    width: 110px;
    height: 107px;
    object-fit: cover;
    flex-shrink: 0;
}

.slider-image.wide {
    width: 110px;
}

/* Divider Line */
.divider-line {
    width: 12px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex-shrink: 0;
}

.divider-line img {
    width: 110px;
    height: 2px;
    transform: rotate(90deg);
    object-fit: cover;
}

/* Details and Image Container */
.details-image-container {
    background-color: #ffffff;
    display: flex;
    flex-direction: row; /* LTR: Image (Left), Details (Right) */
    align-items: flex-start;
    gap: 10px;
    padding: 15px 12px 8px 0; /* Mirrored padding: Right 12px, Left 0, Top 15px, Bottom 8px */
    flex-shrink: 0; 
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Details Container */
.details-container {
    width: 113px; /* Fixed width from Figma */
    height: 107px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* LTR: Align left */
    justify-content: space-between;
}

/* Details Content */
.details-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.name-container {
    display: flex;
    align-items: flex-start;
}

.person-name {
    font-family: 'MosesText', sans-serif;
    font-size: 18px;
    font-weight: 670;
    line-height: 19px;
    color: #000000;
    text-align: left; /* LTR */
    white-space: nowrap;
}

.person-age {
    font-family: 'MosesText', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 14px;
    color: #000000;
    text-align: left; /* LTR */
    white-space: nowrap;
    width: 100%;
}

.person-details {
    font-family: 'MosesText', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
    color: #000000;
    text-align: left; /* LTR */
    white-space: pre-wrap;
    width: 100%;
}

/* Counter Badge */
.counter-badge {
    background-color: #d4d5d9;
    width: 100%;
    padding: 2px 0;
    height: 20px; /* Fixed height from Figma */
    display: flex;
    align-items: center;
}

.counter-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    height: 100%;
}

.counter-text {
    font-family: 'MosesText', sans-serif;
    font-weight: 670;
    color: #000000;
    text-align: left; /* LTR */
    white-space: nowrap;
    margin-left: -4px; /* Mirrored margin: Left -4px */
    margin-right: 0;
    display: flex;
    align-items: baseline;
    width: 82px; 
    gap: 3px;
}

.counter-word {
    font-size: 13px;
    line-height: 13px;
}

.counter-number {
    font-size: 14px;
    line-height: 14px;
}

.counter-icon {
    width: 16px;
    height: 16px;
    overflow: hidden;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.counter-icon img {
    width: 100%;
    height: 100%;
}

/* Fixed Image */
.fixed-image-wrapper {
    width: 110px;
    height: 107px;
}

.fixed-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Responsive (Up to 609px) */
@media (max-width: 609px) {
    .memorial-widget {

    .header-icon {
        width: 13px;
        height: 22px;
    }
        width: 100%;
        min-width: 100%;
        height: 151px;
        margin: 0 auto;
    }
    
    /* Main container changes to vertical layout */
    .main-container {
        flex-direction: row;
        gap: 0;
        height: 121px;
    }
    
    /* Image slider becomes narrower */
    .image-container {
        width: 178px; 
        overflow: hidden;
        padding: 8px 4px;
        direction: ltr; 
    }
    
    .slider-track {
        gap: 4px;
        padding: 0;
        direction: ltr; 
    }
    
    .slider-image {
        width: 83px;
        height: 105px;
    }
    
    .slider-image.wide {
        width: 83px;
    }
    
    /* Divider adjusts */
    .divider-line {
        height: 105px;
        width: 12px;
    }
    
    .divider-line img {
        width: 105px;
        height: 2px;
    }
    
    /* Details section gets wider to fit content perfectly */
    .details-image-container {
        width: 200px;
        padding: 8px;
        gap: 5px;
    }
    
    .details-container {
        width: 96px;
        height: 105px;
    }

    .details-content {
        gap: 0;
    }
    
    .person-name {
        font-size: 16px;
        line-height: 16px;
    }
    
    .person-details {
        font-size: 11px;
    }
    
    .counter-text {
        font-size: 12px;
        line-height: 12px;
        padding-right: 7px; /* Mirrored padding: Right 7px */
        padding-left: 0;
        width: auto; 
    }

    .counter-container {
        padding-right: 0; /* Mirrored */
        padding-left: 0;
        gap: 2px; 
    }
    
    .counter-text strong {
        font-size: 13px;
        line-height: 13px;
    }
    
    .counter-icon {
        width: 14px;
        height: 14px;
    }
    
    .fixed-image-wrapper {
        width: 83px;
        height: 105px;
    }
    
    .text-desktop {
        display: none;
    }

    .text-mobile {
        display: inline;
    }
}

/* Tablet Responsive (611px - 1024px) */
@media (min-width: 611px) and (max-width: 1024px) {
    .memorial-widget {
        width: 100%;
        height: 387px; /* Adjusted height from Figma */
    }

    /* Section Headers */
    .section-header {
        height: 45px;
        min-height: 45px;
        max-height: 45px;
        padding: 4px 10px;
    }

    .header-icon {
        width: 19px;
        height: 32px;
    }

    .header-right {
        gap: 5px;
    }

    .title-count {
        font-size: 20px;
        line-height: 43px;
    }

    .more-link {
        font-size: 20px;
        line-height: 45px;
    }

    /* Main Container */
    .main-container {
        height: 297px;
    }

    /* Image Container */
    .image-container {
        height: 100%;
        padding: 20px 15px;
    }

    .slider-track {
        gap: 15px;
        padding: 0;
        height: 257px;
    }

    .slider-image {
        width: 234px;
        height: 257px;
    }

    .slider-image.wide {
        width: 234px;
    }

    /* Divider */
    .divider-line {
        height: 262px;
    }
    
    .divider-line img {
        width: 262px;
    }

    /* Details Section */
    .details-image-container {
        padding: 20px 10px 20px 0; /* Mirrored padding */
        gap: 10px;
        width: 404px; /* Fixed width for details part */
    }

    .fixed-image-wrapper {
        width: 234px;
        height: 257px;
    }

    .details-container {
        width: 160px;
        height: 257px;
        justify-content: space-between;
    }

    .person-name {
        font-size: 27px;
        line-height: 28px;
    }

    .person-age {
        font-size: 22px;
        line-height: 24px;
    }

    .person-details {
        font-size: 20px;
        line-height: 24px;
    }

    .counter-badge {
        height: 26px;
    }

    .counter-text {
        font-size: 18px;
        line-height: 20px;
        width: auto;
        padding-right: 5px; /* Mirrored padding */
        padding-left: 0;
    }
    
    .counter-container {
        padding: 0;
    }
    
    .counter-word, .counter-number {
        font-size: 18px;
        line-height: 20px;
    }
    
    .counter-icon {
        width: 22px;
        height: 22px;
    }
}

/* Mobile Web (640px) */
@media (min-width: 640px) and (max-width: 640px) {
    .memorial-widget {
        width: 100%;
        height: 250px;
        overflow: hidden; /* Prevent scroll */
    }

    .section-header {
        height: 55px;
        min-height: 55px;
        max-height: 55px;
    }

    .header-icon {
        width: 19px;
        height: 32px;
    }

    .title-count {
        font-size: 26px;
        line-height: 55px;
    }

    .more-link {
        font-size: 20px;
        line-height: 55px;
    }

    .main-container {
        height: 195px;
        overflow: hidden; /* Prevent scroll */
    }

    .details-image-container {
        padding: 15px 10px 15px 0;
        gap: 10px;
        width: 320px; /* Fixed width for details part */
        flex-shrink: 0;
    }

    .fixed-image-wrapper {
        width: 150px;
        height: 165px;
    }

    .details-container {
        width: 160px;
        height: 165px;
    }

    .person-name {
        font-size: 25px;
        line-height: 28px;
    }

    .person-age {
        font-size: 17px;
        line-height: 20px;
    }

    .person-details {
        font-size: 18px;
        line-height: 20px;
    }

    .counter-badge {
        height: 26px;
    }

    .counter-icon {
        width: 22px;
        height: 22px;
    }

    .counter-text {
        font-size: 18px;
        line-height: 20px;
        width: auto;
    }

    .counter-container {
        padding: 0;
    }

    .counter-word, .counter-number {
        font-size: 18px;
        line-height: 20px;
    }

    .divider-line {
        height: 158px;
    }
    
    .divider-line img {
        width: 158px;
    }

    .image-container {
        padding: 15px 10px;
        flex: 1;
        min-width: 0; /* Allow shrinking */
    }

    .slider-track {
        height: 165px;
        gap: 15px;
    }

    .slider-image {
        width: 150px;
        height: 165px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Backgrounds */
    body, 
    .memorial-widget, 
    .main-container, 
    .image-container, 
    .details-image-container,
    .slider-track {
        background-color: #3e3e3e;
    }

    /* Section Headers */
    .section-header-top {
        background-color: #0c1c3a;
        color: #ffffff;
    }

    /* Text Colors */
    .person-name, 
    .person-age, 
    .person-details,
    .counter-text,
    .more-link {
        color: #ffffff;
    }

    /* Counter Badge */
    .counter-badge {
        background-color: #25262b;
    }
    
    /* Icons that need to be white */
    .divider-line img,
    .chevron-icon img {
        filter: brightness(0) invert(1);
    }
}