@import url('https://fonts.googleapis.com/css2?family=Siemreap&display=swap');

body {
    font-family: "Siemreap", system-ui, -apple-system, sans-serif;
    margin: 0;
    background: #0f0f12;
    color: #eaeaea;
    line-height: 1.5;
}

a {
    color: #7dd3fc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

small {
    color: #999;
}

/* Project cards */
.project-card {
    padding: 18px;
    margin: 14px 0;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: #151517;
}

.project-card:hover {
    border-color: #3a3a3a;
}

.project-title {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.project-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 10px;
}

.project-desc {
    opacity: 0.8;
    margin: 10px 0;
}

.project-tags {
    margin-top: 12px;
}

.tag {
    font-size: 12px;
    margin-right: 6px;
    color: #aaa;
}

.featured-badge {
    color: #facc15;
    font-weight: 600;
}

/* Back link */
.back-link {
    margin-bottom: 20px;
    display: inline-block;
}

/* Thumbnail placeholder */
.thumbnail {
    width: 100%;
    border-radius: 10px;
    margin: 10px 0;
    background: #1f1f1f;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 14px;
}

/* Content area */
.content-area {
    margin-top: 24px;
}

/* Metadata line */
.meta-line {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Authors */
.authors-list {
    margin: 12px 0;
    color: #999;
}

/* Links section */
.links-section {
    margin: 16px 0;
}

.link-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    margin: 4px 8px 4px 0;
    font-size: 14px;
}

.link-btn:hover {
    background: #2a2a2a;
    text-decoration: none;
}

/* Gallery grids */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

/* Project gallery */
.project-gallery,
.scanned-gallery {
    margin-top: 40px;
}

.project-gallery h2,
.scanned-gallery h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* Gallery item */
.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    background: #111;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: #444;
}

.gallery-item:focus {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    display: block;
}

.gallery-item .gallery-item-caption {
    padding: 6px 8px;
    font-size: 11px;
    color: #888;
}
/* ===============================
   Site Header / Navigation
================================= */
.site-header {
    border-bottom: 1px solid #2a2a2a;
    background: #151517;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.site-logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #eaeaea !important;
    text-decoration: none !important;
}

.site-logo img {
    max-height: 40px;
    width: auto;
    margin-right: 8px;
    animation: slideInRotate 1s ease-out forwards;
}

.site-logo span {
    font-size: 20px;
}

@keyframes slideInRotate {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(180deg);
        opacity: 1;
    }
}
.site-logo {
    font-size: 0; /* Remove text node size */
    font-weight: 700;
    color: #eaeaea !important;
    text-decoration: none !important;
}

.site-logo:hover {
    text-decoration: underline !important;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: #999;
    font-size: 14px;
    text-decoration: none;
}

.nav-links a:hover {
    color: #7dd3fc;
    text-decoration: none;
}

/* ===============================
    Site Footer
================================= */
.site-footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid #2a2a2a;
    color: #666;
    font-size: 13px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left {
    color: #999;
}

.footer-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-right a {
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: #7dd3fc;
}

.footer-right svg {
    width: 20px;
    height: 20px;
}

/* ===============================
    Lightbox Modal
================================= */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
}

.lightbox-media {
    flex: 1;
    text-align: center;
}

.lightbox-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
    color: #aaa;
    font-size: 13px;
    text-align: left;
}

.lightbox-sidebar h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.lightbox-sidebar p {
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.lightbox.visible {
    display: block;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 48px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #7dd3fc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    padding: 16px 8px;
    border-radius: 4px;
    z-index: 2001;
}

.lightbox-main-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #7dd3fc;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    color: #aaa;
    font-size: 14px;
    margin-top: 12px;
}

.lightbox-counter {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
}

/* Lightbox sidebar responsive */
@media (max-width: 1024px) {
    .lightbox-sidebar {
        display: none;
    }
}

/* ===============================
   Editorial Grid System
================================= */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.grid-card {
    background: #151517;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    grid-column: span 12;
}

.grid-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

.grid-card.featured {
    background: linear-gradient(135deg, #1a1a1f 0%, #151517 100%);
    border-color: #444;
}

.grid-card .project-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.grid-card .project-title {
    font-size: 18px;
    line-height: 1.3;
    margin: 14px 18px 6px 18px;
    font-weight: 600;
}

.grid-card.featured .project-title {
    font-size: 20px;
    margin: 18px 22px 8px 22px;
}

.grid-card .project-meta {
    font-size: 12px;
    color: #666;
    margin: 0 18px 10px 18px;
}

.grid-card.featured .project-meta {
    margin: 0 22px 12px 22px;
}

.grid-card .project-desc {
    font-size: 13px;
    color: #666;
    margin: 0 18px 14px 18px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-card.featured .project-desc {
    font-size: 14px;
    margin: 0 22px 16px 22px;
    -webkit-line-clamp: 4;
}

.grid-card .project-tags {
    margin: 0 18px 14px 18px;
}

.grid-break {
    background: rgba(125, 255, 255, 0.03);
    border: 1px solid rgba(125, 255, 255, 0.08);
    border-left: 3px solid #7dd3fc;
    margin: 20px 0;
    padding: 24px 36px !important;
    text-align: center;
    font-style: italic;
    color: #7dd3fc;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.9;
    border-radius: 12px !important;
    grid-column: span 12;
}

.grid-break:hover {
    background: rgba(125, 255, 255, 0.06);
    border-color: rgba(125, 255, 255, 0.15);
}

/* ===============================
   Listing Page
================================= */
.listing-header {
    margin-bottom: 24px;
}

.listing-subtitle {
    color: #666;
    margin-top: -10px;
}

.listing-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.listing-card {
    box-shadow: none;
}

.listing-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.listing-card .project-thumb {
    height: 200px;
}

.listing-card .project-title {
    font-size: 17px;
}

.listing-card .project-desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}

.project-list {
    margin-bottom: 40px;
}

.project-list ul {
    list-style: none;
    padding: 0;
}

.project-list li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #151517;
    transition: border-color 0.2s ease;
}

.project-list li:hover {
    border-color: #3a3a3a;
}

.list-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 16px;
    flex-shrink: 0;
}

.list-thumb.placeholder {
    background: #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 12px;
}

.list-content a {
    color: #7dd3fc;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.list-content a:hover {
    text-decoration: underline;
}

.list-content p {
    color: #999;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.tag-cloud {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
}

.tag-cloud a {
    display: inline-block;
    margin: 5px 10px;
    padding: 8px 16px;
    background: #151517;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    color: #7dd3fc;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tag-cloud a:hover {
    background: #1a1a1f;
    border-color: #3a3a3a;
    color: #5dcffb;
}

.stl-section, .pdf-section {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #2a2a2a;
}

.stl-section h2, .pdf-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.stl-item, .pdf-item {
    margin-bottom: 20px;
}

.stl-item a {
    color: #7dd3fc;
    text-decoration: none;
}

.stl-item a:hover {
    text-decoration: underline;
}

.pdf-item embed {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.project-body {
    max-width: 68ch;
    margin: 0 auto;
    padding: 24px 0;
}

.project-body h2 {
    font-size: 20px;
    margin: 24px 0 12px 0;
}

.project-body h3 {
    font-size: 17px;
    margin: 20px 0 10px 0;
}

.project-body p {
    line-height: 1.7;
    margin: 0 0 14px 0;
}

.project-body ul, .project-body ol {
    margin: 0 0 14px 0;
    padding-left: 24px;
}

.project-body li {
    margin: 4px 0;
    line-height: 1.6;
}

.project-body pre {
    max-width: 68ch;
    overflow-x: auto;
}

/* ===============================
   Map containment (prevents map /
   Leaflet panes from escaping the
   map container and overlapping the
   sticky site-header on scroll)
================================= */
#map,
.map-wrapper {
    contain: layout paint style;
    position: relative;
    z-index: 1;
}

#map .leaflet-pane {
    z-index: auto !important;
}

/* ===============================
   Responsive
================================= */
@media (max-width: 1024px) {
    .editorial-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 18px;
    }
    .grid-card, .grid-card.featured {
        grid-column: span 12 !important;
    }
    .grid-break { grid-column: span 12 !important; }
    .listing-card .project-thumb {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .editorial-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 16px;
    }
    .grid-card, .grid-card.featured {
        grid-column: span 12 !important;
    }
    .grid-break { grid-column: span 12 !important; }
    .grid-card .project-thumb {
        height: 180px;
    }
    .listing-card .project-thumb {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .editorial-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .grid-card, .grid-card.featured, .grid-break {
        grid-column: 1 !important;
    }
    .grid-card .project-thumb {
        height: 160px;
    }
    .grid-card .project-title {
        font-size: 16px;
    }
    .listing-card .project-thumb {
        height: 160px;
    }
    .site-logo span {
        display: none;
    }
}

/* ===============================
    Project List — Card Item
================================= */
.project-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: #121214;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    margin: 8px 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.project-list li:hover {
    background: #1a1a1e;
    border-color: #222222;
}

.thumb-wrap {
    flex-shrink: 0;
    width: 90px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1e;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

/* Right content stack */
.card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: #eaeaea;
    margin: 0;
}

.card-title a {
    color: #eaeaea;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.card-title a:hover {
    color: #7dd3fc;
}

.card-desc {
    font-size: 13px;
    line-height: 1.55;
    color: #9a9a9a;
    margin: 0;
    color-scheme: dark;
}

/* Subtle tags under cards */
.project-list .tag {
    font-size: 11px;
    margin-right: 4px;
    color: #6c6c6c;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 1px 6px;
}

/* Hover: thumbnail nudge */
.project-list li:hover .thumb-img {
    transform: scale(1.06);
}

.footer-logo {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 900;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

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