/* 
   PROJECTS PAGE — SRAEDS
    */

body { background: var(--col-light); }

/* ---- Gallery wrapper ---- */
.project-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px 60px;
}

.project-gallery h1 {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--col-steel);
    margin-bottom: 10px;
    padding-bottom: 20px;
    position: relative;
}

.project-gallery h1::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 5px;
    background: var(--col-amber);
    border-radius: 3px;
}

/* ---- Grid ---- */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1280px;
    margin-top: 40px;
}

/* ---- Project card ---- */
.item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--col-card);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition);
    aspect-ratio: 4 / 3;
}

.item:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

/* Image */
.item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.4s ease;
    z-index: 0;
}

.item:hover img {
    transform: scale(1.08);
    opacity: 0.25;
}

/* Gradient overlay (always present, stronger on hover) */
.item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(26,35,50,0.85) 0%,
        rgba(26,35,50,0.1) 60%,
        transparent 100%
    );
    z-index: 1;
    transition: opacity var(--transition);
}

.item:hover::before { opacity: 0; }

/* Title bar (visible always at bottom) */
.text {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 2;
    padding: 20px 22px;
    transition: all var(--transition);
}

.item:hover .text {
    top: 0; bottom: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
}

.text h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--col-white);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    text-transform: uppercase;
    line-height: 1.2;
    transition: font-size var(--transition);
}

.item:hover .text h3 {
    font-size: 22px;
}

/* "Learn More" button */
.item .button {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--col-steel);
    background: var(--col-amber);
    padding: 12px 32px;
    border-radius: 4px;
    border: 2px solid var(--col-amber);
    cursor: pointer;
    white-space: nowrap;
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background var(--transition),
                box-shadow var(--transition);
    box-shadow: 0 4px 16px rgba(232,160,32,0.4);
}

.item:hover .button {
    bottom: 18px;
}

.item .button:hover {
    background: var(--col-amber-dk);
    border-color: var(--col-amber-dk);
    color: var(--col-white);
    box-shadow: 0 6px 20px rgba(232,160,32,0.55);
}

/* 
   MODAL
    */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10,15,25,0.0);
    transition: background 0.4s ease;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal.open {
    background: rgba(10,15,25,0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--col-card);
    max-width: 760px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.88) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.modal.open .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal.closing .modal-content {
    transform: scale(0.92) translateY(10px);
    opacity: 0;
}

/* Modal image */
#img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

/* Title bar */
#title {
    background: var(--col-steel);
    color: var(--col-white);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 20px 28px;
    position: relative;
    border-top: 3px solid var(--col-amber);
}

/* Description */
#details {
    padding: 24px 28px 32px;
    background: var(--col-card);
    color: var(--col-muted);
    font-size: 15px;
    line-height: 1.75;
    max-height: 260px;
    overflow-y: auto;
    word-wrap: break-word;
}

#details::-webkit-scrollbar { width: 5px; }
#details::-webkit-scrollbar-thumb { background: var(--col-border); border-radius: 3px; }

/* Close button */
.close {
    position: absolute;
    top: 14px; right: 18px;
    font-size: 28px;
    color: rgba(245,243,239,0.7);
    cursor: pointer;
    line-height: 1;
    z-index: 5;
    transition: all var(--transition);
    font-weight: 300;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.close:hover {
    color: var(--col-white);
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* 
   RESPONSIVE
    */

@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }

    .item .button { bottom: 14px; }
    .item img { opacity: 0.2; transform: scale(1.05); }
    .item .text { top: 0; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; }
    .item .button { bottom: 18px; }
    .item::before { opacity: 0; }

    #img { height: 260px; }
    .modal { padding: 20px 12px; }
    .project-gallery h1 { font-size: 36px; }
}

@media (max-width: 480px) {
    .project-gallery h1 { font-size: 28px; }
    #img { height: 200px; }
    .container { grid-template-columns: 1fr; }
}

/* ---- Location badge on cards ---- */
.card-location-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--col-amber);
    background: rgba(26,35,50,0.75);
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 8px;
    border: 1px solid rgba(232,160,32,0.3);
    white-space: nowrap;
}

/* ---- Modal title bar with location ---- */
#title-bar {
    background: var(--col-steel);
    padding: 20px 28px;
    border-top: 3px solid var(--col-amber);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#title-bar #title {
    color: var(--col-white);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

#modal-location {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--col-amber);
    background: rgba(232,160,32,0.12);
    padding: 3px 10px;
    border-radius: 3px;
    border: 1px solid rgba(232,160,32,0.3);
    display: inline-block;
    width: fit-content;
}

/* Remove old #title standalone styles if any interference */
#title { color: var(--col-white); }