/* poketwitter.css */

.waw-poketwitter-container {
    width: 100%;
    margin-bottom: 30px;
}

/* Compact layout (5 columns + arrow) */
.waw-poketwitter-compact {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.waw-poketwitter-compact > .waw-poketweet-box {
    flex: 1 1 0;
    min-width: 0;
}

/* Ensure no wrap/hide overflow in compact */
@media screen and (max-width: 1200px) {
    .waw-poketwitter-compact .waw-poketweet-box:nth-child(n+5) { display: none !important; }
}
@media screen and (max-width: 992px) {
    .waw-poketwitter-compact .waw-poketweet-box:nth-child(n+4) { display: none !important; }
}
@media screen and (max-width: 768px) {
    .waw-poketwitter-compact .waw-poketweet-box:nth-child(n+3) { display: none !important; }
}
@media screen and (max-width: 480px) {
    .waw-poketwitter-compact .waw-poketweet-box:nth-child(n+2) { display: none !important; }
}

/* Large layout (4 columns) */
.waw-poketwitter-large-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Base Box Styles */
.waw-poketweet-box {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 10px;
    margin: 0; /* Reset margin because of grid gap */
    text-decoration: none !important;
    color: #14171a !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.waw-poketweet-box:hover {
    background: #fdfdfd;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.waw-poketweet-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.waw-poketwitter-compact .waw-poketweet-inner {
    gap: 6px;
}

.waw-poketweet-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    display: block;
    background: #f5f8fa;
    margin-bottom: 5px;
}

.waw-poketweet-image.waw-poketweet-image-only {
    flex-grow: 1;
    display: flex;
    margin-bottom: 0;
}

.waw-poketweet-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16/9; /* keep it uniform */
    display: block;
}

.waw-poketweet-image.waw-poketweet-image-only img {
    height: 100%;
    aspect-ratio: auto;
}

.waw-poketweet-content {
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    font-weight: 600;
    text-align: center;
    flex-grow: 1; /* Pushes footer to the bottom */
}

.waw-poketwitter-compact .waw-poketweet-content {
    font-size: 13px;
    line-height: 1.2;
}

.waw-poketwitter-compact .waw-poketweet-centered {
    font-size: 15px;
    padding: 10px 5px;
}

.waw-poketweet-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 20px 10px;
}

/* Footer & Reactions */
.waw-poketweet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    padding-top: 0;
}

.waw-poketweet-meta-number {
    font-size: 13px;
    color: #8899a6;
    font-weight: 600;
}

.waw-poketweet-reactions {
    display: flex;
    gap: 15px;
}

.waw-poketweet-react-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #657786;
    font-size: 14px;
    transition: transform 0.1s ease;
}

.waw-poketweet-react-btn:hover {
    transform: scale(1.1);
}

.waw-poketweet-react-btn.reacted {
    color: #e0245e;
}

/* Large Layout (for shortcode [waw_poketwitter]) */
.waw-poketwitter-compact .waw-poketweet-box {
    padding: 8px;
}

.waw-poketwitter-large-layout .waw-poketweet-box {
    /* Padding is already 10px, maybe keep it or make it slightly larger */
    padding: 15px;
}

.waw-poketwitter-large-layout .waw-poketweet-image {
    max-height: none;
}
.waw-poketwitter-large-layout .waw-poketweet-image img {
    aspect-ratio: 4/3; /* Taller on large layout */
}
.waw-poketwitter-large-layout .waw-poketweet-content {
    font-size: 16px;
}

/* Lightbox Styles */
.waw-poketweet-lightbox {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.waw-poketweet-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.waw-poketweet-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.waw-poketweet-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0px;
    color: #f1f1f1;
    font-size: 35px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.waw-poketweet-lightbox-close:hover,
.waw-poketweet-lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Pagination */
.waw-poketwitter-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    grid-column: 1 / -1; /* span across all columns in grid */
}

.waw-poketwitter-pagination a,
.waw-poketwitter-pagination span {
    padding: 8px 16px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    color: #1b95e0;
    text-decoration: none;
}

.waw-poketwitter-pagination .current {
    background-color: #1b95e0;
    color: #fff;
    border-color: #1b95e0;
}

/* Arrow More Link */
.waw-poketweet-more-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    background: #f5f8fa;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    color: #1b95e0;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    cursor: pointer;
    margin: 0;
}
.waw-poketweet-more-arrow:hover {
    background: #1b95e0;
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Responsive Overrides */
@media screen and (max-width: 1200px) {
    .waw-poketwitter-compact {
        grid-template-columns: repeat(4, 1fr);
    }
    .waw-poketwitter-large-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .waw-poketwitter-compact {
        grid-template-columns: repeat(3, 1fr);
    }
    .waw-poketwitter-large-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .waw-poketwitter-compact,
    .waw-poketwitter-large-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .waw-poketwitter-compact,
    .waw-poketwitter-large-layout {
        grid-template-columns: 1fr;
    }
}
