/* ============================================================
   about.css — page-local layout for about.php (Template Name: About).
   Mirrors the inline <style> from accountants_uz_redesign/about.html.
   ============================================================ */

/* ── Story: prose left, sticky founder card right ────────── */
.story {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: start;
}

.story-media {
  position: sticky;
  top: 140px;
}

.founder-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.founder-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--rd-md);
  overflow: hidden;
  box-shadow: var(--sh-md);
  background: var(--cream-100);
  border: 1px solid var(--d-100);
}

.founder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.founder-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.founder-meta .av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--g-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--sh-red);
}

.founder-meta .nm b {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  color: var(--d-900);
}

.founder-meta .nm span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--d-500);
}

/* ── Certificate row ─────────────────────────────────────── */
.cert-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cert {
  aspect-ratio: 3 / 4;
  border-radius: var(--rd-sm);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  background: var(--cream-100);
  border: 1px solid var(--d-100);
}

.cert img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Mission: kicker+pullquote left, prose right ─────────── */
.mission-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

/* ── Auto-style first prose paragraph as lead (mockup behavior) ── */
.story .prose > p:first-of-type {
  font-size: 19px;
  line-height: 1.6;
  color: var(--d-900);
  font-weight: 500;
}

/* ── Gallery ─────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--rd-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  background: var(--cream-100);
  border: 1px solid var(--d-100);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
}

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

/* ── Story without side media: single readable column ───── */
.story.solo {
  grid-template-columns: 1fr;
  max-width: 860px;
}

/* ── Certificates section ────────────────────────────────── */
.certs-section .sect-head { max-width: 800px; }

.certs-line {
  display: block;
  width: 64px;
  height: 2px;
  margin: 0 auto 28px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  max-width: 1060px;
  margin: 0 auto;
}

.cert-card { margin: 0; }

.certs-grid { perspective: 1400px; }

.cert-frame {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  --glare: 0;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5.3;
  padding: 16px;
  border: 1px solid var(--d-100);
  border-radius: var(--rd-sm);
  background: #fff;
  box-shadow: var(--sh-md);
  cursor: zoom-in;
  overflow: hidden;
  isolation: isolate;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
  will-change: transform;
}

/* Soft light spot that follows the cursor */
.cert-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx) var(--my),
    rgba(255, 255, 255, .55) 0%,
    rgba(255, 246, 220, .18) 28%,
    transparent 60%);
  mix-blend-mode: soft-light;
  opacity: var(--glare);
  transition: opacity .4s ease;
}

/* Diagonal sheen that sweeps across once on hover */
.cert-frame::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255, 255, 255, .0) 30%,
    rgba(255, 255, 255, .65) 50%,
    rgba(255, 255, 255, .0) 70%,
    transparent 100%);
  transform: rotate(8deg);
}

.cert-frame:hover {
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(227, 169, 59, .35);
}

.cert-frame:hover::before {
  left: 160%;
  transition: left 1.1s cubic-bezier(.3, .7, .2, 1);
}

/* While the cursor moves, JS sets .is-tilting so the tilt tracks without lag */
.cert-frame.is-tilting {
  transition: transform .12s linear, box-shadow .4s ease;
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .cert-frame { transform: none; }
  .cert-frame::before, .cert-frame::after { display: none; }
}

.cert-frame:focus-visible {
  outline: 2px solid var(--r-500);
  outline-offset: 4px;
}

.cert-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 1px solid var(--d-100);
}

.cert-card figcaption { padding: 28px 4px 0; }

.cert-card .cert-tag {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--r-600);
}

.cert-card b {
  display: block;
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--d-900);
}

.cert-card .cert-desc {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--d-500);
}

.cert-card .cert-download {
  margin-top: 18px;
  color: var(--d-800);
  text-decoration: none;
}

.cert-card .cert-download:hover {
  border-color: var(--r-500);
  color: var(--r-600);
}

.cert-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.cert-lightbox-title {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
}

.cert-lightbox-bar .cert-download {
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}

/* Lightbox (native <dialog>) */
.cert-lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(92vw, 900px);
  max-height: 92vh;
  overflow: visible;
}

.cert-lightbox[open] { animation: cert-pop .35s cubic-bezier(.2, .8, .2, 1); }
.cert-lightbox[open]::backdrop { animation: cert-fade .3s ease; }

@keyframes cert-pop  { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cert-fade { from { opacity: 0; } to { opacity: 1; } }

.cert-lightbox::backdrop {
  background: rgba(14, 16, 22, 0.82);
  backdrop-filter: blur(4px);
}

.cert-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 80px);
  margin: 0 auto;
  border-radius: var(--rd-sm);
  background: #fff;
}

.cert-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--d-900);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--sh-md);
}

/* ── Responsive collapse ─────────────────────────────────── */
@media (max-width: 991px) {
  .story {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .story-media {
    position: static;
  }
  .mission-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .certs-grid {
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .certs-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cert-frame {
    padding: 0;
  }
  .cert-frame img {
    border: 0;
  }
  .cert-lightbox-close {
    top: 8px;
    right: 8px;
  }
}
