/* ==========================================================================
   Classifieds MVC — Public Site Global CSS
   Scope: styles used on ALL public pages (nav, footer, body, ad detail, gallery).
   Homepage-specific styles live in home.css.
   BEM: .block, .block__element, .block--modifier
   Bootstrap 5 utilities first; custom CSS extends only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens  (shared by site.css AND home.css)
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --color-brand-dark:       #1a1a2e;
    --color-brand-mid:        #16213e;
    --color-brand-accent:     #4f46e5;
    --color-brand-accent-dk:  #3730a3;
    --color-brand-light:      #eef2ff;

    /* Surface */
    --color-page-bg:          #f8f8fb;
    --color-card-bg:          #ffffff;
    --color-card-bg-hover:    #fdfdff;
    --color-surface-raised:   #f2f3f8;

    /* Borders */
    --color-border:           #e3e5f0;
    --color-border-light:     #eceef6;

    /* Text */
    --color-text:             #1a1a2e;
    --color-text-secondary:   #4a4b5c;
    --color-text-muted:       #8b8fa8;

    /* Badges */
    --color-badge-featured:   #f59e0b;
    --color-badge-vip:        #7c3aed;
    --color-badge-new:        #059669;
    --color-badge-urgent:     #dc2626;

    /* Geometry */
    --radius-card:            16px;
    --radius-card-sm:         12px;
    --radius-pill:            100px;
    --radius-btn:             10px;

    /* Elevation */
    --shadow-xs:   0 1px 2px rgba(26,26,46,.06);
    --shadow-sm:   0 1px 4px rgba(26,26,46,.08), 0 4px 12px rgba(26,26,46,.04);
    --shadow-md:   0 4px 16px rgba(26,26,46,.10), 0 12px 32px rgba(26,26,46,.05);
    --shadow-lg:   0 8px 24px rgba(26,26,46,.12), 0 20px 48px rgba(26,26,46,.07);
    --shadow-search: 0 8px 40px rgba(26,26,46,.22);

    /* Motion */
    --ease-out:    cubic-bezier(.22,.68,0,1.2);
    --ease-std:    cubic-bezier(.4,0,.2,1);
    --dur-fast:    0.14s;
    --dur-base:    0.20s;
    --dur-slow:    0.30s;

    /* Layout — used by both site.css and home.css */
    --site-max-w:  1680px;
    --site-gutter: clamp(1rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
    background-color: var(--color-page-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip-to-content */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: .375rem .875rem;
    background: var(--color-brand-accent);
    color: #fff;
    border-radius: 0 0 var(--radius-btn) var(--radius-btn);
    font-size: .875rem;
    text-decoration: none;
    transition: top var(--dur-base) var(--ease-std);
}
.skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: 2px; }

/* Focus ring */
:focus-visible { outline: 2px solid var(--color-brand-accent); outline-offset: 3px; }

/* Reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   3. Navigation  — sticky header shared by all public pages
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-navbar {
    min-height: 80px;
    padding-top: 0;
    padding-bottom: 0;
    background: rgba(15,15,32,.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 20px rgba(0,0,0,.28);
}

/* Wider container: overrides Bootstrap's .container max-width */
.site-nav-container {
    max-width: var(--site-max-w) !important;
    min-height: 80px;
    align-items: center;
}

.site-navbar .navbar-brand,
.site-navbar__brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-top: 0;
    padding-bottom: 0;
    max-width: calc(100% - 3.5rem);
}

/* Portrait-friendly slot: width drives scale; clip hides tagline below icon */
.site-navbar__logo-wrap {
    display: block;
    flex-shrink: 0;
    height: 64px;
    overflow: hidden;
    line-height: 0;
}

.site-navbar__logo {
    width: 68px;
    height: auto;
    max-width: none;
    object-fit: contain;
    object-position: top center;
    display: block;
    flex-shrink: 0;
}

.site-navbar__logo-fallback {
    font-size: 1.625rem;
    line-height: 1;
    flex-shrink: 0;
    color: var(--color-brand-accent);
}

.site-navbar__name {
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.125rem;
    letter-spacing: -.02em;
}

.site-navbar .navbar-brand:hover { color: rgba(255,255,255,.88); }

.site-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.3);
    padding: .25rem .5rem;
}
.site-navbar .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.45); }

.site-navbar .nav-link {
    color: rgba(255,255,255,.72) !important;
    font-size: .875rem;
    font-weight: 500;
    padding: .375rem .75rem !important;
    border-radius: var(--radius-btn);
    transition:
        color       var(--dur-fast) var(--ease-std),
        background  var(--dur-fast) var(--ease-std);
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus-visible {
    color: #fff !important;
    background: rgba(255,255,255,.08);
}
.site-navbar .nav-link:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: 2px; }

/* Professional CTA button in the nav */
.site-navbar .nav-cta {
    background: var(--color-brand-accent) !important;
    color: #fff !important;
    border-radius: var(--radius-pill) !important;
    padding: .375rem 1.125rem !important;
    font-weight: 600;
    transition:
        background  var(--dur-fast) var(--ease-std),
        box-shadow  var(--dur-fast) var(--ease-std),
        transform   var(--dur-fast) var(--ease-out) !important;
}
.site-navbar .nav-cta:hover {
    background: var(--color-brand-accent-dk) !important;
    box-shadow: 0 4px 14px rgba(79,70,229,.38);
    transform: translateY(-1px);
}
.site-navbar .nav-cta:active { transform: translateY(0); }
.site-navbar .nav-cta:focus-visible {
    outline: 2px solid rgba(255,255,255,.7);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. Footer  — shared by all public pages
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--color-brand-dark);
    color: rgba(255,255,255,.72);
}

.site-footer__top {
    padding: 3rem 0 2.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-footer__bottom { padding: .875rem 0; }

/* Wider container override for footer */
.site-footer-container {
    max-width: var(--site-max-w) !important;
}

/* Brand column */
.site-footer__brand   { margin-bottom: 1.125rem; }
.site-footer__logo    { display: block; }
.site-footer__icon {
    font-size: 1.625rem;
    color: var(--color-brand-accent);
    display: block;
    margin-bottom: .4rem;
}
.site-footer__site-name {
    font-size: .9375rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .2rem;
}
.site-footer__tagline {
    font-size: .78rem;
    color: rgba(255,255,255,.48);
    margin-bottom: .875rem;
    line-height: 1.55;
    max-width: 24ch;
}

/* Social icons */
.site-footer__social    { display: flex; gap: .4rem; margin-top: .25rem; }
.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.62);
    font-size: .875rem;
    text-decoration: none;
    transition:
        background  var(--dur-fast) var(--ease-std),
        color       var(--dur-fast) var(--ease-std),
        transform   var(--dur-fast) var(--ease-out);
}
.site-footer__social-link:hover {
    background: var(--color-brand-accent);
    color: #fff;
    transform: translateY(-2px);
}
.site-footer__social-link:focus-visible { outline: 2px solid rgba(255,255,255,.65); outline-offset: 2px; }

/* Link columns */
.site-footer__heading {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.36);
    margin-bottom: .875rem;
}
.site-footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.site-footer__link {
    color: rgba(255,255,255,.58);
    text-decoration: none;
    font-size: .8125rem;
    transition: color var(--dur-fast) var(--ease-std);
}
.site-footer__link:hover { color: #fff; }
.site-footer__link:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 2px; border-radius: 2px; }
.site-footer__link--soon { opacity: .4; cursor: default; }

/* Newsletter column */
.site-footer__newsletter-text {
    font-size: .8rem;
    color: rgba(255,255,255,.5);
    margin-bottom: .75rem;
    line-height: 1.55;
}

.newsletter-form {
    display: flex;
    gap: 0;
    border-radius: var(--radius-btn);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    opacity: .7;
}
.newsletter-form__input {
    flex: 1 1 0;
    border: none;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.6);
    font-size: .8rem;
    padding: .5rem .75rem;
    outline: none;
    min-width: 0;
}
.newsletter-form__input::placeholder { color: rgba(255,255,255,.35); font-size: .78rem; }
.newsletter-form__btn {
    flex: 0 0 auto;
    border: none;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.7);
    font-size: .78rem;
    font-weight: 600;
    padding: .5rem .875rem;
    cursor: default;
    white-space: nowrap;
    letter-spacing: .01em;
}
.newsletter-form__soon {
    display: block;
    font-size: .68rem;
    color: rgba(255,255,255,.28);
    margin-top: .3rem;
    text-align: center;
}

/* Copyright */
.site-footer__copy {
    font-size: .75rem;
    color: rgba(255,255,255,.32);
    margin: 0;
    text-align: center;
}

/* --------------------------------------------------------------------------
   5. Ad detail page
   -------------------------------------------------------------------------- */
.listing-detail-image {
    max-height: 480px;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   6. Ad gallery (detail page thumbnails)
   -------------------------------------------------------------------------- */
.listing-gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.listing-gallery-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .7;
    transition:
        opacity      var(--dur-fast) var(--ease-std),
        border-color var(--dur-fast) var(--ease-std);
}
.listing-gallery-thumb:hover,
.listing-gallery-thumb.active {
    opacity: 1;
    border-color: var(--color-brand-accent);
}

/* --------------------------------------------------------------------------
   7. Communication cards (detail page & future reuse)
      .comm-card           — base clickable card (any channel)
      .comm-card--whatsapp — WhatsApp primary CTA (green)
      .comm-card--telegram — future: Telegram
      .comm-card--phone    — future: direct call
      .comm-meta           — secondary contact details below the CTA card
   -------------------------------------------------------------------------- */

/* Primary CTA card — centered, fully clickable */
.comm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.75rem 1.625rem;
    background: #fff;
    border: 1.5px solid #d1fae5;
    border-radius: 20px;
    box-shadow:
        0 2px 16px rgba(37,211,102,.08),
        0 1px 4px  rgba(0,0,0,.05);
    text-decoration: none;
    margin-top: 1rem;
    margin-bottom: .875rem;
    cursor: pointer;
    transition:
        transform    .2s cubic-bezier(.22,.68,0,1.2),
        box-shadow   .2s ease,
        border-color .2s ease;
}
.comm-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 36px rgba(37,211,102,.18),
        0 4px 14px  rgba(0,0,0,.07);
    border-color: #25d366;
}
.comm-card:focus-visible {
    outline: 2px solid #25d366;
    outline-offset: 3px;
}

/* WhatsApp icon circle */
.comm-card__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1.125rem;
    box-shadow: 0 6px 22px rgba(37,211,102,.28);
    transition: transform .2s cubic-bezier(.22,.68,0,1.2);
}
.comm-card:hover .comm-card__icon { transform: scale(1.08); }

/* Card text */
.comm-card__heading {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 .375rem;
    line-height: 1.3;
}
.comm-card__number {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #128c7e;
    margin: 0 0 .5rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    direction: ltr;
}
.comm-card__subtext {
    font-size: .8125rem;
    color: #6b7280;
    margin: 0 0 1.375rem;
    line-height: 1.55;
}

/* Green pill CTA button inside the card */
.comm-card__cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.625rem;
    background: #25d366;
    color: #fff;
    border-radius: 100px;
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37,211,102,.30);
    transition:
        background .14s ease,
        transform  .14s ease,
        box-shadow .14s ease;
}
.comm-card:hover .comm-card__cta {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(18,140,126,.40);
}

/* Secondary contact meta — email, website, name */
.comm-meta {
    padding: .875rem 1.125rem;
    background: var(--color-page-bg, #f8f8fb);
    border: 1px solid var(--color-border-light, #eceef6);
    border-radius: 14px;
    font-size: .875rem;
    margin-bottom: 1rem;
}
.comm-meta__heading {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--color-text-muted, #8b8fa8);
    margin: 0 0 .625rem;
}
.comm-meta__item {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin: 0 0 .4375rem;
}
.comm-meta__item:last-child { margin-bottom: 0; }
.comm-meta__label {
    color: var(--color-text-muted, #8b8fa8);
    white-space: nowrap;
    min-width: 76px;
    font-weight: 600;
    font-size: .8125rem;
}
.comm-meta__value {
    color: var(--color-text-secondary, #4a4b5c);
    font-size: .875rem;
}
.comm-meta__link {
    color: var(--color-brand-accent, #4f46e5);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .875rem;
}
.comm-meta__link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Navbar — mobile refinements (≤576px, incl. 375px / 430px)
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .site-navbar {
        min-height: 72px;
    }

    .site-nav-container {
        min-height: 72px;
        padding-inline: .875rem;
    }

    .site-navbar .navbar-brand,
    .site-navbar__brand {
        gap: .5625rem;
        font-size: 1rem;
        max-width: calc(100% - 2.75rem);
    }

    .site-navbar__logo-wrap {
        height: 46px;
    }

    .site-navbar__logo {
        width: 48px;
    }

    .site-navbar__name {
        font-size: 1rem;
        max-width: 8.75rem;
    }

    .site-navbar .nav-cta {
        font-size: .8125rem;
        padding: .375rem .875rem !important;
    }
}
