/* Page styles for templates/catches.html (moved out of the template, issue #96) */
.header {
    padding: 2rem;
    background: linear-gradient(180deg, var(--ocean-dark) 0%, var(--ocean-abyss) 100%);
    border-bottom: 1px solid var(--card-border);
}

.main {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem;
}

.page-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.page-intro h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--ocean-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-intro p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 0 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    border-radius: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.filter-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: var(--ocean-deep);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234fd1c5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

/* Catch of the Week Section */
.catch-of-week-section {
    margin-bottom: 2rem;
}

.catch-of-week-title {
    color: #d4a017;
}

.catch-of-week-title svg {
    color: #d4a017 !important;
}

.catch-of-week-card {
    display: flex;
    gap: 1.5rem;
    background: var(--card-bg);
    border: 2px solid #d4a017;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.15);
}

.catch-of-week-image {
    flex: 0 0 300px;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.catch-of-week-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) { .catch-of-week-image:hover img { transform: scale(1.05); } }

.catch-of-week-info {
    flex: 1;
    padding: 1.5rem 1.5rem 1.5rem 0;
    display: flex;
    flex-direction: column;
}

.catch-of-week-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #d4a017, #f0c420);
    color: #1a1a2e;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.catch-of-week-badge svg {
    width: 14px;
    height: 14px;
}

.catch-of-week-species {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ocean-glow);
    margin-bottom: 0.5rem;
}

.catch-of-week-caption {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
}

.catch-of-week-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.catch-of-week-author {
    font-weight: 500;
}

.catch-of-week-bar a {
    color: var(--ocean-glow);
    text-decoration: none;
}

.catch-of-week-bar a:hover {
    text-decoration: underline;
}

.catch-of-week-votes {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-radius: 6px;
    color: #d4a017;
    font-weight: 600;
    font-size: 0.875rem;
}

.catch-of-week-votes svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .catch-of-week-card {
        flex-direction: column;
    }

    .catch-of-week-image {
        flex: none;
        width: 100%;
        max-height: 300px;
    }

    .catch-of-week-info {
        padding: 1rem;
    }
}

/* Featured Section */
.featured-section {
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--ocean-glow);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* Photo Grid - Compact Layout */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.photo-card {
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, translate 0.2s, transform 0.2s;
    position: relative;
    translate: 0px;  /* keeps the stacking context the same on hover (#168) */
}

.photo-card:hover {
    border-color: var(--ocean-glow);
}
@media (prefers-reduced-motion: no-preference) { .photo-card:hover { translate: 0 -2px; } }

.photo-card.featured {
    border-color: var(--ocean-glow);
    box-shadow: 0 0 20px rgba(79, 209, 197, 0.15);
}

.photo-image-container {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--ocean-deep);
    cursor: pointer;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) { .photo-card:hover .photo-image { transform: scale(1.05); } }

/* Overlay with info on hover */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
    pointer-events: none;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay-species {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ocean-glow);
    margin-bottom: 0.25rem;
}

/* Clickable species tags */
.species-tag {
    cursor: pointer;
    transition: color 0.2s, text-decoration 0.2s;
    text-decoration: none;
    color: inherit;
}

.species-tag:hover {
    text-decoration: underline;
}

.photo-overlay .species-tag {
    pointer-events: auto;
    color: var(--ocean-glow);
}

.lightbox-species .species-tag {
    color: var(--ocean-glow);
}

.lightbox-species .species-tag:hover {
    color: var(--ocean-foam);
}

.species-info-link {
    color: var(--ocean-glow);
    text-decoration: none;
    margin-left: 6px;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.species-info-link:hover {
    color: var(--ocean-foam);
    opacity: 1;
}

.photo-overlay-author {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
}

.photo-overlay-bar {
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.6);
}

.photo-featured-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--ocean-glow);
    color: var(--ocean-deep);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

/* Compact card actions (vote count shown in corner) */
.photo-quick-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    z-index: 2;
}

.quick-vote {

}

.quick-vote.voted {
    background: var(--ocean-glow);
    color: var(--ocean-deep);
}

.quick-vote svg {
    width: 12px;
    height: 12px;
}

/* Keep old styles for featured section */
.photo-info {
    padding: 0.75rem;
}

.photo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.375rem;
}

.photo-species {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ocean-glow);
}

.photo-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.photo-caption {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.photo-author {
    color: var(--text-secondary);
}

.photo-bar {
    color: var(--ocean-glow);
    text-decoration: none;
}

.photo-bar:hover {
    text-decoration: underline;
}

.photo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--card-border);
}

.vote-count {
    font-weight: 600;
}

.report-btn {
    padding: 0.25rem 0.375rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-xs);
    cursor: pointer;
    opacity: 0.6;
    transition: color 0.2s, opacity 0.2s;
}

.report-btn:hover {
    opacity: 1;
    color: var(--status-closed);
}

.report-btn.reported {
    color: var(--status-closed);
    opacity: 1;
    cursor: default;
}

/* Report Modal */
.report-modal > .modal {
    width: min(400px, 100%);
    padding: 1.5rem;
}

.report-modal h2 {
    font-size: 1.17em;  /* the size it had as an h3 (#169) */
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.report-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--ocean-deep);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.report-option:hover {
    border-color: var(--ocean-glow);
}

/* :has() follows the radio itself, including keyboard selection (#168) */
.report-option:has(input:checked) {
    border-color: var(--ocean-glow);
    background: rgba(79, 209, 197, 0.1);
}

.report-option:has(input:focus-visible) {
    outline: 2px solid var(--ocean-glow);
    outline-offset: 2px;
}

/* Visually hidden but still focusable, so the reasons can be chosen with the
   keyboard (display: none took the radios out of the tab order) */
.report-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.report-option span {
    color: var(--text-secondary);
}

.report-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pagination a:hover {
    border-color: var(--ocean-glow);
    color: var(--text-primary);
}

.pagination a.active {
    background: var(--ocean-glow);
    color: var(--ocean-deep);
    border-color: var(--ocean-glow);
}

.pagination-ellipsis {
    padding: 0.5rem 0.5rem;
    color: var(--text-muted);
    user-select: none;
}

.pagination-nav {
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.17em;  /* the size it had as an h3 (#169) */
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Enhanced Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
}

.lightbox-container {
    display: flex;
    flex-direction: column;
    max-width: 95vw;
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    overflow: hidden;
}

.lightbox-main {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.lightbox .lightbox-content {
    max-width: 90vw;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
    z-index: 10;
}

.lightbox-nav:hover:not(:disabled, [aria-disabled="true"]) {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--ocean-glow);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
}

.lightbox-actions {
    display: flex;
    gap: 0.375rem;
}

.lightbox-btn.facebook:hover { background: #1877f2; }
.lightbox-btn.twitter:hover { background: #1da1f2; }

.lightbox-info {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 8px 8px;
    color: white;
    flex-shrink: 0;
}

.lightbox-species {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ocean-glow);
    margin-bottom: 0.125rem;
}

.lightbox-caption {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.lightbox-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.lightbox-meta a {
    color: var(--ocean-glow);
    text-decoration: none;
}

.lightbox-meta a:hover {
    text-decoration: underline;
}

/* Share toast */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--ocean-glow);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    z-index: calc(var(--z-modal) + 10);
    opacity: 0;
    transition: opacity 0.3s;
}

.share-toast.visible {
    opacity: 1;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-nav.prev {
        left: 0.5rem;
    }

    .lightbox-nav.next {
        right: 0.5rem;
    }

    .lightbox .lightbox-content {
        max-width: 100%;
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
    }
}

@media (max-width: 768px) {
    .main {
        padding: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;  /* full-width filters and Apply, not pushed right */
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
    }

    .filter-actions a,
    .filter-actions button {
        flex: 1;
        text-align: center;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .page-intro h2 {
        font-size: 1.5rem;
    }

    .page-intro {
        margin-bottom: 1rem;
    }

    /* Always show overlay on mobile (no hover) */
    .photo-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    }
}

@media (max-width: 480px) {
    .featured-grid,
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
