/* ==========================================================================
   Itawak Festival — Frontend Styles
   Rock festival theme · Mobile-first · Dark aesthetic
   ========================================================================== */

:root {
    --fest-surface: #ffffff;
    /* --fest-accent: #e63946; */
    --fest-accent: #1f4a2a;
    /* --fest-accent-glow: rgba(230, 57, 70, .25); */
    --fest-accent-glow: #67A65D;
    --fest-text: #1a1a1a;
    --fest-text-muted: #666;
    --fest-radius: 10px;
    --fest-transition: .3s cubic-bezier(.4, 0, .2, 1);
    --fest-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fest-modal-bg: #ffffff;
    --fest-border: #e5e5e5;
}

/* ==========================================================================
   Grid
   ========================================================================== */

.itawak-fest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

@media (min-width: 480px) {
    .itawak-fest-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .itawak-fest-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 24px;
        max-width: 1280px;
    }
}

.itawak-fest-block {
    width: 100%;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.itawak-fest-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--fest-radius);
    background: var(--fest-surface);
    cursor: pointer;
    transition: transform var(--fest-transition), box-shadow var(--fest-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
}

.itawak-fest-card:hover,
.itawak-fest-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12), 0 0 16px var(--fest-accent-glow);
    z-index: 1;
}

.itawak-fest-card:focus-visible {
    outline: 2px solid var(--fest-accent);
    outline-offset: 2px;
}

/* -- Image ---------------------------------------------------------------- */

.itawak-fest-card__img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
}

.itawak-fest-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--fest-transition);
}

.itawak-fest-card:hover .itawak-fest-card__img {
    transform: scale(1.05);
}

.itawak-fest-card__placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: var(--wp--preset--color--contrast-2);
    font-size: 3rem;
}

/* -- Overlay texte -------------------------------------------------------- */

.itawak-fest-card__info {
    margin: 12px 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    max-height: 110px;
}

.itawak-fest-card__name {
    margin: 0;
    font-family: var(--wp--preset--font-family--oswald);
    font-size: clamp(1.2rem, 1.2rem + ((1vw - 0.2rem) * 1.17), 1.45rem);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--fest-text);
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.itawak-fest-card__style {
    margin: 0;
    font-family: var(--wp--preset--font-family--body);
    text-transform: capitalize;
    font-size: .78rem;
    color: var(--wp--preset--color--contrast-2);
    font-weight: 500;
    letter-spacing: .02em;
}

.itawak-fest-card__more {
    margin: 6px 0 0;
    font-family: var(--wp--preset--font-family--body);
    font-size: .75rem;
    color: var(--fest-accent);
    font-weight: 600;
    letter-spacing: .01em;
    transition: color var(--fest-transition);
}

.itawak-fest-card:hover .itawak-fest-card__more {
    text-decoration: underline;
}

@media (min-width: 480px) {
    .itawak-fest-card__style {
        font-size: .82rem;
    }
}

/* ==========================================================================
   Countdown / Hidden day
   ========================================================================== */

.itawak-fest-countdown {
    text-align: center;
    padding: 64px 24px;
    color: var(--fest-text);
    font-family: var(--wp--preset--font-family--oswald);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.itawak-fest-countdown__title {
    font-size: clamp(1.1rem, 1.1rem + ((1vw - 0.2rem) * 1.17), 1.5rem);
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--wp--preset--font-family--oswald);
    margin: 0 0 16px;
}

.itawak-fest-countdown__timer {
    font-size: clamp(1.2rem, 1.2rem + ((1vw - 0.2rem) * 1.17), 1.6rem);
    font-weight: 800;
    color: var(--fest-accent);
    font-variant-numeric: tabular-nums;
    margin: 0 0 16px;
}

.itawak-fest-countdown__date {
    font-size: clamp(1rem, 1rem + ((1vw - 0.2rem) * 1.17), 1.3rem);
    font-family: var(--wp--preset--font-family--oswald);
    font-weight: 600;
    color: var(--wp--preset--color--contrast-2);
    margin: 0;
}

@media (min-width: 480px) {
    .itawak-fest-countdown__timer {
        font-size: clamp(2rem, 2rem + ((1vw - 0.2rem) * 1.17), 2.5rem);
    }
}

/* ==========================================================================
   Modal (<dialog>)
   ========================================================================== */

.itawak-fest-modal {
    border: none;
    background: transparent;
    padding: 0;
    max-width: min(92vw, 720px);
    max-height: 90vh;
    width: 100%;
    overflow: visible;
    color: var(--fest-text);
    font-family: var(--fest-font);
    outline: none;
}

.itawak-fest-modal:focus {
    outline: none;
}

/* Overlay / backdrop */
.itawak-fest-modal::backdrop {
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Inner wrapper — scrollable */
.itawak-fest-modal__content {
    background: var(--fest-modal-bg);
    border-radius: var(--fest-radius);
    overflow-y: auto;
    max-height: 85vh;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

.itawak-fest-modal__content::-webkit-scrollbar {
    width: 6px;
}

.itawak-fest-modal__content::-webkit-scrollbar-track {
    background: transparent;
}

.itawak-fest-modal__content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .15);
    border-radius: 3px;
}

.itawak-fest-modal__content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, .25);
}

/* Close button */
.itawak-fest-modal__close {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--fest-accent);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--fest-transition), background var(--fest-transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}

.itawak-fest-modal__close:hover {
    transform: scale(1.15) rotate(90deg);
    background: var(--fest-accent-glow);
}

/* -- Header (photo) ------------------------------------------------------- */

.itawak-modal__header {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--fest-radius) var(--fest-radius) 0 0;
    background: #111;
}

.itawak-modal__header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.itawak-modal__header-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--fest-modal-bg) 0%, transparent 50%);
}

/* -- Body ----------------------------------------------------------------- */

.itawak-modal__body {
    padding: 20px;
}

.itawak-modal__name {
    margin: 0 0 4px;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.2;
    font-family: var(--wp--preset--font-family--oswald);
}

.itawak-modal__style {
    color: var(--wp--preset--color--contrast-2);
    font-family: var(--wp--preset--font-family--body);
    font-size: .9rem;
    font-weight: 500;
    margin: 0 0 4px;
    letter-spacing: .03em;
}

.itawak-modal__origine {
    color: var(--wp--preset--color--contrast-2);
    font-family: var(--wp--preset--font-family--body);
    font-size: .85rem;
    margin: 0 0 16px;
}

.itawak-modal__description {
    font-size: .92rem;
    line-height: 1.7;
    color: #444;
    margin: 0 0 20px;
}

.itawak-modal__description p {
    margin: 0 0 10px;
}

.itawak-modal__description p:last-child {
    margin-bottom: 0;
}

/* -- Social links --------------------------------------------------------- */

.itawak-modal__socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.itawak-modal__social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f3f3f3;
    border-radius: 999px;
    color: var(--fest-text);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    transition: background var(--fest-transition), color var(--fest-transition);
}

.itawak-modal__social-link:hover {
    background: var(--fest-accent);
    color: #fff;
}

.itawak-modal__social-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

/* -- Albums / Embeds ------------------------------------------------------ */

.itawak-modal__albums-title-section {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0;
}

.itawak-modal__album-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 12px;
}

.itawak-modal__album-year {
    font-size: .85rem;
    color: var(--wp--preset--color--contrast-2);
    font-weight: 400;
}   

.itawak-modal__albums {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.itawak-modal__albums:empty {
    display: none;
}


.itawak-modal__album iframe {
    max-width: 100%;
    display: block;
}


/* ==========================================================================
   Loading spinner
   ========================================================================== */

.itawak-fest-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 0;
    grid-column: -1/1;;
    width: 100%;
}

.itawak-fest-loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, .08);
    border-top-color: var(--fest-accent);
    border-radius: 50%;
    animation: fest-spin .7s linear infinite;
}

@keyframes fest-spin {
    to { transform: rotate(360deg); }
}

/* Modal inner loader */
.itawak-modal__loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ==========================================================================
   Body scroll lock
   ========================================================================== */

body.itawak-fest-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */

/* Card entrance */
@keyframes fest-card-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.itawak-fest-card {
    animation: fest-card-in .4s ease both;
}

/* Stagger delay set via JS inline style */

/* Modal content entrance */
@keyframes fest-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.itawak-fest-modal[open] .itawak-fest-modal__content {
    animation: fest-modal-in .35s ease;
}
