/* DAM Public Theme - Custom Styles */

/* Fix page height - prevent extra space below footer */
html {
    height: auto !important;
    min-height: 100%;
}

body {
    height: auto !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body>main {
    flex: 1 0 auto;
}

body>footer {
    flex-shrink: 0;
}

/* ESWG Shield Logo */
.logo-shield {
    background-color: #c41230;
    clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%);
}

/* Filter Active States */
.filter-active {
    background-color: #c41230;
    color: white;
    border-color: #c41230;
}

/* Card Hover Effects */
.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation Link Styles */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c41230;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

.group:hover .group-hover\:visible {
    visibility: visible;
}

div.absolute.top-full {
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover div.absolute.top-full {
    transform: translateY(0);
}

/* Pagination Styles */
.pagination {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.pagination ul.page-numbers {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    align-items: center !important;
    justify-content: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100%;
}

.pagination ul.page-numbers li {
    display: inline-flex !important;
    margin: 0 !important;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 0.875rem;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination a.page-numbers {
    background-color: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.pagination a.page-numbers:hover {
    background-color: #c41230;
    color: white;
    border-color: #c41230;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 18, 48, 0.2);
}

.pagination span.page-numbers.current {
    background-color: #c41230;
    color: white;
    border: 1px solid #c41230;
    box-shadow: 0 4px 12px rgba(196, 18, 48, 0.3);
}

.pagination .dots {
    color: #94a3b8;
    font-weight: 400;
}

/* Waterfall Layout using CSS Columns */
.portal-waterfall {
    display: block !important;
    column-count: 4;
    column-gap: 2.5rem;
}

@media (max-width: 1280px) {
    .portal-waterfall {
        column-count: 3;
    }
}

@media (max-width: 1024px) {
    .portal-waterfall {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .portal-waterfall {
        column-count: 1;
    }
}

.portal-waterfall .portal-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 2.5rem;
    break-inside: avoid;
}

/* List View Layout */
.portal-list {
    display: flex !important;
    flex-direction: column;
    gap: 2rem;
}

.portal-list .portal-item {
    display: flex;
    flex-direction: row;
    height: 186px;
}

@media (max-width: 768px) {
    .portal-list .portal-item {
        height: auto;
        flex-direction: column;
    }
}

.portal-list .portal-item-image-wrap {
    width: 280px;
    height: 100%;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .portal-list .portal-item-image-wrap {
        width: 100%;
        aspect-ratio: 16/9;
    }
}

.portal-list .portal-item-list-body {
    display: flex;
}

/* Premium Pagination Styling (Shared) */
.premium-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    margin: 4rem 0 !important;
    width: 100% !important;
}

.premium-pagination a.page-numbers,
.premium-pagination span.page-numbers {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;
    background: #ffffff;
    color: #0f172a !important;
    border-radius: 99px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    text-decoration: none !important;
    border: 1px solid #f1f5f9 !important;
    line-height: 1 !important;
}

/* Page Numbers - Circular */
.premium-pagination a.page-numbers:not(.next):not(.prev),
.premium-pagination span.page-numbers:not(.next):not(.prev) {
    width: 48px !important;
    padding: 0 !important;
}

/* Next/Prev - Pill */
.premium-pagination a.next,
.premium-pagination a.prev {
    padding: 0 1.75rem !important;
    width: auto !important;
    gap: 0.5rem !important;
}

/* Dark Mode */
.dark .premium-pagination a.page-numbers,
.dark .premium-pagination span.page-numbers {
    background: #161f32 !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

/* Active / Hover State */
.premium-pagination .current,
.premium-pagination a.page-numbers:hover {
    background: #c41230 !important;
    color: #ffffff !important;
    border-color: #c41230 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 20px rgba(196, 18, 48, 0.25) !important;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #c41230;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Dark mode overrides */
.dark .pagination a {
    background-color: #1a2c38;
    border-color: #2a3b47;
    color: #cbd5e1;
}

.dark .pagination a:hover {
    background-color: #c41230;
    color: white;
    border-color: #c41230;
}

/* Accessibility: Focus States */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid #c41230;
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    header,
    footer,
    nav {
        display: none;
    }
}