/* Accessibility: links distinguishable without color alone (focus + underline) */
a:focus-visible {
    text-decoration: underline;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.comments-section {
    font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

/* Textarea styles */
#reviewContent {
    min-height: 100px;
}

/* Pagination styling */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.pagination li {
    margin: 0 2px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    text-decoration: none;
}

.pagination li.active span {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination li a:hover {
    background-color: #f3f4f6;
}

/* Animation for showing/hiding reply form */
.reply-form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.reply-form:not(.hidden) {
    max-height: 300px;
}

/* Reaction button hover effects */
.like-btn:hover svg,
.like-btn.active svg {
    color: #2563eb;
}

.dislike-btn:hover svg,
.dislike-btn.active svg {
    color: #dc2626;
}

/* Reply section styling */
.replies {
    position: relative;
}

.replies::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 2px;
    background-color: #e5e7eb;
}

/* ---- Search: responsive container and dropdown ---- */
.search-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
}
.search-container.sticky {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-results-container {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, max-height 0.2s ease, visibility 0.2s;
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.search-results-container.visible {
    max-height: min(70vh, 400px);
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
    .search-results-container.visible {
        max-height: min(60vh, 480px);
    }
}
@media (min-width: 1024px) {
    .search-results-container {
        margin-left: auto;
        margin-right: auto;
        max-width: 1280px;
    }
}

.results-list {
    padding: 0.5rem 0;
    min-height: 0;
}
.search-all-results {
    display: block;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9375rem;
    color: #2563eb;
}
.search-all-results:hover {
    color: #1d4ed8;
}
.search-section-header {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.search-result-item {
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.search-result-item:hover {
    background: #f9fafb;
}
@media (max-width: 639px) {
    .search-result-item {
        padding: 0.75rem 1rem;
    }
    #search-results-container .search-result-title,
    #search-results-container .search-result-subtitle {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
    }
}

/* Search dropdown: keep result images small (thumbnail size) - high specificity so they always apply */
#search-results-container .search-result-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
#search-results-container .search-result-image {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    min-width: 48px;
    min-height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}
#search-results-container .search-result-content {
    min-width: 0;
}
#search-results-container .search-result-title,
#search-results-container .search-result-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
