/* ==========================================================================
   Case Studies (#case-studies), Blog (#blog) & Technologies (#technologies)
   ========================================================================== */

#case-studies,
#blog,
#technologies {
    position: relative;
}

.cs-glow {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 9999px;
    filter: blur(120px);
}

.cs-glow-1 {
    top: -140px;
    right: -100px;
    width: 420px;
    height: 420px;
    background: rgba(255, 0, 50, 0.07);
}

.cs-glow-2 {
    bottom: -160px;
    left: -120px;
    width: 460px;
    height: 460px;
    background: rgba(13, 44, 64, 0.06);
}

.cs-fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Blog (#blog) — editorial layout: one large featured story + a compact list
   Deliberately different from the Case Studies slider below.
   ========================================================================== */

.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 1024px) {
    .blog-layout {
        grid-template-columns: 3fr 2fr;
        gap: 3rem;
    }
}

/* --- Featured story --- */
.blog-featured {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(13, 44, 64, 0.08);
    box-shadow: 0 22px 50px -28px rgba(13, 44, 64, 0.3);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.blog-featured:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -24px rgba(13, 44, 64, 0.35);
}

.blog-featured-media {
    position: relative;
    display: block;
    height: 320px;
    overflow: hidden;
}

.blog-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-featured:hover .blog-featured-media img {
    transform: scale(1.06);
}

.blog-featured-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: #FF0032;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    box-shadow: 0 8px 20px -6px rgba(255, 0, 50, 0.5);
}

.blog-featured-tag {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(13, 44, 64, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
}

.blog-featured-body {
    padding: 2rem 2.25rem 2.25rem;
}

.blog-featured-title {
    color: #0D2C40;
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.blog-featured-title a,
.blog-list-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-featured-title a:hover,
.blog-list-title a:hover {
    color: #FF0032;
}

.blog-featured-desc {
    color: #6b7280;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* --- Shared meta row --- */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.blog-meta i {
    color: #FF0032;
    margin-right: 0.35rem;
}

.blog-meta-sm {
    margin-bottom: 0;
    gap: 0.9rem;
    font-size: 0.6875rem;
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #FF0032;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.blog-link i {
    transition: transform 0.3s ease;
}

.blog-link:hover i {
    transform: translateX(4px);
}

/* --- Compact list --- */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.blog-list-item {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(13, 44, 64, 0.08);
    box-shadow: 0 12px 28px -22px rgba(13, 44, 64, 0.3);
    padding: 0.85rem;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.blog-list-item:hover {
    transform: translateX(6px);
    border-color: rgba(255, 0, 50, 0.25);
    box-shadow: 0 16px 32px -20px rgba(255, 0, 50, 0.25);
}

.blog-list-media {
    display: block;
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
}

.blog-list-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-list-body {
    min-width: 0;
}

.blog-list-tag {
    display: inline-block;
    color: #FF0032;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.blog-list-title {
    color: #0D2C40;
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-view-all-btn {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-top: 0.25rem;
}

/* --- View all / Browse all button --- */
.cs-view-all-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(13, 44, 64, 0.2);
    color: #0D2C40;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.85rem 1.75rem;
    border-radius: 9999px;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.cs-view-all-btn:hover {
    border-color: #FF0032;
    background: rgba(255, 0, 50, 0.06);
    color: #FF0032;
}

/* ==========================================================================
   Case Studies slider (#case-studies) — richer photo-forward cards
   ========================================================================== */

.csx-row {
    display: flex;
    gap: 1.75rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.csx-row::-webkit-scrollbar {
    display: none;
}

.csx-card {
    position: relative;
    flex: 0 0 340px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(13, 44, 64, 0.08);
    box-shadow: 0 18px 40px -26px rgba(13, 44, 64, 0.25);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

@media (max-width: 480px) {
    .csx-card {
        flex-basis: 82%;
    }
}

.csx-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 0, 50, 0.25);
    box-shadow: 0 30px 55px -20px rgba(13, 44, 64, 0.3);
}

/* 4:3 box = same shape as the 'exergy-blog-card' crop (800x600), so the
   uploaded featured image fits exactly on the homepage slider AND the
   /case-studies/ archive grid, at every screen width. */
.csx-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.csx-media img {
    display: block;
}

.csx-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.csx-card:hover .csx-media img {
    transform: scale(1.08);
}

.csx-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 22, 34, 0.9) 0%, rgba(5, 22, 34, 0.35) 45%, transparent 70%);
}

.csx-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #FF0032;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 6px 16px -4px rgba(13, 44, 64, 0.3);
}

.csx-metric {
    position: absolute;
    left: 1.25rem;
    bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: #ffffff;
}

.csx-metric-number {
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.csx-metric-label {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.9;
}

.csx-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem 1.5rem 1.75rem;
}

.csx-title {
    color: #0D2C40;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.csx-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.csx-title a:hover {
    color: #FF0032;
}

.csx-desc {
    color: #6b7280;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.1rem;
    flex-grow: 1;
}

.csx-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #FF0032;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: auto;
}

.csx-link i {
    transition: transform 0.3s ease;
}

.csx-link:hover i {
    transform: translateX(4px);
}

/* --- Controls row (shared visual language with the Industries slider) --- */
.csx-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.csx-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.csx-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: rgba(13, 44, 64, 0.06);
    color: #0D2C40;
    transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.csx-nav-btn:hover:not(:disabled) {
    background: #FF0032;
    color: #ffffff;
}

.csx-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ==========================================================================
   Technologies (#technologies)
   ========================================================================== */

/* Tab/panel chrome (.techstack, .techstack-tab, .techstack-panel, etc.)
   lives in tech-stack.css. The tile components below are still shared by
   every category panel. */

.tech-tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    flex: 1;
}

.tech-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 96px;
}

.tech-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    color: #ffffff;
    font-size: 1.75rem;
    box-shadow: 0 10px 24px -10px rgba(13, 44, 64, 0.4);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-radius 0.4s ease;
    animation: techTileFloat 5s ease-in-out infinite;
}

.tech-tile-icon-text {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.tech-tile-icon-dark {
    color: #1f2937;
}

.tech-tile:hover .tech-tile-icon {
    transform: translateY(-6px) scale(1.08);
    border-radius: 28%;
    box-shadow: 0 18px 32px -10px var(--c1);
}

.tech-tile-name {
    color: #4b5563;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.tech-tile:hover .tech-tile-name {
    color: #0D2C40;
}

/* Gentle staggered float so the icon wall feels alive without being distracting */
@keyframes techTileFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tech-tile:nth-child(3n+1) .tech-tile-icon { animation-delay: 0s; }
.tech-tile:nth-child(3n+2) .tech-tile-icon { animation-delay: 1.2s; }
.tech-tile:nth-child(3n+3) .tech-tile-icon { animation-delay: 2.4s; }

/* ==========================================================================
   Single blog post (single.php)
   ========================================================================== */

.blog-single-hero {
    padding: 170px 0 3rem;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1.75rem;
    transition: color 0.3s ease;
}

.blog-back-link:hover {
    color: #FF0032;
}

.blog-single-tag {
    display: inline-block;
    background: rgba(255, 0, 50, 0.08);
    color: #FF0032;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    margin-bottom: 1.25rem;
}

.blog-single-title {
    color: #0D2C40;
    font-weight: 800;
    font-size: 2.25rem;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .blog-single-title {
        font-size: 3rem;
    }
}

.blog-single-meta {
    margin-bottom: 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(13, 44, 64, 0.08);
}

.blog-single-media {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
    margin-top: -1.5rem;
}

.blog-single-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 25px 50px -20px rgba(13, 44, 64, 0.35);
}

.blog-single-content-section {
    padding: 3.5rem 0 5rem;
}

/* --- the_content() prose styling --- */
.blog-content {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.85;
    font-weight: 300;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: #0D2C40;
    font-weight: 800;
    line-height: 1.35;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
}

.blog-content h2 { font-size: 1.625rem; }
.blog-content h3 { font-size: 1.3rem; }
.blog-content h4 { font-size: 1.1rem; }

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content ul,
.blog-content ol {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
}

.blog-content ul { list-style: disc; }
.blog-content ol { list-style: decimal; }

.blog-content li {
    margin-bottom: 0.6rem;
}

.blog-content a {
    color: #FF0032;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.5rem 0;
}

.blog-content blockquote {
    border-left: 3px solid #FF0032;
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 1.75rem 0;
    color: #0D2C40;
    font-style: italic;
    font-weight: 500;
}

.blog-content strong {
    color: #0D2C40;
    font-weight: 700;
}

.blog-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(13, 44, 64, 0.08);
}

.blog-single-tag-pill {
    background: #f8fafc;
    border: 1px solid rgba(13, 44, 64, 0.08);
    color: #6b7280;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

.blog-single-footer-cta {
    margin-top: 3rem;
    text-align: center;
}

/* ==========================================================================
   Blog archive (page-blog.php)
   ========================================================================== */

.blog-archive-hero {
    padding: 170px 0 4rem;
}

.blog-archive-list {
    padding-bottom: 5rem;
}

.blog-archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 640px) {
    .blog-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-archive-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(13, 44, 64, 0.08);
    box-shadow: 0 18px 40px -26px rgba(13, 44, 64, 0.25);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.blog-archive-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 0, 50, 0.25);
    box-shadow: 0 30px 55px -20px rgba(13, 44, 64, 0.3);
}

.blog-archive-media {
    position: relative;
    display: block;
    aspect-ratio: 340 / 240; /* same box shape as the homepage .csx-media cards, so one uploaded image looks identically boxed in both places */
    overflow: hidden;
}

.blog-archive-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-archive-card:hover .blog-archive-media img {
    transform: scale(1.08);
}

.blog-archive-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #FF0032;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 6px 16px -4px rgba(13, 44, 64, 0.3);
}

.blog-archive-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem 1.5rem 1.75rem;
}

.blog-archive-title {
    margin: 0.4rem 0 0.6rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.blog-archive-title a {
    color: #0D2C40;
    font-weight: 800;
}

.blog-archive-title a:hover {
    color: #FF0032;
}

.blog-archive-excerpt {
    color: #6b7280;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.1rem;
    flex-grow: 1;
}

.blog-archive-empty {
    text-align: center;
    color: #6b7280;
    padding: 4rem 0;
    font-size: 1.05rem;
}

.blog-archive-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
}

.blog-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 9999px;
    background: rgba(13, 44, 64, 0.06);
    color: #0D2C40;
    font-weight: 700;
    font-size: 0.875rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.blog-archive-pagination .page-numbers.current {
    background: #FF0032;
    color: #ffffff;
}

.blog-archive-pagination .page-numbers:hover:not(.current):not(.dots) {
    background: rgba(255, 0, 50, 0.12);
    color: #FF0032;
}

/* ==========================================================================
   Case Study metric — archive card badge & single-page display
   ========================================================================== */

.cs-card-metric {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.cs-card-metric-number {
    color: #FF0032;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1;
}

.cs-card-metric-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cs-single-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
    background: rgba(255, 0, 50, 0.06);
    border: 1px solid rgba(255, 0, 50, 0.15);
    border-radius: 14px;
    padding: 0.85rem 1.5rem;
    margin-top: 1.5rem;
}

.cs-single-metric-number {
    color: #FF0032;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
}

.cs-single-metric-label {
    color: #0D2C40;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
    .cs-fade,
    .blog-featured,
    .blog-featured-media img,
    .blog-list-item,
    .blog-link i,
    .csx-card,
    .csx-media img,
    .csx-link i,
    .blog-archive-card,
    .blog-archive-media img,
    .tech-tile-icon,
    .tech-tile-name {
        transition: none !important;
        animation: none !important;
    }
}
