/*
 * Cards & Content Containers
 * pomsy.space — Using folderasset.jpeg as the folder background
 */

/* ── Folder Container Using folderasset.jpeg ── */
.folder-asset-container {
    position: relative;
    max-width: 860px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: clamp(2rem, 3.5vw, 3rem);
    margin-bottom: clamp(-150px, -11vw, -125px);
    aspect-ratio: 1280 / 1004;
    background-image: url('../../images/folder-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 20px 40px rgba(35, 45, 30, 0.28));
    z-index: 10;
}

/* ── Top Tabs Overlay (CV, POETRY WATCHING, BLOG) ── */
.folder-tabs-overlay {
    position: absolute;
    top: 2.0%;
    left: 0;
    width: 100%;
    height: 6.8%;
    z-index: 5;
}

.folder-tab-btn {
    position: absolute;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

.folder-tab-label {
    font-family: var(--font-serif-sub);
    font-size: clamp(0.75rem, 0.98vw, 0.88rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--color-bone);
    text-transform: uppercase;
    margin-bottom: 8px;
    transition: color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
    opacity: 0.94;
}

@media (hover: hover) and (pointer: fine) {
    .folder-tab-btn:hover .folder-tab-label {
        color: #FFFFFF;
        transform: translateY(-1px);
        opacity: 1;
    }
}

.folder-tab-btn:active .folder-tab-label {
    transform: scale(0.96);
}

/* ── 3 Card Slots Mapped to folderasset.jpeg Coordinates ── */
.folder-card-slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: clamp(0.75rem, 1.5vw, 1.35rem);
    z-index: 4;
    transition: transform var(--duration-normal) var(--ease-out);
    border-radius: 4px;
}

/* Interactive Peek Animation when Tab Hovered / Focused on Desktop */
@media (min-width: 769px) {
    .folder-card-slot.is-peeking {
        transform: translateY(-6px);
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Slot 1: CV */
.folder-card-slot--cv {
    left: 7.11%;
    top: 13.94%;
    width: 26.72%;
    height: 52.99%;
}

/* Slot 2: Poetry Watching */
.folder-card-slot--poetry {
    left: 34.84%;
    top: 13.94%;
    width: 26.41%;
    height: 51.5%;
}

/* Slot 3: Blog */
.folder-card-slot--blog {
    left: 62.5%;
    top: 14.04%;
    width: 29.92%;
    height: 57.07%;
}

/* ── Card Header Badge (Icon + Label) ── */
.card-header-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    margin-bottom: clamp(0.35rem, 1vw, 0.75rem);
    color: var(--color-text-muted);
}

.card-header-badge__icon {
    width: 14px;
    height: 14px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.card-header-badge__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}

.card-header-badge__label {
    font-family: var(--font-sans);
    font-size: clamp(0.65rem, 0.8vw, 0.725rem);
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    text-transform: lowercase;
}

/* ── Structured Card Typography ── */
.folder-card__body {
    display: flex;
    flex-direction: column;
}

.folder-card__title {
    font-family: var(--font-serif);
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    font-weight: 700;
    line-height: 1.25;
    color: #24201A;
    margin: 0 0 clamp(0.15rem, 0.4vw, 0.35rem);
}

.folder-card__meta {
    font-family: var(--font-sans);
    font-size: clamp(0.68rem, 0.8vw, 0.76rem);
    font-weight: 500;
    color: #5C5446;
    margin-bottom: clamp(0.3rem, 0.6vw, 0.5rem);
    line-height: 1.35;
}

.folder-card__desc {
    font-family: var(--font-serif-sub);
    font-size: clamp(0.72rem, 0.88vw, 0.82rem);
    line-height: 1.48;
    color: #3D372E;
    margin: 0;
}

.folder-card__stanza {
    font-family: var(--font-serif-sub);
    font-style: italic;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    line-height: 1.55;
    color: #38342A;
    margin: 0;
}

.folder-card__footer {
    margin-top: auto;
    padding-top: clamp(0.35rem, 0.75vw, 0.65rem);
}

/* ── Blog Card Embedded Thumbnail & Layout ── */
.folder-blog-body {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
}

.folder-blog-thumb {
    width: clamp(52px, 7.5vw, 84px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.folder-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.folder-blog-text {
    display: flex;
    flex-direction: column;
}

/* ── Tactile Action Links (Fitts's Law & Touch Affordance) ── */
.card-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: clamp(0.7rem, 0.82vw, 0.76rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-kombu-green);
    transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.card-action-link__icon {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    flex-shrink: 0;
    transition: transform var(--duration-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .card-action-link:hover {
        color: #1F2815;
    }
    .card-action-link:hover .card-action-link__icon {
        transform: translate(2px, -2px);
    }
}

.card-action-link:active {
    transform: scale(0.97);
}

/* ── Bottom Lockup (Heading & Rubber Stamp) ── */
.folder-bottom-overlay {
    position: absolute;
    left: 7.11%;
    top: 73.5%;
    width: 85.5%;
    height: 23%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    z-index: 5;
}

.folder-heading-lockup {
    position: relative;
}

.folder-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.35rem, 2.8vw, 2.65rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--color-bone);
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

.folder-underline {
    display: block;
    width: clamp(130px, 18vw, 195px);
    height: 10px;
    margin-top: 2px;
    color: rgba(229, 215, 196, 0.55);
}

/* ── Postal Rubber Stamp ── */
.postal-stamp {
    position: relative;
    width: clamp(68px, 8.5vw, 96px);
    height: clamp(68px, 8.5vw, 96px);
    transform: rotate(14deg);
    color: rgba(229, 215, 196, 0.78);
    user-select: none;
    cursor: default;
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .postal-stamp:hover {
        transform: rotate(20deg) scale(1.05);
    }
}

.postal-stamp svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Responsive Behavior on Mobile & Tablet (< 768px) ── */
@media (max-width: 768px) {
    #things-archive {
        margin-top: var(--space-40);
        margin-bottom: 0;
        padding-left: clamp(12px, 3.5vw, 20px);
        padding-right: clamp(12px, 3.5vw, 20px);
        position: relative;
        z-index: 10;
    }

    .folder-asset-container {
        aspect-ratio: auto;
        background-image: none;
        background-color: var(--color-kombu-green);
        border-radius: 20px;
        padding: clamp(24px, 5.5vw, 36px) clamp(16px, 4.5vw, 24px) clamp(28px, 6.5vw, 40px);
        display: flex;
        flex-direction: column;
        box-shadow: 0 16px 36px rgba(35, 45, 30, 0.35);
        margin-top: 0;
        margin-bottom: -95px;
        position: relative;
        z-index: 10;
    }

    .folder-tabs-overlay {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-bottom: clamp(14px, 3.5vw, 20px);
        z-index: 5;
    }

    .folder-tab-btn {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        padding: 8px 12px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        transition: background 160ms var(--ease-out), transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
        cursor: pointer;
    }

    .folder-tab-btn:active {
        transform: scale(0.96);
    }

    .folder-tab-btn.is-active {
        background: rgba(255, 255, 255, 0.22);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    }

    .folder-tab-label {
        margin-bottom: 0;
        font-size: clamp(0.7rem, 2.8vw, 0.78rem);
        letter-spacing: 0.06em;
        color: var(--color-bone);
        opacity: 0.85;
        white-space: nowrap;
    }

    .folder-tab-btn.is-active .folder-tab-label {
        color: #FFFFFF;
        font-weight: 700;
        opacity: 1;
    }

    .folder-card-slot {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 240px;
        box-sizing: border-box;
        background-color: var(--color-paper-card);
        border-radius: 12px;
        border: 1px solid rgba(76, 61, 25, 0.12);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
        padding: clamp(20px, 5vw, 28px) clamp(16px, 4.5vw, 24px);
        display: none;
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }

    .folder-card-slot.is-mobile-active {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        opacity: 1;
        transform: translateY(0) scale(1);
        animation: cardEnter 220ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    @keyframes cardEnter {
        from {
            opacity: 0;
            transform: translateY(6px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .folder-card-slot {
        background-color: var(--color-paper-card) !important;
    }

    .folder-card-slot--poetry {
        background-color: var(--color-paper-deckle) !important;
    }

    .card-header-badge {
        margin-bottom: 12px;
    }

    .card-header-badge__label {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #786F5C;
        font-weight: 500;
    }

    .folder-card__title {
        font-size: clamp(1.15rem, 4.5vw, 1.35rem);
        line-height: 1.25;
        margin-bottom: 4px;
        color: #24201A;
    }

    .folder-card__meta {
        font-size: 0.85rem;
        color: #5C5446;
        margin-bottom: 12px;
        line-height: 1.35;
    }

    .folder-card__desc {
        font-size: 0.95rem;
        line-height: 1.65;
        color: #3D372E;
    }

    .folder-card__stanza {
        font-size: clamp(0.95rem, 3.8vw, 1.08rem);
        line-height: 1.7;
        color: #2E2920;
        margin-top: 4px;
    }

    .folder-card__footer {
        margin-top: clamp(18px, 4vw, 24px);
        padding-top: 0;
    }

    .card-action-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 999px;
        background: rgba(53, 64, 36, 0.08);
        border: 1px solid rgba(53, 64, 36, 0.14);
        font-size: 0.78rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-weight: 600;
        color: var(--color-kombu-green);
        min-height: 40px;
        box-sizing: border-box;
    }

    .card-action-link:active {
        transform: scale(0.96);
        background: rgba(53, 64, 36, 0.16);
    }

    .card-action-link__icon {
        width: 14px;
        height: 14px;
    }

    .folder-blog-body {
        display: flex;
        gap: clamp(12px, 3.5vw, 16px);
        align-items: flex-start;
        margin-top: 4px;
    }

    .folder-blog-thumb {
        width: clamp(64px, 18vw, 84px);
        height: clamp(64px, 18vw, 84px);
        border-radius: 4px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .folder-blog-text .folder-card__title {
        font-size: clamp(1.05rem, 4vw, 1.2rem);
        margin-bottom: 4px;
    }

    .folder-blog-text .folder-card__desc {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .folder-bottom-overlay {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        margin-top: clamp(24px, 6vw, 36px);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: clamp(8px, 2.5vw, 16px);
    }

    .folder-heading {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
        line-height: 1.15;
        margin: 0;
    }

    .folder-underline {
        width: clamp(110px, 32vw, 140px);
        height: 8px;
        margin-top: 4px;
    }

    .postal-stamp {
        align-self: center;
        width: clamp(58px, 16vw, 72px);
        height: clamp(58px, 16vw, 72px);
        flex-shrink: 0;
        transform: rotate(12deg);
    }
}
