/*
 * About page (page-about.php). The hero, awards ribbon, team cards and The Javan Way reuse
 * services-index.css and home.css.
 */

.about-hero-photo { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter) clamp(16px, 2vw, 32px); }
.about-hero-photo img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius-photo); }

.about-hero-photo .javan-edit-empty { aspect-ratio: 21 / 9; min-height: 0; }

/* Inline rich text inside a section (not the full-page .prose). */
.prose-inline > * + * { margin-top: 1.1em; }
.prose-inline p { font-size: var(--fs-body); line-height: var(--lh-text); }
.prose-inline a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }


/* ---------- The practice ---------- */

.practice-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.practice-copy .eyebrow { display: block; margin-bottom: 16px; }
.practice-copy h2 { margin-bottom: 24px; max-width: 22ch; }
.practice-story { max-width: 62ch; }
.practice-facts { display: grid; gap: 28px; padding: clamp(24px, 3vw, 40px); background: var(--surface-warm); }
.practice-facts dt { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; }
.practice-facts dd { font-size: var(--fs-small); color: var(--ink-soft); margin-top: 6px; }


/* ---------- Founders ---------- */

.about-founders .section-head { text-align: center; }
/* Every founder photo is the same fixed 420 x 525, whichever side it sits on. */
.founder-row { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.founder-row + .founder-row { margin-top: clamp(48px, 6vw, 96px); }
.founder-row.flip { grid-template-columns: minmax(0, 1fr) 420px; }
.founder-row.flip .founder-row-photo { order: 2; }
.founder-row-photo { width: 420px; height: 525px; overflow: hidden; border-radius: var(--radius-photo); }
.founder-row-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder-row-copy .eyebrow { display: block; margin-bottom: 14px; }
.founder-row-copy h3 { font-size: var(--fs-h2); margin-bottom: 8px; }
.founder-credentials { font-size: var(--fs-small); color: var(--ink-soft); margin-bottom: 18px; }
.founder-row-copy .prose-inline { max-width: 60ch; }


/* ---------- Team grid (cards from home.css) ---------- */

.about-team { background: var(--surface-soft); }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(18px, 2vw, 28px); }
.team-grid .team-card { flex: none; }


/* ---------- Team photos: a strip that scrolls sideways ---------- */

.about-photos { padding: clamp(32px, 4vw, 56px) 0; overflow: hidden; }
.about-photos-track { display: flex; gap: 16px; padding: 0 var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.about-photos-track::-webkit-scrollbar { display: none; }
.about-photo { flex: 0 0 auto; width: min(480px, 80vw); aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-photo); scroll-snap-align: start; }
.about-photo-pic { display: block; width: 100%; height: 100%; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
/* A team photo set to "Show whole picture": the same height as its neighbors, as wide as its own shape needs. */
.about-photos-track { align-items: flex-start; }
.about-photo:has(img.javan-whole) { width: auto; max-width: 92vw; aspect-ratio: auto; height: auto; }
.about-photo .about-photo-pic:has(> img.javan-whole) { width: auto; }
.about-photo img.javan-whole { display: block; width: auto; max-width: 100%; height: min(320px, 53.33vw) !important; }

/* A team photo opens large when clicked (page-about.php): as big as the screen allows, never cropped. */
.about-photo img[data-zoom] { cursor: zoom-in; }
.javan-editing .about-photo img[data-zoom] { cursor: grab; }
.modal.photo-viewer { width: auto; max-width: min(1600px, 100%); max-height: none; overflow: visible; padding: 12px; background: var(--surface); }
.photo-viewer img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 72px); margin: 0 auto; }
.photo-viewer .modal-close { top: -4px; right: -4px; background: var(--surface); border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.photo-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--gold-surface); border: 1px solid var(--gold-surface); z-index: 2; cursor: pointer; }
.photo-viewer-nav[hidden] { display: none; }
.photo-viewer-nav::before { content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-left: 2px solid var(--on-gold); border-bottom: 2px solid var(--on-gold); transform: translate(-40%, -50%) rotate(45deg); }
.photo-viewer-nav.next::before { transform: translate(-60%, -50%) rotate(-135deg); }
.photo-viewer-nav.prev { left: 20px; }
.photo-viewer-nav.next { right: 20px; }
.photo-viewer-nav:hover { background: var(--ink); border-color: var(--ink); }
.photo-viewer-nav:hover::before { border-color: var(--paper); }


/* ---------- Smaller screens ---------- */

@media (max-width: 1000px) {
	.team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.practice-grid { grid-template-columns: 1fr; }
	.practice-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.founder-row,
	.founder-row.flip { grid-template-columns: 1fr; }
	.founder-row.flip .founder-row-photo { order: 0; }
	.founder-row-photo { width: 100%; max-width: 420px; height: auto; aspect-ratio: 4 / 5; }
}
@media (max-width: 640px) {
	.team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.about-hero-photo img { aspect-ratio: 4 / 3; }
}
@media (max-width: 700px) {
	/* Phones: the picture gets nearly the whole width; pinch to read the small print. */
	.modal-overlay:has(.photo-viewer) { padding: 8px; }
	.modal.photo-viewer { padding: 4px; }
	.photo-viewer .modal-close { top: 6px; right: 6px; }
	.photo-viewer-nav.prev { left: 8px; }
	.photo-viewer-nav.next { right: 8px; }
}
