/* Digitools Galerija — frontend stili (overlay style) */

.dg-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 0.95rem;
}

.dg-grid {
    display: grid;
    grid-template-columns: repeat(var(--dg-cols, 3), 1fr);
    gap: 20px;
    margin: 24px 0;
}

.dg-card {
    position: relative;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a1a;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
}
.dg-card::before {
    /* Tumšs gradients apakšā, lai teksts būtu salasāms */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.15) 35%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0.95) 100%);
    transition: background 0.25s;
}
.dg-card:hover,
.dg-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    outline: none;
}
.dg-card:hover::before,
.dg-card:focus::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.3) 35%, rgba(0,0,0,0.8) 70%, rgba(0,0,0,1) 100%);
}

.dg-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 20px 22px 22px;
    color: #fff;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dg-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    color: #ffffff !important;
    text-shadow:
        0 2px 4px rgba(0,0,0,0.8),
        0 1px 12px rgba(0,0,0,0.5);
    letter-spacing: -0.01em;
}
.dg-date {
    font-size: 0.88rem;
    color: #ffffff !important;
    opacity: 0.95;
    text-shadow:
        0 1px 3px rgba(0,0,0,0.8),
        0 1px 8px rgba(0,0,0,0.5);
    font-weight: 500;
}
.dg-credit {
    position: absolute;
    bottom: 14px;
    right: 16px;
    z-index: 2;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.88);
    text-shadow:
        0 1px 3px rgba(0,0,0,0.9),
        0 1px 6px rgba(0,0,0,0.6);
    font-style: italic;
    font-weight: 500;
    max-width: 55%;
    text-align: right;
    line-height: 1.25;
}

/* Responsīvs */
@media (max-width: 1100px) {
    .dg-grid { grid-template-columns: repeat(min(var(--dg-cols, 3), 2), 1fr); }
}
@media (max-width: 640px) {
    .dg-grid { grid-template-columns: 1fr; gap: 16px; }
    .dg-title { font-size: 1.1rem; }
    .dg-date { font-size: 0.8rem; }
}

/* Lightbox */
.dg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dg-lightbox.dg-open {
    display: flex;
}
.dg-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.dg-lb-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: min(720px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    animation: dgFadeIn 0.2s ease-out;
}
@keyframes dgFadeIn {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.dg-lb-img {
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}
.dg-lb-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dg-lb-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: #222;
}
.dg-lb-date {
    font-size: 0.82rem;
    color: #888;
    margin: 0;
}
.dg-lb-desc {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.5;
    margin: 4px 0 0;
}
.dg-lb-button {
    margin-top: 10px;
    display: inline-block;
    padding: 10px 18px;
    background: #1a73e8;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    align-self: flex-start;
    transition: background 0.15s;
}
.dg-lb-button:hover {
    background: #1557b0;
}
.dg-lb-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.dg-lb-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Infinite scroll loader */
.dg-wrap { position: relative; }
.dg-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #888;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.dg-loader.dg-loading {
    opacity: 1;
}
.dg-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: dgSpin 0.7s linear infinite;
}
@keyframes dgSpin {
    to { transform: rotate(360deg); }
}
.dg-loader-text {
    font-weight: 500;
}
