/**
 * MJB Reviews Frontend Styles
 * 
 * This file contains all front-end styles for the Media Junkbox Reviews plugin.
 * The styles are organized into logical sections with detailed comments.
 */

/* ========================
   GLOBAL VARIABLES & SETTINGS
   ======================== */
:root {
    /* Color Scheme */
    --primary-color: #eeeeee;    /* Main accent color */
    --secondary-color: #ffffff;  /* Text and highlights */
    --accent-color: #ddd;        /* Secondary accents and borders */
    --bg-overlay: rgba(0, 0, 0, 0.3); /* Background overlay for contrast */

    /* Spacing System */
    --padding-default: 1rem;     /* Default padding for containers */
    --margin-default: 2rem;      /* Default margin between elements */
    --gap-default: 1rem;         /* Default gap for grid/flex layouts */

    /* Typography */
    --font-size-title: clamp(1.5rem, 2.5vw, 1.8rem); /* Responsive title size */
    --font-size-rating: 1.25rem; /* Rating badge text size */
    --font-size-label: 0.75rem;  /* Small label text size */

    /* Transitions */
    --transition-default: 0.3s ease; /* Default animation timing */
}

/* ========================
   ACCESSIBILITY & BASE STYLES
   ======================== */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 2px;
}

.screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px; 
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ========================
   LAYOUT STRUCTURE
   ======================== */
.mjb-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--padding-default));
}

.mjb-col {
    padding: 0 var(--padding-default);
}

/* ========================
   REVIEW BOX COMPONENTS
   ======================== */
.mjb-review-box {
    position: relative;
    margin-bottom: var(--margin-default);
	margin-top:10px;
    border-radius: 6px;
    overflow: hidden;
    color: var(--secondary-color);
    background-color: var(--bg-overlay);
    animation: fadeIn 0.5s ease-in-out;
}

.mjb-review-box__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: 1;
    will-change: transform, filter;
}

.mjb-review-box__overlay {
    position: relative;
    z-index: 2;
    background-color: var(--bg-overlay);
    padding: var(--padding-default);
    border-radius: inherit;
}

/* ========================
   TYPOGRAPHY & TEXT STYLES
   ======================== */
.mjb-review-title {
    color: var(--secondary-color);
    font-size: var(--font-size-title);
    margin-bottom: 0.5em;
    width: 100%;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    padding: 0 0 0 0.3125rem;
}

.mjb-review-title:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ========================
   MEDIA & THUMBNAILS
   ======================== */
.mjb-album-review-before-box .mjb-thumbnail {
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    width: 150px;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mjb-album-review-before-box .mjb-thumbnail:hover {
    transform: scale(1.05);
}

/* ========================
   RATING BADGES
   ======================== */
.mjb-archive-badge {
    position: absolute;
    top: 10%;
    right: 0;
    transform: translateY(-10%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

.mjb-rating-badge {
    display: inline-block;
    padding: 0.5em 0.75em;
    border-radius: 4px 0 0 4px;
    color: var(--secondary-color);
    font-weight: bold;
    text-align: center;
    min-width: 60px;
    box-sizing: border-box;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease-in-out;
}

.mjb-rating-badge:hover {
    transform: translateY(-5%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.mjb-rating-badge__rating {
    font-size: var(--font-size-rating);
    line-height: 1em;
}

.mjb-rating-badge__label {
    font-size: var(--font-size-label);
    margin-top: 0.2em;
}

/* ========================
   EMBEDS & EXTERNAL CONTENT
   ======================== */
.mjb-review-box__embed {
    margin-top: var(--margin-default);
}

.mjb-spotify-embed iframe {
    width: 100%;
    height: 380px;
    border: none;
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */
@media (max-width: 48em) {
    .mjb-row {
        flex-direction: column;
    }

    .mjb-col {
        padding: 0;
    }
    
    .mjb-review-details-col {
        padding: 1rem;
        width: 100%;
    }
    
    .mjb-review-box__overlay {
        padding: 1.5rem;
    }

    .mjb-album-review-before-box .mjb-thumbnail {
        width: 100px;
        height: 100px;
    }

    .mjb-live-review-box .mjb-review-details {
        padding: 0.5rem 0.5rem 0.5rem 0.3125rem !important;
    }
    
    .mjb-live-review-box .mjb-review-details p {
        width: 100% !important;
        margin: 0 0 0.5rem !important;
        padding: 0 0 0 0.3125rem !important;
    }

    .mjb-archive-badge {
        top: 10%;
        right: 0;
        transform: translateY(-10%);
    }
    
    .mjb-review-content {
        padding: 1.5rem;
    }
}

@media (max-width: 30em) {
    .mjb-review-box__overlay {
        padding: 1rem;
    }
    
    .mjb-review-details-col {
        padding: 0.75rem;
        width: 100%;
    }

    .mjb-review-title {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }
    
    .mjb-review-content {
        padding: 1.5rem;
    }
    
    .mjb-live-review-box .mjb-review-details {
        padding: 1rem !important;
    }
    
    .mjb-live-review-box .mjb-review-details p {
        padding: 0 1rem !important;
        width: 100% !important;
        margin: 0 0 0.5rem !important;
    }

    .mjb-rating-badge {
        font-size: 0.9rem;
        padding: 0.4em 0.6em;
    }
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
