/* --- Project Page Variables --- */
:root {
    --p-bg: #141218;
    --p-card: #211F26;
    --p-accent: #A8C7FA;
    --p-text: #E6E1E5;
    --p-text-dim: #CAC4D0;
}

body.project-page {
    background-color: var(--p-bg);
    color: var(--p-text);
    font-family: 'Roboto', sans-serif;
}

/* --- Floating Back Button --- */
.back-pill {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 100px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s;
}
.back-pill:hover { background: var(--p-accent); color: black; }

/* --- Hero Header --- */
.project-hero {
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--p-bg) 0%, transparent 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}
.hero-tag {
    background: var(--p-accent);
    color: black;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.hero-content h1 { font-size: 3.5rem; margin: 10px 0; line-height: 1; }
.hero-lead { font-size: 1.2rem; max-width: 600px; color: var(--p-text-dim); }

/* --- Layout Grid --- */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.project-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3rds content, 1/3rd sidebar */
    gap: 40px;
}

/* --- Typography --- */
.info-block h2 { color: var(--p-accent); margin-bottom: 20px; }
.text-content { line-height: 1.8; font-size: 1.05rem; color: #CCC; }
.text-content p { margin-bottom: 20px; }

/* --- Sidebar Boxes --- */
.bento-box {
    background: var(--p-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.bento-box h3 { margin-top: 0; font-size: 1.1rem; color: var(--p-accent); }

/* Specs List */
.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}
.spec-key { color: var(--p-text-dim); }
.spec-val { font-family: 'Fira Code', monospace; color: white; }

/* BOM List */
.bom-list { list-style: none; padding: 0; }
.bom-list li { padding: 8px 0; display: flex; gap: 10px; color: #CCC; }
.check-icon { color: var(--p-accent); }

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.gallery-item img {
    width: 100%;
    border-radius: 12px;
    transition: transform 0.3s;
}
.gallery-item img:hover { transform: scale(1.02); }

/* --- Download Button --- */
.download-card {
    background: linear-gradient(135deg, #2B2930, #1e1e1e);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}
.download-btn-large {
    display: block;
    background: var(--p-accent);
    color: black;
    text-decoration: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 15px;
    transition: transform 0.2s;
}
.download-btn-large:hover { transform: translateY(-3px); }

/* --- Mobile --- */
@media (max-width: 800px) {
    .project-grid-layout { grid-template-columns: 1fr; }
    .project-hero { height: 50vh; }
    .hero-content h1 { font-size: 2.5rem; }
    /* Reorder sidebar to bottom on mobile */
    .sidebar-column { order: 2; }
    .main-column { order: 1; }
}
/* --- Long Form Text Styling --- */

/* Make the text easier to read (max-width for readability) */
.text-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #D1D1D1;
    margin-bottom: 40px;
}

/* Style the H3 headers inside the JSON content */
.text-content h3 {
    color: #A8C7FA; /* Your M3 Blue */
    font-size: 1.5rem;
    margin-top: 50px; /* Space above new sections */
    margin-bottom: 20px;
    border-left: 4px solid #A8C7FA; /* A cool blue accent line on the left */
    padding-left: 15px;
    font-weight: 700;
}

/* Remove margin for the very first header */
.text-content h3:first-child {
    margin-top: 0;
}

/* Bold text emphasizes keywords */
.text-content strong {
    color: #FFFFFF;
    font-weight: 700;
}

/* Tech terms in italics */
.text-content em {
    color: #A8C7FA;
    font-style: normal;
    font-family: 'Fira Code', monospace; /* Monospace for part names */
    font-size: 0.9em;
}

/* Bullet lists styling */
.text-content ul {
    background: rgba(255, 255, 255, 0.03); /* Subtle box background */
    border-radius: 16px;
    padding: 25px 30px 25px 50px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-content li {
    margin-bottom: 12px;
    color: #E3E3E3;
}

.text-content li:last-child {
    margin-bottom: 0;
}

/* --- Project Page Specifics --- */
body.project-page {
    background-color: #141218;
    color: #E6E1E5;
}

/* Hero Section */
.project-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #141218 5%, rgba(20,18,24,0.4) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}
.hero-tag {
    background: #A8C7FA; /* M3 Blue */
    color: #000;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.project-hero h1 {
    font-size: 3.5rem;
    margin: 15px 0;
    line-height: 1.1;
    color: #FFF;
}

/* Layout */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
.project-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Content 2/3, Sidebar 1/3 */
    gap: 40px;
}

/* Sidebar Boxes (Bento Style) */
.bento-box {
    background: #211F26;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 24px;
}
.bento-box h3 {
    margin-top: 0;
    color: #A8C7FA;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Specs List styling */
.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.spec-list li:last-child { border-bottom: none; }
.spec-key { color: #999; font-size: 0.9rem; }
.spec-val { color: #FFF; font-family: 'Fira Code', monospace; font-size: 0.9rem; text-align: right; }

/* BOM List styling */
.bom-list { list-style: none; padding: 0; margin: 0; }
.bom-list li {
    padding: 8px 0;
    display: flex;
    gap: 12px;
    color: #CCC;
    font-size: 0.95rem;
}
.check-icon { color: #A8C7FA; font-weight: bold; }

/* --- Gallery Grid (Autocrop 4:3) --- */

.gallery-grid {
    display: grid;
    /* Creates a responsive grid where columns are at least 250px wide */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    /* 1. FORCE THE SHAPE */
    aspect-ratio: 4 / 3;     /* Forces the box to be 4:3 */
    width: 100%;
    
    /* 2. KEEP IT CLEAN */
    overflow: hidden;        /* Hides the parts of the image that get cropped out */
    border-radius: 12px;     /* Rounds the corners of the container */
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: border-color 0.3s;
}

.gallery-item img {
    /* 3. FILL THE BOX */
    width: 100%;
    height: 100%;
    
    /* 4. THE MAGIC CROP */
    object-fit: cover;       /* Zooms image to fill the 4:3 box (crops edges) */
    
    display: block;          /* Removes annoying bottom gap */
    transition: transform 0.5s ease;
}

/* --- Hover Effects --- */
.gallery-item:hover {
    border-color: #A8C7FA;   /* Blue border on hover */
}

.gallery-item:hover img {
    transform: scale(1.05);  /* Subtle zoom inside the box */
}
/* Mobile Responsive */
@media (max-width: 900px) {
    .project-grid-layout { grid-template-columns: 1fr; }
    .project-hero h1 { font-size: 2.5rem; }
    /* Put sidebar below content on mobile */
    .sidebar-column { order: 2; }
    .main-column { order: 1; }
}

/* --- Private Card Styling --- */

/* Change background slightly to differentiate */
.private-card {
    background: linear-gradient(135deg, #2B2930, #2C1F1F); /* Subtle reddish tint */
    border-color: rgba(255, 100, 100, 0.2); /* Reddish border */
}

/* Change text color for the warning */
.private-card h3 {
    color: #FF8A80; /* Light Red/Orange text */
}

/* Contact Button Styling */
.contact-btn {
    background: transparent;
    border: 1px solid #FF8A80;
    color: #FF8A80;
    transition: all 0.2s ease;
}

.contact-btn:hover {
    background: #FF8A80;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 138, 128, 0.3);
}