/*
Theme Name: Creatively Faith Photography
Theme URI: https://creativelyfaithphotos.com
Author: Faith Pena
Author URI: https://creativelyfaithphotos.com
Description: A minimal, photography-first one-page WordPress theme for Creatively Faith Photography.
Version: 2.7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: creatively-faith
Tags: photography, one-page, minimal, portfolio
*/

/* =============================================
   CSS Custom Properties
   ============================================= */
:root {
  /* Typography — Muli (Mulish) via Google Fonts */
  --font-primary: 'Mulish', sans-serif;

  /* Golden ratio scale: base 16px × φ (1.618)
     p    → 1rem      (16px)
     h6   → 1.125rem  (18px)
     h5   → 1.25rem   (20px)
     h4   → 1.618rem  (26px)
     h3   → 2.058rem  (33px)
     h2   → 2.618rem  (42px)
     h1   → 4.236rem  (68px)  */
  --text-p:  1rem;
  --text-h6: 1.125rem;
  --text-h5: 1.25rem;
  --text-h4: 1.618rem;
  --text-h3: 2.058rem;
  --text-h2: 2.618rem;
  --text-h1: 4.236rem;

  /* Font weights (Mulish has 200–900) */
  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  /* Colors — minimal, photography-forward */
  --color-bg:         #ffffff;
  --color-header-bg:   #ffffff;
  --color-header-text: #111111;
  --color-text:       #111111;
  --color-muted:      #555555;
  --color-border:     #e0e0e0;
  --color-accent:     #4f46e5;   /* link hover / submit button */
  --color-accent-hover: #3730a3;

  /* Layout */
  --max-width:        1200px;
  --section-padding:  80px;
  --header-height:    64px;

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  font-size: var(--text-p);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

ul { list-style: none; }

/* =============================================
   Typography
   ============================================= */
h1 { font-size: var(--text-h1); font-weight: var(--weight-extrabold); line-height: 1.1; }
h2 { font-size: var(--text-h2); font-weight: var(--weight-bold);      line-height: 1.2; }
h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold);  line-height: 1.3; }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold);  line-height: 1.4; }
h5 { font-size: var(--text-h5); font-weight: var(--weight-medium);    line-height: 1.5; }
h6 { font-size: var(--text-h6); font-weight: var(--weight-medium);    line-height: 1.5; }
p  { font-size: var(--text-p);  font-weight: var(--weight-regular);   line-height: 1.7; }

/* =============================================
   Layout Helpers
   ============================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   HEADER
   ============================================= */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--color-header-bg);
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: stretch;
  transition: transform 0.35s var(--ease-out),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Make .container inside header fill full width */
#site-header .container {
  display: flex;
  align-items: center;
  width: 100%;
  flex: 1;
  min-width: 0;
}

#site-header.scrolled {
  border-color: var(--color-border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

#site-header.hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0;
  position: relative; /* anchor for absolute socials */
}

/* Site title — hard left, never shrinks, explicit right margin */
.site-title {
  font-size: var(--text-h6);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-header-text);
  flex: 0 0 auto;
  white-space: nowrap;
  margin-right: 48px;
}

/* Nav links — follow the title, left-aligned */
.header-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  flex: 0 0 auto; /* don't grow — socials are absolute */
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: var(--weight-medium);
  color: var(--color-header-text);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.25s var(--ease-out);
}

.header-nav a:hover {
  color: var(--color-accent);
}

.header-nav a:hover::after {
  width: 100%;
}

/* Social icons (desktop) — pinned to right edge absolutely */
.header-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.header-socials a {
  display: flex;
  align-items: center;
  color: var(--color-header-text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.header-socials a:hover {
  color: var(--color-accent);
  transform: translateY(-1px);
}

.header-socials svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
  transform-origin: center;
}

.hamburger span:nth-child(1) { margin-bottom: 6px; }
.hamburger span:nth-child(3) { margin-top: 6px; }

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: var(--color-header-bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

/* Hamburger when living inside the open overlay — pin to top right */
.mobile-menu .hamburger {
  position: absolute;
  top: 16px;
  right: 24px;
  display: flex !important; /* override base display:none regardless of breakpoint */
  transform: none;
  z-index: 1200;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  margin-bottom: 48px;
}

.mobile-menu nav a {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-menu nav a:hover {
  color: var(--color-accent);
}

.mobile-menu-socials {
  display: flex;
  gap: 48px;
}

.mobile-menu-socials a {
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  transition: color 0.2s ease;
}

.mobile-menu-socials a:hover {
  color: var(--color-accent);
}

.mobile-menu-socials svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* =============================================
   MAIN CONTENT (offset for fixed header)
   ============================================= */
main {
  padding-top: var(--header-height);
}

/* Offset anchors so fixed header doesn't cover section titles */
#introduction,
#investment,
#contact,
#photos {
  scroll-margin-top: calc( var(--header-height) + 16px );
}

/* =============================================
   SECTION WRAPPERS
   ============================================= */
.section {
  padding: var(--section-padding) 0;
}

.section-title {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

/* =============================================
   PHOTOS SECTION
   ============================================= */
#photos {
  padding: 0;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  padding: 0 24px;
  align-items: flex-start;
  align-content: flex-start;
  box-sizing: border-box;
}

/* JS justified layout drives width + height on each item */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #111; /* dark bg visible only during load */
  /* Initial flex-basis from PHP data-ratio; JS overrides with exact px */
  flex-shrink: 0;
  flex-grow: 0;
}

/* Placeholder tint for items without images */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* Lazy load fade-in */
.gallery-item.lazy-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.gallery-item.lazy-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.94);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  display: block;
  width: auto;
  height: auto;
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s ease;
  z-index: 2001;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.2); }
.lightbox-arrow.prev { left: 16px; }
.lightbox-arrow.next { right: 16px; }

/* =============================================
   INTRODUCTION SECTION
   ============================================= */
#introduction {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}

.intro-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.profile-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
  flex-shrink: 0;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.intro-greeting {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.intro-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-right p {
  font-size: var(--text-p);
  font-weight: var(--weight-light);
  color: var(--color-muted);
  line-height: 1.8;
}

/* =============================================
   INVESTMENT SECTION
   ============================================= */
#investment {
  border-top: 1px solid var(--color-border);
}

.investment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-card h4 {
  font-size: var(--text-h5);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.pricing-card .price {
  font-size: var(--text-h4);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.pricing-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-card ul li {
  font-size: 1rem;
  font-weight: var(--weight-regular);
  color: var(--color-muted);
  padding-left: 14px;
  position: relative;
}

.pricing-card ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-muted);
}

/* =============================================
   CONTACT SECTION
   ============================================= */
#contact {
  border-top: 1px solid var(--color-border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 80px;
  align-items: start;
}

.contact-left p {
  font-size: var(--text-p);
  font-weight: var(--weight-regular);
  color: var(--color-muted);
  margin-bottom: 28px;
  line-height: 1.7;
}

.contact-socials {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: var(--weight-medium);
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-social-link:hover {
  color: var(--color-accent);
}

.contact-social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-primary);
  font-size: var(--text-p);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
  min-height: 140px;
}

.btn-submit {
  align-self: flex-start;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--color-text);
  border: none;
  border-radius: 4px;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-submit:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Form success / error */
.form-message {
  font-size: 0.9rem;
  padding: 12px 16px;
  border-radius: 4px;
  display: none;
}
.form-message.success {
  background: #ecfdf5;
  color: #065f46;
  display: block;
}
.form-message.error {
  background: #fef2f2;
  color: #991b1b;
  display: block;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  padding: 32px 24px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: var(--weight-light);
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 768px) {
  :root {
    --text-h1: 2.618rem;
    --text-h2: 2.058rem;
    --text-h3: 1.618rem;
    --text-h4: 1.25rem;
    --section-padding: 48px;
  }

  /* Header — mobile: hide nav+socials, show hamburger on far right */
  .header-nav,
  .header-socials {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  /* Gallery — JS handles mobile single column layout */
  .gallery-grid {
    gap: 4px;
    padding: 0;
  }

  /* Intro */
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .intro-left {
    align-items: flex-start;
  }

  /* Investment */
  .investment-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Lightbox arrows */
  .lightbox-arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .gallery-grid { padding: 0 8px; }
}

/* =============================================
   DESKTOP NAV DROPDOWN
   ============================================= */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: var(--weight-medium);
  color: var(--color-header-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.25s var(--ease-out);
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
  color: var(--color-accent);
}

.nav-dropdown-toggle:hover::after,
.nav-dropdown-toggle[aria-expanded="true"]::after {
  width: 100%;
}

.nav-dropdown-toggle .chevron {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease-out);
  flex-shrink: 0;
}

.nav-dropdown-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  background: var(--color-header-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 6px 0;
  z-index: 1100;
  list-style: none;
}

.nav-dropdown-menu.open,
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  color: var(--color-header-text);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-dropdown-menu li a:hover {
  color: var(--color-accent);
  background: rgba(0,0,0,0.03);
}

/* =============================================
   MOBILE ACCORDION (Photos dropdown)
   ============================================= */
.mobile-accordion {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mobile-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.mobile-accordion-toggle:hover {
  color: var(--color-accent);
}

.mobile-accordion-toggle .chevron {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-out);
}

.mobile-accordion-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.mobile-accordion-body {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.mobile-accordion-body.open {
  display: flex;
}

.mobile-sub-link {
  font-size: var(--text-h5) !important;
  font-weight: var(--weight-medium) !important;
  color: var(--color-muted) !important;
}

/* =============================================
   PHOTO PAGES (Seniors / Families / Headshots)
   ============================================= */
.photo-page-intro {
  padding-top: 24px;  /* was implicit section padding ~80px, reduced 70% */
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.photo-page-intro.section {
  padding-top: 24px;
}

.photo-page-title {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.photo-page-desc {
  font-size: var(--text-p);
  font-weight: var(--weight-light);
  color: var(--color-muted);
  max-width: 640px;
  line-height: 1.8;
}

/* photo pages: gallery section spacing */
.photo-page #photos {
  padding-top: 32px;
}
