/* ========================================
   COLORS AND GLOBAL STYLES
======================================== */

:root {
  --brand: #123d67;
  --orange: #ff9b42;
  --ink: #1c2935;
  --muted: #617080;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  background: #fff;
}

a {
  color: var(--brand);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  outline-offset: 4px;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h2 {
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 750;
}

[hidden] {
  display: none !important;
}

/* ========================================
   LAYOUT AND UTILITY CLASSES
======================================== */

.container {
  width: min(1140px, calc(100% - 40px));
  margin: auto;
}

.py-5 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.text-center {
  text-align: center;
}

.bg-light {
  background: #f5f7fa !important;
}

.bg-dark {
  background: #142b40 !important;
}

.text-white {
  color: white;
}

.text-secondary {
  color: var(--muted) !important;
}

/* ========================================
   BUTTONS
======================================== */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: #245780;
  color: white;
}

.btn-outline-primary {
  border: 1px solid var(--brand);
  color: var(--brand);
}

.btn-outline-primary:hover {
  background: var(--brand);
  color: white;
}

/* ========================================
   ACCESSIBILITY
======================================== */

.skip-link {
  position: absolute;
  top: -100px;
  background: white;
  z-index: 99;
  padding: 12px;
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   NAVIGATION
======================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f8f9fa;
  box-shadow: 0 2px 12px #0b293012;
  padding: 10px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--brand);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.2em;
}

.portfolio-logo {
	display: block;
    width: auto;
    height: 48px;
    max-width: 180px;
    object-fit: contain;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  text-decoration: none;
  color: #435567;
  display: block;
  padding: 10px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand);
  font-weight: 700;
}

.nav-link.active {
  box-shadow: 0 2px var(--orange);
}

.navbar-toggler {
  display: none;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 12px;
}

/* ========================================
   CAROUSEL
======================================== */

.carousel {
  position: relative;
  background: #102c43;
}

.carousel-item {
  display: none;
  position: relative;
}

.carousel-item.active {
  display: block;
}

.carousel-item img {
  display: block;
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #061b30aa,
    #061b3010 70%
  );
}

.carousel-caption {
  position: absolute;
  z-index: 2;
  left: 15%;
  right: 15%;
  bottom: 55px;
  padding: 24px;
  border-radius: 12px;
  background: rgba(45, 55, 63, 0.65);
  text-align: center;
  color: white;
}

.carousel-caption h1,
.carousel-caption h2 {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  font-style: italic;
}

.carousel-caption p {
  margin: 0;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.75;
}

/* Carousel Controls */

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  border: 0;
  background: transparent;
  color: white;
  font-size: 64px;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-control-prev {
  left: 0;
}

.carousel-control-next {
  right: 0;
}

/* Carousel Indicators */

.carousel-indicators {
  position: absolute;
  display: flex;
  gap: 7px;
  bottom: 20px;
  left: 0;
  right: 0;
  justify-content: center;
  margin: 0;
  z-index: 5;
}

.carousel-indicators button {
  width: 28px;
  height: 4px;
  border: 0;
  padding: 0;
  background: #ffffff70;
}

.carousel-indicators button.active {
  background: var(--orange);
}

/* ========================================
   INTRODUCTION AND STATISTICS
======================================== */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: #49718f;
  margin-bottom: 12px;
}

.intro .lead {
  max-width: 850px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 70px;
  margin-top: 32px;
}

.stats div {
  text-align: center;
}

.stats strong {
  display: block;
  color: var(--brand);
  font-size: 32px;
}

.stats span {
  font-size: 13px;
  color: var(--muted);
}

/* ========================================
   GALLERY HEADINGS AND FILTERS
======================================== */

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
}

.gallery-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: white;
  padding: 22px;
  border: 1px solid #e1e7ec;
  border-radius: 10px;
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

/* ========================================
   PROJECT SECTIONS
======================================== */

.project-section {
  margin: 35px 0 55px;
  scroll-margin-top: 100px;
}

.project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dbe3ea;
}

.project-heading h3 {
  font-size: 23px;
  margin: 0;
}

.project-heading span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ========================================
   PHOTO GRID AND CARDS
======================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.photo-card {
  margin: 0;
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e7ec;
  overflow: hidden;
  box-shadow: 0 3px 10px #142b4008;
}

.photo-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: #e6edf2;
  position: relative;
}

.photo-open img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.photo-open:hover img {
  transform: scale(1.035);
}

.photo-open::after {
  content: "View photo ↗";
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: #102c43d9;
  color: white;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
}

.photo-card figcaption {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

.photo-card figcaption small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  margin-top: 4px;
}

.empty-state {
  padding: 60px;
  text-align: center;
}

/* ========================================
   CONTACT
======================================== */

#contact .eyebrow {
  color: var(--orange);
}

.contact-copy {
  color: #d7e1e9;
}

.contact-email {
  color: #c8deef;
}

/* ========================================
   QUICK LINKS AND FOOTER
======================================== */

#quick-links {
  background: #edf3f8;
}

#quick-links a {
  display: block;
  text-decoration: none;
  font-size: 14px;
  line-height: 2.1;
}

#quick-links a:hover {
  text-decoration: underline;
}

#quick-links .row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

#quick-links .row > * {
  width: auto;
}

footer {
  font-size: 12px;
}

/* ========================================
   PHOTO VIEWER
======================================== */

dialog {
  width: min(1100px, 95vw);
  max-height: 95vh;
  border: 0;
  border-radius: 12px;
  padding: 20px;
  color: var(--ink);
  background: #fff;
}

dialog::backdrop {
  background: #071626d9;
}

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.viewer-top h2 {
  font-size: 20px;
  align-items: center;
  margin: 0;
}

.viewer-top button {
  border: 0;
  background: transparent;
  font-size: 32px;
}

.viewer-image {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}

.viewer-image img {
  max-width: calc(100% - 80px);
  height: auto;
  max-height: 65vh;
  object-fit: contain;
  margin: auto;
}

.viewer-image button {
  border: 0;
  color: white;
  background: var(--brand);
  border-radius: 5px;
  font-size: 30px;
  min-width: 30px;
}

.viewer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
}

.viewer-bottom p {
  margin: 0;
}

/* ========================================
   RESPONSIVE: TABLETS AND SMALL LAPTOPS
======================================== */

@media (max-width: 991px) {
  .navbar-toggler {
    display: block;
  }

  .nav-inner {
    flex-wrap: wrap;
    gap: 0;
  }

  .nav-menu {
    display: none;
    width: 100%;
  }

  .nav-menu.open {
    display: block;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0;
    padding-top: 15px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .carousel-caption {
    left: 12%;
    right: 12%;
  }
}

/* ========================================
   RESPONSIVE: MOBILE
======================================== */

@media (max-width: 767px) {
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    gap: 25px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-controls {
    grid-template-columns: 1fr;
  }

  .carousel-item img {
    height: 350px;
  }

  .carousel-caption {
    left: 10%;
    right: 10%;
    padding: 18px;
    bottom: 40px;
  }

  #quick-links .row {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-heading h3 {
    font-size: 20px;
  }

  .photo-open img {
    height: 150px;
  }

  .viewer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   RESPONSIVE: SMALL MOBILE
======================================== */

@media (max-width: 450px) {
  .container {
    width: calc(100% - 28px);
  }

  .photo-grid {
    gap: 12px;
  }

  .photo-card figcaption {
    padding: 10px;
    font-size: 11px;
  }

  .stats {
    gap: 15px;
  }

  .stats span {
    font-size: 11px;
  }

  .carousel-caption h1,
  .carousel-caption h2 {
    font-size: 25px;
  }
}

/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .photo-open img {
    transition: none;
  }
}