/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(8px, 1.2vw, 16px);
}


/*CARD SECTION */

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
    gap: var(--gap);
    max-width: var(--grid-max);
    width: 100%;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 24px);
    box-sizing: border-box;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

/* Card Structure */
.card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: var(--creator-card-radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--creator-card-radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
    pointer-events: none;
}

.skeleton-card .thumb-wrap {
    background: linear-gradient(90deg, var(--card-bg) 25%, #2a2a2a 50%, var(--card-bg) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s linear infinite;
}

.skeleton-card .card-footer {
    padding: 12px;
}

.skeleton-card .title {
    height: 1em;
    margin-top: 0.5em;
    background: linear-gradient(90deg, var(--card-bg) 25%, #2a2a2a 50%, var(--card-bg) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 4px;
}

.card-footer {
    padding: 12px;
    background: var(--card-bg);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.card:active {
    box-shadow: 0 0 0 2px var(--rim) inset;
}

.title {
    margin: 0;
    font-size: var(--card-title-size, clamp(0.9rem, 2vw, 1.2rem));
    font-weight: var(--card-title-weight, 600);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: var(--card-title-lines, 2);
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--card-title-color, inherit);
    min-height: calc(var(--card-title-lines, 2) * 1.35em);
    max-height: calc(var(--card-title-lines, 2) * 1.35em);
}



/* Card shapes */
[data-card-shape="rounded"] .card {
  border-radius: var(--creator-card-radius);
  clip-path: none;
}
[data-card-shape="blocky"] .card {
  border-radius: 4px;
  clip-path: none;
}
[data-card-shape="bevel"] .card {
  border-radius: 0;
  /* chamfered corners via clip-path; keep overflow hidden for media */
  clip-path: polygon(
    var(--card-bevel) 0,
    100% 0,
    100% calc(100% - var(--card-bevel)),
    calc(100% - var(--card-bevel)) 100%,
    0 100%,
    0 var(--card-bevel)
  );
}

/* Surface videos */
.video-bg {                 /* page background video */
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}
.surface-video {           /* header/footer/description video layer */
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;  /* respect rounded headers/desc */
  z-index: -1;
  pointer-events: none;
}



/* media wrapper with fixed aspect */
.thumb-wrap{
  position: relative;
  width: 100%;
  aspect-ratio: 742 / 960; /* same as your .thumb ratio */
  overflow: hidden;
}

/* stack placeholder under the image */
.thumb-wrap .ph,
.thumb-wrap .thumb{
  position: absolute;
  inset: 0;
}

/* make SVG scale to the box */
.thumb-wrap .ph svg{
  width: 100%;
  height: 100%;
  display: block;
}

/* image on top, no stretch */
.thumb-wrap .thumb{
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Four columns on wider screens */
@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.description {
     max-width: var(--description-max-width);
     margin: var(--description-margin);
     padding: clamp(1rem, 5vw, 2rem);
     border-radius: var(--description-border-radius);
     color: white;
     position: relative;
     z-index: 200; /* Higher than the dot button */
}

/* keep text in a centered box even when the band is full-bleed */
.description > * { max-width: var(--description-content-max, 720px); margin-left:auto; margin-right:auto; }

.description h1 {
    font-size: clamp(1.2rem, 5vw, 2rem);
    margin-bottom: 1rem;
    font-weight: 800;
}

.description p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    opacity: 0.9;
    max-width: var(--description-p-max, 600px);
    margin: 0 auto;
}

.description.style-1 {
    background: var(--creator-gradient);
    border: var(--description-border);
}

.description.style-2 {
    background: rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--brand-primary);
}

.description.style-3 {
    background: var(--creator-gradient);
    border: none;
}

.description.style-4 {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--glass-blur));
}

.description.style-5 {
    background: var(--brand-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.description.align-center {
    text-align: center;
}

.description.align-left {
    text-align: left;
}

body {
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--text);
    background: var(--creator-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Apply gradient background if enabled */
body[data-gradient="true"] {
    background: var(--creator-gradient);
}

/* Header container uses grid so .header-links can use justifySelf set by JS */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--hdr-h);
  padding: 0 max(1rem, calc((100% - var(--grid-max)) / 2));
  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur));
  -webkit-backdrop-filter: blur(var(--header-blur));
  border-bottom: 1px solid var(--header-bd);
}

/* NEW: ensure 3 slots: branding | spacer | quick+hamburger */
.header-content {
  max-width: var(--grid-max);
  height: var(--hdr-h);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1rem;
}

.branding { display: flex; align-items: center; gap: 1rem; }

#logo {
    width: var(--logo-size);
    height: var(--logo-size);
    border-radius: 12px;
    object-fit: cover;
}

#handle {
    font-size: clamp(2rem, 4vw, 2.25rem);
    font-weight: 600;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* JS will set justifySelf: start|center|end via theme.js */
}

.header-links a {
    display: flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.header-links img {
    width: clamp(24px, 6vw, 32px);
    height: clamp(24px, 6vw, 32px);
}

#hamburger {
  padding: 1rem;  
  margin-left: 1rem; /* sits to the right of quick links */
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: clamp(2rem, 8vw, 2.5rem);
  
}

#hamburgerMenu {
    position: fixed;
    top: var(--hdr-h);
    right: max(1rem, calc((100% - var(--grid-max)) / 2));
    background: var(--menu-bg, rgba(30, 30, 30, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--creator-card-radius);
    max-height: clamp(50vh, 50vh, 80vh);
    width: min(250px, 70vw);
    display: none;
    margin: 0;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    overflow-y: auto; /* Changed from 'hidden' to 'auto' */
    flex-direction: column;
}

/* Add smooth scrolling for the menu */
#hamburgerMenu .menu-links {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0;
    flex: 1;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#hamburgerMenu .close-menu {
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--text);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    cursor: pointer;
    padding: 0.5rem 1rem;
}

#hamburgerMenu.visible {
    display: flex;
}

#hamburgerMenu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
    /* Add font size control */
    font-size: clamp(1.4rem, 2vw, 1.5rem);
    font-weight: 400;
}

#hamburgerMenu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

#hamburgerMenu img {
    width: 35px;
    height: 35px;
}

@media (max-width: 768px) {
    #hamburgerMenu {
        max-height: 60vh;
    }
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    padding: 1rem max(1rem, calc((100% - var(--grid-max)) / 2));
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-bottom: var(--gap);
}

.pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    min-width: 140px;
    justify-content: center;
}

.pill:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.pill.active {
    background: var(--creator-gradient);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pill img {
    width: 18px;
    height: 18px;
}

.icon-btn.dot-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5; /* Lower than description */
}

.copy-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-feedback.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Back to Top Button */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.back-to-top {
    --bottom-padding: 13rem;  /* Adjustable bottom padding */
    --right-padding: 6.5rem;     /* Adjustable right padding */
    position: fixed;
    bottom: var(--bottom-padding);
    right: var(--right-padding);
    width: clamp(42px, 11vw, 45px);
    height: clamp(42px, 11vw, 45px);
    border-radius: 50%;
    background: var(--creator-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: float 2.5s ease-in-out infinite;
}

.back-to-top:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Mobile and orientation-specific adjustments for back-to-top button */
@media (max-width: 768px) {
    .back-to-top {
        --bottom-padding: 10rem;    /* Mobile bottom padding */
        --right-padding: 3.6rem;     /* Mobile right padding */
        width: clamp(38px, 10vw, 42px);
        height: clamp(38px, 10vw, 42px);
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .back-to-top {
        --bottom-padding: 5rem;    /* Landscape mode bottom padding */
        --right-padding: 2.5rem;   /* Landscape mode right padding */
    }
}

/* Footer */
@keyframes slideInFooter {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

 .footer {
    margin-top: auto;
    padding: var(--footer-padding-y) max(1rem, calc((100% - var(--grid-max)) / 2));
    background: var(--footer-bg);
    backdrop-filter: blur(var(--footer-blur));
    -webkit-backdrop-filter: blur(var(--footer-blur));
    border-top: 1px solid var(--footer-bd);
    text-align: center;
    width: 100%;
    height: var(--ftr-h);
    position: fixed; /* Changed to fixed */
    bottom: 0;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, calc(var(--footer-padding-y) / 2), 0.7rem);
 }

.footer.sticky {
    position: fixed; /* Keep it fixed */
    transform: translateY(0);
    opacity: 1;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--footer-gap);
}

.footer-links a {
    text-decoration: none;
}

.footer-links img {
    width: var(--footer-icon-size);
    height: var(--footer-icon-size);
    transition: transform 0.2s;
}

.footer-links a:hover img {
    transform: scale(1.1);
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: var(--footer-font-size, 0.95rem);
    font-weight: var(--footer-font-weight, 500);
}

.footer-legal a {
    color: var(--footer-link-color);
    text-decoration: none;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-bottom: 0.5rem; /* adjust as needed */

}

/* Description Sections */
.description-section {
    grid-column: 1 / -1;
    margin: var(--gap) 0;
}

.description-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--creator-card-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}

.description-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--creator-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.description-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Stick description below the header when data-sticky="true" */
.description[data-sticky="true"] {
  position: sticky;
  top: calc(var(--hdr-h) + 1rem);
  z-index: 10;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    place-items: center;
    z-index: 1000;
}

.modal.visible {
    display: grid;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: var(--creator-card-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--modal-bd);
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal input,
.modal textarea {
    padding: 0.5rem;
    border: 1px solid var(--modal-bd);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

#reportMessage {
    min-height: 6rem;
    resize: none;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel,
.btn-submit {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-submit {
    background: var(--creator-gradient);
    color: white;
}

/* Menu */
.dropdown-menu {
    position: absolute;
    background: var(--menu-bg);
    border-radius: var(--creator-card-radius);
    padding: 0.5rem;
    z-index: 200;
    display: none;
}

.dropdown-menu.visible {
    display: block;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    pointer-events: all; /* Ensure clicks are caught by the button */
    position: relative; /* Create stacking context */
    z-index: 2; /* Ensure buttons are above card link */

}

.dropdown-menu button:hover {
    background: var(--menu-hover);
}


.description .create-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--brand-text);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.description .create-link:hover {
    opacity: 1;
}

