/* Portfolio shared styles */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Portfolio index */
.portfolio-hero {
  position: relative;
  padding: 140px 24px 80px;
  text-align: center;
  background: linear-gradient(160deg, var(--hero-bg-from) 0%, var(--hero-bg-to) 100%);
  color: var(--hero-text);
  overflow: hidden;
  border-bottom: 1px solid var(--hero-border);
}

.portfolio-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -5%, var(--hero-glow) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 15% 100%, var(--hero-grain) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 85% 100%, var(--hero-grain) 0%, transparent 60%);
}

.portfolio-hero__title {
  position: relative;
  z-index: 1;
  font-family: 'Marhey', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  margin: 0 0 16px;
  animation: fadeInUp 0.5s ease both;
}

.portfolio-hero__desc {
  position: relative;
  z-index: 1;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  color: var(--hero-sub);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
  animation: fadeInUp 0.5s ease 0.1s both;
}

.portfolio-content {
  padding: 60px 20px 80px;
  background: var(--bg-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-card {
  background: var(--glass-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--glass-shadow);
  border-color: var(--portfolio-accent-ui, var(--portfolio-accent, var(--accent-color)));
}

.portfolio-card__link {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.portfolio-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.portfolio-card__body {
  padding: 22px 22px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-card__client {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--portfolio-accent-ui, var(--portfolio-accent, var(--accent-color)));
  margin: 0 0 8px;
}

.portfolio-card__title {
  font-family: 'Marhey', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.3;
  color: var(--text-color);
}

.portfolio-card__desc {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text-color);
  opacity: 0.75;
  margin: 0 0 16px;
  line-height: 1.65;
  flex: 1;
}

.portfolio-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.portfolio-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portfolio-card__tag {
  background: var(--border-color);
  color: var(--text-color);
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.75rem;
}

.portfolio-card__cta {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--portfolio-accent-ui, var(--portfolio-accent, var(--accent-color)));
}

/* Portfolio detail */
.portfolio-detail-hero {
  position: relative;
  padding: 130px 24px 56px;
  text-align: center;
  background: linear-gradient(165deg, var(--hero-bg-from) 0%, var(--hero-bg-to) 100%);
  color: var(--hero-text);
  overflow: hidden;
  border-bottom: 1px solid var(--hero-border);
}

.portfolio-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--portfolio-accent-glow, rgba(239, 68, 68, 0.15)) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 90%, var(--hero-grain) 0%, transparent 60%);
}

.portfolio-brand-title {
  position: relative;
  z-index: 1;
  font-family: 'Marhey', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--portfolio-accent, #ef4444) 0%, var(--portfolio-accent-end, #f97316) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.5s ease both;
}

.portfolio-breadcrumb {
  position: relative;
  z-index: 1;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.portfolio-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.portfolio-breadcrumb a {
  color: var(--hero-sub);
  text-decoration: none;
}

.portfolio-breadcrumb a:hover {
  color: var(--hero-text);
}

.portfolio-breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-inline-start: 8px;
  opacity: 0.5;
}

.portfolio-detail-hero__tagline {
  position: relative;
  z-index: 1;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.15rem;
  color: var(--hero-sub);
  max-width: 640px;
  margin: 16px auto 0;
  line-height: 1.65;
}

.portfolio-detail-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.portfolio-btn__icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

.portfolio-btn__icon svg {
  width: 1.125em;
  height: 1.125em;
}

.portfolio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-btn--primary {
  background: linear-gradient(135deg, var(--portfolio-accent, #ef4444), var(--portfolio-accent-end, #f97316));
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px var(--portfolio-accent-shadow, rgba(239, 68, 68, 0.35));
}

.portfolio-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--portfolio-accent-shadow-hover, rgba(239, 68, 68, 0.45));
}

.portfolio-btn--ghost {
  background: var(--glass-bg);
  color: var(--hero-text);
  border: 1px solid var(--hero-border);
}

.portfolio-btn--ghost:hover {
  border-color: var(--portfolio-accent, var(--accent-color));
}

.portfolio-detail-cover {
  max-width: 960px;
  margin: -32px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.portfolio-detail-cover img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px var(--glass-shadow);
}

.portfolio-detail-body {
  padding: 48px 20px 80px;
  background: var(--bg-color);
  max-width: 800px;
  margin: 0 auto;
}

.portfolio-detail-body :global(h2) {
  font-family: 'Marhey', sans-serif;
  font-size: 1.75rem;
  margin-top: 2em;
  margin-bottom: 0.6em;
  color: var(--text-color);
}

.portfolio-detail-body :global(h3) {
  font-family: 'Marhey', sans-serif;
  font-size: 1.25rem;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.portfolio-detail-body :global(p),
.portfolio-detail-body :global(li) {
  font-family: 'Tajawal', sans-serif;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-color);
}

.portfolio-detail-body :global(table) {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
}

.portfolio-detail-body :global(th),
.portfolio-detail-body :global(td) {
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  text-align: start;
}

.portfolio-detail-body :global(th) {
  background: var(--bg-color2);
  font-weight: 600;
}

.portfolio-detail-body :global(a) {
  color: var(--portfolio-accent, var(--accent-color));
  font-weight: 600;
}

/* Homepage portfolio teaser */
.portfolio-teaser {
  padding: 80px 20px;
  background: var(--bg-color);
}

.portfolio-teaser__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-teaser__header {
  text-align: center;
  margin-bottom: 48px;
}

.portfolio-teaser__title {
  font-family: 'Marhey', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 12px;
  color: var(--text-color);
}

.portfolio-teaser__subtitle {
  font-family: 'Tajawal', sans-serif;
  font-size: 1.05rem;
  color: var(--text-color);
  opacity: 0.75;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.portfolio-teaser__link {
  display: inline-block;
  margin-top: 32px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}

.portfolio-teaser__link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .portfolio-hero,
  .portfolio-detail-hero {
    padding-top: 100px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .rotating-word-title {
    justify-content: center;
  }
}

