/* ============================================================
   Company Portfolio — Stylesheet v2.0
   Matches the screenshot design
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- Archive Page ---------- */
.cp-archive-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    margin-bottom: 40px;
}
.cp-archive-title    { font-size: 2.4rem; margin: 0 0 10px; font-weight: 800; }
.cp-archive-subtitle { font-size: 1rem; opacity: .7; margin: 0; }
.cp-archive-container { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }

/* ---------- Filter Bar ---------- */
.cp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}
.cp-filter-btn {
    padding: 8px 22px;
    border: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    transition: all .2s ease;
}
.cp-filter-btn:hover,
.cp-filter-btn.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* ---------- Grid ---------- */
.cp-grid { display: grid; gap: 28px; }
.cp-cols-1 { grid-template-columns: 1fr; }
.cp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cp-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .cp-cols-3, .cp-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .cp-cols-2, .cp-cols-3, .cp-cols-4 { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */
.cp-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,.08);
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}
.cp-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.cp-card.cp-hidden { display: none; }

.cp-card-image-link { display: block; overflow: hidden; }
.cp-card-img {
    width: 100%; height: 210px; object-fit: cover; display: block;
    transition: transform .4s ease;
}
.cp-card:hover .cp-card-img { transform: scale(1.04); }
.cp-no-image {
    height: 210px; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 14px;
}

.cp-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cp-card-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.cp-card-title a { color: #0f172a; text-decoration: none; }
.cp-card-title a:hover { color: #1d4ed8; }
.cp-card-meta { display: flex; gap: 12px; font-size: 13px; color: #64748b; }
.cp-card-excerpt { font-size: 13px; color: #475569; line-height: 1.6; margin: 0; flex: 1; }
.cp-card-btn {
    display: inline-block; margin-top: auto;
    padding: 8px 16px; background: #1d4ed8; color: #fff;
    border-radius: 6px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: background .2s; align-self: flex-start;
}
.cp-card-btn:hover { background: #1e40af; color: #fff; }
.cp-no-projects { text-align: center; color: #94a3b8; padding: 40px; }

/* =================================================================
   SINGLE PROJECT PAGE
   Matches screenshot:
   - Title top-left
   - Image on left (~65%), sidebar on right (~35%)
   - Scope of Work list
   - Project Summary below
   ================================================================= */

.cp-single-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    font-family: inherit;
}

/* Title */
.cp-single-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 24px;
    line-height: 1.2;
}

/* Top layout */
.cp-single-top {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
    margin-bottom: 48px;
}
@media (max-width: 860px) {
    .cp-single-top { grid-template-columns: 1fr; }
}

/* Left: Image */
.cp-single-image-col {}
.cp-single-main-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}
.cp-single-no-img {
    width: 100%; height: 320px;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; border-radius: 8px;
}

/* Right: Sidebar */
.cp-single-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* Project Information Box */
.cp-info-box {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 8px;
    padding: 20px 22px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.cp-info-box-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}
.cp-info-divider {
    border: none;
    border-top: 1px solid #e8edf2;
    margin-bottom: 14px;
}
.cp-info-list  { margin: 0; padding: 0; }
.cp-info-row   { display: flex; padding: 7px 0; border-bottom: 1px solid #f1f5f9; gap: 8px; }
.cp-info-row:last-child { border-bottom: none; }
.cp-info-row dt {
    font-weight: 700;
    color: #1e293b;
    font-size: 13px;
    min-width: 100px;
    flex-shrink: 0;
}
.cp-info-row dd {
    margin: 0;
    font-size: 13px;
    color: #475569;
}
.cp-info-link {
    color: #2563eb;
    text-decoration: none;
}
.cp-info-link:hover { text-decoration: underline; }

/* Scope of Work */
.cp-scope-box {}
.cp-scope-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
}
.cp-scope-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}
.cp-scope-list li {
    font-size: 14px;
    color: #334155;
    line-height: 1.55;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* Project Summary */
.cp-project-summary {
    border-top: 1px solid #e8edf2;
    padding-top: 36px;
    margin-bottom: 32px;
}
.cp-summary-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px;
}
.cp-summary-body {
    font-size: 15px;
    line-height: 1.8;
    color: #475569;
}
.cp-summary-body p { margin-bottom: 1em; }

/* Back Link */
.cp-back-link { padding-top: 16px; }
.cp-back-link a {
    color: #1d4ed8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.cp-back-link a:hover { text-decoration: underline; }

/* Count */
.cp-count { font-weight: 700; }

/* =================================================================
   RELATED PROJECTS — Full-width carousel at bottom of page
   ================================================================= */

.cp-related-section {
    margin-top: 56px;
    padding-top: 48px;
    border-top: 2px solid #e2e8f0;
}

.cp-related-inner {}

.cp-related-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 32px;
    position: relative;
    padding-bottom: 14px;
}
.cp-related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: #1d4ed8;
    border-radius: 2px;
}

/* Carousel wrapper */
.cp-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Prev / Next buttons */
.cp-carousel-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    z-index: 2;
    padding: 0;
}
.cp-carousel-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 14px rgba(29,78,216,.25);
}
.cp-carousel-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    background: #fff;
    color: #1e293b;
    border-color: #e2e8f0;
    box-shadow: none;
}

/* Viewport — clips slides */
.cp-carousel-viewport {
    flex: 1;
    overflow: hidden;
}

/* Track — slides sit in a row */
.cp-carousel-track {
    display: flex;
    gap: 20px;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* Each slide */
.cp-carousel-slide {
    flex: 0 0 calc((100% - 40px) / 3); /* 3 visible cards */
    min-width: 0;
}

@media (max-width: 900px) {
    .cp-carousel-slide { flex: 0 0 calc((100% - 20px) / 2); }
}
@media (max-width: 560px) {
    .cp-carousel-slide { flex: 0 0 100%; }
}

/* Card */
.cp-rel-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8edf2;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    transition: transform .25s, box-shadow .25s;
    height: 100%;
}
.cp-rel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,.11);
}

.cp-rel-img-wrap { overflow: hidden; }
.cp-rel-img-wrap img {
    width: 100%;
    height: 185px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.cp-rel-card:hover .cp-rel-img-wrap img { transform: scale(1.05); }

.cp-rel-no-img {
    width: 100%;
    height: 185px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
}

.cp-rel-body { padding: 16px 18px 18px; }
.cp-rel-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-rel-meta {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 12px;
}
.cp-rel-btn {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.cp-rel-card:hover .cp-rel-btn { border-color: #1d4ed8; }

/* Dots */
.cp-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.cp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}
.cp-dot.active {
    background: #1d4ed8;
    transform: scale(1.3);
}

/* =================================================================
   CAROUSEL AUTOPLAY — Progress bar on active dot
   ================================================================= */
.cp-dot {
    position: relative;
    overflow: hidden;
}
.cp-dot.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: cp-dot-progress 3.5s linear forwards;
}
@keyframes cp-dot-progress {
    from { transform: scaleX(0); transform-origin: left; }
    to   { transform: scaleX(1); transform-origin: left; }
}
