/* projects-styling.css */

/* Reset & Base */
body, .about-us {
  background: #ffffff; /* Set plain background for projects page */
  min-height: 100vh;
}

/* Widen container specifically for the Projects page */
.about-us > .container {
    max-width: 1400px;
    padding-left: 20px;
    padding-right: 20px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 1600px) {
  .about-us > .container { max-width: 1600px; }
}

/* Section: Projects */
.projects {
    margin: 0 auto 70px auto;
    padding: 0 0 0 0;
    position: relative;
  /* Avoid competing with global overlay blur */
  z-index: initial;
}

#projects-section-title {
    font-size: 2.5rem;
    color: #333;
    font-weight:bold;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: 2px;
    position: relative;
    animation: fadeInDown 1s cubic-bezier(.77,0,.18,1.01);
}

#projects-section-title::after {
    content: "";
    display: block;
    width: 90px;
    height: 5px;
    background: linear-gradient(90deg, #ff6600 0%, #ffb347 100%);
    margin: 18px auto 0;
    border-radius: 3px;
    animation: underlineGrow 1.2s cubic-bezier(.77,0,.18,1.01);
}

@keyframes underlineGrow {
    from { width: 0; opacity: 0; }
    to { width: 90px; opacity: 1; }
}

/* New spacious layout */
.project-showcase {
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding: 0 6px;
  animation: fadeInUp 1.2s cubic-bezier(.77,0,.18,1.01);
}

.project-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); /* prevent overflow */
  grid-template-areas: "info media"; /* default order: title/summary then image */
  gap: 28px;
  align-items: start; /* let image height be natural */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  padding: 18px 18px 20px;
}

.project-info {
  grid-area: info;
  padding: 6px 8px;
  text-align: left; /* ensure left alignment */
  min-width: 0; /* allow content to shrink in grid */
  max-width: 760px; /* consistent column width for clean right edge */
  display: flex;
  flex-direction: column;
  gap: 12px; /* control vertical rhythm without collapsed margins */
}
.project-name {
  --underline-height: 3px;
  --underline-color: #ff6600; /* solid accent color */
  color: #ff6600;
  font-weight: 800;
  font-size: clamp(1.45rem, 1.05rem + 1.05vw, 2.05rem);
  line-height: 1.25;
  margin: 0 0 14px 0;
  position: relative;
  padding-bottom: 8px; /* space for underline */
  display: inline-block; /* shrink underline to text width */
  background: none; /* remove gradient highlight */
}
.project-name::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--underline-height);
  background: var(--underline-color);
  border-radius: 2px;
  transform-origin: left center;
  animation: underlineSweep 650ms ease; /* keep a simple sweep animation */
}
@keyframes underlineSweep {
  from { transform: scaleX(0); opacity: 0; }
  45% { opacity: 1; }
  to { transform: scaleX(1); opacity: 1; }
}
.project-summary {
  color: #333;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1rem);
  line-height: 1.7;
  margin: 0; /* managed by .project-info gap */
}

/* Paragraphs: justify for clean left/right edges, keep last line left-aligned */
.project-info p {
  text-align: justify;
  text-align-last: left; /* avoid stretched last line */
  -webkit-hyphens: auto; /* allow proper hyphenation */
  hyphens: auto;
  overflow-wrap: break-word; /* prevent overflow on very long words/URLs */
  word-break: normal;
}

.project-media { grid-area: media; width: 100%; min-width: 0; display: block; overflow: hidden; height: auto; }
.project-media > .owl-carousel { width: 100%; height: auto; }
.project-carousel .item { position: relative; }
.project-carousel img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto; /* overridden to 100% in responsive rules where container height is defined */
  object-fit: contain; /* overridden to cover when height is constrained */
  margin: 0 auto; /* center smaller images */
  border-radius: 0; /* rounding handled by outer wrapper */
}
.project-carousel .owl-stage-outer { border-radius: 12px; overflow: hidden; }
/* allow stage to follow image height */
.project-carousel .owl-stage-outer,
.project-carousel .owl-stage,
.project-carousel .owl-item,
.project-carousel .item { height: auto; }

/* Tablet and up: per-card uniform carousel height = text column height */
@media (min-width: 769px) {
  .project-entry { align-items: start; }
  /* Media height is set by JS to match text height; keep flex so carousel fills */
  .project-media { display: flex; }
  .project-media > .owl-carousel { flex: 1 1 auto; height: 100%; }
  .project-carousel .owl-stage-outer,
  .project-carousel .owl-stage,
  .project-carousel .owl-item,
  .project-carousel .item { height: 100%; }
  /* Ensure all slides in the same carousel render at the same size */
  .project-carousel img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
}

/* Video link under project body */
.project-video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0; /* spacing handled by gap */
  color: #ff6600;
  font-weight: 700;
  text-decoration: none;
}
.project-video-link:hover,
.project-video-link:focus,
.project-video-link:active,
.project-video-link:visited { color: #ff6600; text-decoration: none; }
.project-video-link i { font-size: 1.1rem; }

/* Owl controls theme matching site colors */
.project-carousel .owl-nav button.owl-prev,
.project-carousel .owl-nav button.owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,102,0,0.9) !important;
  color: #fff !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 12px rgba(255,102,0,0.3);
}
.project-carousel .owl-nav button.owl-prev { left: 8px; }
.project-carousel .owl-nav button.owl-next { right: 8px; }
.project-carousel .owl-nav button span { font-size: 1.6rem; line-height: 1; }
.project-carousel .owl-dots { margin-top: 10px; }
.project-carousel .owl-dot span { background: #ffd8be; }
.project-carousel .owl-dot.active span { background: #ff6600; }

/* Responsive */
@media (max-width: 1200px) {
  .project-entry { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 992px) {
  .project-entry { grid-template-columns: 1fr; grid-template-areas: "info" "media"; }
  .project-info { max-width: none; }
}
@media (max-width: 768px) {
  .project-showcase { gap: 28px; }
  .project-entry { padding: 16px; grid-template-areas: "media" "info"; }
  /* Center the project title when image is above */
  .project-entry .project-name { text-align: center; display: inline-block; }
  .project-entry .project-name::after { left: 8%; right: 8%; } /* slight inset on phones */
  /* Ensure large images never overflow on small screens */
  .project-media { aspect-ratio: 16 / 9; }
  .project-media > .owl-carousel { height: 100%; }
  .project-carousel .owl-stage-outer,
  .project-carousel .owl-stage,
  .project-carousel .owl-item,
  .project-carousel .item { height: 100%; }
  .project-carousel img { width: 100%; height: 100%; object-fit: cover; }
}

@media (max-width: 480px) {
  /* Let the media span full card width by offsetting the card padding */
  .project-entry { overflow: hidden; }
  .project-entry .project-media {
    width: calc(100% + 32px); /* 16px left + 16px right card padding */
    margin-left: -16px;
    margin-right: -16px;
    /* Pull media up to fill the tiny top gap inside the card */
    margin-top: -16px; /* match card top padding on phones */
  }
  .project-entry .project-media > .owl-carousel { width: 100%; }
  .project-entry .project-carousel .owl-stage-outer {
    /* Keep top corners nicely rounded when media bleeds */
    border-radius: 18px 18px 0px 0px;
  }

  /* Subtle decorative line under the image curve */
  .project-entry .project-media::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    background: linear-gradient(to right, #ff802c, #ffc6a0);
    border-radius: 999px;
    margin: 10px auto 0; /* centered under the image */
  }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(60px);}
    to { opacity: 1; transform: translateY(0);}
}

/* legacy grid card styles kept below for reference if needed */

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(60px) scale(0.95);}
    to { opacity: 1; transform: translateY(0) scale(1);}
}

.project-card:hover {
    transform: translateY(-18px) scale(1.03) rotateZ(-1deg);
    box-shadow: 0 16px 40px rgba(255, 102, 0, 0.18), 0 4px 16px rgba(0,0,0,0.10);
    z-index: 2;
}

.project-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 0 0 18px 18px;
    transition: transform 0.5s cubic-bezier(.77,0,.18,1.01);
    position: relative;
    z-index: 1;
}



.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.0) 60%, rgba(255,102,0,0.08) 100%);
    z-index: 1;
    pointer-events: none;
}

.project-title {
    font-size: 1.45rem;
    color: #ff6600;
    font-weight: 700;
    margin: 28px 0 10px 0;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.project-card:hover .project-title {
    color: #ff8800;
}

.project-description {
    font-size: 1.08rem;
    color: #444;
    line-height: 1.7;
    padding: 0 18px;
    margin-bottom: 18px;
    min-height: 70px;
    transition: color 0.3s;
}

.project-card:hover .project-description {
    color: #222;
}

.project-card .project-btn {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s, transform 0.4s;
    background: linear-gradient(90deg, #ff6600 60%, #ffb347 100%);
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 10px 32px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(255,102,0,0.10);
    cursor: pointer;
}

.project-card:hover .project-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .project-cards {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 24px;
    }
    .project-card {
        min-height: 370px;
        max-width: 98vw;
    }
}

@media (max-width: 600px) {
    #projects-section-title {
        font-size: 2rem;
    }
    .project-card {
        min-height: 320px;
        padding-bottom: 18px;
    }
    .project-title {
        font-size: 1.1rem;
    }
    .project-description {
        font-size: 0.98rem;
    }
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-40px);}
    to { opacity: 1; transform: translateY(0);}
}

/* Add or enhance @media queries for 1200px, 992px, 768px, 600px, 480px, 375px for all major components: project-cards, project-card, project-img, project-btn, etc. Ensure all elements are mobile/tablet/desktop friendly. */

/* --- Responsive Design: Projects Page --- */

/* Large desktops (1200px and up) */
@media (max-width: 1200px) {
  .project-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

/* Tablets and small desktops (992px and up) */
@media (max-width: 992px) {
  .project-cards {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .project-card {
    max-width: 95vw;
    margin: 0 auto;
  }
}

/* Tablets (768px and up) */
@media (max-width: 768px) {
  .projects {
    padding: 24px 0 0 0;
  }
  #projects-section-title {
    font-size: 2rem;
    margin-bottom: 32px;
  }
  .project-cards {
    gap: 18px;
  }
  .project-card {
    padding: 18px 10px;
    font-size: 1rem;
  }
}

/* Large phones and small tablets (600px and up) */
@media (max-width: 600px) {
  .projects {
    padding: 12px 0 0 0;
  }
  #projects-section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  .project-card {
    padding: 12px 6px;
    font-size: 0.98rem;
  }
  .project-img {
    height: 140px;
  }
}

/* Phones (480px and up) */
@media (max-width: 480px) {
  .projects {
    padding: 6px 0 0 0;
  }
  #projects-section-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }
  .project-card {
    padding: 8px 2px;
    font-size: 0.95rem;
  }
  .project-img {
    height: 100px;
  }
}

/* Smallest phones (375px and up) */
@media (max-width: 375px) {
  .project-card {
    padding: 4px 0;
    font-size: 0.9rem;
  }
  .project-img {
    height: 80px;
  }
}

/* --- Responsive Utilities --- */
.project-cards,
.project-card,
.project-img {
  box-sizing: border-box;
}
