body { background: var(--sand-light, #f8f6f2); }
main { padding: 1rem 0 3rem; }
@media (min-width: 768px) { main { padding: 2.5rem 0 4rem; } }

/* ── Hero ── */
.gallery-hero {
    background: linear-gradient(135deg, #0B2545 0%, #134E6F 100%);
    color: #fff;
    padding: 1.5rem 1rem;
    text-align: center;
}
.gallery-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    line-height: 1.15;
    margin: 0 0 .4rem;
}
.gallery-hero p { opacity: .85; margin: 0 auto; max-width: 640px; font-size: .9rem; }
.gallery-back {
    display: inline-flex; align-items: center; gap: .4rem;
    color: rgba(255,255,255,.8); text-decoration: none; font-size: .85rem; margin-bottom: .5rem;
}
.gallery-back:hover { color: #fff; }
@media (min-width: 640px) {
    .gallery-hero { padding: 2rem 0; }
    .gallery-hero h1 { font-size: 2.2rem; }
}

/* ── Trip list ── */
.gallery-trips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 600px)  { .gallery-trips { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; } }
@media (min-width: 1000px) { .gallery-trips { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.gallery-trip {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}
@media (hover: hover) {
    .gallery-trip:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
}
.gallery-trip__cover {
    position: relative;
    aspect-ratio: 16/10;
    background: #e5edf3;
    display: flex; align-items: center; justify-content: center;
    color: #9fb3c4; font-size: 2.5rem;
}
.gallery-trip__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-trip__count {
    position: absolute; right: .6rem; bottom: .6rem;
    background: rgba(11,37,69,.8); color: #fff;
    font-size: .8rem; padding: .25rem .6rem; border-radius: 999px;
}
.gallery-trip__body { padding: .9rem 1.1rem 1.1rem; }
.gallery-trip__body h2 { font-size: 1rem; color: var(--ocean-deep); margin: 0 0 .3rem; line-height: 1.3; }
.gallery-trip__body p { font-size: .85rem; color: #6b7280; margin: 0; }
.gallery-trip__badge {
    display: inline-flex; align-items: center; gap: .35rem;
    margin-top: .6rem; font-size: .75rem; font-weight: 600;
    color: #0f766e; background: #ccfbf1; padding: .2rem .55rem; border-radius: 999px;
}

/* ── Alerts / hints / empty ── */
.gallery-alert {
    background: #dcfce7; color: #166534;
    padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem;
}
.gallery-alert--warn { background: #fef3c7; color: #92400e; }
.gallery-hint { color: #4b5563; font-size: .9rem; margin: 0 0 1.25rem; }
.gallery-hint a { color: var(--ocean-light); font-weight: 600; }
.gallery-empty { text-align: center; color: #9ca3af; padding: 3rem 0; }
.gallery-empty i { font-size: 2.5rem; margin-bottom: .75rem; }

/* ── Upload form ── */
.gallery-upload {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.gallery-upload__drop {
    display: flex; flex-direction: column; align-items: center; gap: .4rem;
    border: 2px dashed #cbd5e1; border-radius: 12px;
    padding: 1.25rem; text-align: center; cursor: pointer;
    color: #64748b; font-size: .9rem;
    transition: border-color .2s, background .2s;
}
.gallery-upload__drop i { font-size: 1.8rem; color: var(--ocean-light); }
.gallery-upload__drop.dragover,
.gallery-upload__drop:hover { border-color: var(--wave-teal); background: #f0fdfa; }
.gallery-upload__drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gallery-upload__fields {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .9rem;
}
.gallery-upload__fields input[type="text"],
.gallery-upload__fields select {
    flex: 1 1 180px;
    padding: .6rem .75rem; border: 1px solid #d1d5db; border-radius: 8px;
    font: inherit; font-size: .9rem; min-height: 42px;
}
.gallery-upload__check { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: #374151; }
.gallery-upload__fields .btn-primary { border: none; cursor: pointer; min-height: 42px; }

/* ── Photo grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
}
@media (min-width: 640px)  { .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: .75rem; } }
@media (min-width: 1000px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }

.gallery-item {
    position: relative;
    margin: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.gallery-item__img {
    display: block; width: 100%; padding: 0; border: none; background: #e5edf3;
    aspect-ratio: 4/3; overflow: hidden; cursor: zoom-in;
}
.gallery-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
@media (hover: hover) { .gallery-item__img:hover img { transform: scale(1.05); } }
.gallery-item figcaption { padding: .45rem .6rem; font-size: .8rem; color: #374151; line-height: 1.35; }
.gallery-item figcaption strong { color: var(--ocean-blue); margin-right: .3rem; }

.gallery-item__tag {
    position: absolute; top: .4rem; left: .4rem;
    background: rgba(11,37,69,.75); color: #fff;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .7rem;
}
.gallery-item__tag--cover { left: auto; right: .4rem; background: #f59e0b; }
.gallery-item__actions {
    position: absolute; bottom: 2.2rem; right: .4rem;
    display: flex; gap: .3rem;
}
.gallery-item:not(:has(figcaption)) .gallery-item__actions { bottom: .4rem; }
.gallery-item__actions form { margin: 0; }
.gallery-item__actions button {
    width: 32px; height: 32px; border: none; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,.92); color: #374151; font-size: .8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.gallery-item__actions button:hover { color: var(--coral); }
.gallery-item__actions button[name="set_cover"]:hover { color: #f59e0b; }

/* ── Lightbox ── */
.gal-lb {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9000;
    align-items: center; justify-content: center;
}
.gal-lb.active { display: flex; }
.gal-lb img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 8px; }
.gal-lb__close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.gal-lb__prev,
.gal-lb__next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: .75rem .9rem; border-radius: 8px; }
.gal-lb__prev { left: .75rem; }
.gal-lb__next { right: .75rem; }
.gal-lb__caption { position: absolute; bottom: 1.25rem; left: 1rem; right: 1rem; color: rgba(255,255,255,.85); font-size: .9rem; text-align: center; }
