/**
 * Game Foundry - Components Stylesheet
 * 
 * Reusable UI components: buttons, cards, forms, banners.
 * 
 * @author Game Foundry
 * @version 2.0.0
 */


/* =============================================================================
   1. SECTION DIVIDER
   ============================================================================= */

.section-divider {
    height: 2px;
    margin: var(--space-md) auto;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    opacity: 0.35;
}


/* =============================================================================
   2. BUTTONS
   
   Two types of buttons:
   1. Icon buttons (.btn-icon) - circular buttons with icons
   2. Text buttons (.btn-text) - buttons with text labels
   
   Both share the same interactive behaviors (hover, cursor, colors).
   ============================================================================= */

/* Text button*/
.btn-text {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    appearance: none;
    -webkit-appearance: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-black);
    background-color: var(--color-gold);
    color: var(--color-black);
    width: auto;
    align-self: flex-start;
    display: inline-block;
    padding: 1rem 1rem;
    white-space: nowrap;
    text-decoration: none;
    cursor: url("/assets/hammer.cur"), pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-text:hover {
    color: var(--color-gold);
}


/* Circular icon button */
.btn-icon {
    position: relative;
    width: var(--btn-icon-size);
    height: var(--btn-icon-size);
    border-radius: 50%;
    background-color: var(--color-gold);
    border: 1px solid var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    font-size: 1.1rem;
    text-decoration: none;
    font-weight: 700;
    cursor: url("/assets/hammer.cur"), pointer;
    transition: background-color var(--transition-fast);
}

.btn-icon:hover,
.btn-text:hover {
    background-color: var(--color-red);
    animation: btn-shake 0.1s linear;
}

/* Button icon image */
.btn-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    display: block;
    filter: brightness(0); /* Makes icon black */
    transition: filter var(--transition-fast);
}

/* Size-only modifier for icon images on specific buttons */
.btn-icon--img-40 img {
    width: 40%;
    height: 40%;
}

/* Hover state - gold accent (#ffa600) on icon */
.btn-icon:hover img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(54%) saturate(3000%) 
            hue-rotate(360deg) brightness(100%) contrast(105%);
}

/* Disabled state - faded out, non-interactive */
.btn-icon[aria-disabled="true"],
.btn-text:disabled,
.btn-text[aria-disabled="true"] {
    background-color: var(--color-smoke);
    cursor: default;
    pointer-events: none;
    opacity: 0.4;
}

.btn-icon[aria-disabled="true"] img {
    opacity: 0.5;
}


/* =============================================================================
   3. PRIVACY BANNER
   Informational banner that slides up from bottom
   ============================================================================= */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient-coal);
    padding: var(--space-md) 0;
    z-index: 1000;
    transform: translateY(100%); /* Hidden by default */
    transition: transform var(--transition-slow);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5); /* Upward shadow */
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner__content {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-md);
}

.cookie-banner__text {
    flex: 1;
}

.cookie-banner__title {
    margin-bottom: var(--space-sm);
}

.cookie-banner__description {
    font-size: 0.875rem;
    line-height: var(--leading-loose);
}

.cookie-banner__link {
    color: var(--color-gold);
    text-decoration: underline;
}

.cookie-banner__link:hover {
    color: var(--color-gold-dark);
}

.cookie-banner__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex-shrink: 0;
}


/* =============================================================================
   4. GAME CARDS
   Used in games grid section
   ============================================================================= */

.game-card {
    background-color: rgb(var(--color-white) / 0.03);
    border-radius: var(--radius-sm);
    overflow: visible;
    text-align: left;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-drop);
}

@media (hover: hover) and (pointer: fine) {
    .game-card:hover {
        transform: scale(1.05);
    }
}

/* Card Image */
.game-card__image-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
}

.game-card__image-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.game-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optional blur modifier */
.game-card__image--blurred {
    filter: blur(4px);
}

/* Game Logo Overlay */
.game-card__logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 60%;
    max-height: 60%;
    z-index: 1;
    transition: transform var(--transition-base);
}

@media (hover: hover) and (pointer: fine) {
    .game-card:hover .game-card__logo {
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Tags (Pills) */
.game-card__tags {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.game-card__pill {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.game-card__pill--origin {
    background-color: var(--color-gold);
}

.game-card__pill--status {
    background-color: var(--color-blue);
}

/* Card Content - set color once, children inherit */
.game-card__content {
    padding: var(--space-md);
}

/* Title (Serif) */
.game-card__title {
    margin-bottom: var(--space-xs);
}

.game-card__hook {
    margin-bottom: var(--space-sm);
}

/* Meta Info */
.game-card__meta {
    margin-bottom: var(--space-sm);
}

.game-card__meta-label {
    font-weight: var(--font-weight-body-bold);
}

/* Platform Buttons */
.game-card__platforms {
    display: flex;
    gap: var(--space-xs);
}

.game-card__platforms .btn-icon {
    margin-left: 0;
}


/* =============================================================================
   5. FORM INPUTS — shared base
   Structural properties shared across newsletter and contact form inputs.
   Apply .form-input alongside variant-specific classes.
   ============================================================================= */

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

.form-input:focus-visible {
    outline: 4px solid var(--color-white);
    outline-offset: 4px;
}


/* =============================================================================
   6. NEWSLETTER FORM
   ============================================================================= */

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: stretch;
}

.newsletter-form__field {
    flex: 1;
}

.newsletter-form__input {
    color: var(--color-black);
    background-color: rgb(var(--color-black) / 0.08);
    border-color: rgb(var(--color-black) / 0.2);
}

.newsletter-form__input::placeholder {
    color: rgb(var(--color-black) / 0.5);
}

.newsletter-form__input:hover {
    border-color: rgb(var(--color-black) / 0.4);
    background-color: rgb(var(--color-black) / 0.12);
}

.newsletter-form__input:focus {
    
    border-color: var(--color-gold-dark);
    background-color: rgb(var(--color-black) / 0.08);
}

.newsletter-form__success {
    color: var(--color-black);
    text-align: center;
}

.newsletter-form__error {
    color: var(--color-red);
    margin-bottom: var(--space-xs);
}


/* =============================================================================
   6. CONTACT FORM
   ============================================================================= */

.contact-form {
    max-width: var(--content-narrow);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-form__row {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-form__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.contact-form__label {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
}

.contact-form__required {
    color: var(--color-gold);
}

/* Input & Textarea color scheme (dark theme) */
.contact-form__input,
.contact-form__textarea,
.contact-form__select {
    color: var(--color-white);
    background-color: rgb(var(--color-white) / 0.05);
    border-color: rgb(var(--color-white) / 0.15);
    transition: border-color var(--transition-base),
                background-color var(--transition-base),
                box-shadow var(--transition-base);
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
    color: var(--color-smoke);
}

.contact-form__input:hover,
.contact-form__textarea:hover,
.contact-form__select:hover {
    border-color: rgb(var(--color-white) / 0.3);
    background-color: rgb(var(--color-white) / 0.08);
}

.contact-form__input:focus,
.contact-form__textarea:focus,
.contact-form__select:focus {
    border-color: var(--color-gold);
    background-color: rgb(var(--color-gold) / 0.08);
    box-shadow: 0 0 0 3px rgb(var(--color-gold) / 0.15);
}

/* Textarea specific */
.contact-form__textarea {
    resize: vertical;
    min-height: 120px;
}

/* Select wrapper for custom arrow */
.contact-form__select-wrapper {
    position: relative;
}

.contact-form__select {
    appearance: none;
    cursor: url("/assets/hammer.cur"), pointer;
    padding-right: 2.5rem;
}

.contact-form__select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-smoke);
    pointer-events: none;
    font-size: var(--text-sm);
    transition: color var(--transition-base);
}

.contact-form__select:hover + .contact-form__select-arrow,
.contact-form__select:focus + .contact-form__select-arrow {
    color: var(--color-gold);
}

/* Select option styling (limited browser support) */
.contact-form__select option {
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Submit button area */
.contact-form__actions {
    margin-top: var(--space-sm);
}

/* Honeypot field - hidden from users */
.contact-form__honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* Success message */
.contact-form__success {
    background-color: var(--color-green-dark);
    color: var(--color-green);
    
}

.contact-form__success p {
    margin: var(--space-md) 0;
}


/* Error message */
.contact-form__error {
    background-color: var(--color-red-dark);
    color: var(--color-red);
    
}

.contact-form__error p {
    margin: var(--space-md) 0;
}


/* =============================================================================
   7. FORM MESSAGES
   Success/error feedback banners for forms.
   Apply .form-message alongside variant class.
   ============================================================================= */

.form-message {
    max-width: var(--content-narrow);
    margin: 0 auto var(--space-md);
    padding: var(--space-sm);
    border: 1px solid;
    border-radius: var(--radius-sm);
    text-align: center;
    display: block;
}

/* If a form message appears as the last/only child in a container,
   remove its bottom margin so it doesn't add extra space before the
   parent's closing edge. */
.form-message:last-child,
.form-message:only-child {
    margin-bottom: 0;
}

/* =============================================================================
   UTILITIES — Small, reusable helpers for alignment and centering
   Apply these sparingly; they are intended for simple layout tweaks.
   ============================================================================= */

.u-text-left { text-align: left; }
.u-text-center { text-align: center; }
.u-text-right { text-align: right; }

.u-center { display: block; margin-left: auto; margin-right: auto; }

.u-justify-start { justify-content: flex-start; }
.u-justify-center { justify-content: center; }
.u-justify-end { justify-content: flex-end; }

.u-align-start { align-items: flex-start; }
.u-align-center { align-items: center; }
.u-align-end { align-items: flex-end; }

.u-self-start { align-self: flex-start; }
.u-self-center { align-self: center; }
.u-self-end { align-self: flex-end; }



/* =============================================================================
   8. CALLOUT BOX
   Highlighted aside with left border accent. Used for notes, callouts, etc.
   ============================================================================= */

.callout {
    padding: var(--space-sm) var(--space-md);
    background-color: rgb(var(--color-gold) / 0.08);
    border-left: 2px solid var(--color-gold);
    border-radius: var(--radius-sm);
    margin: var(--space-md) 0;
}


/* =============================================================================
   8. SERVICE ITEMS — Used in services section/page
   ============================================================================= */

.service-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgb(var(--color-white) / 0.1);
    text-align: center;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(var(--color-gold) / 0.15);
    border-radius: var(--radius-sm);
}

.service-item__icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(63%) sepia(47%) saturate(456%) 
            hue-rotate(8deg) brightness(93%) contrast(88%);
}

.service-item__content {
    flex: 1;
    min-width: 0;
}

.service-item__description {
    line-height: var(--leading-loose);
}


/* =============================================================================
   9. SPLIT LAYOUT
   Reusable two-column flex layout used by about, community, split-section,
   and services-page item layouts.
   ============================================================================= */

.split-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    align-items: center;
}

.split-layout__col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

/** Fixed-width column — full-width on mobile, fixed on desktop */
.split-layout__col--fixed {
    width: 100%;
    max-width: var(--sidebar-width);
    margin: 0 auto;
}

/** Stretch columns to equal height */
.split-layout--stretch {
    align-items: stretch;
}

/** Tighter gap variant */
.split-layout--compact {
    gap: var(--space-lg);
}

/** Icon list — reusable horizontal list (e.g., social icons) */
.icon-list {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

/** Newsletter column alignment */
.newsletter-col {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/** Newsletter container block */
.newsletter-block {
    width: 100%;
}

/* Section-specific CTA alignment (mobile/default centered) */
.about-preview-section .btn-text.u-self-end {
    align-self: center;
}

#community .newsletter-form .btn-text {
    align-self: center;
}

.contact-section .contact-form__actions {
    text-align: center;
}

/** Section image — reusable image styling for split layouts */
.section-image {
    width: auto;
    height: auto;
    max-height: 200px;
    border-radius: var(--radius-sm);
    display: block;
    object-fit: contain;
    filter: drop-shadow(var(--shadow-drop));
}


/* =============================================================================
   10. RESPONSIVE — DESKTOP ENHANCEMENTS
   Mobile-first: base styles are mobile, desktop overrides below.
   ============================================================================= */

@media (min-width: 769px) {

    /* Split layout — horizontal on desktop */
    .split-layout {
        flex-direction: row;
    }

    .split-layout--reversed {
        flex-direction: row-reverse;
    }

    .split-layout__col {
        text-align: left;
    }

    .split-layout__col--fixed {
        flex: 0 0 var(--sidebar-width);
        width: auto;
        max-width: none;
        margin: 0;
    }

    /* Icon list — align to start on desktop */
    .icon-list {
        justify-content: flex-start;
    }

    /* Newsletter column — align to end on desktop */
    .newsletter-col {
        justify-content: flex-end;
    }

    /* Restore current desktop CTA/button positions in target sections */
    .about-preview-section .btn-text.u-self-end {
        align-self: flex-end;
    }

    #community .newsletter-form .btn-text {
        align-self: flex-start;
    }

    .contact-section .contact-form__actions {
        text-align: center;
    }

    /* Section image — larger on desktop */
    .section-image {
        height: 300px;
        max-height: none;
    }

    /* Service items — horizontal on desktop */
    .service-item {
        flex-direction: row;
        text-align: left;
    }

    /* Newsletter form — horizontal on desktop */
    .newsletter-form {
        flex-direction: row;
        align-items: center;
    }

    /* Privacy banner — horizontal on desktop */
    .cookie-banner {
        padding: var(--space-md);
    }

    .cookie-banner__content {
        flex-direction: row;
        gap: 32px;
        align-items: center;
        padding: 0 var(--space-md);
    }

    .cookie-banner__description {
        font-size: var(--text-base);
    }

    .cookie-banner__actions {
        flex-direction: row;
        gap: var(--space-sm);
    }
}
