/* portfolio.css */

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background: #121212;
    color: #eee;
    font-family: 'Segoe UI', sans-serif;
    padding: 20px 5px;
}

/* ─── Loader ───────────────────────────────────────────────────────────────── */
#loader {
    position: fixed;
    inset: 0;
    background: #121212;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 15px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
    border: 6px solid #333;
    border-top-color: #8B3103;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 14px;
}

/* ─── Header ───────────────────────────────────────────────────────────────── */
.header-container {
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 0 10px;
}

.main-title {
    font-size: 2.2em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    margin: 0 0 4px;
}

.sub-title { margin: 0; font-size: 0.95em; color: #aaa; }

.email-link { color: #c0440f; text-decoration: none; }
.email-link:hover { text-decoration: underline; }

/* ─── Toolbar ──────────────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 50px 0 0;
    flex-wrap: wrap;
}

.btn-primary {
    background: #8B3103;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-primary:hover { background: #a83c04; }

/* ─── Divider ──────────────────────────────────────────────────────────────── */
.red-divider {
    max-width: 1400px;
    height: 3px;
    background: #8B3103;
    margin: 20px auto 30px;
}

/* ─── Masonry Grid ─────────────────────────────────────────────────────────── */
#masonry-grid {
    opacity: 0;
    transition: opacity 0.5s ease-in;
    margin: 0 auto;
}

#masonry-grid.ready { opacity: 1; }

.portfolio-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.photo-card {
    width: calc(25% - 10px);
    margin-bottom: 15px;
    background: #1a1a1a;
    padding: 6px;
    box-sizing: border-box;
    border-radius: 4px;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.photo-card.featured {
    width: calc(50% - 10px);
    background: transparent;
    border: none;
}

.photo-card.featured img {
    width: 70% !important;
    margin: 0 auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    background: #151515;
}

/* ─── JS Lightbox ──────────────────────────────────────────────────────────── */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#lightbox-overlay.open { display: flex; }

#lightbox-img {
    max-width: 88%;
    max-height: 85%;
    object-fit: contain;
    border: 1px solid #444;
}

#lightbox-close,
#lightbox-prev,
#lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    opacity: 0.75;
    transition: opacity 0.2s;
}
#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover { opacity: 1; }

#lightbox-close { top: 15px; right: 20px; }
#lightbox-prev  { left: 15px; top: 50%; transform: translateY(-50%); }
#lightbox-next  { right: 15px; top: 50%; transform: translateY(-50%); }

/* ─── Cinematic Rotator ────────────────────────────────────────────────────── */
#cinematic-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
}

#rotator-target {
    position: relative;
    width: 100%;
    height: 100%;
}

.rotator-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 85%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    border: 12px solid #fff;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    background-color: #111;
}

.rotator-slide.active { opacity: 1; }

.rotator-controls {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5001;
}

.rotator-counter {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', sans-serif;
}

.rotator-btn {
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    text-shadow: 0 0 10px #000;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.rotator-btn:hover { opacity: 1; }

/* ─── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0 20px;
    flex-wrap: wrap;
}

.page-btn {
    background: #1a1a1a;
    color: #eee;
    border: 1px solid #333;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
}

.page-btn:hover   { background: #2a2a2a; border-color: #8B3103; }
.page-btn.active  { background: #8B3103; border-color: #8B3103; color: #fff; cursor: default; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .photo-card         { width: calc(50% - 10px); }
    .photo-card.featured{ width: calc(100% - 10px); }
    .toolbar            { padding-right: 10px; }
}

@media (max-width: 500px) {
    .photo-card { width: calc(100% - 10px); }
    .main-title { font-size: 1.5em; }
}
