/**
 * Fullscreen Article Carousel
 * Literary Magazine Aesthetic
 */

:root {
    --fullarca-bg-primary: #12100e;
    --fullarca-bg-secondary: #1a1815;
    --fullarca-text-primary: #f0ebe3;
    --fullarca-text-secondary: #9a8a7a;
    --fullarca-accent: #d4a96a;
    --fullarca-accent-glow: rgba(212, 169, 106, 0.3);
    --fullarca-overlay: rgba(18, 16, 14, 0.97);
    --fullarca-font-display: -apple-system, 'PingFang SC', 'Songti SC', 'SimSun', serif;
    --fullarca-font-body: -apple-system, 'PingFang SC', 'Songti SC', 'SimSun', serif;
    --fullarca-font-ui: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --fullarca-ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --fullarca-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Fullscreen Button (Floating)
   ============================================ */

.fullarca-fullscreen-btn {
    position: fixed;
    top: 36px;
    right: 32px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--fullarca-accent);
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8a898;
    transition: all 0.4s var(--fullarca-ease-out);
    box-shadow: 0 0 0 0 var(--fullarca-accent-glow);
}

.fullarca-fullscreen-btn:hover {
    background: rgba(201, 169, 98, 0.1);
    color: var(--fullarca-accent);
    box-shadow: 0 0 30px var(--fullarca-accent-glow);
    transform: scale(1.05);
}

.fullarca-fullscreen-btn:active {
    transform: scale(0.95);
}

.fullarca-fullscreen-btn svg {
    transition: transform 0.3s var(--fullarca-ease-out);
}

.fullarca-fullscreen-btn:hover svg {
    transform: rotate(15deg);
}

/* ============================================
   Fullscreen Overlay
   ============================================ */

.fullarca-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: var(--fullarca-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--fullarca-ease-out), visibility 0.5s;
    overflow: hidden;
}

.fullarca-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.fullarca-overlay.is-opening {
    animation: fullarca-overlay-open 0.6s var(--fullarca-ease-out) forwards;
}

.fullarca-overlay.is-closing {
    animation: fullarca-overlay-close 0.4s var(--fullarca-ease-out) forwards;
}

@keyframes fullarca-overlay-open {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fullarca-overlay-close {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.96);
    }
}

.fullarca-overlay-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   Top Bar
   ============================================ */

.fullarca-topbar {
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.fullarca-category {
    font-family: var(--fullarca-font-ui);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fullarca-accent);
}

.fullarca-category-label {
    opacity: 0.7;
}

.fullarca-category-name {
    opacity: 1;
    margin-left: 8px;
}

.fullarca-progress {
    display: none;
}

.fullarca-current {
    color: var(--fullarca-text-primary);
    font-weight: 600;
}

.fullarca-separator {
    margin: 0 4px;
    opacity: 0.5;
}

.fullarca-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fullarca-text-secondary);
    transition: all 0.3s var(--fullarca-ease-out);
}

.fullarca-close-btn:hover {
    border-color: var(--fullarca-accent);
    color: var(--fullarca-accent);
    background: rgba(212, 169, 106, 0.1);
    transform: rotate(90deg);
}

.fullarca-close-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Content Area
   ============================================ */

.fullarca-content-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    position: relative;
    padding: 40px 60px;
    -webkit-overflow-scrolling: touch;
}

.fullarca-carousel {
    width: 100%;
    max-width: 900px;
    min-height: 400px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* ============================================
   Article Card
   ============================================ */

.fullarca-article {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.5s var(--fullarca-ease-out), transform 0.5s var(--fullarca-ease-out);
    pointer-events: none;
    padding: 0 20px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    box-sizing: border-box;
}

.fullarca-article.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.fullarca-article.is-prev {
    transform: translateY(0) scale(1);
    opacity: 0;
}

.fullarca-article.is-next {
    transform: translateY(0) scale(1);
    opacity: 0;
}

.fullarca-article-content {
    text-align: center;
    padding-top: 26px;
}

.fullarca-article-category {
    display: inline-block;
    font-family: var(--fullarca-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--fullarca-accent);
    padding: 6px 16px;
    border: 1px solid var(--fullarca-accent);
    border-radius: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.fullarca-article-title {
    font-family: var(--fullarca-font-display);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
    color: var(--fullarca-text-primary);
    line-height: 1.3;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.fullarca-article-meta {
    font-family: var(--fullarca-font-ui);
    font-size: 13px;
    color: var(--fullarca-text-secondary);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.fullarca-article-author {
    font-weight: 500;
}

.fullarca-article-date {
    opacity: 0.7;
}

.fullarca-article-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fullarca-accent), transparent);
    margin: 0 auto 48px;
}

.fullarca-article-excerpt {
    font-family: var(--fullarca-font-body);
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    line-height: 1.95;
    color: var(--fullarca-text-primary);
    opacity: 0.85;
    margin-bottom: 48px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.fullarca-article-fullcontent {
    font-family: var(--fullarca-font-body);
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 2;
    color: var(--fullarca-text-primary);
    opacity: 0.85;
    margin-bottom: 32px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.fullarca-article-fullcontent::-webkit-scrollbar {
    width: 4px;
}

.fullarca-article-fullcontent::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.fullarca-article-fullcontent::-webkit-scrollbar-thumb {
    background: var(--fullarca-accent);
    border-radius: 2px;
}

.fullarca-article-fullcontent > *:first-child {
    margin-top: 0;
}

.fullarca-article-fullcontent p {
    margin-bottom: 1.5em;
}

.fullarca-article-fullcontent h2,
.fullarca-article-fullcontent h3,
.fullarca-article-fullcontent h4 {
    font-family: var(--fullarca-font-display);
    color: var(--fullarca-text-primary);
    margin: 1.5em 0 0.8em;
    line-height: 1.3;
}

.fullarca-article-fullcontent h2 {
    font-size: 1.5em;
}

.fullarca-article-fullcontent h3 {
    font-size: 1.25em;
}

.fullarca-article-fullcontent h4 {
    font-size: 1.1em;
}

.fullarca-article-fullcontent img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

.fullarca-article-fullcontent a {
    color: var(--fullarca-accent);
    text-decoration: underline;
}

.fullarca-article-fullcontent blockquote {
    border-left: 3px solid var(--fullarca-accent);
    margin: 1.5em 0;
    padding: 0.5em 0 0.5em 1.5em;
    font-style: italic;
    opacity: 0.9;
}

.fullarca-article-fullcontent ul,
.fullarca-article-fullcontent ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.fullarca-article-fullcontent li {
    margin-bottom: 0.5em;
}

.fullarca-article-fullcontent pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9em;
}

.fullarca-article-fullcontent code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.fullarca-article-fullcontent pre code {
    background: none;
    padding: 0;
}

.fullarca-article-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--fullarca-font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--fullarca-accent);
    background: transparent;
    padding: 12px 24px;
    border: 1px solid var(--fullarca-accent);
    border-radius: 30px;
    transition: all 0.3s var(--fullarca-ease-out);
    letter-spacing: 0.05em;
    cursor: pointer;
}

.fullarca-article-readmore:hover {
    background: var(--fullarca-accent);
    color: #0a0a0a;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--fullarca-accent-glow);
}

.fullarca-article-readmore svg {
    transition: transform 0.3s var(--fullarca-ease-out);
}

.fullarca-article-readmore:hover svg {
    transform: translateX(4px);
}

/* ============================================
   Loading State
   ============================================ */

.fullarca-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fullarca-loading-dots {
    display: flex;
    gap: 12px;
}

.fullarca-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fullarca-accent);
    animation: fullarca-loading-bounce 1.4s ease-in-out infinite;
}

.fullarca-loading-dots span:nth-child(1) { animation-delay: 0s; }
.fullarca-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.fullarca-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fullarca-loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   Content Skeleton Loader
   ============================================ */

.fullarca-skeleton {
    animation: fullarca-skeleton-pulse 1.5s ease-in-out infinite;
}

.fullarca-skeleton-line {
    height: 1.2em;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    margin-bottom: 1em;
}

.fullarca-skeleton-line:last-child {
    margin-bottom: 0;
}

@keyframes fullarca-skeleton-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* ============================================
   Empty State
   ============================================ */

.fullarca-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.fullarca-empty-title {
    font-family: var(--fullarca-font-display);
    font-size: 1.5rem;
    color: var(--fullarca-text-secondary);
    margin-bottom: 24px;
}

.fullarca-back-link {
    font-family: var(--fullarca-font-ui);
    font-size: 14px;
    color: var(--fullarca-accent);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--fullarca-accent);
    border-radius: 20px;
    transition: all 0.3s var(--fullarca-ease-out);
}

.fullarca-back-link:hover {
    background: var(--fullarca-accent);
    color: var(--fullarca-bg-primary);
}

/* ============================================
   Navigation
   ============================================ */

.fullarca-nav {
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 0 40px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.fullarca-nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #4a3f35;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b5d4d;
    transition: all 0.4s var(--fullarca-ease-out);
    flex-shrink: 0;
}

.fullarca-nav-arrow:hover {
    border-color: var(--fullarca-accent);
    color: var(--fullarca-accent);
    box-shadow: 0 0 15px var(--fullarca-accent-glow);
}

.fullarca-nav-arrow:active {
    transform: scale(0.95);
}

.fullarca-nav-arrow svg {
    width: 16px;
    height: 16px;
}

.fullarca-nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullarca-nav-current {
    font-family: var(--fullarca-font-ui);
    font-size: 16px;
    font-weight: 600;
    color: var(--fullarca-text-primary);
}

.fullarca-nav-separator {
    font-family: var(--fullarca-font-ui);
    font-size: 14px;
    color: var(--fullarca-text-secondary);
    opacity: 0.5;
}

.fullarca-nav-total {
    font-family: var(--fullarca-font-ui);
    font-size: 14px;
    color: var(--fullarca-text-secondary);
}

.fullarca-nav-left,
.fullarca-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullarca-nav-left {
    order: 1;
}

.fullarca-nav-center {
    order: 2;
}

.fullarca-nav-right {
    order: 3;
}

.fullarca-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fullarca-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #444;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s var(--fullarca-ease-out);
    padding: 0;
}

.fullarca-dot:hover {
    border-color: var(--fullarca-accent);
}

.fullarca-dot.is-active {
    width: 10px;
    height: 10px;
    background: var(--fullarca-accent);
    border-color: var(--fullarca-accent);
    box-shadow: 0 0 12px var(--fullarca-accent-glow);
}

.fullarca-dot.is-hidden {
    display: none;
}

/* ============================================
   Keyboard Hint
   ============================================ */

.fullarca-keyboard-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    font-family: var(--fullarca-font-ui);
    font-size: 12px;
    color: var(--fullarca-text-secondary);
    opacity: 0.5;
    pointer-events: none;
    white-space: nowrap;
}

/* ============================================
   Article Entry Animation
   ============================================ */

.fullarca-article.is-entering {
    animation: fullarca-article-enter 0.6s var(--fullarca-ease-out) forwards;
}

@keyframes fullarca-article-enter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fullarca-article.is-leaving-left {
    animation: fullarca-article-leave-left 0.4s var(--fullarca-ease-out) forwards;
}

.fullarca-article.is-leaving-right {
    animation: fullarca-article-leave-right 0.4s var(--fullarca-ease-out) forwards;
}

@keyframes fullarca-article-leave-left {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ============================================
   Featured Image Support
   ============================================ */

.fullarca-article-image {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 32px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.fullarca-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.fullarca-article-image img:hover {
    opacity: 1;
}

/* ============================================
   Error State
   ============================================ */

.fullarca-error {
    text-align: center;
    padding: 60px 20px;
}

.fullarca-error-title {
    font-family: var(--fullarca-font-display);
    font-size: 1.5rem;
    color: var(--fullarca-text-primary);
    margin-bottom: 16px;
}

.fullarca-error-message {
    font-family: var(--fullarca-font-ui);
    font-size: 14px;
    color: var(--fullarca-text-secondary);
    margin-bottom: 24px;
}

.fullarca-error-retry {
    font-family: var(--fullarca-font-ui);
    font-size: 13px;
    color: var(--fullarca-accent);
    background: transparent;
    border: 1px solid var(--fullarca-accent);
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullarca-error-retry:hover {
    background: var(--fullarca-accent);
    color: var(--fullarca-bg-primary);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    .fullarca-fullscreen-btn {
        display: none;
    }

    .fullarca-topbar {
        height: 50px;
        padding: 0 16px;
    }

    .fullarca-category {
        font-size: 11px;
    }

    .fullarca-close-btn {
        width: 36px;
        height: 36px;
    }

    .fullarca-content-wrapper {
        padding: 20px 16px;
    }

    .fullarca-carousel {
        min-height: auto;
    }

    .fullarca-article {
        padding: 0;
    }

    .fullarca-article-category {
        font-size: 10px;
        padding: 5px 12px;
        margin-bottom: 20px;
    }

    .fullarca-article-title {
        margin-bottom: 16px;
    }

    .fullarca-article-meta {
        margin-bottom: 24px;
        flex-direction: column;
        gap: 6px;
    }

    .fullarca-article-divider {
        margin-bottom: 24px;
    }

    .fullarca-article-excerpt {
        margin-bottom: 24px;
    }

    .fullarca-article-fullcontent {
        font-size: 1rem;
    }

    .fullarca-nav {
        height: 52px;
        padding: 0 16px;
        gap: 24px;
    }

    .fullarca-nav-arrow {
        width: 32px;
        height: 32px;
    }

    .fullarca-nav-arrow svg {
        width: 14px;
        height: 14px;
    }

    .fullarca-nav-current {
        font-size: 14px;
    }

    .fullarca-nav-separator,
    .fullarca-nav-total {
        font-size: 12px;
    }

    .fullarca-dots {
        gap: 6px;
    }

    .fullarca-dot {
        width: 6px;
        height: 6px;
    }

    .fullarca-dot.is-active {
        width: 8px;
        height: 8px;
    }

    .fullarca-keyboard-hint {
        display: none;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.fullarca-fullscreen-btn:focus,
.fullarca-close-btn:focus,
.fullarca-nav-arrow:focus,
.fullarca-dot:focus,
.fullarca-article-readmore:focus {
    outline: 2px solid var(--fullarca-accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Print (Hide fullscreen elements)
   ============================================ */

@media print {
    .fullarca-fullscreen-btn,
    .fullarca-overlay {
        display: none !important;
    }
}
