*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f6feff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a{
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
    cursor: pointer;
}

header {
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5rem;
    color: #007bff;
}

nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav ul{
    list-style: none;
    display: flex;
    gap: 1rem;
}

nav li{
    margin: 0;
}

nav a {
    text-decoration: none;
    color: #333;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    color: #007bff;
    background-color: #e9f2ff;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

main h1 {
    margin-bottom: 2rem;
    color: #333;
    font-size: 2rem;
}

.actions-bar {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

main h2 {
    margin: 1.5rem 0 1rem;
    color: #555;
}

main p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.document-item {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.document-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.document-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.document-link:hover {
    color: #007bff;
}

.document-title {
    font-weight: 500;
}

.document-ext {
    font-size: 0.875rem;
    color: #666;
    background-color: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.gallery-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-viewer[hidden] {
    display: none;
}

.viewer-figure {
    margin: 0 auto;
    max-width: 100%;
    position: relative;
}

.viewer-figure img {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #070a14;
}

.viewer-figure figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.5rem;
    color: #f3f5ff;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    font-size: 0.9rem;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-close:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.viewer-nav {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.viewer-nav:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.viewer-nav.prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.viewer-nav.next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Document Viewer */
[data-document-viewer] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-document-viewer].hidden {
    display: none;
}

[data-document-viewer][hidden] {
    display: none;
}

[data-document-viewer-content] {
    width: 90%;
    height: 90%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.document-title {
    background-color: #f5f5f5;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    font-weight: 500;
    color: #333;
}

[data-document-viewer-content] embed,
[data-document-viewer-content] iframe,
[data-document-viewer-content] img {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

[data-document-viewer-content] img {
    object-fit: contain;
}

.document-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.document-download p {
    margin-bottom: 1rem;
    color: #666;
}

.download-btn {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #0056b3;
}

[data-document-viewer-close] {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

[data-document-viewer-close]:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.commentaires {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.commentaire {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.commentaire-preview {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.btn-view-comment {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.5rem;
}

.btn-view-comment:hover {
    text-decoration: underline;
}

.commentaire:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.infos-identite {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.infos-identite span {
    font-style: italic;
    font-size: 0.85rem;
    color: #999;
}

.commentaire h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: #007bff;
}

.commentaire p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

/* Prières */
.prieres-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.priere-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.3rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
}

.priere-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.priere-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.priere-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.btn-edit {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.priere-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
}

.priere-link:hover {
    color: #007bff;
}

.priere-type-badge {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: capitalize;
    white-space: nowrap;
}

.priere-title {
    font-weight: 500;
    font-size: 1.1rem;
    flex: 1;
}

.priere-meta {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
}

/* Prière details in modal */
.priere-details {
    line-height: 1.6;
}

.priere-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.priere-info .priere-type-badge {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.priere-author {
    font-style: italic;
    color: #666;
}

.priere-date {
    color: #999;
    font-size: 0.85rem;
}

.priere-chapo {
    margin-bottom: 1rem;
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

.priere-contenu {
    color: #333;
    margin-bottom: 1.5rem;
}

.priere-contenu p {
    margin-bottom: 0.75rem;
}

.priere-stats {
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #999;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.pagination a:hover {
    background-color: #0056b3;
}

.pagination span {
    color: #666;
    font-size: 0.9rem;
}

/* Stats Cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    margin: 0 0 0.5rem 0;
}

.stat p {
    font-size: 1rem;
    color: #666;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive pour les stats */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat {
        padding: 1.5rem;
    }
    
    .stat h2 {
        font-size: 2rem;
    }
    
    .stat p {
        font-size: 0.9rem;
    }
}

/* Welcome Message */
.welcome-message {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    border-left: 4px solid #007bff;
}

.welcome-message h2 {
    font-size: 1.5rem;
    color: #007bff;
    margin: 0 0 1rem 0;
}

.welcome-message p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.public-visits-dashboard {
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 16px;
    background: linear-gradient(145deg, #f9fcff 0%, #edf4ff 100%);
    border: 1px solid #d6e6ff;
    box-shadow: 0 10px 28px rgba(9, 45, 94, 0.08);
}

.public-visits-dashboard__header {
    margin-bottom: 1.5rem;
}

.public-visits-dashboard__header h2 {
    margin: 0;
    font-size: 1.55rem;
    color: #0f376d;
}

.public-visits-dashboard__header p {
    margin: 0.65rem 0 0;
    color: #4d5f77;
    font-size: 0.98rem;
}

.public-visits-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.35rem;
}

.public-visits-kpi {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #dbe8ff;
    box-shadow: 0 4px 12px rgba(9, 45, 94, 0.06);
}

.public-visits-kpi__label {
    margin: 0;
    color: #526580;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.public-visits-kpi__value {
    margin: 0.35rem 0 0;
    color: #0f376d;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.public-visits-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.public-visits-panel {
    background-color: #ffffff;
    border: 1px solid #dbe8ff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(9, 45, 94, 0.05);
}

.public-visits-panel h3 {
    margin: 0 0 0.85rem;
    color: #0f376d;
    font-size: 1.05rem;
}

.public-visits-ranking {
    margin: 0;
    padding-left: 1.35rem;
    display: grid;
    gap: 0.55rem;
}

.public-visits-ranking li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.public-visits-ranking__key {
    color: #33445b;
    word-break: break-word;
}

.public-visits-ranking__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 1.8rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background-color: #e8f0ff;
    color: #1a4f96;
    font-weight: 700;
    font-size: 0.9rem;
}

.public-visits-recent {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.public-visits-recent li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 0.65rem;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    background-color: #f6f9ff;
}

.public-visits-recent__type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.public-visits-recent__type--photo {
    background-color: #e8fff2;
    color: #0b6a3f;
}

.public-visits-recent__type--priere {
    background-color: #fff4e6;
    color: #8b4c0f;
}

.public-visits-recent__type--visite {
    background-color: #e8eefc;
    color: #294e98;
}

.public-visits-recent__type--autre {
    background-color: #eef0f4;
    color: #4a586d;
}

.public-visits-recent__key {
    color: #33445b;
    font-size: 0.92rem;
    word-break: break-word;
}

.public-visits-recent__time {
    grid-column: 1 / -1;
    color: #6e7f98;
    font-size: 0.8rem;
}

.public-visits-empty {
    margin: 0;
    color: #6f7f95;
    font-style: italic;
}

.public-visits-activity-wrap {
    overflow-x: auto;
}

.public-visits-activity {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.public-visits-activity th,
.public-visits-activity td {
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid #e5eefc;
    text-align: left;
    white-space: nowrap;
}

.public-visits-activity th {
    font-size: 0.8rem;
    color: #506583;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.public-visits-activity td {
    color: #33445b;
}

/* Responsive pour welcome-message */
@media (max-width: 768px) {
    .welcome-message {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .welcome-message h2 {
        font-size: 1.25rem;
    }
    
    .welcome-message p {
        font-size: 0.9rem;
    }

    .public-visits-dashboard {
        padding: 1.2rem;
        margin: 1.5rem 0;
    }

    .public-visits-dashboard__header h2 {
        font-size: 1.3rem;
    }

    .public-visits-panels {
        grid-template-columns: 1fr;
    }

    .public-visits-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Usrs list */
/* Users List */
.users-list {
    margin-top: 2rem;
}

.users-list__items {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.users-list__items thead {
    background-color: #007bff;
    color: white;
}

.users-list__items th {
    padding: 1rem;
    text-align: left;
    font-weight: 500;
}

.users-list__items tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.users-list__items tbody tr:hover {
    background-color: #f9f9f9;
}

.users-list__items tbody tr:last-child {
    border-bottom: none;
}

.users-list__items td {
    padding: 1rem;
}

.users-list__items td a {
    margin-right: 1rem;
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.users-list__items td a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Responsive pour users-list */
@media (max-width: 768px) {
    .users-list {
        overflow-x: auto;
    }

    .users-list__items {
        font-size: 0.9rem;
        min-width: 600px;
    }

    .users-list__items th,
    .users-list__items td {
        padding: 0.75rem 0.5rem;
    }
}

.formulaire-commentaire {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.formulaire-commentaire fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 0;
}

.formulaire-commentaire legend {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    padding: 0 0.5rem;
}

.form-note {
    font-size: 0.8rem;
    font-style: italic;
    color: #086d03;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: #fff;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 2rem;
}

.btn-submit {
    padding: 0.75rem 2rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #0056b3;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.modal-body .formulaire-commentaire {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

.modal-body .formulaire-commentaire fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.modal-body .formulaire-commentaire legend {
    display: none;
}

.modal-body .commentaire-full h2{
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.modal-body .commentaire-full p{
    margin: 0;
    font-size: 1rem;
    color: #5d5c5c;
}

footer {
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: auto;
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        margin: 0;
        text-align: center;
    }

    main {
        padding: 1rem;
    }

    main h1 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .gallery-viewer {
        padding: 0.5rem;
        grid-template-columns: auto minmax(240px, 80vw) auto;
        gap: 0.55rem;
    }

    .viewer-nav {
        justify-self: center;
    }

    .viewer-figure {
        max-height: 75vh;
    }
}

@media (orientation: landscape) {
    .gallery-viewer {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .viewer-figure {
        max-width: 95vw;
    }

    .viewer-nav.prev {
        position: absolute;
        left: 0.6rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .viewer-nav.next {
        position: absolute;
        right: 0.6rem;
        top: 50%;
        transform: translateY(-50%);
    }
}

