/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

@font-face {
    font-family: 'Peniel';
    src: url('../font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #3a6042;
    --green: #3a6042;
    --green-light: #6bab55;
    --yellow: #fac04f;
    --orange: #7f3d09;
    --secondary-color: #fac04f;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    --warm-overlay: rgba(58, 96, 66, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: url('../assets/images/background-forest.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, rgba(58, 96, 66, 0.5) 0%, rgba(0, 0, 0, 0.55) 40%, rgba(127, 61, 9, 0.2) 100%);
    z-index: -1;
}

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

ul {
    list-style: none;
}

/* Header & Navigation */
header {
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(58, 96, 66, 0.25);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

a.logo {
    display: inline-block;
    cursor: pointer;
}

a.logo:hover {
    color: var(--text-color);
}

a.logo:hover span {
    color: var(--yellow);
}

.logo span {
    color: var(--green-light);
}

nav ul {
    display: flex;
    gap: 20px;
}

nav a {
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
}

nav a:hover, nav a.active {
    color: var(--yellow);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    width: 100%;
    margin: 20px 0;
}

/* Pagini cu iframe RaceHub – mai puțin spațiu lateral, container mai lat */
main.main--wide-iframe {
    padding-left: 2%;
    padding-right: 2%;
}

.glass-container--wide {
    max-width: 1400px;
    padding: 40px 24px;
}

@media (min-width: 1400px) {
    main.main--wide-iframe {
        padding-left: 1.25%;
        padding-right: 1.25%;
    }

    .glass-container--wide {
        max-width: min(1440px, 97vw);
    }
}

h1, h2, h3 {
    margin-bottom: 20px;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
    text-align: center;
}

h1 span {
    color: var(--primary-color);
}

/* Hero title homepage – PENIEL white, TRAIL RUN green, 2 orange, font custom */
.hero-title {
    font-family: 'Peniel', 'Poppins', sans-serif;
}
.hero-title .hero-peniel { color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.3); }
.hero-title .hero-trailrun { color: var(--green-light); font-weight: 700; }
.hero-title .hero-two { color: var(--orange); font-weight: 700; margin-left: 2px; }
.hero-title .hero-location { color: var(--yellow); font-weight: 600; }
.hero-location { color: var(--yellow) !important; font-weight: 600; }

p {
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    transition: transform 0.3s ease, background 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #4a7a52;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(58, 96, 66, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--yellow);
    color: var(--yellow);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: var(--yellow);
    color: #2d2d2d;
    box-shadow: 0 6px 20px rgba(250, 192, 79, 0.35);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-left: 10px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.hero-buttons .btn {
    margin-left: 0;
}

.gallery-link {
    margin-top: 20px;
    font-size: 0.95rem;
}

.gallery-link a {
    color: var(--yellow);
    transition: opacity 0.2s ease;
}

.gallery-link a:hover {
    opacity: 0.9;
}

.gallery-link i {
    margin-right: 6px;
}

/* RaceHub iframe pages */
.iframe-fallback {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.iframe-fallback a {
    color: var(--yellow);
}

.iframe-fallback a:hover {
    text-decoration: underline;
}

/* Dropdown mărimi tricou (register) */
.sizes-dropdown {
    margin-bottom: 20px;
}

.sizes-dropdown__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(58, 96, 66, 0.35);
    border: 1px solid rgba(250, 192, 79, 0.35);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sizes-dropdown__toggle:hover {
    background: rgba(58, 96, 66, 0.5);
    border-color: var(--yellow);
}

.sizes-dropdown__toggle[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.sizes-dropdown__toggle span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sizes-dropdown__chevron {
    transition: transform 0.25s ease;
}

.sizes-dropdown__toggle[aria-expanded="true"] .sizes-dropdown__chevron {
    transform: rotate(180deg);
}

.sizes-dropdown__panel {
    padding: 0;
    margin: 0;
    background: #fff;
    border: 1px solid rgba(250, 192, 79, 0.35);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.sizes-dropdown__panel img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.iframe-light-wrap {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.racehub-iframe {
    display: block;
    border-radius: 8px;
    min-height: 1200px;
    filter: brightness(1.08) contrast(1.03);
}

/* Link către proiectul centrului (hero index) */
.hero-cause-link {
    text-decoration: underline;
    text-decoration-color: rgba(250, 192, 79, 0.55);
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.hero-cause-link:hover {
    color: var(--yellow);
    text-decoration-color: var(--yellow);
}

/* Pagina construcție / centru multifuncțional */
.constructie-page {
    max-width: 960px;
}

.constructie-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto 36px;
}

.constructie-gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: zoom-in;
}

.constructie-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.constructie-lightbox[hidden] {
    display: none;
}

.constructie-lightbox__close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 2501;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.constructie-lightbox__close:hover {
    background: rgba(250, 192, 79, 0.25);
    border-color: rgba(250, 192, 79, 0.45);
    color: var(--yellow);
}

.constructie-lightbox__img {
    max-width: 100%;
    max-height: calc(100vh - 88px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    cursor: default;
    pointer-events: none;
}

.constructie-quote {
    margin: 0 0 28px;
    padding: 1.35rem 1.5rem 1.35rem 1.35rem;
    border-left: 4px solid var(--yellow);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    text-align: left;
}

.constructie-quote p {
    margin-bottom: 1rem;
}

.constructie-quote p:last-of-type {
    margin-bottom: 0.75rem;
}

.constructie-quote footer {
    font-style: normal;
    font-weight: 600;
    color: var(--green-light);
    font-size: 0.95rem;
}

.constructie-page-actions {
    text-align: center;
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* Donate page */
.donate-intro {
    font-size: 1.15rem;
    margin-top: 24px;
}

.donate-details {
    margin: 28px 0;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.donate-details h3 {
    margin-bottom: 16px;
    color: var(--yellow);
}

.donate-iban {
    list-style: none;
    margin: 0;
    padding: 0;
}

.donate-iban li {
    margin-bottom: 12px;
    font-size: 1.05rem;
    word-break: break-all;
}

.donate-iban strong {
    display: inline-block;
    min-width: 3.5rem;
    color: var(--green-light);
}

/* Countdown */
.countdown-wrapper {
    margin: 14px 0;
    padding: 24px 32px;
    background: rgba(58, 96, 66, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(250, 192, 79, 0.25);
    border-radius: 16px;
    display: inline-block;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.countdown-block {
    text-align: center;
    min-width: 72px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(250, 192, 79, 0.2);
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.countdown-block:hover {
    background: rgba(250, 192, 79, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(250, 192, 79, 0.2);
}

.countdown-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--yellow);
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.countdown-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.85;
    margin-top: 4px;
}

/* Despre eveniment */
#despre-eveniment .lead {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 24px;
}

#despre-eveniment .event-meta {
    margin-top: 28px;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

#despre-eveniment .tagline {
    font-weight: 600;
    color: var(--green-light);
    margin-bottom: 0;
}

/* Regulament */
.regulament h2 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: var(--yellow);
}

.regulament h2:first-of-type {
    margin-top: 0;
}

.reg-list {
    list-style: disc;
    margin-left: 24px;
    margin-bottom: 16px;
}

.reg-list li {
    margin-bottom: 6px;
}

.regulament a {
    color: var(--yellow);
}

.regulament a:hover {
    text-decoration: underline;
}

/* Tricou section */
.tricou-section h2 {
    text-align: center;
    margin-bottom: 24px;
}

.tricou-images {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
}

.tricou-images figure {
    margin: 0;
    text-align: center;
    max-width: 320px;
}

.tricou-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.tricou-images figcaption {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--yellow);
    font-weight: 500;
}

@media (max-width: 768px) {
    .tricou-images {
        flex-direction: column;
        align-items: center;
    }
}

/* Grid Layout for Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(58, 96, 66, 0.15);
    border-color: rgba(250, 192, 79, 0.3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.5rem;
    color: var(--yellow);
}

/* Footer */
footer {
    background: linear-gradient(180deg, rgba(58, 96, 66, 0.4) 0%, rgba(0, 0, 0, 0.85) 100%);
    padding: 40px 5%;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(250, 192, 79, 0.15);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-info h3 {
    color: var(--yellow);
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.footer-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(250, 192, 79, 0.35);
    color: var(--yellow);
    font-size: 1.2rem;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.footer-social__link:hover {
    background: rgba(250, 192, 79, 0.2);
    color: #fff;
    transform: translateY(-3px);
}

/* Pagina Organizatori */
.organizer-carousel {
    margin-top: 28px;
}

.organizer-carousel__nav {
    display: none;
}

.organizer-carousel__viewport {
    overflow: visible;
    width: 100%;
    position: relative;
}

.organizer-carousel__track {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.organizer-carousel__slide {
    width: 100%;
    flex-shrink: 0;
}

.organizer-carousel__slide:first-child .organizer-card {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.organizer-carousel__slide:not(:first-child) .organizer-card {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.organizer-card {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 32px;
    align-items: start;
}

.organizer-card--reverse {
    grid-template-columns: 1fr minmax(220px, 320px);
}

.organizer-card--reverse .organizer-card__photo {
    grid-column: 2;
    grid-row: 1;
}

.organizer-card--reverse .organizer-card__body {
    grid-column: 1;
    grid-row: 1;
}

.organizer-card__photo img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.organizer-card__body h2 {
    margin-bottom: 16px;
    color: var(--yellow);
    font-size: 1.5rem;
}

.organizer-card__body p:last-child {
    margin-bottom: 0;
}

@media (min-width: 769px) {
    .organizer-carousel__track {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .organizer-carousel {
        margin-top: 20px;
    }

    .organizer-carousel__nav {
        display: flex;
        position: absolute;
        z-index: 2;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 44px;
        padding: 0;
        top: 30%;
        transform: translateY(-50%);
        font-size: 1rem;
        color: var(--yellow);
        background: rgba(58, 96, 66, 0.85);
        border: 1px solid rgba(250, 192, 79, 0.5);
        border-radius: 10px;
        cursor: pointer;
        transition: background 0.2s ease, opacity 0.2s ease;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    }

    .organizer-carousel__nav--prev {
        left: 6px;
    }

    .organizer-carousel__nav--next {
        left: auto;
        right: 6px;
    }

    .organizer-carousel__nav:hover:not(:disabled) {
        background: rgba(58, 96, 66, 0.95);
    }

    .organizer-carousel__nav:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .organizer-carousel__viewport {
        overflow: hidden;
    }

    .organizer-carousel__track {
        flex-direction: row;
        transition: transform 0.35s ease;
        will-change: transform;
    }

    .organizer-carousel__slide {
        flex: 0 0 100%;
        min-width: 100%;
    }

    .organizer-carousel__slide:not(:first-child) .organizer-card {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    .organizer-card,
    .organizer-card--reverse {
        grid-template-columns: 1fr;
    }

    .organizer-card--reverse .organizer-card__photo,
    .organizer-card--reverse .organizer-card__body {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-trailrun-line {
        display: block;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .countdown-wrapper {
        padding: 18px 16px;
    }

    .countdown-value {
        font-size: 1.85rem;
    }

    .countdown-block {
        min-width: 62px;
        padding: 10px 12px;
    }
    header {
        padding: 15px 5%;
    }

    .menu-toggle {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: linear-gradient(180deg, rgba(58, 96, 66, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        border-top: 1px solid rgba(250, 192, 79, 0.2);
    }

    nav ul.active {
        left: 0;
    }

    nav a {
        font-size: 1.2rem;
    }

    h1 {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}
