/* ==========================================================================
   Fodder Comic Carousel — carousel.css
   Theme: Dungeon dark nav with stone/tan icons and Gop-green hover accents.
   Inherits WordPress theme fonts/colors for all non-nav elements.
   ========================================================================== */

/* --- Fodder brand tokens ------------------------------------------------ */
:root {
    --fcc-nav-bg:        #2a1f14;
    --fcc-nav-border:    #3d2e1e;
    --fcc-icon-color:    #c4b49a;
    --fcc-icon-hover:    #7ab84e;
    --fcc-icon-active:   #5a8a3c;
    --fcc-btn-hover-bg:  #3d2e1e;
    --fcc-btn-radius:    6px;
    --fcc-btn-size:      44px;
}

/* --- Wrapper ------------------------------------------------------------ */

.fcc-carousel-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto 2em;
    box-sizing: border-box;
    outline: none;
}

/* Fullscreen mode */
.fcc-carousel-wrap.fcc-is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: hidden;
}

/* --- Top bar ------------------------------------------------------------ */

.fcc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4em 12px 0.5em;
    gap: 0.5em;
    background: var(--fcc-nav-bg);
    border-bottom: 1px solid var(--fcc-nav-border);
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
}

.fcc-page-title {
    color: var(--fcc-icon-color);
    font-size: 0.95em;
    font-weight: 600;
}

.fcc-page-title {
    font-size: 1em;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.fcc-stage {
    position: relative;
    width: 100%;
    line-height: 0;
    background: #111;
}

.fcc-is-fullscreen .fcc-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fcc-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.fcc-is-fullscreen .fcc-image {
    width: auto;
    max-width: 100%;
    max-height: 100%;
}

/* Loading indicator */
.fcc-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.15s;
    color: #fff;
    background: rgba(0,0,0,0.4);
}

.fcc-loading.fcc-hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Caption ------------------------------------------------------------ */

.fcc-caption {
    padding: 0.5em 0 0.25em;
    font-size: 0.92em;
    font-style: italic;
    line-height: 1.55;
    min-height: 1.5em;
    opacity: 0.85;
}

.fcc-caption:empty {
    display: none;
}

/* --- Navigation bar ----------------------------------------------------- */

.fcc-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--fcc-nav-bg);
    border-radius: 0 0 6px 6px;
    border-top: 1px solid var(--fcc-nav-border);
}

/* Nav buttons */
.fcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--fcc-btn-size);
    height: var(--fcc-btn-size);
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--fcc-btn-radius);
    background: transparent;
    color: var(--fcc-icon-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.fcc-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.fcc-btn:hover {
    background: var(--fcc-btn-hover-bg);
    color: var(--fcc-icon-hover);
    border-color: var(--fcc-nav-border);
}

.fcc-btn:focus-visible {
    outline: 2px solid var(--fcc-icon-hover);
    outline-offset: 2px;
}

.fcc-btn:active {
    color: var(--fcc-icon-active);
}

.fcc-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.fcc-btn:disabled:hover {
    background: transparent;
    color: var(--fcc-icon-color);
    border-color: transparent;
}

/* Spacer pushes fullscreen button to the far right */
.fcc-nav-spacer {
    flex: 1;
}

/* Jump-to input group */
.fcc-jump-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px;
}

.fcc-jump-input {
    width: 52px;
    height: var(--fcc-btn-size);
    text-align: center;
    font-size: 0.95em;
    font-weight: 600;
    padding: 0 6px;
    border: 1px solid #4a3828;
    border-radius: var(--fcc-btn-radius);
    background: #1a1208;
    color: var(--fcc-icon-color);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.fcc-jump-input:focus {
    outline: none;
    border-color: var(--fcc-icon-hover);
    color: #fff;
}

/* Hide browser spinner arrows */
.fcc-jump-input::-webkit-inner-spin-button,
.fcc-jump-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fcc-jump-input[type=number] { -moz-appearance: textfield; }

.fcc-total-label {
    font-size: 0.88em;
    color: var(--fcc-icon-color);
    opacity: 0.6;
    white-space: nowrap;
}

/* Fullscreen button lives inside the nav bar, right-aligned */
.fcc-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--fcc-btn-size);
    height: var(--fcc-btn-size);
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--fcc-btn-radius);
    background: transparent;
    color: var(--fcc-icon-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.fcc-fullscreen-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.fcc-fullscreen-btn:hover {
    background: var(--fcc-btn-hover-bg);
    color: var(--fcc-icon-hover);
    border-color: var(--fcc-nav-border);
}

.fcc-fullscreen-btn:focus-visible {
    outline: 2px solid var(--fcc-icon-hover);
    outline-offset: 2px;
}

/* In fullscreen, nav sits at the bottom */
.fcc-is-fullscreen .fcc-nav {
    border-radius: 0;
    flex-shrink: 0;
}

/* --- Accessibility ------------------------------------------------------- */

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

/* --- Error state -------------------------------------------------------- */

.fcc-error {
    padding: 1em;
    border-left: 4px solid #c00;
    background: rgba(200,0,0,0.05);
    font-size: 0.9em;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 480px) {
    .fcc-nav {
        padding: 6px 8px;
        gap: 2px;
    }
    :root {
        --fcc-btn-size: 40px;
    }
    .fcc-jump-input {
        width: 44px;
    }
}
