/**
 * Crafters Link - Universal Style Sheet
 *
 * This stylesheet contains the root color variables, base styles, and universal
 * design tokens used across all pages of the Crafters Link platform.
 *
 * Heritage Color Palette: Brown, Green, Grey, Black, Yellow, Red
 * Base: White background with professional, warm accents
 *
 * @version 2.0 (Updated for index.php feed)
 * @date December 2025
 */

/* ===================================
   ROOT COLOR VARIABLES (Heritage Theme)
   =================================== */
:root {
    /* Primary Heritage Colors */
    --heritage-brown: #6B4423;      /* Deep Brown */
    --heritage-brown-light: #8B6F47;
    --heritage-brown-dark: #4A2F18;

    --heritage-green: #3D6B3D;      /* Forest Green */
    --heritage-green-light: #5A8A5A;
    --heritage-green-dark: #2A4A2A;

    --heritage-grey: #7A7A7A;       /* Neutral Grey */
    --heritage-grey-light: #A8A8A8;
    --heritage-grey-dark: #4A4A4A;

    --heritage-black: #1A1A1A;      /* Near Black */
    --heritage-yellow: #F4C430;     /* Accent Yellow (Gold) */
    --heritage-yellow-light: #FFD966;
    --heritage-red: #C43D3D;        /* Alert Red */
    --heritage-blue: #3065C4;       /* Link/Action Blue */

    /* Global UI Variables */
    --background-primary: #FFFFFF;
    --background-secondary: #F0F2F5; /* Light Grey for containers */
    --text-primary: var(--heritage-black);
    --text-muted: var(--heritage-grey);
    --border-color: #E0E0E0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-family-primary: 'Inter', sans-serif;
    --font-size-base: 16px;
}

/* ===================================
   BASE STYLES
   =================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family-primary);
    color: var(--text-primary);
    background-color: var(--background-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

a {
    color: var(--heritage-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--heritage-blue);
    text-decoration: underline;
}

/* ===================================
   BUTTON STYLES
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--heritage-brown);
    color: var(--background-primary);
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    background-color: var(--heritage-brown-dark);
    box-shadow: 0 6px 10px rgba(74, 47, 24, 0.2);
}

.btn-secondary {
    background-color: var(--background-primary);
    color: var(--heritage-brown);
    border: 1px solid var(--heritage-brown);
}

.btn-secondary:hover {
    background-color: var(--background-secondary);
}

/* ===================================
   FORM STYLES
   =================================== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--background-primary);
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: var(--heritage-brown-light);
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.1);
}

/* ===================================
   UTILITY & ANIMATIONS
   =================================== */
.hidden {
    display: none !important;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 5px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===================================
   HEADER & NAVIGATION STYLES (Provided by head.php)
   =================================== */
/* Placeholder: assume cl-header and cl-mobile-nav styles exist from head(9).php */

/* ===================================
   FEED SPECIFIC STYLES (index.php)
   =================================== */

.cl-feed-container {
    max-width: 600px; /* Standard feed width */
    margin: 20px auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .cl-feed-container {
        margin-top: 80px; /* Space below fixed desktop header */
    }
}

.cl-post-card {
    background-color: var(--background-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

/* Post Header (Profile Bar) */
.cl-post-header {
    display: flex;
    align-items: center;
    padding: 15px;
}

.cl-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    background-color: var(--background-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    flex-shrink: 0;
}

.cl-user-info a {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
}

.cl-user-info a:hover {
    text-decoration: none;
}

.cl-user-info span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.cl-premium-badge {
    color: var(--heritage-yellow);
    margin-left: 5px;
    font-size: 14px;
    vertical-align: top;
}

/* Image Carousel (Instagram-style) */
.cl-image-carousel {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-height: 75vh; /* Keep images within reasonable height on large screens */
    width: 100%;
}

.cl-carousel-item {
    flex: 0 0 100%; /* Each item takes full width */
    scroll-snap-align: start;
    width: 100%;
    position: relative;
}

.cl-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scrollbar hiding (optional but cleaner UI) */
.cl-image-carousel::-webkit-scrollbar {
    display: none;
}
.cl-image-carousel {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Post Actions and Content */
.cl-post-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.cl-action-btn {
    background: none;
    border: none;
    color: var(--heritage-grey-dark);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.cl-action-btn:hover {
    background-color: var(--background-secondary);
    color: var(--heritage-brown);
}

.cl-action-btn i {
    margin-right: 8px;
    font-size: 18px;
}

/* Specific color for a 'liked' state */
.cl-action-btn.liked {
    color: var(--heritage-red);
}

.cl-post-content {
    padding: 15px;
    padding-bottom: 5px; /* Adjust spacing */
}

.cl-post-content .cl-product-info {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 5px;
}

.cl-post-content .cl-post-description {
    margin-bottom: 10px;
}

.cl-post-content .cl-metadata {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    display: block;
}

.cl-post-content .cl-cta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.cl-post-content .cl-price {
    font-weight: 700;
    color: var(--heritage-green-dark);
    font-size: 1.2em;
}

/* IP Consent Modal */
.cl-consent-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-primary);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cl-consent-modal-content {
    max-width: 600px;
}

.cl-consent-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

@media (min-width: 768px) {
    .cl-consent-modal-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .cl-consent-modal p {
        text-align: left;
        margin-right: 20px;
        margin-bottom: 0;
    }
    .cl-consent-actions {
        margin-top: 0;
    }
}
/* General Link */
.cl-link {
    color: var(--heritage-brown);
    font-weight: 600;
    transition: color 0.2s;
}

.cl-link:hover {
    color: var(--heritage-brown-dark);
}




/**
 * Crafters Link - Universal Style Sheet
 * Updated for Feed Layout Revisions
 */

/* ===================================
   ROOT COLOR VARIABLES
   =================================== */
:root {
    --heritage-brown: #6B4423;
    --heritage-brown-light: #8B6F47;
    --heritage-brown-dark: #4A2F18;
    --heritage-green: #3D6B3D;
    --heritage-green-light: #5A8A5A;
    --heritage-green-dark: #2A4A2A;
    --heritage-grey: #7A7A7A;
    --heritage-grey-light: #A8A8A8;
    --heritage-grey-dark: #4A4A4A;
    --heritage-black: #1A1A1A;
    --heritage-yellow: #F4C430;
    --heritage-red: #C43D3D;
    --heritage-blue: #3065C4;

    --background-primary: #FFFFFF;
    --background-secondary: #F0F2F5;
    --text-primary: var(--heritage-black);
    --text-muted: var(--heritage-grey);
    --border-color: #E0E0E0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);

    --font-family-primary: 'Inter', sans-serif;
    --font-size-base: 16px;
}

/* ===================================
   BASE STYLES
   =================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family-primary);
    color: var(--text-primary);
    background-color: var(--background-secondary);
    line-height: 1.6;
    scroll-behavior: smooth;
}

a {
    color: var(--heritage-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* ===================================
   BUTTON STYLES
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--heritage-brown);
    color: var(--background-primary);
    box-shadow: var(--shadow-medium);
}
.btn-primary:hover {
    background-color: var(--heritage-brown-dark);
}

.btn-secondary {
    background-color: var(--background-primary);
    color: var(--heritage-brown);
    border: 1px solid var(--heritage-brown);
}
.btn-secondary:hover {
    background-color: var(--background-secondary);
}

/* ===================================
   FORM STYLES
   =================================== */
input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    background-color: var(--background-primary);
}
input:focus, textarea:focus {
    border-color: var(--heritage-brown);
    outline: none;
}

/* ===================================
   FEED POST STYLES (Shared across views)
   =================================== */

.cl-feed-post {
    background: var(--background-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    margin-bottom: 25px;
}

/* Hashtag Links in Descriptions */
.cl-hashtag {
    color: var(--heritage-blue);
    font-weight: 500;
}

/* Gallery Scroll Snap */
.cl-gallery-container {
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}
.cl-gallery-item {
    scroll-snap-align: start;
}

/* Verified Badge */
.cl-premium-badge {
    color: var(--heritage-yellow);
    margin-left: 4px;
    font-size: 0.9em;
}

/* ===================================
   UTILITY
   =================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }