/* Root variables */
:root {
  --color-black: #0A0A0A;
  --color-bronze: #B87333;
  --color-gold: #D4AF37;
  --color-offwhite: #E0E0E0;

  --font-heading: 'Playfair Display', 'Cinzel', serif;
  --font-body: 'Lora', 'Merriweather', serif;
  --font-sans: 'Montserrat', 'Raleway', sans-serif;

  --app-bg: var(--color-black);
  --card-bg: rgba(255, 255, 255, 0.02);
  --caption-color: var(--color-offwhite);
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--app-bg);
  color: var(--caption-color);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-bronze);
  font-weight: 700;
  margin-top: 0;
}

/* Navbar */
.navbar {
  background-color: transparent;
  border-bottom: 1px solid rgba(184, 115, 51, 0.06);
}

.navbar-brand,
.nav-link {
  font-family: var(--font-sans);
  color: var(--color-bronze) !important;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-gold) !important;
}

.navbar-brand:hover {
  color: var(--color-gold) !important;
}

.navbar-toggler {
  color: var(--color-bronze);
}

.navbar-toggler-icon {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23B87333' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
  outline: none;
}

.navbar-toggler:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Featured sub-menu: hidden while contracted so primary nav options stay spaced; fades in on expand */
.dropdown-menu {
  --bs-dropdown-color: var(--color-bronze);
  --bs-dropdown-link-color: var(--color-bronze);
  --bs-dropdown-link-hover-color: var(--color-bronze);
  background-color: rgba(10, 10, 10, 0.9);
}

.dropdown-menu.show {
  animation: navDropdownFade 0.18s ease-out;
}

@keyframes navDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Arrow points up while the section is expanded */
.dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Limit hero portrait size */
.about-portrait {
  max-height: 500px;
  width: auto;
  display: block;
  margin: 0 auto;
  object-fit: cover;
  object-position: center;
}

/* Buttons */
.btn-bronze {
  background-color: var(--color-bronze);
  color: var(--color-black);
  font-family: var(--font-sans);
  border: none;
}

.btn-bronze:hover,
.btn-bronze:focus {
  background-color: var(--color-gold);
  color: var(--color-black);
  box-shadow: 0 6px 18px rgba(184, 115, 51, 0.12);
}

/* Cards / Sections */
.card {
  background-color: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(184, 115, 51, 0.12);
  color: var(--color-offwhite);
}

.card-title {
  color: var(--color-bronze);
  font-family: var(--font-heading);
}

/* Links */
a {
  color: var(--color-bronze);
  text-decoration: none;
}

a:hover {
  color: var(--color-gold);
  text-decoration: underline;
}

/* Carousel Controls (bronze tone) */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(60%) sepia(80%) saturate(300%) hue-rotate(10deg);
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
  filter: invert(90%) sepia(100%) saturate(500%) hue-rotate(50deg);
}

/* Footer */
footer {
  background-color: transparent;
  color: var(--color-offwhite);
  padding: 1rem;
  text-align: center;
  font-family: var(--font-sans);
}

.social-links a {
  font-size: 1.2rem;
  margin: 0 0.4rem;
  text-decoration: none;
}

/* Success Modal Styling */
.success-modal {
  background-color: rgba(10, 10, 10, 0.95);
  color: var(--color-bronze);
  border: 2px solid var(--color-bronze);
}

.success-modal .modal-title {
  color: var(--color-gold);
  font-family: var(--font-heading);
}

.success-modal p {
  font-family: var(--font-body);
  color: var(--color-offwhite);
}

.success-icon {
  font-size: 3rem;
  color: var(--color-gold);
  animation: popIn 0.6s ease;
}

.error-icon {
  font-size: 3rem;
  color: #dc3545;
  animation: popIn 0.6s ease;
}

@keyframes popIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------------------------
   Portfolio gallery styles
   --------------------------- */

/* Grid safety: allow flex children to shrink and keep gutters */
#portfolioGrid>[class*="col-"],
.portfolio-grid>[class*="col-"] {
  min-width: 0;
  box-sizing: border-box;
  padding-left: .5rem;
  padding-right: .5rem;
}

/* Thumbnail card */
.portfolio-thumb {
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease;
  border: 1px solid rgba(255, 255, 255, 0.03);
  min-width: 0;
}

/* Image behavior inside thumbnail */
.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
  max-width: 100%;
  min-width: 0;
}

/* Hover and focus */
.portfolio-thumb:hover,
.portfolio-thumb:focus {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  outline: none;
}

.portfolio-thumb:hover img,
.portfolio-thumb:focus img {
  transform: scale(1.03);
}

/* Caption overlay */
.caption-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: .5rem .75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  color: var(--color-offwhite);
  font-size: .95rem;
  display: block;
}

/* Pangolin cards: image on top, dedicated caption area below, no text overlay */
.portfolio-thumb.pangolin-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
}

.portfolio-thumb.pangolin-card picture {
  flex: 1 1 0%;
  min-height: 0; /* image area yields space to the caption; never clips it */
  width: 100%;
}

.portfolio-thumb.pangolin-card img {
  height: 100%; /* uniform image area across cards... */
  object-fit: cover; /* ...with artwork preserved; no text under it */
}

.pangolin-caption {
  display: block;
  flex: 0 0 auto;
  min-height: 4rem; /* equal-height caption area; name + meaning always fit */
  padding: .5rem .75rem;
  color: var(--color-offwhite);
  text-align: left;
}

.pangolin-name {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700; /* primary title */
  line-height: 1.3;
}

.pangolin-meaning {
  display: block;
  font-size: .875rem; /* secondary: smaller + lighter than the name */
  font-weight: 400;
  line-height: 1.4;
  opacity: .8;
}

/* Fixed thumbnail heights for tidy rows */
@media (max-width: 991.98px) {

  /* mobile & tablet: two columns — show the full image, no crop */
  .portfolio-thumb {
    height: auto;
  }

  .portfolio-thumb img {
    height: auto;
  }
}

@media (min-width: 992px) {

  /* desktop: four columns */
  .portfolio-thumb {
    height: 260px;
  }
}

/* Keyboard accessible figure */
.portfolio-thumb[tabindex] {
  cursor: pointer;
}

/* Modal / lightbox styling */
.modal-content {
  background: rgba(0, 0, 0, 0.85);
  border: none;
  color: var(--color-offwhite);
  border-radius: 8px;
}

.modal-body {
  padding: 0;
}

.modal-footer {
  background: rgba(255, 255, 255, 0.03);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
}

/* Carousel slide image sizing inside modal (responsive fit) */
#galleryCarousel,
#galleryCarousel .carousel-inner {
  width: 100%;
}

#galleryCarousel .carousel-item img,
.modal-content img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 140px);
  /* viewport minus chrome (controls/caption) */
  object-fit: contain;
}

/* Slightly smaller max-height for very small screens */
@media (max-width: 420px) {

  #galleryCarousel .carousel-item img,
  .modal-content img {
    max-height: calc(100vh - 120px);
  }
}

/* Carousel image zoom (pinch on mobile, wheel/double-click on desktop) */
#galleryCarousel .carousel-item img.carousel-zoom {
  transform: scale(1);
  transform-origin: center center;
  transition: transform .18s ease-out;
}

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Small utility tweaks */
.lead {
  color: rgba(224, 224, 224, 0.92);
}

.text-muted {
  color: rgba(224, 224, 224, 0.6) !important;
}

/* Ensure images don't show white background in browsers that render transparency differently */
img {
  background-color: transparent;
}

/* Responsive spacing for the hero/header area */
header.container {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
}

/* Optional: subtle focus ring for keyboard users */
.portfolio-thumb:focus-visible {
  box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.18);
  outline: none;
}

/* Optional UX: center last-row thumbnails if you prefer centered last row */
/* .portfolio-grid { justify-content: center; } */

/* Uniform art-gallery cells: same size, image scaled to fit without cropping */
.art-cell {
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid rgba(184, 115, 51, 0.12);
  border-radius: 6px;
  overflow: hidden;
}

.art-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* scale to fit, never crop */
  display: block;
}

/* Details table: fit the dark bronze theme (Bootstrap table is light by default) */
table.table {
  --bs-table-bg: var(--color-black);
}

th {
  color: #FFF;
  font-family: var(--font-heading);
}

/* End of stylesheet */