/* Portfolio Page Styling */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  cursor: url("../cursors/default-cursor.png"), auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #f5f5f5;
  color: #333;
  padding: 20px;
  animation: fade 1s;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

a,
button {
  cursor: url("../cursors/pointer-cursor.png"), pointer;
}

#paper-b {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -100;
  opacity: 0.5;
  filter: blur(2px);
}

#grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.2;
  z-index: 1000;
  filter: blur(1px);
}

#logo-png {
  width: 6rem;
  z-index: 1001;
  margin-right: -0.5rem;
  cursor: url("../cursors/pointer-cursor.png"), pointer;
}

#logo-png:hover {
  animation: rotate 1s infinite forwards linear;
}

#logo-png:active {
  cursor: url("../cursors/clicked-cursor.png");
}

.header-container {
  position: fixed;
  top: 3.5rem;
  left: 4rem;
  display: flex;
  align-items: center;
  gap: 1.5rem; /* Space between logo and menu */
  z-index: 1001;
}

/* Menu Button - Positioned in the top-right corner */
.menu-toggle {
  padding: 1.9rem 2rem 1rem 0;
  background: none;
  color: rgb(48, 48, 48);
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  border: none;
  z-index: 2000;
  transition: transform 0.3s ease-in-out;
  cursor: url("../cursors/pointer-cursor.png"), default;
}

.menu-toggle:hover {
  color: white;
}

.menu-toggle:active {
  color: white;
  cursor: url("../cursors/clicked-cursor.png"), default;
}

#dropdown-title a {
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  font-size: 3.3rem;
  color: #333;
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 2rem;
  transition: transform 0.6s ease-in-out;
  background: none;
  padding: none;
  line-height: 4rem;
}

#dropdown-title a:hover {
  transform: rotate(-2deg);
  cursor: url("../cursors/pointer-cursor.png"), pointer;
}

#dropdown-title a:active {
  cursor: url("../cursors/clicked-cursor.png"), pointer;
}

/* Fullscreen overlay when menu is open */
.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.197); /* Dark overlay */
  backdrop-filter: blur(7px); /* Blur effect */
  display: none; /* Initially hidden */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease-in-out;
}

/* Dropdown container */
.dropdown-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: url("/photos-regular/paper.jpg") no-repeat center center / cover;
  position: relative;
  padding: 30px;
  border-radius: 20px;
  width: 95%;
  max-width: 38rem;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 1s ease-in-out;
}

/* Add a crumpled texture effect like the home page */
.dropdown-menu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/photos-regular/grain.png"); /* Match home-style.css */
  opacity: 0.1;
  z-index: -1;
  border-radius: 20px;
}

/* Add plant shadow effect */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/photos-regular/plant-shadow-left.jpg") no-repeat center
    center / cover;
  opacity: 0.3;
  z-index: -1;
  border-radius: 20px;
}

/* Show dropdown when active */
.dropdown-overlay.active {
  display: flex;
}

/* Animate dropdown entrance */
.dropdown-overlay.active .dropdown-menu {
  animation: slideIn 0.6s ease-out forwards;
}

.dropdown-overlay.closing .dropdown-menu {
  animation: slideOut 0.8s ease-in forwards;
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide Out */
@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Options styling */
.options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 20px;
  margin: 1.5rem 5rem 1rem 0;
  text-decoration: none;
  color: #333;
  background-color: white;
  border-radius: 50px;
  transition: background-color 0.3s ease;
  font-size: 1.5rem;
  font-family: "brandon-grotesque", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.options a span {
  margin-left: 4rem;
  margin-right: 4rem;
  text-align: center;
}

.options a img {
  /* Add this */
  width: 2rem; /* Adjust size as needed */
  height: 2rem;
  margin-top: 0.3rem; /* Keeps spacing balanced */
}

.options a:hover {
  background-color: rgba(89, 89, 89, 0.397);
}

.options a:active {
  cursor: url("../cursors/clicked-cursor.png"), pointer;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  justify-content: center;
}

h1 {
  font-size: 3rem;
  color: #333;
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  margin-bottom: 3rem;
  cursor: default;
  line-height: 4rem;
}

.torn-paper {
  position: relative;
  display: inline-block;
  padding: 1rem 5rem 0.5rem 4.3rem;
  background: white;
  font-size: 3rem;
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  color: #333;
  text-align: center;
  z-index: 1;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  transition: transform 0.6s ease-in-out;
  cursor: url("../cursors/camera-cursor.png"), default;
}

.torn-paper:hover {
  transform: rotate(-2deg);
}

.torn-paper:active {
  color: white;
  background-color: rgb(0, 0, 0);
  cursor: url("../cursors/camrecorder-cursor.png"), default;
}

/* Add a subtle crumpled paper texture */
.torn-paper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("images/crumpled-paper-texture.jpg"); /* Replace with your actual texture */
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

/* MATCH PRICING PAGE GRID */
.portfolio-grid {
  width: 90%;
  margin: 3rem auto 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  justify-items: center; /* centers cards in each grid cell */
}

.portfolio-container {
  width: 90%;
  max-width: 70rem;
  margin: 3rem auto 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  justify-items: center;
}

/* Match Wedding Pricing Page Polaroid Behavior */
.portfolio-item {
  perspective: 1400px;
  transition: transform 0.4s ease-in-out;
  width: 100%;
  max-width: 18rem; /* SAME as pricing cards */
  flex: 0 0 auto;
}

.portfolio-item:hover {
  transform: rotate(0deg) scale(1.03);
}

.portfolio-item:active {
  cursor: url("../cursors/clicked-cursor.png"), default;
}

.flip-card-inner {
  width: 100%;
  aspect-ratio: 2 / 3.5; /* SAME aspect ratio as the pricing cards */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s;
}

.portfolio-item.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* Ensure images don’t shrink strangely */
.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevents weird squeezing */
  border-radius: 6px;
}

.portfolio-item.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* Front & Back */
.flip-card-front,
.flip-card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
  background: white;
  padding: 15px;
  text-align: center;
  transition: box-shadow 0.3s;
  background: linear-gradient(135deg, #f1f1f1, #ffffff);
}

/* Front Side */
.flip-card-front {
  transform: rotateY(0deg);
  overflow: hidden;
}

.portfolio-caption {
  font-size: 1.5rem;
  margin-top: 0.2rem;
  margin-bottom: -0.8rem;
  font-weight: bold;
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  line-height: 4rem;
}

.portfolio-caption.inside {
  font-size: 2.2rem !important;
  line-height: 2.5rem !important;
  margin-bottom: 1rem;
  margin-top: -1rem !important;
}

/* Back Side */
.flip-card-back {
  transform: rotateY(180deg);
  color: rgb(0, 0, 0);
  background: linear-gradient(135deg, #ffffff, #e3e3e3);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  word-wrap: break-word;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.flip-card-back p {
  font-size: 1.2rem;
  max-width: 95%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal; /* Ensures text doesn't continue in one line */
  line-height: 1.4;
  padding: 0.5rem;
  font-family: "brandon-grotesque", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.calligraphy-line {
  width: 80%; /* Adjust width as needed */
  max-width: 10rem; /* Prevent it from getting too big */
  display: block;
  opacity: 0.7; /* Slightly faded effect */
  margin-top: -2rem;
  margin-bottom: -3rem;
}

.view-project-btn {
  background: none;
  border: black 1.5px solid;
  border-radius: 50px;
  color: rgb(41, 41, 41);
  text-decoration: none;
  padding: 0.3rem 1.5rem 0.3rem 1.5rem;
  transition: 0.3s;
  margin: 2rem 1rem 1rem 1rem;
  font-family: "brandon-grotesque", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.1rem;
  z-index: 1000;
  width: 90%;
}

.view-project-btn:hover {
  color: var(--dynamic-color);
  border: transparent;
}

.view-project-btn:active {
  cursor: url("../cursors/clicked-cursor.png"), pointer;
}

/* Footer Styling */
footer {
  background: none;
  color: #444;
  text-align: center;
  padding: 15px;
  font-family: "brandon-grotesque", sans-serif;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  margin-top: 50px;
}

.footer-links a {
  text-decoration: none;
  color: #555;
  font-weight: bold;
  transition: color 0.3s;
  padding-top: 2rem;
}

.footer-links a:hover {
  color: black;
}

@keyframes diagonalShimmer {
  0% {
    transform: translate(-150%, -150%) rotate(30deg);
  }
  100% {
    transform: translate(150%, 150%) rotate(30deg);
  }
}

.shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 150%;
  height: 150%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.236) 0%,
    rgba(255, 255, 255, 0.37) 50%,
    rgba(255, 255, 255, 0.225) 100%
  );
  transform: translate(-150%, -150%) rotate(30deg);
  animation: diagonalShimmer 1s ease-in-out;
  pointer-events: none;
  z-index: 10;
  filter: blur(10px);
}

.portfolio-item:hover .flip-card-front::after,
.portfolio-item:hover .flip-card-back::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 150%;
  height: 150%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.236) 0%,
    rgba(255, 255, 255, 0.37) 50%,
    rgba(255, 255, 255, 0.225) 100%
  );
  transform: translate(-150%, -150%) rotate(30deg);
  animation: diagonalShimmer 1s ease-in-out;
  pointer-events: none;
  z-index: 10;
  filter: blur(10px);
}

@keyframes rotate {
  0% {
    transform: rotateZ(0deg);
  }
  100% {
    transform: rotateZ(360deg);
  }
}

@keyframes fallOff {
  0% {
    transform: translateY(0) rotateY(0deg) scale(1); /* Ensure reset */
  }
  50% {
    transform: translateY(-2vh);
  }
  100% {
    transform: translateY(100vh); /* Fall without spin */
  }
}

@keyframes swipeRight {
  0% {
    transform: translateX(0) rotateY(0deg) scale(1); /* Ensure reset */
  }
  50% {
    transform: translateX(-2vw);
  }
  100% {
    transform: translateX(100vw); /* Swipe without spin */
  }
}

/* Apply animations when triggered */
.fall-animation {
  animation: fallOff 1.3s ease-in-out forwards;
  will-change: transform, opacity;
}

.swipe-animation {
  animation: swipeRight 1s ease-in-out forwards;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  .view-project-btn {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}

@media (max-width: 1024px) {
  .dropdown-overlay.active + .header-container {
    visibility: hidden; /* Hide but keep space */
    opacity: 0; /* Make it invisible */
    pointer-events: none; /* Prevent interaction */
  }

  .dropdown-overlay:not(.active) + .header-container {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .close-menu {
    display: inline;
    position: absolute;
    top: 0rem;
    right: 1.9rem;
    font-size: 3rem;
    color: black;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2000;
    font-family: "brandon-grotesque", sans-serif;
    font-weight: 400;
    font-style: normal;
    cursor: url("/cursors/pointer-cursor.png"), pointer;
    padding: 1rem;
  }

  .close-menu:hover {
    color: white;
  }

  .close-menu:active {
    cursor: url("/cursors/clicked-cursor.png"), pointer;
  }

  #logo-png {
    margin-right: auto;
    margin-left: 1.5rem;
  }

  .menu-toggle {
    padding: 1.7rem 1.5rem 1rem 0;
  }

  .view-project-btn {
    font-size: 1.1rem;
    padding: 0.5rem 2rem 0.5rem 2rem;
  }

  .options a {
    font-size: 1.2rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
    margin-top: 0.7rem;
  }

  #dropdown-title a {
    font-size: 2.8rem;
    line-height: 3rem;
    white-space: inherit;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  #logo-png {
    width: 5rem; /* Further reduce logo size only for small screens */
  }

  .menu-toggle {
    font-size: 1.5rem;
    padding: 1rem;
  }

  .flip-card-back p {
    font-size: 1.5rem;
  }

  .view-project-btn {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}

@media (max-width: 1024px) {
  /* Ensure the entire page scrolls properly */
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    overflow-y: auto;
    padding-bottom: 50px;
  }

  /* Fix header spacing so it doesn't overlap */
  .header-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 4vh;
  }

  /* Ensure the title doesn't get squished */
  h1 {
    font-size: 8vw !important;
    text-align: center;
    line-height: 8vw;
    padding: 1rem 2rem 0.5rem 2rem !important;
  }

  /* Fix menu placement */
  .menu-toggle {
    position: relative;
    font-size: 1.5rem;
    padding-right: 1.5rem;
  }

  .options a {
    width: 100%;
    margin: none;
  }

  .options a span {
    margin: 0;
  }

  /* Ensure the container expands naturally */
  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
  }

  .portfolio-caption {
    font-size: 1.5rem;
    line-height: 3rem;
    padding-top: 3px;
  }

  .flip-card-front,
  .flip-card-back {
    padding: 2.5rem 0.2rem 2rem 0.2rem;
  }

  .flip-card-back p {
    font-size: 4vw;
  }

  .view-project-btn {
    padding: 1vw 5vw 1vw 5vw;
    font-size: 3.5vw;
  }

  /* Ensure footer positions correctly */
  footer {
    font-size: 0.9rem;
    position: relative;
    margin-top: 4rem;
    text-align: center;
    margin-bottom: -4rem;
  }
}

@media (min-width: 1025px) {
  .close-menu {
    display: none; /* Hide close button on desktops */
  }

  .header-container {
    display: flex !important; /* Force it to reappear */
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* iPad layout (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Clean layout */
  body {
    padding-top: 8rem; /* spacing under header */
    justify-content: flex-start;
  }

  .container {
    width: 100%;
    margin-top: 2rem;
    text-align: center;
  }

  /* Title (Our Work) */
  .torn-paper {
    font-size: 3rem !important;
    padding: 1rem 6rem 0 !important;
    margin-bottom: 2rem;
    border-radius: 15px;
    margin-top: -5rem;
  }

  .flip-card-inner {
    height: 100%;
  }

  /* Front Image – perfect fit */
  .flip-card-front img {
    width: 90%;
    height: 100%;
    object-fit: cover;
  }

  /* Back Text – no overflow issues */
  .flip-card-back {
    height: 100%;
    overflow-y: auto;
    padding: 2rem 1rem;
  }

  .flip-card-back p {
    font-size: 1.2rem;
    line-height: 1.5;
  }

  /* Grid alignment */
  .portfolio-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem 1rem !important; /* vertical / horizontal */
    width: 90% !important;
    margin: 2rem auto 0 !important;
    justify-items: center;
  }

  .portfolio-item {
    width: 100%;
  }

  .portfolio-caption {
    font-size: 2rem;
    padding: 1rem 0 0.5rem;
  }

  /* Button size */
  .view-project-btn {
    font-size: 1.1rem;
    padding: 0.6rem 2rem;
  }

  .menu-toggle {
    font-size: 3rem;
  }

  #logo-png {
    width: 7rem;
    margin-top: -2rem;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* FIX — Make mobile polaroids match desktop spacing */
@media (max-width: 768px) {
  .portfolio-grid {
    width: 100%;
    padding: 0 1.2rem; /* Creates left/right whitespace */
  }

  .portfolio-item {
    width: 100% !important;
    max-width: 20rem; /* Same as desktop */
    margin: 0 auto; /* Centers each card */
  }

  .flip-card-inner {
    width: 100%;
  }

  .flip-card-front img {
    width: 100% !important; /* Do NOT shrink to 90% anymore */
    height: auto;
    object-fit: cover;
  }
}

/* FINAL FIX — Make mobile & tablet polaroids match desktop spacing */
@media (max-width: 1024px) {
  /* Restore desktop-style grid */
  .portfolio-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 95% !important; /* gives beautiful white margins */
    margin: 2rem auto 4rem;
    gap: 3rem;
  }

  /* Keep cards same proportions as desktop */
  .portfolio-item {
    max-width: 22rem !important; /* SAME as desktop */
    width: 75% !important;
    margin: 0 auto;
  }

  .flip-card-inner {
    width: 100% !important;
    aspect-ratio: 2 / 3.5 !important; /* match desktop */
  }

  /* Image should fit nicely inside frame, not edge-to-edge */
  .flip-card-front img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 6px;
  }

  /* Polaroid padding to match desktop */
  .flip-card-front,
  .flip-card-back {
    padding: 15px !important;
  }
}

.mobile-strip {
  will-change: transform;
}

.scroll-right,
.scroll-left {
  transform: translate3d(0, 0, 0);
}

@keyframes scrollRight {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scrollLeft {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}
