/* Project Page Content Styles Only - No Header/Nav/Footer */

/* Do not apply generic padding to all sections; specific blocks define spacing */
section {
    padding: 0;
}


/* Project Hero */
.project-hero {
    position: relative;
    padding: 0;
    background: none;
}

.project-hero .hero-visual {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    overflow: hidden;
}

@media (max-width: 1080px) and (orientation: portrait) {
    .project-hero .hero-visual {
        height: clamp(360px, 55vh, 520px);
        min-height: 360px;
    }
    .project-hero .hero-mobile-preview {
        bottom: max(4rem, 5vh);
        left: max(1.5rem, 4vw);
    }
}

/* Floating portrait (mobile) preview */
.project-hero .hero-mobile-preview {
    position: absolute;
    left: max(1.5rem, 4vw);
    bottom: max(5.5rem, 8vh);
    width: clamp(160px, 18vw, 260px);
    aspect-ratio: 9/16;
    border-radius: 24px;
    box-shadow: none;
    overflow: hidden;
    background: none;
}
.project-hero .hero-mobile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-hero .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Laptop range: show full hero without cropping but keep overlay placement consistent */
@media (min-width: 1281px) and (max-width: 1440px) {
  .project-hero .hero-visual {
    height: 85vh;
    min-height: 420px;
    display: block; /* restore block flow so abs children position consistently */
  }
  .project-hero .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;   /* no cropping */
    object-position: center;
  }
  .project-hero .hero-mobile-preview {
    bottom: max(3.5rem, 6vh); /* similar visual alignment as larger screens */
    left: max(1.5rem, 4vw);
  }
}

.project-hero .hero-overlay {
    position: absolute;
    inset: 0;
    /* No gradient overlay over the whole image */
    background: none;
    display: flex;
    align-items: flex-end; /* bottom */
    justify-content: center; /* center within container */
}

.project-hero .hero-content {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: var(--color-text);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; /* top corners only */
    box-shadow: 0 -6px 24px rgba(0,0,0,0.12);
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--spacing-xl);
    align-items: center;
    position: relative; /* for absolute status placement */
}

/* Compact spacing for hero content */
.project-hero .hero-content .project-header { margin: 0; display:flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-md); }
.project-hero .hero-content .project-meta { order:1; margin:0; display:flex; align-items:center; gap: var(--spacing-md); }
.project-hero .hero-content .project-title { order:2; margin:0; }
.project-hero .hero-content .project-description { order:3; margin:0; color: var(--color-text-light); flex:1 1 300px; min-width:260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-hero .hero-content .project-details { order:3; width:auto; display:flex; flex-wrap:wrap; align-items:center; gap: var(--spacing-lg); margin-top: 0; }
.project-hero .hero-content .detail-item { flex: 0 0 auto; display:flex; gap: var(--spacing-xs); align-items:center; }

.project-hero .hero-content .project-title { color: var(--color-text); }
.project-hero .hero-content .project-description { color: var(--color-text-light); }
.project-hero .hero-content .project-timeline { color: var(--color-text-light); }

.project-hero .hero-ctas { display:flex; gap: var(--spacing-md); flex-wrap: wrap; justify-self: end; }

/* Place status pill at top-right of content panel */
.project-hero .hero-content .project-status {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-xl);
    z-index: 2;
}

.project-header {
    margin-bottom: var(--spacing-3xl);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.project-status {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-delivered {
    background-color: var(--color-success);
    color: var(--color-white);
}

.status-in-progress {
    background-color: var(--color-warning);
    color: var(--color-white);
}

.status-planned {
    background-color: var(--color-text-light);
    color: var(--color-white);
}

.status-maintenance {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.project-timeline {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

.project-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-tight);
}

.project-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--spacing-2xl);
    max-width: 800px;
}

.project-details {
    display: flex;
    gap: var(--spacing-2xl);
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: var(--font-size-base);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.project-showcase {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-3xl);
    align-items: start;
}

.project-image {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-btn {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-white);
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.project-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-background-alt);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-block {
    width: 100%;
}

/* Project Content */
.project-content {
    padding: var(--spacing-5xl) 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-4xl);
}

/* Tablet landscape: if the mobile-only info widget is output before the main column
   (because wp_is_mobile() is true on iPad), keep it on its own full-width row so
   the main column stays in the left column. */
@media (max-width: 1080px) and (orientation: landscape) {
  .content-grid > .sidebar-widget--info { grid-column: 1 / -1; }
}

.main-column {
    max-width: none;
}

.content-section {
    margin-bottom: var(--spacing-4xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--spacing-2xl);
    line-height: var(--line-height-tight);
}

.subsection-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.title-icon {
    
}

.section-content p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
}

.section-content p:last-child {
    margin-bottom: 0;
}

.challenge-list,
.solution-list,
.result-list {
    list-style: none;
    margin: var(--spacing-lg) 0;
    padding-left: 0; /* remove default UL indent when class is on the list */
}

.challenge-list li,
.solution-list li,
.result-list li {
    position: relative;
    padding-left: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-light);
    line-height: var(--line-height-relaxed);
}

/* If .result-list is applied to a wrapper DIV, neutralize native bullets inside */
.section-content.result-list ul,
.section-content.result-list ol {
    list-style: none !important;   /* override theme/Gutenberg defaults */
    padding-left: 0;               /* prevent double indent */
    margin-left: 0;                /* reset UA/Theme margin */
    margin: var(--spacing-lg) 0;
}
.section-content.result-list li { list-style: none !important; }
/* Hide any remaining UA/Gutenberg markers explicitly */
.section-content.result-list li::marker { content: '' !important; }

/* Project summary card titles: put separator under the title (like other cards) */
.project-summary-card .section-title,
.project-summary-card .subsection-title {
  padding: 0 0 var(--spacing-sm) 0;
  margin: 0 0 var(--spacing-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

/* Project summary grouped card */
.project-summary-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-2xl);
  }
  /* Remove between-section separators; handled by title underline now */
  .project-summary-card .content-section + .content-section {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
  }
  @media (max-width: 768px) {
    .project-summary-card { padding: var(--spacing-xl); border-radius: var(--radius-xl); }
    /* Mobile layout: single-column grid; PHP controls DOM order for mobile */
    .content-grid { display: grid; grid-template-columns: 1fr; gap: var(--spacing-2xl); }
    /* Avoid stacked margins in addition to grid gap */
    .content-grid .project-summary-card,
    .content-grid .sidebar-widget,
    .content-grid .project-gallery,
    .content-grid .content-section { margin-bottom: 0; }
}

/* Stronger, Gutenberg-aware overrides (higher specificity) */
.project-page .section-content.result-list > ul,
.project-page .section-content.result-list > ol,
.project-page .section-content.result-list .wp-block-list,
.project-page .section-content.result-list ul.wp-block-list,
.project-page .section-content.result-list ol.wp-block-list {
    list-style: none !important;
    list-style-type: none !important;
    list-style-image: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}
.project-page .section-content.result-list li { list-style: none !important; list-style-type: none !important; list-style-image: none !important; }
.project-page .section-content.result-list li::marker { content: '' !important; }

.challenge-list li::before,
.solution-list li::before,
.result-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 6px;
    height: 6px;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    transform: translateY(-50%);
}



/* Project Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--color-white);
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: var(--spacing-xl);
    height: fit-content;
}

.sidebar-widget {
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.widget-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.widget-content {
    font-size: var(--font-size-sm);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--color-text-light);
    font-weight: var(--font-weight-medium);
}

.info-value {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.services-list,
.features-list {
    list-style: none;
}

.services-list li,
.features-list li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-light);
}

.services-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 6px;
    height: 6px;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    transform: translateY(-50%);
}

.features-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: var(--radius-full);
    transform: translateY(-50%);
}

/* Tech Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-white);
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.tech-tag:hover {
    transform: translateY(-2px);
}

.tech-tag.wordpress { background-color: #21759b; }
.tech-tag.woocommerce { background-color: #96588a; }
.tech-tag.php { background-color: #777bb4; }
.tech-tag.javascript { background-color: #f7df1e; color: var(--color-text); }
.tech-tag.css { background-color: #1572b6; }
.tech-tag.figma { background-color: #f24e1e; }





/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3xl);
    }
    
    .sidebar {
        position: static;
    }
    
    .project-showcase {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .project-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* Fit the entire hero image on screen, keep aspect ratio */
    .project-hero .hero-visual { height: auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
    .project-hero .hero-img { position: static; width: 100%; height: auto; max-height: 80vh; object-fit: contain; object-position: center; }
    .project-hero .hero-mobile-preview { display: none; }
    .project-hero .hero-overlay { align-items: center; justify-content: center; }
    .project-hero .hero-content { grid-template-columns: 1fr; padding: var(--spacing-sm) var(--spacing-md); }
    .project-hero .hero-ctas { justify-self: start; margin-top: var(--spacing-sm); }
    
    .project-title {
        font-size: var(--font-size-2xl);
    }
    
    .project-description {
        font-size: var(--font-size-base);
    }
    
    .project-details {
        gap: var(--spacing-lg);
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .project-gallery {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .project-title {
        font-size: var(--font-size-xl);
    }
    /* Ensure entire image fits on very small screens */
    .project-hero .hero-visual { height: auto; min-height: 0; }
    .project-hero .hero-img { max-height: 85vh; }
    
    .project-details {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        padding: var(--spacing-lg);
    }
    
    .result-number {
        font-size: var(--font-size-2xl);
    }
    
    .sidebar-widget {
        padding: var(--spacing-lg);
    }
    
    .tech-tags {
        gap: var(--spacing-xs);
    }
    
    .tech-tag {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeInUp 0.6s ease-out;
}

.result-item {
    animation: fadeInUp 0.6s ease-out;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }



/* Justify long text on mobile for the project page only */
@media (max-width: 768px) {
    /* Apply to most long-form text blocks, including DB-driven content */
    .project-page .project-description,
    .project-page .section-content,
    .project-page .section-content p,
    .project-page .section-content li,
    .project-page .project-summary-card .section-content,
    .project-page .sidebar-widget .widget-content,
    .project-page .sidebar-widget .widget-content p {
      text-align: justify;
      text-justify: inter-word;
      hyphens: auto;
      -webkit-hyphens: auto; /* Safari */
      -ms-hyphens: auto;     /* Legacy Edge */
    }

    /* Keep headings and labels left-aligned for readability */
    .project-page .section-title,
    .project-page .subsection-title,
    .project-page .sidebar-widget .widget-title,
    .project-page .info-label { text-align: start; }
}