/* Base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Smooth fade between light/dark themes */
    transition: background-color 0.35s ease, color 0.35s ease;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: #111111;
    background-color: #f4f4f4;
    transition: background-color 0.35s ease, color 0.35s ease;
}

a {
    color: #333365;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    transition: filter 0.35s ease;
}

/* Layout */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background-color: #ffffff;
    color: #000000;
    padding: 8px 16px;
    z-index: 1000;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
    outline: 2px solid #333365;
}

/* Header & navigation */
.site-header {
    background-color: #333365;
    color: #ffffff;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-square {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333365;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.main-nav a {
    color: #ffffff;
    font-weight: 600;
}

.main-nav a:focus,
.main-nav a:hover {
    text-decoration: underline;
}

/* Search button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-button {
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.search-button:focus {
    outline: 2px solid #ffffff;
}

/* MOBILE MENU */
.mobile-menu-btn,
#mobile-menu-button {
    display: none;
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
}

.mobile-menu-btn:focus,
#mobile-menu-button:focus {
    outline: 2px solid #ffffff;
}

@media (max-width: 768px) {
    .mobile-menu-btn,
    #mobile-menu-button {
        display: inline-block;
    }

    .main-nav {
        display: none !important;
    }
}

/* Backdrop */
#mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    z-index: 9999;
}

#mobile-menu-backdrop[hidden] {
    display: none;
}

/* Dialog panel */
#mobile-menu-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    padding: 20px;
    outline: none;
}

/* Close button */
#mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    float: right;
    cursor: pointer;
    color: #333365;
}

#mobile-menu-close:focus {
    outline: 2px solid #333365;
}

/* Menu list */
.mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}

.mobile-menu-nav a {
    display: block;
    padding: 14px 0;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #dddddd;
    color: #333365;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a:focus {
    background: #f0f0ff;
    text-decoration: none;
}

/* SEARCH DIALOG */
.search-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.search-dialog {
    background-color: #ffffff;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    border-radius: 8px;
}

/* Content layout */
.page-section {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px 24px 16px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: background-color 0.35s ease, color 0.35s ease;
}

.page-section h1 {
    margin-top: 0;
    padding-top: 16px;
}

/* Card layout */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 20px;
}

.item {
    border-top: 1px solid #dddddd;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.item-title a,
.item-image a {
    text-decoration: none !important;
}

.item-layout {
    gap: 20px !important;
}

.item-image img {
    border-radius: 6px;
}

.item-summary,
.item-meta {
    margin-bottom: 12px !important;
}

/* Focus visible */
:focus-visible {
    outline: 3px solid #ff9900 !important;
    outline-offset: 4px !important;
    border-radius: 6px;
}

/* BLOG matching */
.page-section ul.item-list .read-more {
    padding: 8px 14px;
    font-size: 18px;
}

/* SEARCH results matching */
.search-results .item {
    border-radius: 10px;
    padding: 20px !important;
}

/* ============================================================
   DARK MODE — TOGGLE + SMOOTH TRANSITION
   ============================================================ */

/* Everything fades smoothly */
.dark-mode body,
.dark-mode .page-section,
.dark-mode .item,
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* Dark theme colors */
.dark-mode body {
    background-color: #121212;
    color: #f2f2f2;
}

.dark-mode .page-section {
    background-color: #1c1c1c;
    color: #ffffff;
}

.dark-mode .item {
    background-color: #1a1a1a;
    border-color: #333333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.dark-mode a {
    color: #9db7ff;
}

.dark-mode .item-summary,
.dark-mode .item-meta {
    color: #dddddd;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: #1d1d1d;
    color: #ffffff;
    border-color: #444444;
}

.dark-mode .site-header {
    background-color: #111133;
}

.dark-mode .site-footer {
    background-color: #000000;
    color: #dddddd;
}
/* ============================================================
   FOOTER SOCIAL ICON BUTTONS — RESTORED + IMPROVED
   ============================================================ */

.footer-social {
    margin-bottom: 12px;
}

.footer-social a {
    display: inline-block;
    margin-right: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.25s ease, opacity 0.25s ease;
}

/* Social Brand Colors */
.footer-social a.facebook {
    background-color: #1877F2;
}

.footer-social a.instagram {
    background: radial-gradient(circle at 30% 107%, 
        #fdf497 0%, #fdf497 5%, #fd5949 45%, 
        #d6249f 60%, #285AEB 90%);
}

.footer-social a.threads {
    background-color: #000000;
}

.footer-social a.mastodon {
    background-color: #3088D4;
}

.footer-social a.bluesky {
    background-color: #0285FF;
}

.footer-social a.linkedin {
    background-color: #0077B5;
}

/* Hover + Focus (light mode) */
.footer-social a:hover,
.footer-social a:focus {
    opacity: 0.85;
    text-decoration: none;
    outline: 3px solid #ff9900;
    outline-offset: 3px;
}

/* Dark pagination */
.dark-mode .pagination a {
    background-color: #222222;
    color: #ffffff;
}

.dark-mode .pagination a[aria-current="page"] {
    background-color: #333365;
    color: #ffffff !important;
}

/* Search + dialogs */
.dark-mode .search-dialog {
    background-color: #1c1c1c;
    color: #ffffff;
}

.dark-mode .search-dialog input {
    background-color: #0f0f0f;
    color: #ffffff;
    border-color: #444444;
}

/* ============================================================
   DARK MODE TOGGLE BUTTON (DESKTOP)
   ============================================================ */

#dark-mode-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background-color: #333365;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

#dark-mode-toggle:hover,
#dark-mode-toggle:focus {
    background-color: #5557a0;
    outline: 3px solid #ff9900;
    outline-offset: 3px;
}

.dark-mode #dark-mode-toggle {
    background-color: #f0f0f0;
    color: #111111;
}

/* ============================================================
   MOBILE DARK MODE LINK (inline)
   ============================================================ */

#dark-mode-mobile-link {
    display: none;
    color: #ffffff;
    font-size: 16px;
    margin-left: 12px;
    text-decoration: underline;
}

#dark-mode-mobile-link:hover,
#dark-mode-mobile-link:focus {
    text-decoration: none;
    outline: 2px solid #ff9900;
    outline-offset: 3px;
}

.dark-mode #dark-mode-mobile-link {
    color: #9db7ff;
}

/* SHOW MOBILE LINK, HIDE FLOATING BUTTON */
@media (max-width: 768px) {
    #dark-mode-toggle {
        display: none !important;
    }
    #dark-mode-mobile-link {
        display: inline-block !important;
    }
}
