/**
 * SHARED PAGE LAYOUT
 * ===================
 * Content layout styles for subpages (bio, donate, etc.).
 * Base resets, body, noise, and header are in base-page.css.
 * Each page provides a container class and may override
 * --page-glow-color / --page-glow-subtle if needed.
 *
 * STRUCTURE (ITCSS):
 * - Settings: Glow custom properties
 * - Components: Subpage container, page heading, page section, photo with glow
 * - Utilities: Shared animations
 * - Overrides: Media queries, reduced motion
 *
 * BEM NAMING:
 * - Blocks: .subpage, .page-photo
 */

/* ==========================================================================
   SETTINGS - Glow Custom Properties
   ========================================================================== */

:root {
  --page-glow-color: var(--glow-purple-sm);
  --page-glow-subtle: var(--glow-purple-xs);
}

/* ==========================================================================
   COMPONENTS - Shared Subpage Layout
   ========================================================================== */

/* --------------------------------------------
   Page Container
   -------------------------------------------- */

.subpage {
  max-width: var(--max-width-content);
  animation: fadeIn 0.8s ease-out;
}

/* --------------------------------------------
   Page Heading (in-content title)
   -------------------------------------------- */

.page-heading {
  font-family: var(--font-title);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-xl);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 var(--margin-lg);
  line-height: 1;
  color: var(--color-white);
}

/* --------------------------------------------
   Page Section (Content Area)
   -------------------------------------------- */

.page-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 36rem;
  margin-top: var(--margin-md);
  margin-inline: auto;
  padding: 0 var(--pad-xs);
  animation: fadeInUp 0.8s ease-out 0.2s both;
  position: relative;
}

/* Ambient glow behind section */
.page-section::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse at 50% 30%, var(--glow-purple-xs) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

/* --------------------------------------------
   Content Card (Neumorphic Surface)
   -------------------------------------------- */

.page-content {
  background: transparent;
  border-radius: 0;
  padding: var(--pad-lg) var(--pad-md);
  box-shadow: none;
  position: relative;
  width: 100%;
}

/* Frosted glass overlay removed with content box */
.page-content::before {
  display: none;
}

/* --------------------------------------------
   Photo with Glow Effect
   -------------------------------------------- */

.page-photo {
  position: relative;
  margin: 0 0 var(--margin-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* Glow halo behind photo */
.page-photo::before {
  content: '';
  position: absolute;
  inset: -15%;
  background: radial-gradient(circle, var(--page-glow-color) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  animation: breatheGlow 8s ease-in-out infinite;
}

.page-photo img {
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-inset);
  animation: breathe 8s ease-in-out infinite;
}

/* ==========================================================================
   UTILITIES - Animations
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.012);
  }
}

@keyframes breatheGlow {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ==========================================================================
   OVERRIDES - Media Queries & Accessibility
   ========================================================================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .subpage,
  .page-section,
  .page-photo img,
  .page-photo::before {
    animation: none;
  }

  .page-section::before {
    display: none;
  }
}

/* Mobile adjustments */
@media (max-width: 40rem) {
  .page-heading {
    font-size: var(--text-lg);
  }

  .page-section {
    padding: 0 var(--pad-xs);
    width: 100%;
  }

  .page-photo img {
    max-width: 16rem;
  }

  .page-content {
    padding: var(--pad-md) var(--pad-sm);
  }
}

/* Small mobile */
@media (max-width: 24rem) {
  .page-heading {
    font-size: var(--text-base);
  }
}
