/*
Theme Name: Arjuna Coffee Export
Theme URI: https://arjunacoffee.com
Author: Arjuna Team
Version: 1.0
Description: Premium Indonesian coffee B2B export theme with Tailwind, glassmorphism, interactive map, and full CPT support. Built from HTML/PNG references benchmarked against MAS theme architecture.
Text Domain: arjuna-coffee
*/

/* =========================================
   1. DESIGN TOKENS
   ========================================= */
:root {
    --color-primary: #8b2626;
    --color-primary-dark: #6b1c1c;
    --color-espresso: #4e342e;
    --color-parchment: #f7f5f0;
    --color-parchment-border: #e4d8cf;
    --color-volcanic: #2a2421;
    --color-muted-jungle: #e4e9e1;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Work Sans', 'Inter', sans-serif;
}

/* =========================================
   2. RESET & BASICS
   ========================================= */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--color-espresso);
    background-color: var(--color-parchment);
}

ul, li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

/* =========================================
   3. GLOBAL LAYOUT (WPBakery Override)
   ========================================= */
body .site-content,
body .entry-content,
body article {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Hide WordPress page titles on all pages */
body .entry-header,
body .page-header,
body .entry-title,
body .page-title,
body article > header,
.hentry .entry-title,
.page .entry-title,
.home .entry-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

main#main-content,
.site-main,
.site-content,
.entry-content,
article {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 200px;
    overflow: visible !important;
    display: flow-root;
    padding: 0 !important;
    margin: 0 !important;
}

/* WPBakery Resets */
.vc_row,
.vc_column_container,
.vc_column-inner {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.vc_column-inner {
    box-shadow: none !important;
    background: transparent !important;
    display: block !important;
}

.site-content-full,
.site-main {
    background: transparent !important;
    box-shadow: none !important;
}

/* =========================================
   4. HEADER — Glass Effect States
   ========================================= */
#masthead {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* Default (Top) — transparent glass */
#masthead:not(.scrolled) {
    background-color: transparent;
}

/* Scrolled — premium frosted glass */
#masthead.scrolled {
    background-color: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow:
        0 4px 24px rgba(78, 52, 46, 0.06),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* Home Apple Glass Effect */
.home #masthead.scrolled {
    background-color: rgba(255, 255, 255, 0.55) !important; 
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05) !important;
}

#masthead.scrolled .nav-link {
    color: var(--color-espresso) !important;
}

#masthead.scrolled .nav-link:hover {
    color: var(--color-primary) !important;
}

#masthead.scrolled .logo-text {
    color: var(--color-espresso) !important;
}

/* Non-Home — parchment header by default */
.header-inner:not(.scrolled) {
    border-bottom: 1px solid var(--color-parchment-border);
}

/* =========================================
   5. GLASS MORPHISM UTILITIES — Premium Look
   ========================================= */
.glass {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 32px rgba(78, 52, 46, 0.08);
}

.glass-dark {
    background: rgba(42, 36, 33, 0.75) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-badge {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    box-shadow: 0 2px 12px rgba(78, 52, 46, 0.06);
}

/* Glass Card — used for feature cards, product cards, stats */
.glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 24px rgba(78, 52, 46, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.75);
    box-shadow:
        0 12px 40px rgba(139, 38, 38, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    border-color: rgba(139, 38, 38, 0.15);
}

/* Glass Section — for section backgrounds */
.glass-section {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(247, 245, 240, 0.5) 100%);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
}

/* Glass Stats Bar */
.glass-stats {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(78, 52, 46, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Glass Input on dark bg */
.glass-input {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(139, 38, 38, 0.5);
}

/* =========================================
   6. MAP INTERACTIVITY
   ========================================= */
.map-region {
    transition: fill 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

.map-region:hover {
    fill: var(--color-primary);
    filter: drop-shadow(0 2px 4px rgba(139, 38, 38, 0.3));
}

.map-tooltip {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.group:hover .map-tooltip {
    opacity: 1;
    transform: translateY(-8px);
}

/* =========================================
   7. FAQ ACCORDION
   ========================================= */
details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

details[open] summary ~ * {
    animation: sweep 0.3s ease-in-out;
}

@keyframes sweep {
    0%    { opacity: 0; transform: translateY(-10px); }
    100%  { opacity: 1; transform: translateY(0); }
}

details[open] .rotate-icon {
    transform: rotate(180deg);
}

/* =========================================
   8. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
}

.text-primary {
    color: var(--color-primary);
}

.bg-primary {
    background-color: var(--color-primary);
}

/* =========================================
   9. SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-parchment-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Horizontal scroll hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   10. CONTAINER OVERRIDE
   ========================================= */
.container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: auto !important;
}

/* Full-bleed sections break out of max-width */
.full-bleed {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
}

/* =========================================
   11. FOOTER
   ========================================= */
footer {
    position: relative;
    z-index: 50;
    clear: both;
}

/* =========================================
   13. PREMIUM EFFECTS
   ========================================= */
/* Subtle grain texture overlay for premium feel */
.grain-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Glow ring for buttons */
.glow-ring {
    box-shadow: 0 0 0 0 rgba(139, 38, 38, 0.4);
    transition: box-shadow 0.3s ease;
}

.glow-ring:hover {
    box-shadow: 0 0 20px 4px rgba(139, 38, 38, 0.15);
}

/* Animated gradient border */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-border {
    background: linear-gradient(135deg, #8b2626, #6b1c1c, #8b2626);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* =========================================
   12. FORM SELECT ARROW
   ========================================= */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%234E342E' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* =========================================
   14. RICH CONTENT FORMATTING — .arjuna-content
   Handles WordPress WYSIWYG output with proper
   heading hierarchy, auto-numbered tables/figures,
   justified paragraphs, and premium styling.
   ========================================= */

/* --- Counter Reset --- */
.arjuna-content {
    counter-reset: arjuna-table arjuna-figure;
    line-height: 1.85;
    color: var(--color-espresso);
    font-family: var(--font-body);
}

/* --- Paragraphs — Justified --- */
.arjuna-content p {
    text-align: justify;
    margin-bottom: 1.5em;
    font-size: 1rem;
    line-height: 1.85;
    color: rgba(78, 52, 46, 0.82);
}

.arjuna-content p:last-child {
    margin-bottom: 0;
}

/* --- Heading Hierarchy --- */
.arjuna-content h1,
.arjuna-content h2,
.arjuna-content h3,
.arjuna-content h4,
.arjuna-content h5,
.arjuna-content h6 {
    font-family: var(--font-display);
    color: var(--color-espresso);
    line-height: 1.3;
    margin-top: 2.2em;
    margin-bottom: 0.75em;
}

.arjuna-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    border-bottom: 3px solid var(--color-primary);
    padding-bottom: 0.5em;
    margin-top: 2.5em;
    margin-bottom: 1em;
}

.arjuna-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-bottom: 2px solid var(--color-parchment-border);
    padding-bottom: 0.4em;
    margin-top: 2.2em;
    margin-bottom: 0.85em;
}

.arjuna-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.7em;
}

.arjuna-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-primary);
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}

.arjuna-content h5 {
    font-size: 1rem;
    font-weight: 600;
    font-style: italic;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.arjuna-content h6 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(78, 52, 46, 0.6);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* First heading in content should not have top margin */
.arjuna-content > h1:first-child,
.arjuna-content > h2:first-child,
.arjuna-content > h3:first-child,
.arjuna-content > h4:first-child,
.arjuna-content > h5:first-child,
.arjuna-content > h6:first-child {
    margin-top: 0;
}

/* --- Links --- */
.arjuna-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.arjuna-content a:hover {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-primary);
}

/* --- Strong & Emphasis --- */
.arjuna-content strong,
.arjuna-content b {
    font-weight: 700;
    color: var(--color-espresso);
}

.arjuna-content em,
.arjuna-content i {
    font-style: italic;
}

/* --- Lists --- */
.arjuna-content ul {
    list-style: disc !important;
    padding-left: 1.8em !important;
    margin-bottom: 1.5em;
}

.arjuna-content ol {
    list-style: decimal !important;
    padding-left: 1.8em !important;
    margin-bottom: 1.5em;
}

.arjuna-content ul li,
.arjuna-content ol li {
    margin-bottom: 0.5em;
    line-height: 1.75;
    color: rgba(78, 52, 46, 0.82);
    padding-left: 0.3em;
}

.arjuna-content ul ul,
.arjuna-content ol ol,
.arjuna-content ul ol,
.arjuna-content ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* --- Blockquotes --- */
.arjuna-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: linear-gradient(135deg, rgba(139, 38, 38, 0.04) 0%, rgba(247, 245, 240, 0.6) 100%);
    border-radius: 0 12px 12px 0;
    padding: 1.25em 1.75em;
    margin: 2em 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-espresso);
    line-height: 1.7;
}

.arjuna-content blockquote p {
    margin-bottom: 0;
    text-align: left;
}

/* --- Tables — Auto-Numbered --- */
.arjuna-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5em 0 0.5em 0;
    font-size: 0.9rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-parchment-border);
    box-shadow: 0 2px 12px rgba(78, 52, 46, 0.05);
}

.arjuna-content table thead {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.arjuna-content table thead th {
    padding: 0.85em 1.15em;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    border-bottom: 2px solid var(--color-primary-dark);
    font-family: var(--font-body);
}

.arjuna-content table tbody td {
    padding: 0.75em 1.15em;
    border-bottom: 1px solid var(--color-parchment-border);
    color: rgba(78, 52, 46, 0.82);
    vertical-align: top;
    line-height: 1.6;
}

.arjuna-content table tbody tr:last-child td {
    border-bottom: none;
}

.arjuna-content table tbody tr:nth-child(even) {
    background-color: rgba(247, 245, 240, 0.5);
}

.arjuna-content table tbody tr:hover {
    background-color: rgba(139, 38, 38, 0.03);
    transition: background-color 0.2s ease;
}

.arjuna-content table tbody td:first-child {
    font-weight: 600;
    color: var(--color-espresso);
}

/* Table Caption (auto-generated by JS) */
.arjuna-content .arjuna-table-caption {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(78, 52, 46, 0.7);
    margin-top: 0.75em;
    margin-bottom: 2em;
    font-style: italic;
}

.arjuna-content .arjuna-table-caption strong {
    color: var(--color-primary);
    font-weight: 700;
    font-style: normal;
}

/* --- Figures / Images — Auto-Numbered --- */
.arjuna-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(78, 52, 46, 0.08);
    margin: 0 auto;
    display: block;
}

.arjuna-content figure {
    margin: 2em 0 0.5em 0;
    text-align: center;
}

.arjuna-content figure img {
    margin-bottom: 0;
}

.arjuna-content figcaption,
.arjuna-content .wp-element-caption {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(78, 52, 46, 0.7);
    margin-top: 0.75em;
    margin-bottom: 2em;
    font-style: italic;
}

.arjuna-content figcaption strong,
.arjuna-content .wp-element-caption strong {
    color: var(--color-primary);
    font-weight: 700;
    font-style: normal;
}

/* Image auto-caption (generated by JS for standalone imgs) */
.arjuna-content .arjuna-figure-caption {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(78, 52, 46, 0.7);
    margin-top: 0.75em;
    margin-bottom: 2em;
    font-style: italic;
}

.arjuna-content .arjuna-figure-caption strong {
    color: var(--color-primary);
    font-weight: 700;
    font-style: normal;
}

/* --- Horizontal Rule --- */
.arjuna-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--color-parchment-border), transparent);
    margin: 2.5em 0;
}

/* --- Code / Pre --- */
.arjuna-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
    background: rgba(78, 52, 46, 0.06);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    color: var(--color-primary-dark);
}

.arjuna-content pre {
    background: var(--color-volcanic);
    color: #e4d8cf;
    padding: 1.5em;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2em 0;
    font-size: 0.88rem;
    line-height: 1.65;
}

.arjuna-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* --- WordPress Specific — Galleries, Captions, Alignments --- */
.arjuna-content .wp-block-image {
    margin: 2em 0 0.5em 0;
    text-align: center;
}

.arjuna-content .alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.arjuna-content .alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.arjuna-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.arjuna-content::after {
    content: '';
    display: table;
    clear: both;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .arjuna-content h1 { font-size: 1.75rem; }
    .arjuna-content h2 { font-size: 1.45rem; }
    .arjuna-content h3 { font-size: 1.2rem; }
    .arjuna-content h4 { font-size: 1.05rem; }

    .arjuna-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .arjuna-content .alignleft,
    .arjuna-content .alignright {
        float: none;
        margin: 1.5em auto;
        display: block;
    }
}
