/**
 * BeritaWPP Main CSS - Additional styles and overrides
 */

/* Search Form Styles */
.search-form {
    display: flex;
    width: 100%;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-form .search-field:focus {
    border-color: var(--primary);
}

.search-form .search-submit {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-form .search-submit:hover {
    background: var(--primary-dark);
}

/* WordPress default gallery */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.5rem 0;
}

.wp-block-image {
    margin: 1rem 0;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.wp-block-quote {
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 1.5rem 0;
    background: var(--gray-50);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wp-block-quote p {
    font-style: italic;
    color: var(--gray-700);
}

.wp-block-quote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--gray-500);
    font-style: normal;
}

/* Alignment */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin: 1.5rem auto;
}

.alignwide {
    max-width: 1200px;
    width: calc(100% + 60px);
    margin-left: calc(-30px);
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* Table styles */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-body th,
.post-body td {
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.post-body th {
    background: var(--gray-50);
    font-weight: 700;
}

.post-body tr:nth-child(even) {
    background: var(--gray-50);
}

/* Caption */
.wp-caption {
    max-width: 100%;
    margin: 1rem 0;
}

.wp-caption-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 5px;
    font-style: italic;
}

/* Sticky post indicator */
.sticky .card-thumb::after {
    content: 'PINNED';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary);
    color: var(--white);
    padding: 2px 8px;
    font-size: 0.55rem;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Loading animation */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Print styles */
@media print {
    .top-bar,
    .main-navigation,
    .breaking-news,
    .sidebar,
    .share-buttons,
    .post-tags,
    .related-posts,
    .comments-area,
    .footer-main,
    .footer-bottom,
    .back-to-top,
    .header-search,
    .pagination {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .post-body {
        font-size: 12pt;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* Load More Button */
.beritawpp-load-more-wrap {
    text-align: center;
    margin: 2rem 0;
    width: 100%;
}

.load-more-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background: var(--primary-dark);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
