/* ==================================================
   section-about.css — Advanced About styles (responsive padding)
   Works with mrkali-cv.css root variables and theme
   ================================================== */

/* fallbacks for root variables (if غير معرفين في مكان آخر) */
:root{
  --accent-gold: #D4AF37;
  --accent-cyan: #00C8FF;
  --muted: #777b80;
  --glass-soft: rgba(255,255,255,0.03);
  --card-radius: 14px;
  --container-max: 1200px;
  --t: 420ms;
  --ease: cubic-bezier(.22,.9,.32,1);
}

/* make sure box-sizing prevents padding from breaking 100vh calculations */
.about, .about * { box-sizing: border-box; }

/* container spacing: padding on all edges, responsive, and safe-area aware */
.about{
  /* vertical padding: between 28px and 72px (responsive)
     horizontal padding: between 12px and 48px (responsive) */
  padding: calc(env(safe-area-inset-top, 0px) + clamp(28px, 6vw, 72px))
           clamp(12px, 4vw, 48px)
           calc(env(safe-area-inset-bottom, 0px) + clamp(28px, 6vw, 72px));
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.99));
  /* ensure section stretches visually inside a slide too */
  width: 100%;
  margin: 0 auto;
}

/* grid layout that matches hero visuals (keeps inner padding, centered, responsive) */
.about__grid{
  display: grid;
  gap: 18px;
  grid-template-columns: 320px 1fr;
  align-items: start;
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  /* inner horizontal gutter to avoid touching edges even when container very wide */
  padding-inline: clamp(12px, 3vw, 36px);
}

/* medium screens: shrink left column */
@media (max-width: 1200px){
  .about__grid{ grid-template-columns: 280px 1fr; }
}

/* small screens: stack columns */
@media (max-width: 980px){
  .about__grid{ grid-template-columns: 1fr; }
}

/* Profile card (left) */
.about__profile{
  border-radius: var(--card-radius);
  padding: clamp(14px, 2.6vw, 28px);
  text-align: left;
  display:flex;
  flex-direction:column;
  gap:12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,250,250,0.95));
  box-shadow: 0 20px 50px rgba(11,11,11,0.06);
  border: 1px solid rgba(11,11,11,0.04);
  /* Ensure elements that need to overflow (badges, avatars) are visible */
  overflow: visible;
}

/* avatar block */
.profile-avatar{
  width: 100%;
  height: clamp(120px, 18vw, 220px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,255,255,0.02));
  box-shadow: inset 0 -8px 20px rgba(0,0,0,0.03);
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 2px;
  overflow: hidden;
}
/* Optionally, replace background-image via inline style or with <img> */
.profile-avatar img{ width:100%; height:100%; object-fit:cover; border-radius:12px; }

/* heading */
.about__profile .card__title{
  font-size: 1.25rem;
  margin: 0 0 0.125rem 0;
  color: var(--black, #0b0b0b);
}
.about__profile .small-muted{ color: var(--muted); font-size: .92rem; }

/* key-value rows */
.profile__kv { display:flex; flex-direction:column; gap:.45rem; margin-top:6px; }
.kv { display:flex; justify-content:space-between; gap:8px; padding:6px 0; font-size:.95rem; color:var(--muted); border-top: 1px dashed rgba(11,11,11,0.03); }
.kv strong { color: var(--black, #0b0b0b); font-weight:700; }

/* profile CTA area */
.profile__cta{ margin-top: 10px; display:flex; gap:10px; flex-wrap:wrap; }
.profile__cta .btn--primary{ flex: 1 1 auto; min-width: 140px; }
.profile__cta .btn--secondary{ flex: 0 0 auto; }

/* content card (right) */
.about__content{
  border-radius: var(--card-radius);
  padding: clamp(18px, 3.5vw, 30px);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(250,250,250,0.98));
  box-shadow: 0 18px 48px rgba(11,11,11,0.06);
  border: 1px solid rgba(11,11,11,0.03);
  overflow: visible;
}

/* card title and lead */
.about__content .card__title{ margin:0 0 6px 0; font-size: 1.2rem; }
.about__lead .lead{ margin:0 0 6px 0; }

/* pillars / values */
.about__pillars{
  display:grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 12px;
}
.pillar{ padding:12px; border-radius:10px; background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); border:1px solid rgba(11,11,11,0.02); }
.pillar h4{ margin:0 0 6px 0; font-size: 1rem; color:var(--black, #0b0b0b); }
.pillar p{ margin:0; color:var(--muted); font-size:.95rem; }

/* skills list (animated bars) */
/* use gap and ensure layout collapses nicely on narrow screens */
.skills-list{ list-style:none; margin:12px 0 0 0; padding:0; display:block; gap:8px; }
.skill{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
  /* allow wrap if container too narrow */
  flex-wrap:wrap;
}
.skill__name{
  /* use resilient min and allow shrink on small screens */
  flex: 0 0 220px;
  min-width: 120px;
  max-width: 40%;
  color:var(--black, #0b0b0b);
  font-weight:700;
  font-size:.95rem;
}
.skill__bar{ flex:1 1 auto; height:12px; background: linear-gradient(180deg, rgba(11,11,11,0.04), rgba(11,11,11,0.02)); border-radius:999px; position:relative; overflow:hidden; border: 1px solid rgba(11,11,11,0.02); }
.skill__fill{ display:block; height:100%; width:0; border-radius:999px; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold)); box-shadow: 0 6px 18px rgba(11,11,11,0.06) inset; transition: width 900ms cubic-bezier(.22,.9,.32,1); }
.skill__pct{ width:52px; text-align:right; color:var(--muted); font-weight:700; }

/* about more (collapsible) */
.about__more{ margin-top:12px; display:block; }
.about__more-toggle{
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid rgba(11,11,11,0.04);
  cursor: pointer;
}
.about__more-body{ margin-top:10px; padding-top:6px; border-top:1px dashed rgba(11,11,11,0.03); }

/* entrance classes (added by JS) */
/* use fallback timing variables defined above */
.about__profile, .about__content {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.about__profile.is-visible, .about__content.is-visible { opacity: 1; transform: translateY(0); }

/* focus, accessibility */
.about__more-toggle:focus-visible, .profile__cta .btn:focus-visible { outline: none; box-shadow: 0 0 0 8px rgba(0,200,255,0.06); }

/* responsive tweaks */
/* smaller screens: allow skill name to shrink more and adjust paddings */
@media (max-width: 900px){
  .about__grid{ gap: 14px; padding-inline: clamp(10px, 4vw, 28px); }
  .skill__name{ flex: 0 0 160px; max-width: 45%; font-size:.92rem; }
  .about__profile, .about__content { padding: clamp(12px, 3.5vw, 20px); }
}

/* very small phones */
@media (max-width: 600px){
  .skill__name{ flex: 0 0 140px; max-width: 60%; font-size:.9rem; }
  .profile-avatar{ height: 140px; }
  .about__content{ padding: 14px; }
  .about { padding-inline: env(safe-area-inset-left,12px) env(safe-area-inset-right,12px); }
}

/* print */
@media print{
  .about__content, .about__profile{ box-shadow:none; background:transparent; border:none; }
}

/* Utility: If this section is used inside a full-page .slide, add a small inner gap
   so the content never touches the slide edges (helps with fullpage layout) */
.slide > .about,
.about.slide-section, /* alternate selector if using .about as slide */
.slide .about {
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(24px, 5vw, 64px));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(24px, 5vw, 64px));
  padding-left: clamp(12px, 4vw, 48px);
  padding-right: clamp(12px, 4vw, 48px);
}

/* small helper for animations that other JS expects (data-animate / is-visible) */
[data-animate], .slide-animate {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  transition-delay: var(--delay, 0ms);
}
[data-animate].is-visible, .slide-animate.visible, .slide-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}
