
@font-face {
    font-family: 'HOWIE S FUNHOUSE';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/custom/HOWIE_S_FUNHOUSE.TTF') format('truetype');
}

:root {
    --bg-color: #000000;
    --bg-image: url('web_images/f78612cf-b39b-4a44-9cad-69f6ee1da766_Cf-Strawhat2.png');
    --card-bg: #151c24; 
    --grid-bg: #1f2833;
    --text-color: #ff0000;
    --text-hover: #ffffff;
    --bio-color: #ff0000;
    --modal-bg: rgba(0, 0, 0, 0.85);
    --portal-content-max-width: 650px;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0;
    padding: 40px 20px;
    font-family: 'HOWIE S FUNHOUSE', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease; 
}

/* ==========================================================================
   HERO BANNER LAYERING SYSTEM (FIXED GRADIENT & SHADOW)
   ========================================================================== */

/* MASTER CONTAINER: Establishes the primary stacking context base */
.banner-hero-container {
    width: 100%;
    position: relative;
    margin: 0 auto -60px auto; 
    z-index: 1; /* Locks the background layer stack on the bottom plane */
    overflow-x: clip; /* Keep blend overlay from widening the page on mobile */
}

/* Square banner: width follows .wrapper; height from 1:1 aspect ratio */
.banner-outer-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6); 
    position: relative;
    z-index: 2; 
}

/* The canvas frame holding the graphic image assets */
.banner-view-box {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.banner-render-img {
    width: 100%;
    height: 100%;
    display: block;
}

/* SEPARATE GRADIENT ELEMENT: Aggressive opacity ramp to bury the bottom edge */
.banner-blend-overlay {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    bottom: -240px; /* Keeps the bottom floor aligned with the social row baseline */
    height: 760px;  /* Taller vertical canvas to force it deep back up over the image */
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        color-mix(in srgb, var(--bg-color) 0%, transparent) 35%,   /* Crisp and clear further down the image */
        color-mix(in srgb, var(--bg-color) 52%, transparent) 50%,  /* Balanced mid-tone haze over the seam */
        color-mix(in srgb, var(--bg-color) 94%, transparent) 60%,  /* Firm mask right over the bottom edge zone */
        var(--bg-color) 68%, /* Transitions cleanly to solid right before the text zone */
        var(--bg-color) 100% 
    );
    pointer-events: none;
    z-index: 3; /* Keeps it layered firmly over the image, but safely beneath the content */
}

/* Animated GIF heroes: keep motion visible through a lighter fade */
.banner-hero-container.banner-animated .banner-blend-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        color-mix(in srgb, var(--bg-color) 0%, transparent) 42%,
        color-mix(in srgb, var(--bg-color) 40%, transparent) 58%,
        color-mix(in srgb, var(--bg-color) 88%, transparent) 68%,
        var(--bg-color) 76%,
        var(--bg-color) 100%
    );
}

/* ==========================================================================
   OBJECT-FIT CROPPING CONFIGURATORS
   ========================================================================== */
.fit-mode-fill { object-fit: cover; object-position: center; }
.fit-mode-fit { object-fit: contain; background-color: rgba(0, 0, 0, 0.2); }
.fit-mode-center { object-fit: none; object-position: center; }

/* CIRCULAR AVATAR INJECTION LAYER */
.fit-mode-square {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    object-fit: cover;
    border: 3px solid var(--text-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
    display: block;
}

/* ==========================================================================
   PROFILE HEADER & TYPOGRAPHY
   ========================================================================== */
.wrapper { 
    width: 100%; 
    max-width: var(--portal-content-max-width); 
    text-align: center; 
    position: relative;
    z-index: 10; /* Elevates the primary content block over the background banner overlay */
}

.profile-header { 
    margin-bottom: 25px; 
    position: relative; 
    z-index: 11; /* Extra insurance for header-specific elements */
}

.profile-header h1 { 
    color: var(--text-color); 
    font-size: 2rem; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    margin: 15px 0 8px 0; 
}

.profile-bio { 
    color: var(--bio-color); 
    font-size: 1rem; 
    max-width: 450px; 
    margin: 0 auto 20px auto; 
    line-height: 1.5; 
}

.portal-footer {
    width: 100%;
    max-width: var(--portal-content-max-width);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    color: var(--bio-color);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    opacity: 0.85;
    white-space: pre-line;
    line-height: 1.5;
}

.social-icons-row { 
    display: flex; 
    justify-content: center; 
    gap: 25px; 
    margin-bottom: 25px; 
    flex-wrap: wrap; 
}

.social-icon-link { 
    color: var(--bio-color); 
    font-size: 1.6rem; 
    transition: color 0.2s ease, transform 0.2s ease; 
    text-decoration: none; 
}

.social-icon-link:hover { 
    color: var(--text-color); 
    transform: scale(1.15); 
}

.social-icon-link .social-icon-svg {
    width: 1.6rem;
    height: 1.6rem;
    display: block;
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */
.tab-container { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 30px; 
    border-bottom: 1px solid #2c3540; 
    padding-bottom: 10px; 
    position: relative;
    z-index: 12; /* Keeps tabs perfectly readable and clickable */
}

.tab-btn { 
    background: none; 
    border: none; 
    color: var(--bio-color); 
    font-size: 1.1rem; 
    font-weight: 600; 
    padding: 8px 20px; 
    cursor: pointer; 
    transition: color 0.2s ease; 
    position: relative; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.tab-btn:hover { 
    color: #ffffff; 
}

.tab-btn.active { 
    color: var(--text-color); 
}

.tab-btn.active::after { 
    content: ''; 
    position: absolute; 
    bottom: -11px; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background-color: var(--text-color); 
}

.view-content { 
    display: none; 
    position: relative;
    z-index: 12; /* Ensures cards are cleanly rendered over the gradients */
}

.view-content.active { 
    display: block; 
}

.html-page-view {
    width: 100%;
    max-width: 100%;
    margin-bottom: 30px;
}

.html-page-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--bio-color);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.html-page-content img,
.html-page-content video,
.html-page-content iframe {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   LINKS COMPONENTS
   ========================================================================== */
.links-grid { 
    display: flex; 
    flex-direction: column; 
    align-items: stretch; 
    width: 100%; 
    margin-bottom: 30px; 
}

.links-grid > .link-card,
.links-grid > .collection-card {
    margin: 0 0 20px 0;
    padding: 0;
    min-width: 0;
    flex: 0 0 auto;
}

.links-grid > .link-card:last-child,
.links-grid > .collection-card:last-child {
    margin-bottom: 0;
}

.links-grid .collection-card {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.links-grid .collection-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.link-card { 
    display: block; 
    text-decoration: none; 
    position: relative; 
    border-radius: 12px; 
    overflow: hidden; 
    background-color: var(--grid-bg); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
}

.link-card--full {
    height: 294px;
    min-height: 294px;
}

/* Bottom fade using portal background (--bg-color from global settings) */
.link-card--full .card-blend-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 64%,
        color-mix(in srgb, var(--bg-color) 5%, transparent) 69%,
        color-mix(in srgb, var(--bg-color) 12%, transparent) 73%,
        color-mix(in srgb, var(--bg-color) 22%, transparent) 77%,
        color-mix(in srgb, var(--bg-color) 38%, transparent) 80%,
        color-mix(in srgb, var(--bg-color) 58%, transparent) 83%,
        color-mix(in srgb, var(--bg-color) 78%, transparent) 86%,
        color-mix(in srgb, var(--bg-color) 92%, transparent) 88%,
        var(--bg-color) 90%,
        var(--bg-color) 100%
    );
}

.link-card--simple {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 64px;
    min-height: 64px;
}

.link-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6); 
}

.link-card--spacer {
    cursor: default;
}

.link-card--spacer:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.link-card-media-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1f2833 0%, #0b0c10 100%);
}

.link-card-media-placeholder--full {
    position: absolute;
    inset: 0;
}

.link-card--full .card-banner,
.link-card--full .link-card-media-placeholder--full {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.card-banner { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    filter: brightness(0.65); 
    transition: filter 0.2s ease; 
}

.link-card:hover .card-banner { 
    filter: brightness(0.75); 
}

.link-card--simple .link-card-media {
    flex-shrink: 0;
    width: 88px;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.link-card--simple .card-banner {
    position: absolute;
    inset: 0;
}

.link-card--simple .card-text {
    position: static;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 0 18px;
    font-size: 1.05rem;
    text-shadow: none;
}

.link-card--simple-no-media .card-text {
    padding: 0 18px;
}

.instagram-card--simple .instagram-simple-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
}

.instagram-card--simple .instagram-simple-logo {
    flex-shrink: 0;
    font-size: 1.65rem;
    color: var(--text-color);
    line-height: 1;
}

.instagram-card--simple .instagram-simple-username {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.instagram-card--simple .instagram-simple-avatar {
    width: 64px;
}

.instagram-card--simple .instagram-simple-avatar-img {
    filter: none;
    object-fit: cover;
}

.instagram-card--simple-no-avatar .instagram-simple-text {
    padding-right: 18px;
}

.pdf-card {
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}

.pdf-card--no-file {
    cursor: not-allowed;
    opacity: 0.55;
}

.pdf-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-card-placeholder-icon {
    font-size: 3rem;
    color: var(--text-color);
    opacity: 0.45;
}

.pdf-card--simple .pdf-card-simple-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 0 18px;
}

.pdf-card--simple .pdf-card-icon {
    color: #e74c3c;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pdf-card--simple .pdf-card-title {
    position: static;
    text-shadow: none;
    padding: 0;
}

.pdf-modal-container {
    max-width: min(920px, 96vw);
    background-color: var(--card-bg);
    border: 1px solid #2c3540;
    color: var(--text-color);
    font-family: inherit;
}

.pdf-modal-container .modal-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid #2c3540;
}

.pdf-modal-container .modal-header h3 {
    color: var(--text-color);
    font-family: inherit;
    font-weight: 600;
}

.pdf-modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid #2c3540;
    background-color: var(--card-bg);
}

.pdf-modal-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid #2c3540;
    background-color: var(--grid-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pdf-modal-download-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.pdf-modal-download-btn--disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

.pdf-modal-container .modal-close-btn {
    color: var(--bio-color);
}

.pdf-modal-container .modal-close-btn:hover {
    color: var(--text-hover);
}

.pdf-modal-body {
    padding: 0;
    min-height: 60vh;
    max-height: min(75vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
}

.pdf-modal-loading {
    margin: 0;
    padding: 48px 20px;
    text-align: center;
    color: var(--bio-color);
    font-family: inherit;
    font-size: 0.95rem;
}

.pdf-modal-pages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.pdf-modal-page {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.pdf-modal-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border-radius: 2px;
}

.link-card--full .card-text { 
    position: absolute; 
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex; 
    align-items: flex-end; 
    justify-content: center; 
    color: var(--text-color); 
    font-size: 1.25rem; 
    font-weight: 600; 
    letter-spacing: 1px; 
    background: none;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 -1px 0 #000,
        0 1px 0 #000,
        -1px 0 0 #000,
        1px 0 0 #000;
    padding: 0 20px 10px; 
    z-index: 2;
}

/* ==========================================================================
   COLLECTION GRAPHIC MATRICES (MOSAIC)
   ========================================================================== */
.collection-card {
    background-color: var(--card-bg); 
    border-radius: 16px; 
    overflow: hidden; 
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); 
    cursor: pointer; 
    display: block; 
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#shop-view .collection-card {
    margin-bottom: 30px;
}

#shop-view .collection-card:last-child {
    margin-bottom: 0;
}

.collection-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7); 
}

.mosaic-banner {
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr; 
    grid-template-rows: repeat(2, 1fr);
    gap: 2px; 
    background-color: var(--bg-color); 
    aspect-ratio: 16 / 9; 
    width: 100%;
}

.mosaic-img-wrapper { 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background-color: #151c24; 
    position: relative; 
}

.mosaic-img-wrapper:first-child { 
    grid-row: span 2; 
}

.mosaic-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease; 
}

.collection-card:hover .mosaic-img { 
    transform: scale(1.04); 
}

.collection-footer { 
    padding: 20px; 
    text-align: center; 
    border-top: 1px solid #2c3540; 
    background-color: var(--card-bg); 
    color: var(--text-color);
}

.collection-footer .ig-handle,
.collection-footer .ig-btn,
.collection-footer .ig-stats {
    color: inherit;
}

.collection-title { 
    color: inherit; 
    font-size: 1.5rem; 
    font-weight: 700; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    margin: 0 0 4px 0; 
}

.collection-count { 
    color: var(--bio-color); 
    font-size: 0.95rem; 
    font-weight: 600; 
    letter-spacing: 0.5px; 
}

/* Instagram showcase cards (custom profile / post URLs) */
.ig-showcase-mosaic .ig-showcase-tile {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 35%, #dc2743 65%, #bc1888 100%);
    position: relative;
    overflow: hidden;
}

.ig-showcase-mosaic .ig-showcase-tile--1 {
    background: linear-gradient(145deg, #bc1888 0%, #833ab4 100%);
}

.ig-showcase-mosaic .ig-showcase-tile--2 {
    background: linear-gradient(145deg, #e6683c 0%, #dc2743 100%);
}

.ig-showcase-mosaic .ig-showcase-tile--3 {
    background: linear-gradient(145deg, #f09433 0%, #e6683c 100%);
}

.ig-showcase-mosaic .ig-showcase-tile--4 {
    background: linear-gradient(145deg, #dc2743 0%, #bc1888 100%);
}

.ig-showcase-mosaic .ig-showcase-tile--0 {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
}

.ig-showcase-tile-label {
    color: #fff;
    font-size: clamp(0.85rem, 2.5vw, 1.15rem);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    padding: 12px;
    text-align: center;
    line-height: 1.3;
}

.ig-showcase-mosaic .mosaic-img {
    transition: transform 0.3s ease;
}

.instagram-card--showcase:hover .ig-showcase-mosaic .mosaic-img {
    transform: scale(1.04);
}

/* ==========================================================================
   POP-OUT LIGHTBOX MODALS
   ========================================================================= */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background-color: var(--modal-bg); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 2000; /* Stays at the absolute top of the entire viewstack */
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.2s ease; 
    padding: 20px; 
}

.modal-overlay.open { 
    opacity: 1; 
    pointer-events: auto; 
}

.modal-container { 
    background-color: #121820; 
    border: 1px solid #2c3540; 
    width: 100%; 
    max-width: 520px; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8); 
    transform: scale(0.95); 
    transition: transform 0.2s ease; 
    display: flex; 
    flex-direction: column; 
    max-height: 85vh; 
}

.modal-overlay.open .modal-container { 
    transform: scale(1); 
}

.modal-header { 
    padding: 18px 24px; 
    border-bottom: 1px solid #2c3540; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background-color: var(--card-bg); 
}

.modal-header h3 { 
    margin: 0; 
    color: #fff; 
    font-size: 1.25rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.modal-close-btn { 
    background: none; 
    border: none; 
    color: var(--bio-color); 
    font-size: 1.4rem; 
    cursor: pointer; 
    padding: 4px; 
    transition: color 0.15s ease; 
}

.modal-close-btn:hover { 
    color: #fff; 
}

.modal-body { 
    padding: 20px; 
    overflow-y: auto; 
    flex-grow: 1; 
}

.modal-product-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
}

.modal-product-card { 
    background-color: var(--grid-bg); 
    border-radius: 12px; 
    overflow: hidden; 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    transition: transform 0.15s ease; 
}

.modal-product-card:hover { 
    transform: translateY(-2px); 
}

.modal-product-img-wrapper { 
    width: 100%; 
    aspect-ratio: 1/1; 
    background-color: var(--bg-color); 
    overflow: hidden; 
}

.modal-product-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.modal-product-info { 
    padding: 10px; 
    text-align: left; 
}

.modal-product-title { 
    color: #fff; 
    font-size: 0.85rem; 
    font-weight: 600; 
    margin: 0 0 4px 0; 
    line-height: 1.3; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.modal-product-price { 
    color: var(--text-color); 
    font-size: 0.9rem; 
    font-weight: 700; 
}

body.modal-active { 
    overflow: hidden; 
}
