/**
 * Rosewood Industrial Platform — Portfolio / Case Studies
 *
 * @package Rosewood
 * @version 2.0.0
 */

/* ═══════ PORTFOLIO HERO ═══════ */

.rw-portfolio-hero {
    background: #1C1C1E;
    padding: 64px 0 56px;
    position: relative;
    overflow: hidden;
}

.rw-portfolio-hero-gradient {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: linear-gradient(135deg, transparent 50%, rgba(230, 51, 41, 0.08) 100%);
    pointer-events: none;
}

.rw-portfolio-hero .container { position: relative; z-index: 2; }

.rw-portfolio-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(30px, 4.5vw, 48px);
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.1;
}

.rw-portfolio-hero-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.45);
    max-width: 520px;
    line-height: 1.7;
    margin: 0 0 32px;
}

/* Hero stats */
.rw-portfolio-hero-stats {
    display: flex;
    gap: 0;
    align-items: center;
}

.rw-ph-stat {
    text-align: left;
    padding: 0 28px;
}
.rw-ph-stat:first-child { padding-left: 0; }

.rw-ph-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
}

.rw-ph-stat-num {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #E63329;
    line-height: 1;
}

.rw-ph-stat-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ═══════ FILTER BAR ═══════ */

.rw-portfolio-filter-bar {
    background: #fff;
    border-bottom: 1px solid #e8e6e3;
    position: sticky;
    top: 0;
    z-index: 90;
}

.rw-portfolio-filter-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.rw-sector-filters {
    display: flex !important;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.rw-sector-filters::-webkit-scrollbar { display: none; }

.rw-sector-filters li { list-style: none; margin: 0; }

.rw-sector-filters .rw-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: transparent;
    color: #888;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: none;
}
.rw-sector-filters .rw-filter-pill:hover { color: #1C1C1E; background: #f4f3f1; }
.rw-sector-filters .rw-filter-pill.selected,
.rw-sector-filters .rw-filter-pill.active { background: #1C1C1E; color: #fff; }

.rw-portfolio-count {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
}

/* ═══════ PROJECT GRID ═══════ */

.rw-portfolio-content {
    padding: 40px 0 64px;
    background: #faf9f8;
}

/* Override Theratio's default project grid styles */
.rw-portfolio-content .projects-grid,
.rw-projects-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0;
}

.rw-projects-grid .grid-sizer { display: none; }

.rw-projects-grid .project-item {
    padding: 0;
    width: 100% !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
}

/* Kill parent's isotope absolute positioning */
.rw-projects-grid[style] {
    height: auto !important;
}

/* ═══════ PROJECT CARD (content-project.php) ═══════ */

.rw-project-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e8e6e3;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Kill parent's projects-box absolute/overlay styles */
.rw-project-card.projects-box {
    position: relative !important;
}

.rw-project-card .projects-thumbnail {
    position: relative !important;
    overflow: hidden;
}
.rw-project-card:hover {
    border-color: #E63329;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.rw-project-card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}
.rw-project-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-project-card:hover .rw-project-card-img img {
    transform: scale(1.04);
}

/* Remove parent theme overlay */
.rw-project-card .projects-thumbnail .overlay,
.projects-grid .projects-box .projects-thumbnail .overlay,
.projects-grid .projects-box .portfolio-info .overlay {
    display: none !important;
    visibility: hidden !important;
}

/* Kill parent theme portfolio-info absolute positioning */
.projects-grid .projects-box .portfolio-info,
.projects-grid .rw-project-card .portfolio-info {
    position: static !important;
    background: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    height: auto !important;
    width: auto !important;
    padding: 22px 24px 26px !important;
    transform: none !important;
}

.projects-grid .projects-box .portfolio-info .portfolio-info-inner,
.projects-grid .projects-box .portfolio-info h5,
.projects-grid .projects-box .portfolio-info .portfolio-cates {
    display: none !important;
}

/* Our overlay */
.rw-project-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 30, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.rw-project-card:hover .rw-project-card-overlay {
    opacity: 1;
}

.rw-project-card-view {
    padding: 12px 28px;
    background: #fff;
    color: #1C1C1E;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transform: translateY(8px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.rw-project-card:hover .rw-project-card-view {
    transform: translateY(0);
}

/* Card info */
.rw-project-card-info {
    padding: 22px 24px 26px;
}

.rw-project-card-sector {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #E63329;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.rw-project-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 0 0 6px;
    line-height: 1.3;
}

.rw-project-card-excerpt {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    margin: 0 0 12px;
}

.rw-project-card-link {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #E63329;
    letter-spacing: 0.04em;
}

/* Load more button */
.rw-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}
.rw-btn-loadmore {
    min-width: 200px;
}

/* ═══════ SINGLE PROJECT ═══════ */

.rw-project-meta-bar {
    background: #fff;
    border-bottom: 1px solid #e8e6e3;
    padding: 40px 0;
}

.rw-project-meta-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.rw-project-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(26px, 3.5vw, 42px);
    font-weight: 700;
    color: #1C1C1E;
    margin: 0 0 8px;
    line-height: 1.15;
}

.rw-project-excerpt {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: #888;
    max-width: 500px;
    line-height: 1.7;
    margin: 0;
}

.rw-project-meta-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

/* Elementor content area */
.rw-project-content {
    background: #fff;
}

/* ═══════ PROJECT CTA ═══════ */

.rw-project-cta-section {
    background: #f4f3f1;
    border-top: 1px solid #e8e6e3;
    padding: 56px 0;
}

.rw-project-cta-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.rw-project-cta-text h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 0 0 6px;
}
.rw-project-cta-text p {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #888;
    margin: 0;
}

.rw-project-cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ═══════ RELATED PROJECTS ═══════ */

.rw-related-projects {
    padding: 64px 0;
    background: #faf9f8;
}

.rw-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rw-related-card {
    text-decoration: none;
    display: block;
}

.rw-related-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    margin-bottom: 16px;
    background: #eee;
    border: 1px solid #e8e6e3;
    transition: border-color 0.3s ease;
}
.rw-related-card:hover .rw-related-card-img {
    border-color: #E63329;
}
.rw-related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.rw-related-card:hover .rw-related-card-img img {
    transform: scale(1.03);
}

.rw-related-sector {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #E63329;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rw-related-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 4px 0 0;
    line-height: 1.3;
}

/* ═══════ PROJECT NAVIGATION ═══════ */

.rw-project-nav {
    border-top: 1px solid #e8e6e3;
    background: #fff;
}

.rw-project-nav-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
    min-height: 90px;
}

.rw-project-nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    text-decoration: none;
    color: #1C1C1E;
    transition: color 0.25s ease;
}
.rw-project-nav-link:hover { color: #E63329; }
.rw-project-nav-link svg {
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.25s ease;
}
.rw-project-nav-link:hover svg { opacity: 1; }

.rw-project-nav-next { justify-content: flex-end; text-align: right; }

.rw-project-nav-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.rw-project-nav-title {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

.rw-project-nav-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    border-left: 1px solid #e8e6e3;
    border-right: 1px solid #e8e6e3;
    color: #ccc;
    transition: color 0.25s ease;
}
.rw-project-nav-grid:hover { color: #E63329; }

/* ═══════ OVERRIDE PARENT THEME ═══════ */

/* Hide Theratio's default page header on portfolio */
.post-type-archive-ot_portfolio .page-header,
.tax-portfolio_cat .page-header,
.single-ot_portfolio .page-header {
    display: none !important;
}

/* Override parent's project-bottom spacing */
.single-ot_portfolio .project-bottom {
    display: none !important;
}

/* Override parent portfolio-info inner styles in grid */
.rw-projects-grid .portfolio-info-inner { display: none; }
.rw-projects-grid .portfolio-info a.overlay { display: none !important; }

/* ═══════ RESPONSIVE ═══════ */

@media (max-width: 992px) {
    .rw-projects-grid { grid-template-columns: repeat(2, 1fr); }
    .rw-project-meta-inner { flex-direction: column; align-items: flex-start; }
    .rw-project-meta-right { flex-direction: row; }
    .rw-related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .rw-projects-grid { grid-template-columns: 1fr; }
    .rw-portfolio-hero { padding: 48px 0 40px; }
    .rw-related-grid { grid-template-columns: 1fr; }
    .rw-project-nav-inner { grid-template-columns: 1fr; }
    .rw-project-nav-grid { border-left: none; border-right: none; border-top: 1px solid #e8e6e3; border-bottom: 1px solid #e8e6e3; padding: 16px; }
    .rw-project-cta-inner { flex-direction: column; text-align: center; }
    .rw-project-cta-buttons { justify-content: center; }
}
