/*
Theme Name: Sepia Foundation Theme
Theme URI: https://sepiafoundation.org
Author: Antigravity Team
Author URI: https://sepiafoundation.org
Description: Custom WordPress theme for the SEPIA Foundation. Built for speed, security, and effortless editing with ACF.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
Text Domain: sepia-theme
*/

:root {
  --color-primary: #00524e;
  --color-primary-dark: #003a37;
  --color-secondary: #b5520e;
  --color-secondary-dark: #8c3f0b;
  --color-bg: #ffffff;
  --color-bg-light: #f9f9f9;
  --color-text-main: #222222;
  --color-text-muted: #666666;
  --color-border: #e2e8f0;
  --font-family: 'Signika', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.3s ease-in-out;
  --container-max-width: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  overflow-x: hidden;
  line-height: 1.6;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  color: #111;
  font-weight: 600;
  margin-top: 0;
  line-height: 1.25;
}

h1 { font-size: clamp(32px, 5vw, 54px); }
h2 { font-size: clamp(26px, 4vw, 42px); }
h3 { font-size: clamp(22px, 3vw, 32px); }
h4 { font-size: clamp(18px, 2.5vw, 24px); }
p { font-size: 17px; margin-bottom: 1.2rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Buttons */
.sepia-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.sepia-btn-primary {
  background-color: var(--color-primary);
  color: #ffffff !important;
}

.sepia-btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 82, 78, 0.25);
}

.sepia-btn-pill {
  border-radius: 50px;
}

.sepia-btn-outline {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary) !important;
}

.sepia-btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff !important;
}

.sepia-btn-white {
  background-color: #ffffff;
  color: var(--color-primary) !important;
}

.sepia-btn-white:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* Header & Navigation */
.sepia-header {
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 100;
}

body.header-green .sepia-header {
  background-color: var(--color-primary);
}

body.header-green .sepia-header .nav-link {
  color: #ffffff;
}

body.header-green .sepia-header .nav-link:hover {
  opacity: 0.8;
  color: #ffffff;
}

.sepia-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.sepia-logo img {
  height: 80px;
  width: auto;
}

.sepia-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 17px;
  font-weight: 500;
  color: #333333;
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: inherit;
  padding: 4px;
}

/* Mobile Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background-color: var(--color-primary);
  color: #ffffff;
  z-index: 999;
  padding: 30px 24px;
  transition: transform 0.3s ease;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.mobile-drawer.active {
  transform: translateX(280px);
}

.mobile-drawer-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  float: right;
  margin-bottom: 20px;
}

.mobile-drawer-nav {
  list-style: none;
  padding: 0;
  margin: 40px 0 0 0;
  clear: both;
}

.mobile-drawer-nav li {
  margin-bottom: 18px;
}

.mobile-drawer-nav a {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  display: block;
}

/* Hero Section */
.hero-wrapper {
  padding: 8px 16px;
}

.hero-banner {
  position: relative;
  min-height: 85vh;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  padding: 40px 20px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(34px, 5.5vw, 64px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 2vw, 20px);
  margin-bottom: 30px;
  font-weight: 400;
}

.hero-dots {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 4;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.hero-dot.active {
  background-color: #ffffff;
  width: 28px;
  border-radius: 8px;
}

/* Page Hero (Internal Pages) */
.page-hero {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 60px 20px;
  text-align: center;
}

.page-hero h1 {
  color: #ffffff;
  margin-bottom: 12px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 650px;
  margin: 0 auto;
  font-size: 19px;
}

/* Highlights / News Grid */
.highlights-section {
  padding: 70px 20px;
  background-color: #ffffff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.sepia-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.sepia-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.sepia-card-media {
  height: 220px;
  overflow: hidden;
}

.sepia-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.sepia-card:hover .sepia-card-media img {
  transform: scale(1.05);
}

.sepia-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.sepia-card-body h3 {
  font-size: 21px;
  margin-bottom: 10px;
}

.sepia-card-body p {
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 0;
}

/* Mission Section */
.mission-section {
  padding: 70px 20px;
  background-color: #fafafa;
}

.badge {
  display: inline-block;
  background-color: rgba(0, 82, 78, 0.1);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 3D Flip Card for Team Members */
.flip-card {
  perspective: 1000px;
  height: 460px;
  width: 100%;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.card-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

.card-side-back {
  transform: rotateY(180deg);
  background-color: #f7f7f7;
  overflow-y: auto;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Partners Carousel */
.partners-section {
  padding: 80px 20px;
  background-color: #f9f9f9;
  text-align: center;
  overflow: hidden;
}

.partners-carousel-track {
  display: flex;
  width: max-content;
  animation: partnersScroll 25s linear infinite;
  align-items: center;
}

.partners-carousel-track:hover {
  animation-play-state: paused;
}

.partner-logo-item {
  margin: 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-logo-item img {
  max-height: 65px;
  max-width: 130px;
  filter: grayscale(20%);
  opacity: 0.9;
  transition: var(--transition-smooth);
}

.partner-logo-item img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

@keyframes partnersScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Search Box */
.search-bar-wrap {
  max-width: 600px;
  margin: 25px 0 35px 0;
}

.search-input {
  width: 100%;
  padding: 14px 22px;
  border-radius: 50px;
  border: 1px solid var(--color-border);
  font-family: var(--font-family);
  font-size: 16px;
  outline: none;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 78, 0.15);
}

/* Publications Masonry Grid */
.publications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.publication-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.publication-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: rgba(0, 82, 78, 0.3);
}

.pub-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.pub-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #111;
}

.pub-authors {
  font-size: 14px;
  color: #444;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Financial Accounts List */
.account-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Modal Popup */
.sepia-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.sepia-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sepia-modal {
  background: #ffffff;
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.sepia-modal-backdrop.open .sepia-modal {
  transform: translateY(0);
}

.sepia-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

/* Contact Form Styling */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-family: var(--font-family);
  font-size: 15px;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 78, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Footer */
.sepia-footer {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 70px 20px 30px 20px;
  margin-top: auto;
}

.sepia-footer a {
  color: #ffffff;
}

.sepia-footer a:hover {
  opacity: 0.75;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 19px;
  margin-bottom: 18px;
  font-weight: 500;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-divider {
  border: none;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.15);
  margin: 40px auto 25px auto;
  max-width: var(--container-max-width);
}

.footer-bottom {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 900px) {
  .sepia-nav,
  .sepia-nav-action {
    display: none;
  }
  .nav-toggle-btn {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
