/*
Theme Name: Tayo Development Foundation (TDF)
Theme URI: https://tayotdf.org/
Author: Tayo Development Foundation Technical Team
Author URI: https://tayotdf.org/
Description: Official, institutional WordPress theme for Tayo Development Foundation (TDF), Dhuusamareeb, Galmudug State, Somalia.
Version: 1.2.0
Text Domain: tdf-foundation
*/

/* -------------------------------------------------------------
 * 1. DESIGN TOKENS & RESET
 * ------------------------------------------------------------- */
:root {
    --tdf-maroon: #941B43;
    --tdf-maroon-hover: #7b1637;
    --tdf-green: #075542;
    --tdf-green-hover: #053e30;
    --tdf-charcoal: #1e293b;
    --tdf-text: #334155;
    --tdf-text-light: #64748b;
    --tdf-bg-soft: #F7F8F6;
    --tdf-bg-white: #ffffff;
    --tdf-border: #E2E8F0;
    --tdf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--tdf-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--tdf-text);
    background-color: var(--tdf-bg-white);
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--tdf-maroon);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus {
    color: var(--tdf-green);
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* -------------------------------------------------------------
 * 2. TOP UTILITY RIBBON
 * ------------------------------------------------------------- */
.tdf-topbar {
    background-color: #111827;
    color: #e2e8f0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tdf-topbar-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tdf-topbar-left, .tdf-topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.tdf-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
}

.tdf-topbar-item svg {
    color: var(--tdf-maroon);
    flex-shrink: 0;
}

.tdf-topbar-item a, .tdf-topbar-link {
    color: #e2e8f0;
}

.tdf-topbar-item a:hover, .tdf-topbar-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.tdf-topbar-divider {
    color: #475569;
}

.tdf-topbar-tims {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(7, 85, 66, 0.6);
    color: #a7f3d0;
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.tdf-topbar-tims:hover {
    background-color: var(--tdf-green);
    color: #ffffff;
}

/* -------------------------------------------------------------
 * 3. MAIN DESKTOP HEADER & LOGO
 * ------------------------------------------------------------- */
.tdf-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--tdf-border);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.tdf-header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tdf-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tdf-logo-wrapper img, .custom-logo {
    height: 52px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.tdf-brand-text {
    display: flex;
    flex-direction: column;
}

.tdf-brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tdf-maroon);
    line-height: 1.2;
}

.tdf-brand-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tdf-green);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Desktop Navigation Menu */
.tdf-desktop-nav {
    display: block;
}

.tdf-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 24px;
}

.tdf-menu-item {
    position: relative;
}

.tdf-menu-item > a {
    color: var(--tdf-charcoal);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tdf-menu-item > a:hover {
    color: var(--tdf-maroon);
}

.tdf-caret {
    transition: transform 0.2s ease;
}

.tdf-has-dropdown:hover .tdf-caret {
    transform: rotate(180deg);
}

/* Submenu Dropdown */
.tdf-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 240px;
    border: 1px solid var(--tdf-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
}

.tdf-submenu-wide {
    min-width: 310px;
}

.tdf-has-dropdown:hover > .tdf-submenu,
.tdf-has-dropdown:focus-within > .tdf-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tdf-submenu li a {
    display: block;
    padding: 9px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--tdf-charcoal);
}

.tdf-submenu li a:hover {
    background-color: var(--tdf-bg-soft);
    color: var(--tdf-maroon);
    padding-left: 24px;
}

/* Header Action Buttons */
.tdf-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.tdf-btn-nav-donate {
    background-color: var(--tdf-maroon);
    color: #ffffff !important;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background 0.2s ease;
}

.tdf-btn-nav-donate:hover {
    background-color: var(--tdf-maroon-hover);
}

.tdf-btn-nav-tims {
    background-color: #0f172a;
    color: #ffffff !important;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    border: 1px solid #334155;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tdf-btn-nav-tims:hover {
    background-color: var(--tdf-green);
    border-color: var(--tdf-green);
}

/* Mobile Toggle Hamburger */
.tdf-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--tdf-border);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.tdf-hamburger-bar {
    width: 22px;
    height: 2px;
    background-color: var(--tdf-charcoal);
    border-radius: 2px;
    transition: transform 0.2s ease;
}

/* -------------------------------------------------------------
 * 4. MOBILE DRAWER NAVIGATION (RESPONSIVE)
 * ------------------------------------------------------------- */
.tdf-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.tdf-drawer-backdrop.tdf-open {
    opacity: 1;
    visibility: visible;
}

.tdf-mobile-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.tdf-mobile-drawer.tdf-open {
    right: 0;
}

.tdf-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tdf-border);
    background-color: var(--tdf-bg-soft);
}

.tdf-drawer-title {
    font-weight: 700;
    color: var(--tdf-maroon);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tdf-drawer-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--tdf-charcoal);
    cursor: pointer;
    padding: 0 4px;
}

.tdf-drawer-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tdf-mobile-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.tdf-mobile-menu > li {
    border-bottom: 1px solid var(--tdf-border);
}

.tdf-m-link {
    display: block;
    padding: 14px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tdf-charcoal);
}

.tdf-m-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tdf-accordion-btn {
    background: #f1f5f9;
    border: 1px solid var(--tdf-border);
    border-radius: 4px;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--tdf-charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdf-m-sub {
    list-style: none;
    background-color: var(--tdf-bg-soft);
    border-radius: 6px;
    margin: 0 0 12px 0;
    padding: 6px 0;
    display: none;
}

.tdf-m-sub.tdf-sub-expanded {
    display: block;
}

.tdf-m-sub li a {
    display: block;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--tdf-charcoal);
}

.tdf-m-sub li a:hover {
    color: var(--tdf-maroon);
}

.tdf-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tdf-m-btn-donate {
    background: var(--tdf-maroon);
    color: #ffffff !important;
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
}

.tdf-m-btn-tims {
    background: #0f172a;
    color: #ffffff !important;
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdf-drawer-contact {
    font-size: 0.8rem;
    color: var(--tdf-text-light);
    line-height: 1.5;
    border-top: 1px solid var(--tdf-border);
    padding-top: 16px;
}

.tdf-drawer-contact p {
    margin-bottom: 6px;
}

/* -------------------------------------------------------------
 * 5. GLOBAL LAYOUTS & BUTTONS
 * ------------------------------------------------------------- */
.tdf-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.tdf-section {
    padding: 70px 0;
}

.tdf-section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 40px;
}

.tdf-section-eyebrow {
    display: inline-block;
    color: var(--tdf-maroon);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.tdf-section-title {
    font-size: 2.2rem;
    color: var(--tdf-charcoal);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
}

.tdf-section-desc {
    font-size: 1.05rem;
    color: var(--tdf-text-light);
    line-height: 1.6;
}

.tdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.tdf-btn-primary {
    background-color: var(--tdf-maroon);
    color: #ffffff !important;
}

.tdf-btn-primary:hover {
    background-color: var(--tdf-maroon-hover);
}

.tdf-btn-outline {
    background-color: transparent;
    color: #ffffff !important;
    border-color: #ffffff;
}

.tdf-btn-outline:hover {
    background-color: #ffffff;
    color: var(--tdf-charcoal) !important;
}

/* -------------------------------------------------------------
 * 6. RESPONSIVE BREAKPOINTS (ALL DEVICES)
 * ------------------------------------------------------------- */

/* Breakpoint 1150px: Switch from Desktop Menu to Mobile Drawer */
@media (max-width: 1150px) {
    .tdf-desktop-nav {
        display: none;
    }
    .tdf-header-actions {
        display: none;
    }
    .tdf-mobile-toggle {
        display: flex;
    }
}

/* Breakpoint 768px: Tablets in Portrait & Mobiles */
@media (max-width: 768px) {
    .tdf-topbar-right, .tdf-topbar-email {
        display: none;
    }
    .tdf-topbar-container {
        justify-content: center;
        text-align: center;
        font-size: 0.75rem;
    }
    .tdf-section-title {
        font-size: 1.8rem;
    }
    .tdf-section {
        padding: 50px 0;
    }
}

/* Breakpoint 480px: Small Screen Phones */
@media (max-width: 480px) {
    .tdf-topbar {
        display: none; /* Hide topbar on very small screens for vertical space */
    }
    .tdf-section-title {
        font-size: 1.5rem;
    }
    .tdf-btn {
        width: 100%;
    }
}