@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap');

/* --- Variable Declarations --- */
:root {
  /* Colors */
  --bc: #efeeee;
  --white: #ffffff;
  --black: #000000;
  --dark-blue: #1f2029;
  --extra-dark-blue: #13141a;
  --dark-light: #424455;
  --red: #da2c4d;
  --dark-red: #6e1727;
  --yellow: #f8ab37;
  --grey: #ecedf3;
  --blue: #007bff;
  --indigo: #6610f2;
  --purple: #6f42c1;
  --pink: #e83e8c;
  --orange: #fd7e14;
  --green: #28a745;
  --light-green: #24e33a;
  --teal: #20c997;
  --cyan: #17a2b8;
  --gray: #6c757d;
  --primary: #d1a9de;
  --secondary: #7015b3;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  
  --color-background: #F9f5ef;
  --color-text-dark: #333;
  --color-text-medium: #666;
  --color-text-light: #888;
  --color-brand-brown: #5D4037;
  --color-brand-caramel: #F3EADF;
  --color-white: #fff;
  --color-footer-bg: #1a202c;
  --border-color: #e0ded7;
  --dark-grey: #666;
  --accent-color: #bb2f63;
  --rosy-taupe: #7B6155;
  --muted-grey: #A8A29E;

  /* Fonts */
  --font-family-sans-serif: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-header: 'Libre Baskerville', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-secondary: 'Libre Baskerville', serif;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --spacing-1: 0.5rem;
  --spacing-2: 1rem;
  --spacing-3: 1.5rem;
  --spacing-4: 2rem;
  --spacing-5: 2.5rem;
  
  /* Box Shadow */
  --box-shadow-light: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* --- Global Styles --- */
* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
  width: 100%;
  min-height: 100vh;
	overflow-x: hidden;
	font-family: var(--font-family-sans-serif);
  scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
  /* background-color: var(--light-mode-brig); */
}

/* --- User Header and Info --- */
.user-header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.user-header-inner {
  width: 80%;
  min-height: 15vh;
  display: grid;
  align-items: center;
  grid-template-columns: auto 1fr;
  grid-column-gap: 2em;
  grid-row-gap: 2em;
}

.uh-left {
  width: 100%;
  height: 100%;
  padding: 0 2em 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.uh-image {
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.uh-image-inner {
  width: 10.5rem;
  height: 10.5rem;
  border: .3em solid var(--grey);
  object-fit: cover;
  border-radius: 50%;
  z-index: 2;
}

.gradient {
  width: 100%;
  height: 100%;
  padding: .3em;
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(214,41,118,1) 0%, rgba(250,126,30,1) 100%);
}

.gradient-gray {
  width: 100%;
  height: 100%;
  padding: .3em;
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(236,237,243,1) 0%, rgba(228,229,233,1) 100%);
}

.uh-right {
  padding: 1em;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.user-info {
  font-size: 2em;
  line-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.uname-verified {
  height: 1.8rem;
}

.btn {
  margin: 1em;
  border-radius: 3px;
  border: 1px solid var(--grey);
  background-color: var(--white); /* Changed from var(--light) which was not defined */
  padding: .4em .6em;
  cursor: pointer;
  color: var(--black);
}

.user-links a {
  margin: 0 1em 0 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--black);
}

.user-links a span {
  font-weight: bolder;
}

.user-bio-name {
  font-weight: bold;
  margin: 1.75em 0 0 0;
  line-height: 0;
}

/* --- Stories --- */
.user-stories {
  margin: 3em 0 1em 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-stories-inner {
  width: 80%;
  display: grid;
  align-items: center;
  grid-template-columns: repeat(5, 1fr);
  grid-column-gap: 4em;
}

.story-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.story-wrapper h2 {
  margin: .25em;
  font-size: 1.1em;
  font-weight: 400;
}

.story-inner {
  width: 75%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.story-inner:after {
  content: "";
  display: block;
  padding-bottom: 100%;
}

.story-img {
  width: calc(100% - .5em);
  height: calc(100% - .5em);
  position: absolute;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--grey);
  z-index: 2;
}

/* --- Post Grid --- */
.user-page-wrapper {
  display: flex;
  justify-content: center;
  margin: 3em 0;
}

.user-page-inner {
  width: 80%;
  display: grid;
  align-items: center;
  grid-template-columns: repeat(3, 1fr);
  grid-column-gap: 2em;
  grid-row-gap: 2em;
}

.image-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.image-wrapper:after {
  content: "";
  display: block;
  padding-bottom: 100%;
}

.image {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
}

.img-overlay-wrapper {
  width: 100%;
  height: 100%;
  opacity: 0;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: opacity .15s ease-in-out;
}

.image-wrapper:hover .img-overlay-wrapper {
  opacity: 1;
}

.img-btns {
  font-size: 1.3em;
  color: var(--white);
  z-index: 10;
}

.img-overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: rgba(0, 0, 0, .4);
  z-index: 9;
}

.image-block {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.block {
  width: 60%;
  height: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--color-background);
  z-index: 20;
}

.block-background {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: rgba(0, 0, 0, .4);
  z-index: 19;
}

/* --- Loader --- */
.user-loader {
  min-height: 25vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  position: relative;
  width: 75px;
}

.circular {
  animation: rotate 2s linear infinite;
  height: 100%;
  width: 100%;
}

.path {
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
  stroke-linecap: round;
}

/* --- Site Header --- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-5) 5%;
}

.brand h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  line-height: 1;
}

.brand h1 a {
  display: flex;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand p {
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: var(--font-weight-light);
  color: var(--color-text-light);
  letter-spacing: 0.5px;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text-dark);
  font-size: 0.9rem;
  font-weight: var(--font-weight-regular);
  transition: color 0.3s ease;
  margin-left: var(--spacing-2);
  font-family: var(--font-secondary);
}

.site-nav a:hover {
  color: var(--color-text-medium);
}

/* Header layout for bites page */
.site-header {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
  background: none;
  transform: none !important;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--color-text-dark);
}

.site-nav a:hover {
  color: var(--color-text-medium);
}

.site-nav a.active {
  font-weight: var(--font-weight-semibold);
}

.logo-link {
  display: block;
}

.logo {
  width: 50px;
  height: auto;
}

/* --- Footer --- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.4rem 5%;
  font-size: 0.9rem;
  color: var(--dark-grey);
  background-color: #fcfbf8;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  font-family: var(--font-body);
}

.footer-left p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-grey);
  line-height: 1.4;
}

.footer-left a, .footer-right a {
  color: var(--muted-grey);
}

.footer-left a:hover, .footer-right a:hover {
  color: var(--rosy-taupe);
}

.logo2 {
  width: 30px;
  height: auto;
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  text-transform: lowercase;
  color: var(--muted-grey);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: color 0.2s ease;
  font-family: var(--font-body);
}

.footer-nav a:hover {
  color: var(--rosy-taupe);
}

.footer-right {
  text-align: right;
}

.footer-right p {
  margin: 0;
  color: var(--dark-grey);
}

#quote-area {
  margin-top: 1.7rem;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.8rem;
}

.quote-carousel-track {
  display: inline-flex;
  animation: marquee 400s linear infinite;
}

.quote-carousel-item {
  padding: 0 1rem;
  font-style: italic;
  color: var(--dark-grey);
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
}

.quote-carousel-item i {
  color: var(--accent-color);
  font-size: 0.9em;
}

/* --- Post Popup & Carousel --- */
.post-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.post-popup-content {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  max-width: 900px;
  max-height: 90vh;
  width: 90%;
  display: flex;
  position: relative;
}

.post-image-section {
  flex: 1;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* Added for carousel */
}

.post-image-section img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.post-details-section {
  width: 340px;
  display: flex;
  flex-direction: column;
  background: white;
}

.post-header {
  padding: 16px;
  border-bottom: 1px solid #efefef;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-header img, .post-caption img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.post-user-info h4 {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}

.post-location {
  font-size: 12px;
  color: #8e8e8e;
  margin: 2px 0 0 0;
}

.post-caption-section {
  padding: 16px;
  flex-grow: 1;
  overflow-y: auto;
}

.post-caption {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.caption-content h4 {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.caption-text {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  white-space: pre-line;
}

.post-date {
  font-size: 10px;
  color: #8e8e8e;
  text-transform: uppercase;
  margin-top: 8px;
}

.post-actions {
  padding: 12px 16px;
  border-top: 1px solid #efefef;
  display: flex;
  gap: 16px;
  align-items: center;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #262626;
}

.action-btn i {
  font-size: 24px;
}

.action-btn.liked i {
  color: #ed4956;
}

.like-count {
  font-weight: 600;
}

.close-popup {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10001;
}

.close-popup:hover {
  background: rgba(0, 0, 0, 0.9);
}

.copy-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #262626;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

.copy-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.image-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-images {
  display: flex;
  transition: transform 0.3s ease;
  height: 100%;
}

.carousel-images img {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #262626;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.95);
}

.carousel-nav.prev {
  left: 12px;
}

.carousel-nav.next {
  right: 12px;
}

.post-image-section:hover .carousel-nav {
  opacity: 1;
}

.carousel-pagination {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.pagination-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.pagination-dot.active {
  background: rgba(255, 255, 255, 0.8);
}

.multi-image-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}

.location-link {
  color: #365899;
  text-decoration: none;
  font-weight: 500;
}

.location-link:hover {
  text-decoration: underline;
}

/* --- Keyframes --- */
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

@keyframes color {
  100%, 0% {
    stroke: var(--red);
  }
  40% {
    stroke: var(--blue);
  }
  66% {
    stroke: var(--green);
  }
  80%, 90% {
    stroke: var(--yellow);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* --- Media Queries --- */
@media (max-width: 1024px) {
  .user-header-inner {
    width: 85%;
  }
  .uh-image {
    width: 10rem;
    height: 10rem;
  }
  .uh-image-inner {
    width: 9.5rem;
    height: 9.5rem;
  }
  .user-stories-inner {
    width: 85%;
    grid-column-gap: 2em;
  }
  .story-wrapper {
    margin: 0 1em;
  }
  .user-page-inner {
    width: 85%;
    grid-column-gap: 1.5em;
    grid-row-gap: 1.5em;
  }
  .img-btns {
    font-size: 1.1em;
  }
}

@media (max-width: 936px) {
  .user-header-inner {
    width: 90%;
  }
  .uh-left {
    padding: 0 1em 0 0;
  }
  .uh-image {
    width: 9rem;
    height: 9rem;
  }
  .uh-image-inner {
    width: 8.5rem;
    height: 8.5rem;
  }
  .user-stories-inner {
    width: 90%;
    grid-column-gap: .75em;
  }
  .story-wrapper {
    margin: 0 .5em;
  }
  .user-page-inner {
    width: 90%;
    grid-column-gap: 1.25em;
    grid-row-gap: 1.25em;
  }
  .img-btns {
    font-size: 1em;
  }
}

@media (max-width: 767px) {
  .uh-left {
    padding: 0;
  }
  .uh-image {
    width: 8.5rem;
    height: 8.5rem;
  }
  .uh-image-inner {
    width: 8rem;
    height: 8rem;
  }
  .story-wrapper {
    margin: 0 .25em;
  }
  .user-page-inner {
    grid-column-gap: 1em;
    grid-row-gap: 1em;
  }
  .img-btns {
    font-size: .8em;
  }

  /* Mobile-specific styles for bio section */
  .user-header-inner {
    grid-template-columns: 1fr;
    grid-row-gap: 1em;
    text-align: center;
  }
  
  .uh-left {
    padding: 0;
  }
  
  .uh-image {
    width: 6rem;
    height: 6rem;
  }
  
  .uh-image-inner {
    width: 5.5rem;
    height: 5.5rem;
  }
  
  .uh-right {
    padding: 0.5em;
    align-items: center;
  }
  
  .user-info {
    font-size: 1.3em;
  }
  
  .uname-verified {
    height: 1.2rem;
  }
  
  .user-links a {
    margin: 0 0.5em 0 0;
    font-size: 0.9em;
  }
  
  .user-bio {
    font-size: 0.85em;
    text-align: center;
  }
  
  .user-bio-name {
    font-size: 0.95em;
    margin: 1em 0 0.5em 0;
  }
  
  .user-bio p {
    line-height: 1.3;
    margin: 0.5em 0;
  }

  .post-popup-content {
    flex-direction: column;
    max-height: 95vh;
    width: 95%;
  }

  .post-details-section {
    width: 100%;
    max-height: 300px;
  }

  .post-image-section {
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  .user-info {
    font-size: 1.1em;
  }
  
  .user-links a {
    font-size: 0.8em;
  }
  
  .user-bio {
    font-size: 0.8em;
  }
  
  .user-bio-name {
    font-size: 0.9em;
  }
}

@media (max-width: 767px) {
  .uh-left {
    padding: 0;
  }
  .uh-image {
    width: 8.5rem;
    height: 8.5rem;
  }
  .uh-image-inner {
    width: 8rem;
    height: 8rem;
  }
  .story-wrapper {
    margin: 0 .25em;
  }
  .user-page-inner {
    grid-column-gap: 1em;
    grid-row-gap: 1em;
  }
  .img-btns {
    font-size: .8em;
  }

  /* Mobile-specific styles for bio section */
  .user-header-inner {
    grid-template-columns: 1fr;
    grid-row-gap: 1em;
    text-align: center;
  }
  
  .uh-left {
    padding: 0;
  }
  
  .uh-image {
    width: 6rem;
    height: 6rem;
  }
  
  .uh-image-inner {
    width: 5.5rem;
    height: 5.5rem;
  }
  
  .uh-right {
    padding: 0.5em;
    align-items: center;
  }
  
  .user-info {
    font-size: 1.3em;
  }
  
  .uname-verified {
    height: 1.2rem;
  }
  
  .user-links a {
    margin: 0 0.5em 0 0;
    font-size: 0.9em;
  }
  
  .user-bio {
    font-size: 0.85em;
    text-align: center;
  }
  
  .user-bio-name {
    font-size: 0.95em;
    margin: 1em 0 0.5em 0;
  }
  
  .user-bio p {
    line-height: 1.3;
    margin: 0.5em 0;
  }

  .post-popup-content {
    flex-direction: column;
    max-height: 95vh;
    width: 95%;
  }

  .post-image-section {
    height: 40%;
  }

  .post-details-section {
    width: 100%;
    height: 60%;
  }

  .carousel-images {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    transition: transform 0.3s ease;
  }

  .carousel-images img {
    width: 75%;
    max-height: 100%;
  }
}

@media (max-width: 480px) {
  .user-info {
    font-size: 1.1em;
  }
  
  .user-links a {
    font-size: 0.8em;
  }
  
  .user-bio {
    font-size: 0.8em;
  }
  
  .user-bio-name {
    font-size: 0.9em;
  }
}
@media (max-width: 768px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--white);
    padding: var(--spacing-2) 5%;
    flex-direction: column;
    align-items: center;
  }

  .site-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    margin-top: var(--spacing-2);
  }

  .user-header-wrapper {
    margin-top: 150px;
  }
}