/**
 * Bulawayo Home 'n Away — main.css
 * Supplementary styles, Google Fonts override, and component polish.
 * style.css is the primary stylesheet; this file adds overrides that
 * need to load after the base theme tokens.
 */

/* ============================================================
   GOOGLE FONTS OVERRIDE
   Once loaded, replace system serif/sans with Playfair + Source Sans
   ============================================================ */
body {
    font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.site-title-wrap .site-title,
.hero-content h1,
blockquote,
.article-card__title,
.diaspora-card__name,
.business-card__name,
.footer-brand .site-title {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ============================================================
   HERO — parallax-style subtle scroll hint
   ============================================================ */
.hero-section .hero-bg {
    will-change: transform;
}

/* ============================================================
   SECTION HEADINGS — gold accent bar refined
   ============================================================ */
.section-header h2::before {
    background: linear-gradient(to bottom, var(--color-gold), var(--color-gold-dark));
}

/* ============================================================
   ARTICLE CARD HOVER — refined lift
   ============================================================ */
.article-card {
    will-change: transform;
}

/* ============================================================
   BUSINESS CARD — logo fallback gradient
   ============================================================ */
.business-card__logo:not(:has(img)) {
    background: linear-gradient(135deg, var(--color-cream), var(--color-gray-200));
}

/* ============================================================
   STICKY SIDEBAR on desktop
   ============================================================ */
@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 90px;
    }
}

/* ============================================================
   PULL QUOTE — enhanced
   ============================================================ */
.entry-content blockquote {
    position: relative;
}

.entry-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 16px;
    font-size: 5rem;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--color-gold);
    line-height: 1;
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   HERO CONTENT TITLE — prevent orphans
   ============================================================ */
.hero-content h1 {
    text-wrap: balance;
}

/* ============================================================
   CATEGORY LABEL — distinct colours per section
   ============================================================ */
a.cat-label[href*="tourism"]    { background: #1a6b5a; }
a.cat-label[href*="lifestyle"]  { background: #7b4f9e; }
a.cat-label[href*="food"]       { background: #c2672a; }
a.cat-label[href*="history"]    { background: #4a3f35; }
a.cat-label[href*="property"]   { background: #2a5c8a; }
a.cat-label[href*="culture"]    { background: #c94f7e; }
a.cat-label[href*="diaspora"]   { background: #2a7f6b; }
a.cat-label[href*="community"]  { background: #5a6e2a; }
a.cat-label[href*="business"]   { background: var(--color-charcoal); }

/* ============================================================
   EVENTS — date block colours for upcoming vs past
   ============================================================ */
.event-card.is-past .event-card__date {
    background: var(--color-gray-500);
}

/* ============================================================
   DIASPORA CARD — flag/country label styling
   ============================================================ */
.diaspora-card__flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-maroon);
    margin-bottom: var(--space-sm);
}

/* ============================================================
   ADVERT BANNER (widget area)
   ============================================================ */
.advert-banner img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

/* ============================================================
   WIDGET — recent posts list style
   ============================================================ */
.sidebar .widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sidebar .widget ul li:last-child {
    border-bottom: none;
}

.sidebar .widget ul li a {
    color: var(--color-charcoal);
    font-weight: 600;
    transition: color var(--transition);
}

.sidebar .widget ul li a:hover {
    color: var(--color-maroon);
}

/* ============================================================
   SEARCH FORM — WordPress core override
   ============================================================ */
.search-form label {
    display: none;
}

.search-form .search-submit {
    padding: 0.75rem 1.2rem;
    background: var(--color-maroon);
    color: var(--color-white);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.search-form .search-submit:hover {
    background: var(--color-maroon-dark);
}

.search-form .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}

.search-form .search-field:focus {
    border-color: var(--color-maroon);
}

.search-form {
    display: flex;
    overflow: hidden;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   PAGINATION — WordPress core override
   ============================================================ */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-2xl) 0;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text);
    transition: all var(--transition);
}

.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
    background: var(--color-maroon);
    border-color: var(--color-maroon);
    color: var(--color-white);
}

/* ============================================================
   POST NAVIGATION (single.php prev/next)
   ============================================================ */
.post-navigation {
    display: flex;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    flex-wrap: wrap;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    min-width: 200px;
    background: var(--color-cream);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: box-shadow var(--transition);
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    box-shadow: var(--shadow-md);
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gold-dark);
    margin-bottom: var(--space-xs);
}

.post-navigation .nav-title {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: var(--color-charcoal);
    font-size: 0.95rem;
    line-height: 1.4;
}

.post-navigation a:hover .nav-title {
    color: var(--color-maroon);
}

/* ============================================================
   AUTHOR BIO CARD
   ============================================================ */
.author-bio {
    border-left: 4px solid var(--color-gold);
}

/* ============================================================
   COMMENTS FORM — WP core input overrides
   ============================================================ */
#commentform .comment-form-author,
#commentform .comment-form-email,
#commentform .comment-form-url {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

#commentform label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-charcoal);
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

#commentform input:focus,
#commentform textarea:focus {
    border-color: var(--color-maroon);
}

#commentform .comment-form-comment {
    margin-bottom: var(--space-md);
}

/* ============================================================
   WP BLOCK EDITOR ALIGNMENT HELPERS — article content
   ============================================================ */
.entry-content .wp-block-image figcaption {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    text-align: center;
    padding: 0.4rem 0;
}

.entry-content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

.entry-content .wp-block-table td,
.entry-content .wp-block-table th {
    border: 1px solid var(--color-border);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.entry-content .wp-block-table th {
    background: var(--color-cream);
    font-weight: 700;
}

/* ============================================================
   ELEMENTOR COMPATIBILITY — prevent override conflicts
   ============================================================ */
.elementor-section .site-header,
.elementor-section .site-footer {
    /* let Elementor-built sections coexist without breaking theme header/footer */
}

/* ============================================================
   RESPONSIVE — TABLET PORTRAIT (768px – 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Show sidebar on tablet in a stacked single column */
    .single-layout {
        display: block;
    }
    .sidebar {
        display: block;
        margin-top: var(--space-2xl);
        border-top: 2px solid var(--color-border);
        padding-top: var(--space-xl);
    }
    .sidebar {
        position: static !important; /* un-sticky on tablet */
    }

    /* Navigation — keep desktop nav on tablet if it fits */
    .main-navigation ul {
        gap: var(--space-sm);
    }
    .main-navigation ul li a {
        font-size: 0.88rem;
        padding: var(--space-sm) var(--space-sm);
    }

    /* Post navigation */
    .post-navigation {
        flex-direction: column;
    }
    .post-navigation .nav-previous,
    .post-navigation .nav-next {
        min-width: auto;
    }
    .post-navigation .nav-next {
        text-align: left;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (max-width: 767px) — component tweaks
   ============================================================ */
@media (max-width: 767px) {
    body {
        font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
    }

    /* Headings */
    h1, h2, h3, h4, h5, h6,
    .hero-content h1,
    .article-card__title {
        font-family: 'Playfair Display', Georgia, serif;
        text-wrap: balance;
    }

    /* Sidebar — show collapsed at bottom on mobile */
    .sidebar {
        position: static !important;
        top: auto;
        margin-top: var(--space-2xl);
        border-top: 2px solid var(--color-border);
        padding-top: var(--space-xl);
    }

    /* Sticky header — reduce top property when sticky */
    .site-header.is-sticky {
        top: 0;
        box-shadow: var(--shadow-md);
    }

    /* Pull quote — reduce size */
    .entry-content blockquote {
        font-size: 1rem;
        padding: 0.8rem 1rem;
    }
    .entry-content blockquote::before {
        font-size: 3rem;
        top: -5px;
    }

    /* Search form — stack on mobile */
    .search-form {
        flex-direction: column;
    }
    .search-form .search-field {
        border-right: 2px solid var(--color-border);
        border-radius: var(--radius-sm);
        border-bottom: none;
    }
    .search-form .search-submit {
        border-radius: var(--radius-sm);
    }

    /* Pagination — wrap on small screens */
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Post navigation — full width stack */
    .post-navigation {
        flex-direction: column;
    }
    .post-navigation .nav-previous,
    .post-navigation .nav-next {
        min-width: auto;
        width: 100%;
    }
    .post-navigation .nav-next {
        text-align: left;
    }

    /* Business card */
    .business-card__logo {
        width: 60px;
        height: 60px;
    }

    /* Event card date block */
    .event-card__date {
        font-size: 1rem;
    }

    /* Footer nav — center items */
    .footer-menu ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
        list-style: none;
        padding: 0;
        margin: var(--space-sm) 0 0;
    }

    /* Comments form — full width */
    #commentform .comment-form-author,
    #commentform .comment-form-email,
    #commentform .comment-form-url {
        width: 100%;
    }

    /* Social share buttons — wrap */
    .social-share {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    /* Author bio — stack */
    .author-bio {
        flex-direction: column;
        text-align: center;
        align-items: center;
        border-left: none;
        border-top: 4px solid var(--color-gold);
        padding: var(--space-lg) var(--space-md);
    }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (max-width: 480px) — component tweaks
   ============================================================ */
@media (max-width: 480px) {
    /* Tighter card padding */
    .article-card__body { padding: 0.85rem; }
    .business-card__body { padding: 0.85rem; }
    .event-card__body { padding: 0.85rem; }
    .diaspora-card__body { padding: 0.85rem; }

    /* Widgets in sidebar — full-width on mobile */
    .sidebar .widget {
        padding: var(--space-md);
    }

    /* Block editor content full width */
    .entry-content .alignwide {
        width: 100%;
        margin-left: 0;
    }

    /* Category colour labels — smaller */
    a.cat-label { font-size: 0.65rem; letter-spacing: 0.04em; }

    /* Advertise CTA stack */
    .advertise-cta .container {
        flex-direction: column;
        text-align: center;
    }
    .advertise-cta h3 { font-size: 1.3rem; }

    /* Footer social icons — larger tap targets */
    .social-links a {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Section headers on tiny screens */
    .section-header {
        flex-direction: column;
        gap: var(--space-sm);
    }
    .section-header .view-all {
        align-self: flex-start;
    }
}

/* ============================================================
   RESPONSIVE — LANDSCAPE PHONE (480px – 767px, landscape)
   ============================================================ */
@media (min-width: 480px) and (max-width: 767px) and (orientation: landscape) {
    .hero-section { min-height: 40vw; }
    .hero-content { padding: var(--space-lg) 0; }
    .hero-content h1 { font-size: 1.5rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   PRINT — extended
   ============================================================ */
@media print {
    .hero-section::before,
    .hero-bg,
    .newsletter-section,
    .advertise-cta,
    .social-share,
    .menu-toggle,
    .sidebar { display: none !important; }

    .single-layout { display: block; }
    .entry-content { font-size: 11pt; }
}
