/* =====================================================
   MESSAGE IN A BOTTLE - Articles Section
   Glass bottles with scrolled letters inside
   ===================================================== */

.bottle-ocean-floor {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    padding: 30px 20px 60px;
    min-height: 300px;
    position: relative;
    margin-top: -10px;
    background: rgba(50, 85, 100, 0.6);
    border-radius: 12px;
    margin-left: 20px;
    margin-right: 20px;
}

/* Individual Bottle Container */
.message-bottle {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message-bottle * {
    cursor: pointer;
}

.message-bottle:hover {
    transform: translateY(-10px) rotate(2deg);
}

.message-bottle:nth-child(2):hover {
    transform: translateY(-10px) rotate(-2deg);
}

.bottle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bottle-canvas {
    image-rendering: auto;
    width: 80px;
    height: 160px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 12px rgba(135, 206, 235, 0.4));
}

/* =====================================================
   BOTTLE LABELS - Clean, readable styling
   ===================================================== */

.bottle-label {
    margin-top: 15px;
    padding: 8px 14px;
    font-size: 0.7rem !important;
    line-height: 1.5 !important;
    color: #FFF8DC;
    text-align: center;
    background: rgba(70, 100, 120, 0.85);
    border-radius: 6px;
    border: 2px solid rgba(135, 206, 235, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 120px;
}

/* =====================================================
   SHIP'S LOG BOOK - Article Details Popup
   Aged leather-bound captain's log aesthetic
   ===================================================== */

.letter-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 380px;
    background: linear-gradient(135deg,
        #D4C4A0 0%,
        #C9B896 20%,
        #D0BFA0 40%,
        #C4B490 60%,
        #CBBC98 80%,
        #BFB088 100%
    ) !important;
    border: none;
    border-radius: 4px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(139, 90, 43, 0.2),
        0 0 0 4px #5D3A1A,
        0 0 0 6px #8B5A2B,
        0 0 0 8px #3D2512;
    overflow: visible;
}

/* Leather binding spine on left side */
.letter-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg,
        #3D2512 0%,
        #5D3A1A 30%,
        #8B5A2B 60%,
        #6D4A2A 100%
    );
    box-shadow:
        inset -2px 0 4px rgba(0, 0, 0, 0.3),
        inset 2px 0 4px rgba(255, 255, 255, 0.1);
}

/* Aged paper texture overlay */
.letter-popup::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(139, 90, 43, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 85% 75%, rgba(139, 90, 43, 0.06) 1px, transparent 1px),
        radial-gradient(circle at 45% 50%, rgba(139, 90, 43, 0.04) 2px, transparent 2px);
    background-size: 30px 30px, 40px 40px, 50px 50px;
    pointer-events: none;
}

.message-bottle.open .letter-popup {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop overlay for letter popup */
.letter-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.message-bottle.open .letter-popup-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Log Book Content Wrapper */
.letter-content {
    padding: 20px 24px 24px 40px;
    position: relative;
    z-index: 1;
}

/* Log entry header - like a captain's log date */
.letter-content h3 {
    font-size: 1rem !important;
    color: #3D2512 !important;
    margin-bottom: 14px;
    line-height: 1.6 !important;
    padding-bottom: 12px;
    border-bottom: 2px solid #8B5A2B;
    font-weight: bold;
    font-style: italic;
}

/* Category tags - like wax seal stamps */
.letter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.letter-tags span {
    background: linear-gradient(145deg, #8B2500, #6B1C00) !important;
    color: #F5E6C8 !important;
    padding: 6px 12px;
    font-size: 0.6rem !important;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.2),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Log entry description - handwritten style */
.letter-content p {
    font-size: 0.8rem !important;
    color: #2D1810 !important;
    line-height: 2.2 !important;
    margin-bottom: 18px;
    font-weight: normal;
    font-style: italic;
}

/* Navigation links - brass button style */
.letter-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.letter-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(145deg, #8B5A2B, #5D3A1A) !important;
    color: #F5E6C8 !important;
    padding: 10px 18px;
    font-size: 0.65rem !important;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid #3D2512;
    font-weight: bold;
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.15),
        2px 3px 6px rgba(0, 0, 0, 0.4);
}

.letter-links a:hover {
    background: linear-gradient(145deg, #A06830, #7D4A2A) !important;
    transform: translateY(-2px);
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.2),
        3px 5px 10px rgba(0, 0, 0, 0.5);
    color: #FFE4B5 !important;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .bottle-ocean-floor {
        gap: 30px;
        padding: 30px 15px;
    }

    .bottle-canvas {
        width: 70px;
        height: 140px;
    }

    .bottle-label {
        font-size: 0.6rem !important;
        padding: 6px 10px;
        max-width: 100px;
    }

    .letter-popup {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .bottle-ocean-floor {
        gap: 20px;
        padding: 20px 10px;
    }

    .bottle-canvas {
        width: 60px;
        height: 120px;
    }

    .bottle-label {
        font-size: 0.55rem !important;
        padding: 5px 8px;
        max-width: 90px;
    }

    .letter-popup {
        width: 90vw;
        max-width: 300px;
    }

    .letter-content {
        padding: 20px 16px 16px;
    }

    .letter-content h3 {
        font-size: 0.85rem !important;
    }

    .letter-content p {
        font-size: 0.7rem !important;
    }
}
