/* =========================================================================
   Custom styles for VP Biblioteka
   ========================================================================= */

/* -------------------------------------------------------------------------
   Skip-to-content link (accessibility)
   ------------------------------------------------------------------------- */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background-color: #1e3a5f;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
}

.skip-to-content:focus {
    position: fixed;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

/* -------------------------------------------------------------------------
   Focus visible outline
   ------------------------------------------------------------------------- */
*:focus-visible {
    outline: 2px solid #2d6a9f;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Mobile menu transitions
   ------------------------------------------------------------------------- */
.mobile-menu-panel {
    transform: translateX(100%);
    transition: transform 300ms ease-in-out;
}

.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0);
}

/* -------------------------------------------------------------------------
   Prose styles (for rich text content from DB)
   ------------------------------------------------------------------------- */
.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1e3a5f;
    line-height: 1.3;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1e3a5f;
    line-height: 1.4;
}

.prose h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1e3a5f;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.25rem;
    line-height: 1.75;
}

.prose a {
    color: #2d6a9f;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 150ms ease;
}

.prose a:hover {
    color: #1e3a5f;
}

.prose blockquote {
    border-left: 4px solid #2d6a9f;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
}

.prose strong {
    font-weight: 600;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Image alignment (class-based from TinyMCE) */
.prose img.img-float-left {
    float: left;
    margin: 0.25rem 1.5em 1em 0;
    max-width: 50%;
}

.prose img.img-float-right {
    float: right;
    margin: 0.25rem 0 1em 1.5em;
    max-width: 50%;
}

.prose img.img-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Legacy: inline style support */
.prose img[style*="float: left"] {
    margin: 0.25rem 1.5em 1em 0;
}

.prose img[style*="float: right"] {
    margin: 0.25rem 0 1em 1.5em;
}

.prose img[style*="margin: 0 auto"],
.prose img[style*="margin: 1em auto"],
.prose img[style*="display: block"] {
    margin-left: auto;
    margin-right: auto;
}

/* Clearfix at end of prose content only */
.prose::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive: stack floated images on mobile */
@media (max-width: 640px) {
    .prose img.img-float-left,
    .prose img.img-float-right,
    .prose img[style*="float: left"],
    .prose img[style*="float: right"] {
        float: none !important;
        display: block;
        margin: 1rem auto !important;
        max-width: 100% !important;
    }
}

.prose hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* -------------------------------------------------------------------------
   Line clamp utilities
   ------------------------------------------------------------------------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   Post card hover effects
   ------------------------------------------------------------------------- */
.post-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.post-card .post-card-image {
    transition: transform 300ms ease;
    overflow: hidden;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

/* -------------------------------------------------------------------------
   Document card hover
   ------------------------------------------------------------------------- */
.document-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.document-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* -------------------------------------------------------------------------
   Smooth page transitions
   ------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

/* -------------------------------------------------------------------------
   Custom scrollbar (webkit)
   ------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* -------------------------------------------------------------------------
   Fade-in on scroll (IntersectionObserver)
   ------------------------------------------------------------------------- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid children */
.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* -------------------------------------------------------------------------
   Hero animations
   ------------------------------------------------------------------------- */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
    animation: heroFadeIn 0.8s ease-out forwards;
}

.hero-animate-delay-1 { animation-delay: 0.2s; opacity: 0; }
.hero-animate-delay-2 { animation-delay: 0.4s; opacity: 0; }
.hero-animate-delay-3 { animation-delay: 0.6s; opacity: 0; }

/* -------------------------------------------------------------------------
   Quick-link card effects
   ------------------------------------------------------------------------- */
.quick-link-card {
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -8px rgba(30, 58, 95, 0.2);
}

.quick-link-card .quick-link-icon {
    transition: transform 300ms ease, background-color 300ms ease;
}

.quick-link-card:hover .quick-link-icon {
    transform: scale(1.1);
    background-color: #1e3a5f;
    color: white;
}

/* -------------------------------------------------------------------------
   Decorative divider
   ------------------------------------------------------------------------- */
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #1e3a5f, #2d6a9f);
    border-radius: 2px;
}

/* -------------------------------------------------------------------------
   News card image zoom
   ------------------------------------------------------------------------- */
.news-card-img {
    transition: transform 400ms ease;
}

.news-card:hover .news-card-img {
    transform: scale(1.05);
}
