/* ============================================
   References Section Styles
   ============================================ */

/* Section Container */
.section-references {
    position: relative;
    background-color: #F4F3EA;
}

/* References Wrapper */
.section-references .references-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Section Title */
.section-references .section-title {
    font-family: 'Impact', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 0;
    color: var(--paperwise-accent);
    text-align: center;
}

/* Grid Container */
.section-references .grid-container {
    position: relative;
    width: 100%;
    max-width: 940px;
    overflow: hidden;
}
.page-id-808 .section-references .grid-container {
    max-width: 1240px;
}

/* References Grid - standaard (pagina 808) */
.section-references .references-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
    align-items: center;
    height: auto;
}
.page-id-808 .section-references .references-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* Loop Grid */
.section-references.is-loop .references-grid {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    will-change: transform;
    gap: 20px; 
}

/* Reference Item */
.section-references .reference-item {
    flex: 0 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    max-height: 132px;
}

.section-references .reference-item img {
    max-width: 100%;
    max-height: 132px;
    object-fit: contain;
}

/* Grid Controls */
.section-references .grid-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

/* Grid Arrow Buttons */
.section-references .grid-arrow {
    width: 42px;
    height: 29px;
    border-radius: 100px;
    border: 1px solid var(--paperwise-dark-green);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--paperwise-dark-green);
}
.section-references .grid-arrow:hover:not(:disabled) {
    background-color: var(--paperwise-dark-green);
    color: #fff;
}
.section-references .grid-arrow:disabled,
.section-references .grid-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading state for AJAX pagination */
.section-references .references-grid {
    transition: opacity 0.3s ease;
}
.section-references .grid-arrow svg {
    width: 14px;
    height: 12px;
}
.section-references .grid-prev svg { transform: rotate(180deg); }
.section-references .grid-next { background-color: var(--paperwise-dark-green); color: #fff; }
.section-references .grid-next:hover:not(:disabled) { background-color: var(--paperwise-teal); }

/* Responsive Tablet */
@media (max-width: 991px) {
    .section-references .section-title { font-size: 30px; }
    .section-references .references-wrapper { gap: 32px; }
    .section-references .references-grid { gap: 32px; }
    .section-references.is-loop .reference-item { width: calc((100% - 2 * 32px) / 3); }
    .section-references .reference-item { min-height: 80px; max-height: 110px; }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .section-references .section-title { font-size: 26px; }
    .section-references .references-wrapper { gap: 28px; }
    .section-references .references-grid { gap: 24px; }
    .section-references.is-loop .reference-item { width: calc((100% - 2 * 24px) / 2); }
    .section-references .reference-item { min-height: 70px; max-height: 100px; }
    .section-references .grid-controls { margin-top: 20px; }
}

/* Responsive Mobile XS */
@media (max-width: 576px) {
    .section-references .section-title { font-size: 22px; letter-spacing: 0.12em; }
    .section-references .references-wrapper { gap: 24px; }
    .section-references .references-grid { gap: 16px; }
    .section-references.is-loop .reference-item { width: 100%; } /* 1 item zichtbaar */
    .section-references .reference-item { min-height: 60px; max-height: 90px; }
    .section-references .grid-arrow { width: 36px; height: 26px; }
    .section-references .grid-arrow svg { width: 12px; height: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .section-references * { transition: none; }
}

/* Print Styles */
@media print {
    .section-references { page-break-inside: avoid; }
    .section-references .grid-controls { display: none; }
    .section-references .reference-item { display: flex !important; }
}
