/*
Theme Name: Digital Cash Labs
Theme URI: https://digitalcashlabs.com
Author: Digital Cash Labs
Description: Custom block theme for Digital Cash Labs — African tech tutorials, prompts, and wallet-powered premium resources.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: digital-cash-labs
*/

/* ---------- Base ---------- */
:root {
  --dcl-radius-sm: 8px;
  --dcl-radius-md: 14px;
  --dcl-radius-lg: 22px;
  --dcl-shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --dcl-shadow-md: 0 4px 8px -2px rgba(16,24,40,.10), 0 2px 4px -2px rgba(16,24,40,.06);
  --dcl-shadow-lg: 0 20px 32px -12px rgba(16,24,40,.18);
  --dcl-border: 1px solid #E4E7EC;
}

body { -webkit-font-smoothing: antialiased; }

/* ---------- Header ---------- */
.dcl-header {
  background: var(--wp--preset--color--base);
  border-bottom: var(--dcl-border);
  position: sticky; top: 0; z-index: 50;
  padding-block: .75rem;
  backdrop-filter: saturate(180%) blur(8px);
}
.dcl-header__inner { align-items: center; gap: 1rem; }
.dcl-brand .wp-block-site-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.dcl-brand .wp-block-site-title a { color: var(--wp--preset--color--primary); text-decoration: none; }
.dcl-header .wp-block-navigation { font-weight: 500; font-size: .95rem; }

/* ---------- Currency switcher ---------- */
.dcl-currency-switcher { display: inline-flex; align-items: center; gap: .4rem; }
.dcl-currency-switcher label { font-size: .8rem; color: var(--wp--preset--color--muted); }
.dcl-currency-switcher select {
  appearance: none;
  border: var(--dcl-border); background: var(--wp--preset--color--surface);
  border-radius: 999px; padding: .4rem .9rem;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  color: var(--wp--preset--color--contrast);
}
.dcl-currency-switcher select:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Cards ---------- */
.dcl-card {
  background: var(--wp--preset--color--base);
  border: var(--dcl-border);
  border-radius: var(--dcl-radius-md);
  overflow: hidden;
  box-shadow: var(--dcl-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column; height: 100%;
}
.dcl-card:hover { transform: translateY(-3px); box-shadow: var(--dcl-shadow-md); }
.dcl-card .wp-block-post-featured-image { margin: 0; aspect-ratio: 16/9; }
.dcl-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.dcl-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.dcl-card .wp-block-post-title { font-size: 1.02rem; line-height: 1.35; margin: 0; }
.dcl-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.dcl-card .wp-block-post-excerpt { font-size: .875rem; color: var(--wp--preset--color--muted); margin: 0; }
.dcl-card .wp-block-post-excerpt__more-text { margin-top: auto; }

/* ---------- Badges ---------- */
.dcl-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .22rem .6rem;
  border-radius: 999px; white-space: nowrap;
}
.dcl-badge--free    { background: #E7F8EF; color: #067647; }
.dcl-badge--premium { background: #F4F0FF; color: #5925DC; }
.dcl-badge--owned   { background: #EFF8FF; color: #175CD3; }

/* ---------- Price gate ---------- */
.dcl-gate {
  border: var(--dcl-border);
  border-radius: var(--dcl-radius-lg);
  background: var(--wp--preset--color--surface);
  padding: 1.5rem;
  margin-block: 2rem;
  box-shadow: var(--dcl-shadow-sm);
}
.dcl-gate__label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.dcl-gate__price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: var(--wp--preset--color--primary); margin: .25rem 0 .75rem; }
.dcl-gate__note { font-size: .85rem; color: var(--wp--preset--color--muted); margin-bottom: 1rem; }
.dcl-gate__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Buttons ---------- */
.dcl-btn, .dcl-gate .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.25rem; border-radius: 999px;
  font-weight: 600; font-size: .92rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: filter .15s ease, background .15s ease;
}
.dcl-btn--primary { background: var(--wp--preset--color--primary); color: #fff; }
.dcl-btn--primary:hover { filter: brightness(1.15); }
.dcl-btn--accent { background: var(--wp--preset--color--accent); color: #101828; }
.dcl-btn--accent:hover { filter: brightness(1.05); }
.dcl-btn--ghost { background: transparent; border-color: #D0D5DD; color: var(--wp--preset--color--contrast); }
.dcl-btn--block { width: 100%; }

/* ---------- WhatsApp Support CTA ---------- */
.dcl-support-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #F0FDF4;
  border: 1px solid #DCFCE7;
  border-radius: var(--dcl-radius-md);
  padding: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.dcl-support-cta__text {
  display: flex;
  flex-direction: column;
}

.dcl-support-cta__text strong {
  font-size: 1rem;
  color: #166534;
  margin-bottom: 0.2rem;
}

.dcl-support-cta__text span {
  font-size: 0.85rem;
  color: #15803D;
}

.dcl-support-cta .dcl-wa-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  background: #25D366;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dcl-support-cta .dcl-wa-btn:hover {
  background: #1DA851;
  filter: brightness(1.05);
}

/* ---------- Wallet dashboard ---------- */
.dcl-wallet { display: grid; gap: 1.25rem; }
.dcl-wallet__balance {
  background: linear-gradient(135deg, #0B1F3A 0%, #163A66 100%);
  color: #fff; border-radius: var(--dcl-radius-lg);
  padding: 1.75rem; box-shadow: var(--dcl-shadow-lg);
}
.dcl-wallet__balance-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.dcl-wallet__balance-amount { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; margin-top: .35rem; }
.dcl-wallet__balance-meta { font-size: .82rem; opacity: .75; margin-top: .35rem; }

.dcl-wallet__grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dcl-wallet__grid { grid-template-columns: 1.15fr .85fr; } }

.dcl-panel {
  background: var(--wp--preset--color--base);
  border: var(--dcl-border); border-radius: var(--dcl-radius-md);
  padding: 1.25rem; box-shadow: var(--dcl-shadow-sm);
}
.dcl-panel__title { font-size: .95rem; font-weight: 700; margin: 0 0 .9rem; }

.dcl-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.dcl-field label { font-size: .82rem; font-weight: 600; color: var(--wp--preset--color--muted); }
.dcl-field input, .dcl-field select {
  border: var(--dcl-border); border-radius: var(--dcl-radius-sm);
  padding: .65rem .8rem; font-size: .95rem; width: 100%;
  background: var(--wp--preset--color--base);
}
.dcl-field input:focus, .dcl-field select:focus {
  outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; border-color: transparent;
}

.dcl-confirm {
  background: #FFFAEB; border: 1px solid #FEDF89;
  border-radius: var(--dcl-radius-sm); padding: .8rem 1rem;
  font-size: .875rem; color: #93370D; margin-bottom: 1rem;
}
.dcl-confirm strong { color: #7A2E0E; }

/* ---------- Ledger table ---------- */
.dcl-ledger { width: 100%; border-collapse: collapse; font-size: .875rem; }
.dcl-ledger th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wp--preset--color--muted); padding: .5rem .6rem; border-bottom: var(--dcl-border); }
.dcl-ledger td { padding: .7rem .6rem; border-bottom: 1px solid #F2F4F7; vertical-align: top; }
.dcl-ledger tr:last-child td { border-bottom: 0; }
.dcl-ledger .is-credit { color: #067647; font-weight: 600; }
.dcl-ledger .is-debit  { color: #B42318; font-weight: 600; }
.dcl-empty { font-size: .875rem; color: var(--wp--preset--color--muted); padding: 1rem 0; }

/* ---------- Auth pages ---------- */
.dcl-auth { max-width: 440px; margin: 3rem auto; }
.dcl-auth .dcl-panel { padding: 1.75rem; }
.dcl-auth h1 { font-size: 1.5rem; margin-bottom: .35rem; }

/* ---------- Hero ---------- */
.dcl-hero {
  background: radial-gradient(120% 120% at 0% 0%, #0B1F3A 0%, #123 55%, #0B1F3A 100%);
  color: #fff; border-radius: var(--dcl-radius-lg);
  padding: clamp(2rem, 6vw, 4rem);
  margin-block: 1.5rem 2.5rem;
}
.dcl-hero h1, .dcl-hero h2 { color: #fff; letter-spacing: -.03em; }
.dcl-hero p { color: rgba(255,255,255,.82); max-width: 60ch; }

/* ---------- Section headers ---------- */
.dcl-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-block: 2.5rem 1rem; }
.dcl-section-head h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); margin: 0; letter-spacing: -.02em; }
.dcl-section-head a { font-size: .875rem; font-weight: 600; text-decoration: none; color: var(--wp--preset--color--primary); }

/* ---------- Utilities ---------- */
.dcl-hidden { display: none !important; }
.dcl-mt-0 { margin-top: 0 !important; }
.dcl-muted { color: var(--wp--preset--color--muted); font-size: .875rem; }

/* Screen-reader only */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); position: absolute !important;
  height: 1px; width: 1px; overflow: hidden; white-space: nowrap;
}

/* ---------------------------------------------------------
   MOBILE RESPONSIVENESS & TEXT OVERFLOW FIXES
--------------------------------------------------------- */

body, .wp-block-post-title, .wp-block-post-excerpt, .wp-block-paragraph, h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
}

@media (max-width: 768px) {
    .wp-block-group.has-global-padding {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .dcl-hero {
        padding: 1.5rem 1.25rem !important;
        margin-top: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .dcl-hero h1 {
        font-size: 1.85rem !important;
        line-height: 1.2 !important;
    }
    .dcl-hero p {
        font-size: 1rem !important;
    }
    .dcl-section-head {
        margin-top: 2rem !important;
        margin-bottom: 1rem !important;
    }
    .dcl-section-head h2 {
        font-size: 1.25rem !important;
    }
    .dcl-card {
        width: 100% !important;
    }
    .dcl-card .wp-block-post-title {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
    }
    .dcl-gate {
        padding: 1.25rem !important;
        margin-block: 1.5rem !important;
    }
    .dcl-gate__price {
        font-size: 1.6rem !important;
    }
    .dcl-gate__actions {
        flex-direction: column !important;
    }
    .dcl-gate__actions .dcl-btn {
        width: 100% !important;
        text-align: center;
    }
    .dcl-wallet__balance {
        padding: 1.25rem !important;
    }
    .dcl-wallet__balance-amount {
        font-size: 2rem !important;
    }
    .dcl-panel {
        padding: 1rem !important;
    }
    .dcl-ledger {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .dcl-support-cta {
        flex-direction: column;
        text-align: center;
    }
    .dcl-support-cta .dcl-wa-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------------------------------------------------------
   ADSTERRA ADS STYLES
--------------------------------------------------------- */

/* Ad Containers */
.dcl-ad-container {
    margin: 2rem auto;
    text-align: center;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent; /* Changed from grey to transparent */
    border-radius: var(--dcl-radius-sm);
}

/* Sticky Mobile Footer Ad */
.dcl-sticky-ad {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .dcl-sticky-ad {
        position: fixed;
        bottom: 0;
        left: 50%; /* Moves to middle */
        transform: translateX(-50%); /* Forces exact center */
        width: 100%;
        z-index: 9999;
        display: flex;
        justify-content: center;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        padding: 5px 0;
    }

    /* Add padding to the body so the sticky ad doesn't cover your footer text */
    body {
        padding-bottom: 65px !important; 
    }
}

/* ---------------------------------------------------------
   SMARTLINK CTA STYLES
--------------------------------------------------------- */
.dcl-smartlink-box {
    margin: 2.5rem auto;
    padding: 1.75rem 1.5rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--dcl-radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dcl-smartlink-box h3 {
    margin: 0;
    color: #92400E;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
}

.dcl-smartlink-box p {
    margin: 0;
    color: #B45309;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 600px;
}

.dcl-smartlink-box .dcl-btn {
    margin-top: 0.5rem;
    width: auto;
    display: inline-block;
    background: #D97706;
    color: #fff;
    padding: 0.8rem 1.5rem;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.dcl-smartlink-box .dcl-btn:hover {
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .dcl-smartlink-box {
        padding: 1.25rem 1rem;
        margin: 1.5rem auto;
    }
    .dcl-smartlink-box h3 {
        font-size: 1.15rem;
    }
    .dcl-smartlink-box p {
        font-size: 0.9rem;
    }
    .dcl-smartlink-box .dcl-btn {
        width: 100%;
        text-align: center;
    }
}

/* ---------------------------------------------------------
   PROFESSIONAL FOOTER STYLES
--------------------------------------------------------- */
.dcl-footer {
    padding-block: 1rem 2rem;
    border-top: 1px solid #F2F4F7;
    margin-top: 3rem;
}

.dcl-footer h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--wp--preset--color--contrast);
}

.dcl-footer p {
    line-height: 1.6;
}

.dcl-footer a {
    color: var(--wp--preset--color--muted);
    text-decoration: none;
}

.dcl-footer a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}

/* Mobile Stacking */
@media (max-width: 768px) {
    .dcl-footer__cols {
        flex-direction: column !important;
    }
    .dcl-footer__cols .wp-block-column {
        flex-basis: 100% !important;
        margin-bottom: 1.5rem;
    }
    .dcl-footer__cols .wp-block-column:last-child {
        margin-bottom: 0;
    }
}