/* ===============================================
   AGORIST.MARKET - MODERN RESPONSIVE STYLESHEET v2.0
   =============================================== */

/* === ROOT VARIABLES === */
:root {
    --primary-green: #2d5a45;
    --secondary-green: #4a8a6a;
    --accent-gold: #D4AF37;
    --link-blue: #4095DF;
    --text-dark: #2E2E2E;
    --text-light: #666;
    --bg-light: #F8F9FA;
    --white: #ffffff;
    --highlight-soft: #FFF9E6;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--link-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

strong {
    font-weight: 600;
}

/* === LAYOUT CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
.site-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
    padding: 2rem 0 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
}

.site-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.site-title a {
    color: var(--white);
    text-decoration: none;
}

.site-tagline {
    font-size: 1.25rem;
    font-style: italic;
    opacity: 0.95;
    font-weight: 300;
}

/* === NAVIGATION === */
.main-nav {
    background-color: var(--white);
    box-shadow: 0 2px 5px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--text-dark);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-green);
}

/* Subtle accent styling instead of yellow highlight */
.nav-menu a.highlight {
    color: var(--primary-green);
    font-weight: 600;
}

/* Hover underline effect - not for highlighted items */
.nav-menu a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: var(--secondary-green);
    border-radius: 2px 2px 0 0;
}

/* === HAMBURGER MENU (iOS Fixed) === */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

/* Hamburger icon using spans */
.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-green);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--primary-green);
    transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Animate to X when active */
.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* === BREADCRUMB === */
.breadcrumb-container {
    background-color: var(--white);
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 20px;
}

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    /* Align with nav - left side under Home */
}

.breadcrumb a {
    color: var(--link-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 0.5rem;
    color: #999;
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 500;
}

/* === MAIN CONTENT GRID === */
.content-grid {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 20px;
    overflow-x: hidden;
}

.main-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
    min-height: 400px;
    overflow-x: hidden;
    max-width: 100%;
}

/* === SIDEBARS === */
.sidebar {
    background-color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.sidebar-ad {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.sidebar-ad:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow);
}

.sidebar-ad img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;
    border-radius: 4px;
}

.sidebar-ad a {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--link-blue);
}

/* === BANNER === */
.banner {
    text-align: center;
    margin: 2rem 0;
}

.banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--link-blue) 0%, #2d7ab8 100%);
    color: var(--white);
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    color: var(--white);
    text-decoration: none;
}

.btn-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #005f8f 100%);
}

/* === LISTINGS === */
.listing {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: var(--white);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.listing:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.listing-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.listing-image {
    flex-shrink: 0;
}

.listing-image img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.listing-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.listing-info h3 {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.listing-details {
    font-size: 0.95rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.listing-details a {
    word-break: break-all;
}

.listing-details strong {
    color: var(--primary-green);
    display: inline-block;
    min-width: 100px;
}

/* === FOOTER === */
.site-footer {
    background-color: #4a7a62;  /* 18% lighter than primary-green #2d5a45 */
    color: var(--white);
    padding: 2.5rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

/* Footer center content */
.footer-content {
    text-align: center;
    width: 100%;
}

/* Footer navigation links */
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-nav a:hover {
    color: var(--accent-gold);
    transform: translateY(-2px);
}

/* Footer info */
.footer-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-info p {
    margin-bottom: 0.5rem;
}

.footer-info a {
    color: var(--white);
    text-decoration: underline;
}

.footer-info a:hover {
    color: var(--accent-gold);
}

.footer-email {
    font-weight: 600;
    font-size: 1rem;
}

.footer-email .email-link {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-email .email-link:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-links a {
    opacity: 0.85;
}

/* === FOOTER EMAIL SIGNUP (SLIM VERSION) === */
.footer-signup {
    margin: 1.5rem 0;
}

.footer-signup-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto;
}

.footer-signup-form input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.footer-signup-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.footer-signup-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-gold);
    background-color: rgba(255, 255, 255, 0.15);
}

.footer-signup-form button {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-green);
    background-color: var(--accent-gold);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.footer-signup-form button:hover {
    background-color: #e5c04b;
    transform: translateY(-1px);
}

.footer-signup-form button:active {
    transform: translateY(0);
}

.footer-signup-form button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Honeypot - hidden */
.footer-signup-form .hp-field,
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

.footer-form-message {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 6px 12px;
    border-radius: 4px;
    display: none;
}

.footer-form-message.success {
    background-color: rgba(212, 175, 55, 0.2);
    color: var(--accent-gold);
    display: block;
}

.footer-form-message.error {
    background-color: rgba(255, 100, 100, 0.2);
    color: #ff9999;
    display: block;
}

/* Footer logos mobile container */
.footer-logos-mobile {
    display: none;
}

/* === EMAIL LINK STYLING === */
.email-link {
    color: var(--link-blue);
    text-decoration: none;
}

.email-link:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-highlight { background-color: var(--highlight-soft); padding: 0.2rem 0.4rem; border-radius: 3px; }
.clearfix::after { content: ""; display: table; clear: both; }

/* === RESPONSIVE DESIGN === */

/* Mobile Banner Ad */
.mobile-banner-ad {
    display: none; /* Hidden by default on desktop */
    visibility: hidden;
    width: 100%;
    background-color: var(--primary-green);
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.mobile-banner-ad a {
    display: block;
    line-height: 0;
}

.mobile-banner-ad img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Tablet */
@media only screen and (max-width: 1024px) {
    /* Show mobile banner on tablet and below */
    .mobile-banner-ad {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Hide sidebars on mobile - banner handles ads */
    .sidebar {
        display: none !important;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .site-title {
        font-size: 2.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-logo.left,
    .footer-logo.right {
        display: none;
    }
    
    .footer-logos-mobile {
        display: flex;
        justify-content: center;
        gap: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-container {
        justify-content: center;
        min-height: 56px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--white);
        width: 80%;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        box-shadow: 4px 0 20px var(--shadow);
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* Mobile menu header */
    .nav-menu::before {
        content: 'Menu';
        display: block;
        padding: 1.25rem 1.5rem;
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--primary-green);
        border-bottom: 2px solid var(--primary-green);
        background-color: var(--bg-light);
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Remove underline effect on mobile, use left border instead */
    .nav-menu a::after {
        display: none;
    }
    
    .nav-menu a.highlight {
        background-color: rgba(45, 90, 69, 0.05);
        border-left: 4px solid var(--primary-green);
    }
    
    .nav-menu a:hover,
    .nav-menu a:active {
        background-color: rgba(45, 90, 69, 0.1);
    }
    
    .site-header {
        padding: 1.5rem 0 1rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-tagline {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .listing-header {
        flex-direction: column;
    }
    
    .listing-image img {
        width: 160px;
        max-width: 100%;
        height: auto;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .footer-nav {
        gap: 0.25rem 1.5rem;
    }
    
    .footer-nav a {
        font-size: 0.95rem;
    }
    
    .footer-logo-img {
        max-width: 100px;
        max-height: 65px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 1.75rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .footer-signup-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer-signup-form input[type="email"] {
        min-width: unset;
    }
}

/* === PRINT STYLES === */
@media print {
    .site-header,
    .main-nav,
    .sidebar,
    .site-footer {
        display: none;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* In-Content Ads */
.content-ad {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.5rem 0 !important;
    text-align: center;
    display: block !important;
}

.content-ad a {
    display: block !important;
    line-height: 0;
    width: 100% !important;
}

.content-ad img {
    width: 100% !important;
    max-width: 1200px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto;
    border-radius: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-green);
    border-radius: 4px;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--primary-green);
    color: white;
}

.page-link.current {
    background: var(--primary-green);
    color: white;
}
