/* ==========================================================================
   Documents Page Styles - ToLight Theme
   Clean, modern design matching the site's design system
   ========================================================================== */

/* Main wrapper for the documents page content */
.documents-page-section {
    padding: var(--space-12) 0 var(--space-16);
    background-color: var(--neutral-50);
    direction: rtl;
}

@media (max-width: 768px) {
    .documents-page-section {
        padding: var(--space-8) 0 var(--space-12);
    }
}

/* Page Title Section */
.documents-page-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.documents-page-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: #10506d;
    margin-bottom: var(--space-6);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .documents-page-title {
        font-size: var(--text-3xl);
    }
}

/* Styles for content added via the standard WordPress editor */
.documents-editor-content {
    max-width: 900px;
    margin: 0 auto var(--space-12);
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--neutral-800);
}

.documents-editor-content h1,
.documents-editor-content h2,
.documents-editor-content h3 {
    margin-bottom: var(--space-6);
    color: #10506d;
    font-weight: 700;
}

.documents-editor-content h1 {
    font-size: var(--text-3xl);
}

.documents-editor-content h2 {
    font-size: var(--text-2xl);
}

.documents-editor-content h3 {
    font-size: var(--text-xl);
}

.documents-editor-content p {
    margin-bottom: var(--space-4);
}

/* Styles for the introductory text from the ACF field */
.documents-intro {
    text-align: center;
    font-size: var(--text-lg);
    color: var(--neutral-700);
    max-width: 800px;
    margin: 0 auto var(--space-12);
    line-height: 1.7;
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-base);
}

/* Grid container for the document cards */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-8);
}

/* Responsive adjustments for the grid */
@media (max-width: 1024px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--space-6);
    }
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* Individual document card styling */
.doc-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-base);
    transition: all var(--transition-base);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.doc-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-500);
}

.doc-card:hover::before {
    opacity: 1;
}

/* Card header: contains icon and title */
.doc-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

/* Circular icon wrapper */
.doc-card-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    color: var(--primary-600);
    transition: all var(--transition-base);
}

.doc-card:hover .doc-card-icon {
    background: var(--primary-500);
    color: white;
    transform: scale(1.1) rotate(-10deg);
}

.doc-card-icon svg {
    width: 28px;
    height: 28px;
}

/* Card title */
.doc-card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: #10506d;
    line-height: 1.4;
    margin: 0;
}

/* This empty div grows to push the footer to the bottom */
.doc-card-body {
    flex-grow: 1;
    min-height: var(--space-4);
}

/* Card footer: contains the download/view link */
.doc-card-footer {
    margin-top: auto;
}

/* "View Document" link, styled as a modern button */
.doc-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    border: 2px solid var(--neutral-400);
    color: var(--neutral-700);
    background-color: white;
    transition: all var(--transition-base);
    min-height: 44px;
}

.doc-card-link:hover,
.doc-card:hover .doc-card-link {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-card-link svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-base);
}

.doc-card-link:hover svg {
    transform: translateX(-3px);
}

/* Message shown when no documents are found */
.no-documents-message {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    background-color: white;
    border-radius: var(--radius-xl);
    color: var(--neutral-600);
    font-size: var(--text-lg);
    box-shadow: var(--shadow-base);
    max-width: 600px;
    margin: 0 auto;
}

.no-documents-message p {
    margin: 0;
    font-weight: 500;
}

/* Focus states for accessibility */
.doc-card-link:focus {
    outline: 3px solid var(--primary-500);
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .doc-card {
        padding: var(--space-5);
    }
    
    .doc-card-icon {
        width: 48px;
        height: 48px;
    }
    
    .doc-card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .doc-card-title {
        font-size: var(--text-lg);
    }
    
    .documents-intro {
        padding: var(--space-6);
    }
}

/* Fix AOS animation opacity issues */
.doc-card[data-aos] {
    opacity: 1 !important;
}

.doc-card[data-aos]:not(.aos-animate) {
    opacity: 0;
    transform: translateY(30px);
}

.doc-card[data-aos].aos-animate {
    opacity: 1 !important;
    transform: translateY(0);
}