/* =========================================
   1. CORE WRAPPER & IMAGE HANDLING
   ========================================= */
.ptrans-hero-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #000;
    margin-bottom: 0;
    cursor: pointer;
    text-decoration: none;
    
    /* Default Variables */
    --ptrans-accent: #e3753a;
    --ptrans-text: #ffffff;
}

/* Image Layer */
.ptrans-img-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.ptrans-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease-in-out;
    display: block;
}

/* Dark Overlay */
.ptrans-overlay-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    transition: opacity 0.3s;
}

/* Hover Scaling */
.ptrans-hero-wrapper:hover .ptrans-hero-img {
    transform: scale(1.05);
}

/* =========================================
   2. REVEAL LAYOUTS (Standard & Center)
   ========================================= */

.ptrans-hero-wrapper.hero-reveal,
.ptrans-hero-wrapper.hero-reveal-center {
    justify-content: center;
    padding: 0 10%;
}

.reveal-content {
    position: relative;
    z-index: 2;
    color: var(--ptrans-text);
}

.title-wrapper {
    display: flex;
    align-items: center; 
}

/* The Vertical Line */
.reveal-line {
    width: 8px;
    background-color: var(--ptrans-accent);
    height: 1.2em; /* Scales with font */
    min-height: 80px;
    margin-right: 20px;
    flex-shrink: 0;
    
    /* Animation Start State */
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
}

/* The Text Mask */
.text-mask {
    overflow: hidden;
    padding: 10px 0;
}

/* The Title */
.hero-title {
    font-size: 5rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--ptrans-text);
    
    /* Animation Start State */
    opacity: 0;
    transform: translateX(-105%); 
}

.hero-title .text-highlight {
    color: var(--ptrans-accent);
}

/* Subtext */
.hero-subtext {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    
    /* Animation Start State */
    opacity: 0;
    transform: translateY(20px);
}

/* --- ANIMATION TRIGGERS --- */
/* Only animate when the JS adds .ptrans-view-active */
.ptrans-hero-wrapper.ptrans-view-active .reveal-line {
    animation: lineGrow 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards 0.2s;
}

.ptrans-hero-wrapper.ptrans-view-active .hero-title {
    animation: slideOut 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards 0.4s;
}

.ptrans-hero-wrapper.ptrans-view-active .hero-subtext {
    animation: fadeUp 0.8s ease forwards 0.8s;
}

/* --- CENTERED VARIATION --- */
.ptrans-hero-wrapper.hero-reveal-center {
    align-items: center;
    text-align: center;
}

.ptrans-hero-wrapper.hero-reveal-center .reveal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ptrans-hero-wrapper.hero-reveal-center .hero-subtext {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   3. SDG CARD LAYOUT
   ========================================= */

.ptrans-hero-wrapper.hero-card {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    /* For card layout, ensure we use flex to position bottom */
    justify-content: flex-end; 
    padding: 0; 
}

.hero-card .sdg-card__content {
    position: relative; /* Changed from absolute to flow naturally in flex */
    width: 100%;
    padding: 30px;
    z-index: 10;
    color: var(--ptrans-text);
    text-align: left;
}

/* Tag / Pill */
.sdg-tag {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--ptrans-text);
    
    opacity: 0;
    transform: translateY(20px);
}

.hero-card:hover .sdg-tag {
    border-color: var(--ptrans-accent);
    color: var(--ptrans-accent);
    background: rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* Title */
.sdg-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--ptrans-text);

    opacity: 0;
    transform: translateY(20px);
}

/* Accent Line */
.sdg-accent-line {
    width: 0;
    height: 4px;
    background-color: var(--ptrans-accent);
    margin-top: 15px;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-card:hover .sdg-accent-line {
    width: 80px;
}

/* --- CARD ANIMATIONS --- */
.ptrans-hero-wrapper.ptrans-view-active .sdg-tag {
    animation: fadeUp 0.8s ease forwards;
}

.ptrans-hero-wrapper.ptrans-view-active .sdg-title {
    animation: fadeUp 0.8s ease forwards 0.2s;
}

/* =========================================
   4. ANIMATION KEYFRAMES
   ========================================= */

@keyframes slideOut {
    from { transform: translateX(-105%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes lineGrow {
    from { transform: scaleY(0); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   5. MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 767px) {
    
    .ptrans-hero-wrapper.hero-reveal,
    .ptrans-hero-wrapper.hero-reveal-center {
        padding: 0 20px;
        align-items: center;
        text-align: center;
    }

    .reveal-content {
        align-items: center;
        width: 100%;
    }

    .title-wrapper {
        justify-content: center;
    }

    /* Reduce font size */
    .hero-title {
        font-size: 2.5rem; 
        text-align: center;
    }

    /* Hide the side line on mobile to prevent weirdness */
    .reveal-line {
        display: none;
    }

    .hero-subtext {
        font-size: 1rem;
        text-align: center;
    }

    /* Card Mobile */
    .hero-card .sdg-card__content {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
        padding-bottom: 40px;
    }

    .sdg-title {
        font-size: 2rem;
    }

    .sdg-accent-line {
        margin-left: auto;
        margin-right: auto;
    }
}