/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --bg: rgb(235, 208, 144);
    --bk: rgb(255, 253, 251);
    --accent: rgb(255, 0, 85);
    --text: rgb(29, 25, 26);
    --rule: rgb(141, 122, 97);
    --frame: rgb(25, 18, 10);
    --button: rgba(125, 88, 50, 0.5);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
    margin: 0;
    background: url(../images/page-background-02.jpg);
    background-size: cover;
    color: var(--text);
    font-family: serif;
    line-height: 1.6;
}

.container {
    max-width: 90%;
    margin: auto;
}

/* Typography */
h1 {
    font-family: "Homemade Apple", cursive;
    font-weight: 400;
    font-style: normal;
    margin-bottom: 0.5rem;
}

h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    margin: 0 0 1.25rem 0;
}

p {
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

li {
    font-family: system-ui, sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
}

a {
    color: var(--bk);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
    background: rgba(25, 18, 10, 0.95);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: #222 0.125rem 0.125rem 0.25rem;
    padding-bottom: 0;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 1.5rem;
    height: 0.125rem;
    background-color: var(--bg);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.375rem, 0.375rem);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.375rem, -0.375rem);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--bg);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Dropdown Menu */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-toggle {
    cursor: pointer;
    padding-bottom: 1rem;
}

.nav-links .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(25, 18, 10, 0.98);
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0;
    padding-top: 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.5);
    z-index: 1000;
}

.nav-links .dropdown:hover .dropdown-menu,
.nav-links .dropdown-menu:hover {
    display: block;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-links .dropdown-menu a:hover {
    background: rgba(255, 0, 85, 0.1);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    height: 15rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: 0 0.625rem 0.625rem rgba(0,0,0,0.4);
}

/* Banner variants for different pages */
.page-header.banner-index {
    background-image: url('../images/banner-index.jpg');
}

.page-header.banner-about {
    background-image: url('../images/banner-about.jpg');
}

.page-header.banner-contact {
    background-image: url('../images/banner-contact.jpg');
}

.page-header.banner-pages {
    background-image: url('../images/banner-pages.jpg');
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 0;
}

.page-header .container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.page-header h1 {
    font-size: clamp(1.5rem, 5vw, 5rem);
    margin-bottom: 0.5rem;
    color: var(--bk);
    text-shadow: 0.125rem 0.125rem 0.5rem rgba(0, 0, 0, 0.8);
}

.page-header .tagline {
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1rem;
    color: var(--bk);
    opacity: 0.95;
    text-shadow: 0.0625rem 0.0625rem 0.25rem rgba(0, 0, 0, 0.8);
}

/* ============================================
   GALLERY GRID (index.html)
   ============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 3rem;
    max-width: 1800px;
    margin: 3rem auto;
    position: relative;
    border-radius: 0.5rem;
    box-shadow: 0 0.625rem 0.625rem rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Blurred background for gallery */
.gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(../images/section-background.jpg);
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    z-index: -1;
}

.thumb {
    display: block;
    position: relative;
    padding: 1.5rem;
    cursor: pointer;
    overflow: visible;
    /* FIX #3: Remove line-height to eliminate white space under images */
    line-height: 0;
    text-decoration: none;
}

.thumb img {
    width: 100%;
    height: auto;
    /* FIX #3: Set display:block to remove baseline spacing under images */
    display: block;
    border: 0.0625rem solid var(--rule);
    box-shadow: 0 0.625rem 0.625rem rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.thumb:hover img {
    transform: scale(1.05);
}

.thumb-title {
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1rem;
    margin-top: 0.5rem;
    text-align: center;
    color: var(--text);
    /* Reset line-height for text after line-height:0 on parent */
    line-height: 1.6;
}

/* ============================================
   ARTWORK DETAIL PAGES - Mobile First
   ============================================ */
.nft-row {
    margin-top: 4vh;
    margin-bottom: 5vh;
    padding: 2rem;
    padding-top: 4rem;
    position: relative;
    border-radius: 0.5rem;
    box-shadow: 0 0.625rem 1.25rem rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}

.nft-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(../images/section-background.jpg);
    background-size: cover;
    filter: blur(8px);
    z-index: -1;
    border-radius: 0.5rem;
}

.nft-row:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 1.25rem 2.5rem rgba(0,0,0,0.16);
}

.nft-title {
    font-family: "Homemade Apple", cursive;
    font-weight: 400;
    margin-bottom: 1rem;
}

.nft-short-desc {
    margin-bottom: 1rem;
}

.nft-short-desc p {
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

.nft-long-desc h3 {
    font-family: 'Oswald', sans-serif;
    margin: 2rem 0 0.75rem 0;
    font-size: 1.2rem;
}

.nft-long-desc p {
    font-family: 'Red Hat Text', sans-serif;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.keywords-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.keywords-list li {
    font-family: 'Red Hat Text', sans-serif;
    background: rgba(125, 88, 50, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.status-module {
    margin: 2rem 0;
}

.nft-rule {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 2rem 0;
}

.index-description {
    color: var(--bg);
}

/* Tablet and Desktop: 5/3 Grid */
@media (min-width: 900px) {
    .nft-row {
        display: grid;
        grid-template-columns: 5fr 3fr;
        column-gap: 3rem;
    }
    
    .nft-image-wrapper {
        grid-column: 1;
        grid-row: 1 / 99;
        margin: 0;
    }
    
    .image-meta {
        grid-column: 1;
    }
    
    .quote-block {
        grid-column: 1;
    }
    
    .nft-rule {
        grid-column: 1;
    }
    
    .nft-title {
        grid-column: 2;
    }
    
    .nft-short-desc {
        grid-column: 2;
    }
    
    .nft-long-desc {
        grid-column: 2;
    }
    
    .status-module {
        grid-column: 2;
    }
    
    .nav-links-bottom {
        grid-column: 2;
    }
}

.section-title {
    font-family: system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.nft-image-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 1.5rem 1rem 1rem;
    width: fit-content;
    height: fit-content;
    cursor: zoom-in;
    overflow: visible;
    order: 0;
    line-height: 0;
}

.nft-image-wrap img {
    width: 100%;
    height: auto;
    border: 0.625rem solid #1d0101;
    display: block;
    object-fit: contain;
    transition: 0.5s transform;
}

.nft-image-wrap:hover img {
    transform: scale(1.03);
}

/* ============================================
   AUTOMATED ASPECT RATIO IMAGE SYSTEM
   ============================================ */
.nft-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: zoom-in;
    border: 0.625rem solid #1d0101;
    margin: 2rem 0;
    line-height: 0;
    display: block;
}

.nft-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: 0.5s transform;
}

.nft-image-wrapper:hover .nft-image {
    transform: scale(1.03);
}

.image-column {
    order: 1;
    grid-column: 1;
    grid-row: 1;
    display: f2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    margin-left: 2rem;
    margin-right: 2rem;
    margin-top: 0;
    align-self: start;
}

.pixel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
}


.image-meta {
    font-family: 'Red Hat Text', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    text-align: center;
    margin: 1rem 0 2rem 0;
    opacity: 0.8;
}

.image-meta p {
    margin: 0;
}

/* Buttons */
.price-btn {
    background: var(--button);
    border: 0.0625rem solid #936f4c;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Red Hat Text', sans-serif;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    display: inline-block;
    color: var(--bk);
    text-decoration: none;
}

.price-btn:hover {
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.5rem 1.125rem rgba(0,0,0,0.18);
    opacity: 0.98;
}

.price-btn:active {
    transform: translateY(0);
}

.back-link {
    display: inline-block;
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--button);
    text-decoration: none;
    margin-top: 2rem;
}

.next-link {
    display: inline-block;
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--button);
    text-decoration: none;
    text-align: right;
}

.back-link:hover,
.next-link:hover {
    color: var(--accent);
}

.nav-links-bottom {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: 'Red Hat Text', sans-serif;
    font-size: 1.1rem;
    margin: 2rem 0;
}

.nav-links a.active {
        color: var(--accent);
}

.nav-links-bottom a {
    color: var(--button);
    text-decoration: none;
}

.nav-links-bottom a:hover {
    color: var(--accent);
}

.nav-links-bottom .nav-separator {
    color: var(--rule);
}

.quote-block {
    margin: 2rem 0;
    text-align: center;
    font-family: 'Homemade Apple', cursive;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    font-style: italic;
    padding: 1.5rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   CONTENT PAGES (About, Contact)
   ============================================ */
.content-page {
    padding: 3rem 0 5rem;
    max-width: 60rem;
}

.about-section h2,
.contact-section h2 {
    font-family: 'Oswald', sans-serif;
    color: var(--text);
    margin: 2.5rem 0 1rem;
    font-size: 1.8rem;
}

.about-section p,
.contact-section p {
    font-family: 'Red Hat Text', sans-serif;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.contact-item {
    padding: 1.5rem;
    background: rgba(43, 22, 1, 0.6);
    border-radius: 0.5rem;
    border: 0.0625rem solid var(--rule);
}

.contact-item h3 {
    font-family: 'Oswald', sans-serif;
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.contact-item p {
    margin: 0;
}

.contact-item a {
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: rgba(25, 18, 10, 0.95);
    color: var(--bk);
    padding: 3rem 0 0;
    margin-top: 5rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-section h3 {
    font-family: 'Oswald', sans-serif;
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-section h4 {
    font-family: 'Oswald', sans-serif;
    color: var(--bg);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: rgba(255, 253, 251, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    font-family: 'Red Hat Text', sans-serif;
    color: rgba(255, 253, 251, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent);
    text-decoration: none;
}

.footer-bottom {
    border-top: 0.0625rem solid rgba(255, 253, 251, 0.2);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 253, 251, 0.6);
    font-size: 0.9rem;
}

/* ============================================
   4K OPTIMIZATIONS
   ============================================ */
@media (min-width: 160rem) {
    .nft-row {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .narrative-text {
        grid-column: span 2;
    }
    
    .nft-image-wrap {
        grid-column: span 4;
    }
    
    .nft-row:nth-child(even) .narrative-text {
        order: 2;
        grid-column: 5 / span 2;
    }
}

/* ============================================
   TABLET RESPONSIVE (up to 1280px)
   ============================================ */
@media (max-width: 1280px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        padding: 1.5rem;
    }
    
    .container {
        max-width: 95%;
    }
}

/* ============================================
   TABLET RESPONSIVE (up to 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Tablet-specific overrides if needed */
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 56.25rem) {
    .container {
        max-width: 95%;
        padding: 0 1rem;
    }
    
    .nft-row {
        margin-bottom: 6vh;
        padding: 1rem;
    }
    
    .nft-image-wrapper {
        width: calc(100% - 2rem) !important;
        max-width: 100%;
        margin: 0 auto !important;
        border-width: 0.3rem;
    }
    
    .image-column {
        display: none;
    }
    
    .image-meta {
        display: none;
    }
    
    .nft-image-wrap {
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .nft-image-wrap img {
        width: 100%;
        height: auto;
        margin-right: 0;
        border-width: 0.5rem;
    }
    
    .navbar .logo {
        font-size: 1.25rem;
    }
    
    /* Hide page header on mobile */
    .page-header {
        display: none;
    }
    
    /* Mobile hamburger menu */
    .hamburger {
        display: flex !important;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background: rgba(25, 18, 10, 0.98);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1rem;
        transition: right 0.3s ease;
        box-shadow: -0.25rem 0 1rem rgba(0,0,0,0.5);
        z-index: 100;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links .dropdown-menu {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.3);
        margin-top: 0.5rem;
        padding: 0.5rem;
        box-shadow: none;
    }
    
    .nav-links .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .nav-links .dropdown-toggle {
        padding-bottom: 0;
    }
    
    /* Hide Quick Links footer section on mobile */
    .footer-section:nth-child(2) {
        display: none;
    }
}

/* ============================================
   MOBILE LAYOUT (≤600px)
   ============================================ */
@media (max-width: 600px) {
    /* FIX #1: DOM order is already correct, no flexbox reordering needed */
    .nft-image-wrapper {
        width: 100%;
        margin: 2rem auto;
    }
    
    /* Align text with left edge of image on mobile */
    .nft-title,
    .nft-description,
    .nft-content,
    .image-meta,
    .quote-block {
        margin-left: 2rem;
        margin-right: 2rem;
    }
    
    .quote-block {
        width: auto;
        text-align: left;
        padding: 1rem 0;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}