@font-face {
    font-family: 'Figtree';
    src: url(./fonts/Figtree-VariableFont_wght.woff2);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Figtree, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0b1a10;
    min-height: 100vh;
    width: 100%;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #ffd700;
    color: #0b1a10;
    padding: 10px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

header {
    background-color: #162c1e;
    color: #e0eadd;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: sticky;
    top: 0;
    height: 70px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-back-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    height: 100%;
    transition: opacity 0.3s ease;
}

.header-back-link:hover {
    opacity: 0.8;
}

.header-back-link:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 4px;
    border-radius: 4px;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-area h1 {
    margin: 0 0 0 10px;
    font-size: 24px;
    font-weight: bold;
}

.logo-area img {
    width: auto;
    height: 40px;
}

.gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: #e0eadd;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 150px; /* Extra space for footer */
}

h2 {
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 5vw + 1rem, 3rem);
    text-align: center;
    line-height: 1.2;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 43%, 200px), 1fr));
    gap: 15px;
    width: 100%;
    padding-bottom: 0;
}

@media (min-width:1100px) and (max-width: 1299px) {
    .photo-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1300px) {
    .photo-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .photo-item:nth-child(8) {
        grid-column-start: 2;
    }
}

.photo-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item:focus-visible,.control-btn:focus-visible,.close-modal:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 4px;
    border-radius: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 26, 16, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

h3 {
    color: #e0eadd;
}

.modal-frame {
    background-color: #162c1e;
    border: 2px solid #2d5a3d;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    position: relative;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;

}

.modal-main-content {
    display: flex;
    flex-direction: column;
    width: fit-content;
    padding: 20px 30px 0 30px;
}

.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    width: 100%;
}

#modal-caption {
    margin: 0;
    padding: 0;
    font-size: 20px;
    color: #e0eadd;
}

.modal-content {
    max-width: 80%;
    max-height: 80%;
    text-align: center;
    color: #e0eadd;
}

.close-modal{
    position: static;
    color: #e0eadd;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ffd700;
}

.modal-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

#modal-img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.modal-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap:clamp(10px, 4vw, 30px);
    padding: 20px 20px 30px 30px;
    width: 100%;
    box-sizing: border-box;
   
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #e0eadd;
    color: #e0eadd;
    width: 45px;
    height: 45px;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.control-btn:hover {
    background-color: #e0eadd;
    color: #162c1e;
    
}

.photo-counter {
    letter-spacing: 1px;
    color: #e0eadd;
    font-size: clamp(14px, 4vw, 18px);
    opacity: 0.8;
    white-space: nowrap;
}

@media (max-width:700px) {
    .modal-frame {
        max-width: 95%;
    }

    .modal-caption {
        font-size: 18px;
    }

    .close-modal {
        font-size: 28px;
    }

    .control-btn {
        font-size: 20px;
        padding: 8px 16px;
    }
}

.like-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.heart-icon {
    font-size: 24px;
    color: #e0eadd;
    transition: color 0.2s ease, transform 0.2s ease;
}

.heart-icon.liked {
    color: #ff4d4d;
    transform: scale(1.2);
}

.heart-icon:hover {
    transform: scale(1.1);
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1.2);
    }
}

.heart-icon.animating {
    animation: heartPop 0.3s ease;
}

footer {
    box-sizing: border-box;
    background-color: #162c1e;
    color: #e0eadd;
    text-align: center;
    padding: 15px 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 80px;
    border-top-left-radius: 100% 30px;
    border-top-right-radius: 100% 30px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 200;
}