/* ═══════════════════════════════════════════════════════════
   AG Portfolio — main.css
   Faithful port of the one-page HTML design to WordPress.
   All CSS variables, typography, layout, and animations are
   identical to the original site.
═══════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:       #FAF8F4;
  --ink:         #1A1916;
  --terra:       #B84A27;
  --terra-lt:    #D4633F;
  --dust:        #E6DDD0;
  --mid:         #7A746C;
  --white:       #FFFFFF;
  --card-bg:     #F2EDE5;
  --section-alt: #1A1916;
  --nav-h:       72px;
}

html {
  scroll-behavior: smooth;
  /* Offset anchor scroll targets so they clear the fixed navbar.
     This replaces the JS e.preventDefault() + window.scrollTo approach,
     which was causing iOS to suppress touch events on fixed elements. */
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

.label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terra);
}

/* ─── NAVIGATION ─── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
#navbar.scrolled {
  background: rgba(250,248,244,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--dust);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  z-index: 10;
}
.nav-logo span { color: var(--terra); }

/* WP nav menu reset */
.nav-links {
  /* Desktop: visually positioned inside the navbar bar via fixed positioning.
     The <ul> is now a sibling of #navbar (not a child), so it has its own
     independent stacking context — not trapped inside #navbar's composited
     backdrop-filter layer. This fixes iOS touch-event routing on the hamburger. */
  position: fixed;
  top: 0;
  right: 5%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 1001; /* Must be above #navbar (1000) so clicks reach the links */
}
.nav-links li { position: relative; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: color 0.2s;
  position: relative;
  display: block;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1.5px;
  background: var(--terra);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--terra); }
.nav-links a:hover::after { width: 100%; }

/* Dropdown (sub-menu for project pages) */
.nav-links .sub-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 220px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(26,25,22,0.12);
  padding: 0.5rem 0;
  list-style: none;
  z-index: 100;
}
.nav-links li:hover > .sub-menu { display: block; }
.nav-links .sub-menu a {
  padding: 0.55rem 1.2rem;
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--mid);
}
.nav-links .sub-menu a:hover { color: var(--terra); background: var(--cream); }
.nav-links .sub-menu a::after { display: none; }

/* Hamburger button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  z-index: 10;
  /* Prevents iOS from treating the button as a scroll-gesture start,
     and removes the 300ms tap delay on older mobile browsers. */
  touch-action: manipulation;
}
.nav-hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: all 0.3s;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 860px) {
  /* Disable CSS smooth scroll on mobile. Animated scrolling causes iOS Safari
     to suppress taps on position:fixed elements while the scroll is running. */
  html { scroll-behavior: auto; }

  /* Remove backdrop-filter on mobile — it creates a new compositing layer that
     interferes with touch-event routing on iOS after a scroll. */
  #navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(250, 248, 244, 0.98);
  }

  /* Override the desktop fixed-position rule for fullscreen overlay */
  .nav-links {
    display: none;
    left: 0;
    top: var(--nav-h);
    right: 0;
    bottom: 0;
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    /* z-index 999 from base rule keeps menu above page but below #navbar */
  }
  .nav-links.open { display: flex; }
  .nav-hamburger {
    display: flex;
    position: relative;
    z-index: 1001;
  }
  .nav-links > li > a {
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.25rem 0;
  }
  .nav-links > li > a::after { display: none; }
  .nav-links .sub-menu {
    display: block;
    position: static;
    box-shadow: none;
    padding: 0.25rem 0 0;
    background: transparent;
    text-align: center;
  }
  .nav-links .sub-menu a {
    padding: 0.25rem 0;
    font-size: 1rem;
    color: var(--mid);
  }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-primary  { background: var(--terra);      border-color: var(--terra);     color: var(--white); }
.btn-primary:hover { background: var(--terra-lt); border-color: var(--terra-lt); }
.btn-ghost    { background: transparent;       border-color: rgba(255,255,255,0.6); color: var(--white); }
.btn-ghost:hover  { background: rgba(255,255,255,0.12); border-color: white; }
.btn-dark     { background: var(--ink);        border-color: var(--ink);       color: var(--white); }
.btn-dark:hover   { background: #333; border-color: #333; }
.btn-outline  { background: transparent;       border-color: var(--terra);     color: var(--terra); }
.btn-outline:hover { background: var(--terra); border-color: var(--terra); color: white; }

/* ─── HERO ─── */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26,25,22,0.05) 0%,
    rgba(26,25,22,0.1)  40%,
    rgba(26,25,22,0.75) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6% 6%;
  color: var(--white);
}
.hero-content .label  { color: rgba(255,255,255,0.65); margin-bottom: 1rem; }
.hero-content h1 {
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 1.2rem;
}
.hero-content h1 em { font-style: italic; }
.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  opacity: 0.85;
  max-width: 500px;
  margin-bottom: 2.5rem;
}
.hero-cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── SECTIONS ─── */
section { padding: 6rem 6%; }

.section-divider {
  width: 48px;
  height: 2px;
  background: var(--terra);
  margin: 1rem 0 2.5rem;
}

/* ─── ABOUT ─── */
#about { background: var(--white); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}
.about-left h2   { margin-bottom: 0.5rem; }
.about-role {
  color: var(--mid);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}
.about-right p {
  font-size: 1.05rem;
  color: #3a3832;
  margin-bottom: 1.4rem;
  font-weight: 300;
}
.about-right strong { font-weight: 600; color: var(--ink); }
.about-ctas { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ─── PROJECTS ─── */
#projects { background: var(--cream); }
.projects-intro {
  max-width: 750px;
  color: var(--mid);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 4rem;
  font-weight: 300;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}
.project-card {
  background: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(26,25,22,0.12); }
.project-card.featured {
  grid-column: span 2;
  flex-direction: row;
}
.project-img-wrap {
  overflow: hidden;
  aspect-ratio: 4/3;
}
.project-card.featured .project-img-wrap {
  flex: 0 0 46%;
  aspect-ratio: auto;
}
.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-img-wrap img { transform: scale(1.04); }
.project-body {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--dust);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  color: var(--mid);
  margin-bottom: 1rem;
  align-self: flex-start;
}
.project-body h3 { margin-bottom: 0.8rem; }
.project-body p  {
  font-size: 0.93rem;
  color: var(--mid);
  font-weight: 300;
  flex: 1;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.project-link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s;
  text-decoration: none;
}
.project-link:hover { gap: 0.7rem; }
.project-link::after { content: '→'; }

@media (max-width: 720px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { flex-direction: column; grid-column: span 1; }
  .project-card.featured .project-img-wrap { flex: none; aspect-ratio: 4/3; }
}

/* ─── TALKS ─── */
#talks { background: var(--section-alt); color: var(--white); }
#talks .label   { color: var(--terra); }
#talks h2       { color: var(--white); }
.talks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: rgba(255,255,255,0.08);
  margin-top: 0;
}
.talk-item {
  background: var(--section-alt);
  padding: 2rem;
  transition: background 0.25s;
}
.talk-item:hover { background: #2a2925; }
.talk-event {
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 0.75rem;
}
.talk-item h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.talk-item p { font-size: 0.85rem; color: rgba(255,255,255,0.55); font-weight: 300; line-height: 1.6; }
.talk-item a { color: var(--terra); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) { .talks-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .talks-grid { grid-template-columns: 1fr; } }

/* ─── ARTICLES ─── */
#articles { background: var(--cream); }
.articles-list { list-style: none; }
.article-item {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--dust);
  transition: all 0.2s;
}
.article-item:first-child { border-top: 1px solid var(--dust); }
.article-item:hover        { padding-left: 0.5rem; }
.article-pub {
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--mid);
  letter-spacing: 0.06em;
  min-width: 170px;
  text-align: right;
  line-height: 1.5;
}
.article-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  transition: color 0.2s;
  text-decoration: none;
}
.article-item:hover .article-title { color: var(--terra); }
@media (max-width: 600px) {
  .article-item { flex-direction: column; gap: 0.4rem; }
  .article-pub  { text-align: left; min-width: auto; }
}

/* ─── IN THE MEDIA ─── */
#media { background: var(--white); }
.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.media-card {
  background: var(--cream);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  text-decoration: none;
}
.media-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(26,25,22,0.1); }
.media-source {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
}
.media-card h4  { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; line-height: 1.3; color: var(--ink); }
.media-type     { font-size: 0.78rem; color: var(--mid); font-weight: 300; margin-top: auto; }
@media (max-width: 900px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .media-grid { grid-template-columns: 1fr; } }

/* ─── SINGING ─── */
#singing { background: var(--cream); }
.singing-intro {
  max-width: 650px;
  color: var(--mid);
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 3rem;
}
.singing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.singing-card { display: flex; flex-direction: column; gap: 1rem; }
.video-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--ink);
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.singing-card h4 { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; line-height: 1.3; }
.singing-card p  { font-size: 0.85rem; color: var(--mid); font-weight: 300; line-height: 1.65; }
@media (max-width: 860px) { .singing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .singing-grid { grid-template-columns: 1fr; } }

/* ─── CONTACT ─── */
#contact {
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: 8rem 6%;
}
#contact .label   { color: var(--terra); margin-bottom: 1.5rem; }
#contact h2 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--white);
  margin-bottom: 1.2rem;
  font-weight: 300;
}
#contact h2 em    { font-style: italic; color: var(--terra); }
#contact p        { color: rgba(255,255,255,0.55); font-size: 1.05rem; font-weight: 300; max-width: 480px; margin: 0 auto 3rem; }
.contact-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: rgba(255,255,255,0.7);
  display: inline-block;
  margin-bottom: 3rem;
  transition: color 0.2s;
  text-decoration: none;
}
.contact-email:hover { color: var(--terra); }

/* ─── FOOTER ─── */
.site-footer {
  background: #111;
  color: rgba(255,255,255,0.35);
  padding: 2rem 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ─── PROJECT PAGE (template-project.php) ─── */

/* Full page wrapper */
.project-page { background: var(--cream); }

/* Hero banner — full-bleed image below nav */
.project-hero-banner { line-height: 0; }
.project-hero-banner img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Header: tag + title — narrower column matches editorial style */
.project-page-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 5% 2rem;
}
.project-page-header .project-tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--dust);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  color: var(--mid);
  margin-bottom: 1.2rem;
}
.project-page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 600;
  margin: 0;
}

/* Main body — wider than front-page sections so image grids have room */
.project-page-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 5% 5rem;
}

/* Content typography */
.project-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #3a3832;
  font-weight: 300;
}
.project-content p   { margin-bottom: 1.4rem; }
.project-content h2  { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin: 2.5rem 0 1rem; line-height: 1.2; color: var(--ink); }
.project-content h3  { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 600; margin: 2rem 0 0.75rem; color: var(--ink); }
.project-content ul  { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.project-content li  { margin-bottom: 0.4rem; }
.project-content a   { color: var(--terra); text-decoration: underline; text-underline-offset: 3px; }
.project-content hr  { border: none; border-top: 1px solid var(--dust); margin: 2.5em 0; }
.project-content strong { font-weight: 600; color: var(--ink); }

/* Images in content — standalone images get vertical breathing room */
.project-content img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Top-level images (not inside tables) get margin */
.project-content > img,
.project-content p > img,
.project-content div > img {
  margin: 1.5rem auto;
}

/* Tables used for side-by-side image layouts */
.project-content table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 1.75rem 0;
}
.project-content table td {
  vertical-align: top;
  padding: 0;
}
/* Reset: images inside table cells must NOT have auto margins */
.project-content table td img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}
/* Gutter between cells is handled by padding-right on the cell, not margin on img */

/* Centred image containers */
.project-content div[style*="text-align:center"] img,
.project-content div[style*="text-align: center"] img {
  margin: 0 auto;
}

/* Lede paragraph (italic, terracotta left border) */
.project-content p[style*="font-style:italic"],
.project-content p[style*="font-style: italic"] {
  font-size: 1.1em;
  line-height: 1.65;
}

/* Button link */
.project-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--dust);
}

/* Responsive: stack table cells on small screens */
@media (max-width: 640px) {
  .project-content table,
  .project-content table tbody,
  .project-content table tr,
  .project-content table td {
    display: block;
    width: 100% !important;
    padding-right: 0 !important;
  }
  .project-content table td {
    margin-bottom: 1rem;
  }
  .project-page-body { padding: 0 6% 4rem; }
  .project-page-header { padding: 2.5rem 6% 1.5rem; }
}

/* ─── SCROLL FADE-IN ANIMATIONS ─── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── WP CORE CONTENT FIXES ─── */
.entry-content p             { margin-bottom: 1.4rem; }
.entry-content ul            { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.entry-content li            { margin-bottom: 0.4rem; }
.entry-content a             { color: var(--terra); text-decoration: underline; text-underline-offset: 3px; }
/* Only apply vertical margin to images that are NOT inside table cells */
.entry-content img           { max-width: 100%; height: auto; }
.entry-content > p > img,
.entry-content > img         { display: block; margin: 1.5rem auto; }

/* ─── WP Admin Bar offset ─── */
.admin-bar #navbar { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar #navbar { top: 46px; } }

/* ─── ACCESSIBILITY ─── */
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   CAROUSEL  (.agp-carousel)
   Add a <div class="agp-carousel"> with <img> tags inside a page —
   the theme JS will turn it into a working slideshow automatically.
═══════════════════════════════════════════════════════════════════ */

.agp-carousel {
  position: relative;
  overflow: hidden;
  margin: 1.75rem 0;
  background: var(--ink);
  user-select: none;
}

/* Track holds all slides in a horizontal row */
.agp-carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Each slide takes exactly the full carousel width */
.agp-carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}
.agp-carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.agp-carousel-slide img:hover { opacity: 0.92; }

/* Prev / Next arrow buttons */
.agp-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(26, 25, 22, 0.65);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.agp-carousel-btn:hover      { background: rgba(184, 74, 39, 0.85); }
.agp-carousel-prev           { left: 14px; }
.agp-carousel-next           { right: 14px; }

/* Dot indicators */
.agp-carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10;
}
.agp-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.agp-carousel-dot.active { background: #fff; transform: scale(1.25); }

/* Slide counter (e.g. "2 / 5") */
.agp-carousel-counter {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  background: rgba(26,25,22,0.5);
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 10;
}

/* Caption strip below image (optional — shown if img has alt text) */
.agp-carousel-caption {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-style: italic;
  min-height: 38px;
  background: var(--ink);
}


/* ═══════════════════════════════════════════════════════════════════
   LIGHTBOX  (#agp-lightbox)
   Shown whenever any image inside .project-content is clicked.
   Also triggered by carousel images.
═══════════════════════════════════════════════════════════════════ */

#agp-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#agp-lightbox.open { display: flex; }

/* Dark overlay — click to close */
.agp-lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 9, 0.92);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Centred content wrapper */
.agp-lb-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 92vh;
}

/* The image itself */
.agp-lb-img {
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transition: opacity 0.2s;
}

/* Close button */
.agp-lb-close {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 2;
  background: rgba(26,25,22,0.7);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.agp-lb-close:hover { background: var(--terra); }

/* Prev / Next buttons */
.agp-lb-prev,
.agp-lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(26,25,22,0.6);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.agp-lb-prev:hover,
.agp-lb-next:hover   { background: var(--terra); }
.agp-lb-prev         { left: 16px; }
.agp-lb-next         { right: 16px; }

/* Counter */
.agp-lb-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
}

/* Caption */
.agp-lb-caption {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  font-style: italic;
  font-family: 'DM Sans', sans-serif;
  max-width: 600px;
  text-align: center;
  pointer-events: none;
}

/* Swipe hint on touch devices */
@media (hover: none) {
  .agp-lb-prev,
  .agp-lb-next { width: 44px; height: 44px; }
}

/* Responsive carousel height */
@media (max-width: 640px) {
  .agp-carousel-slide img { height: 260px; }
  .agp-carousel-btn       { width: 36px; height: 36px; font-size: 1rem; }
}
