
/* =========================================
   1. CSS Reset & Variables
   ========================================= */
:root {
    /* Color Palette */
    --color-primary: #1a56be;
    --color-primary-dark: #103c8b;
    --color-accent: #00bfff;
    --color-text-main: #2c3e50;
    --color-text-light: #64748b;
    --color-bg-body: #f8fafc;
    --color-bg-card: #ffffff;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-white: #ffffff;

    /* Typography */
    --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-h1: clamp(1.75rem, 4vw, 2.5rem);
    --font-size-h2: clamp(1.5rem, 3vw, 2rem);
    --font-size-h3: clamp(1.25rem, 2.5vw, 1.5rem);
    
    /* Spacing & Layout */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --wrapper-width: 80rem; /* ~1280px */
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

/* =========================================
   2. Layout & Wrapper
   ========================================= */
.wrapper {
    width: 100%;
    max-width: var(--wrapper-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =========================================
   3. Header Styling
   ========================================= */
.header {
    background-color: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    animation: slideDown 0.5s ease-out;
}

/* Container inside header usually implied by .wrapper, 
   but since HTML structure places .wrapper outside .header in one level 
   and .header inside in another, we fix layout via flex */
.header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

/* Fix for the specific HTML structure provided */
.wrapper > .header {
    width: 100%;
    flex-direction: row;
}

.logo {
    height: 3rem; /* Fixed height for consistency */
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-smooth);
}

.logo:hover {
    transform: scale(1.05);
}

.m-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-sm);
    flex: 1;
}

/* =========================================
   4. Search Form
   ========================================= */
.search-form {
    width: 100%;
    max-width: 20rem;
    position: relative;
}

.search-form form {
    display: flex;
    align-items: center;
}

.search-form__field {
    width: 100%;
    padding: 0.6em 1em;
    padding-right: 2.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-body);
    transition: all var(--transition-fast);
}

.search-form__field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 190, 0.1);
    background-color: var(--color-white);
}

.search-form__button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.search-form__button:hover {
    background-color: var(--color-border);
}

/* =========================================
   5. Navigation
   ========================================= */
.main-menu {
    width: 100%;
}

.main-menu__inner {
    width: 100%;
}

.main-menu__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Hide mobile list on desktop */
.main-menu__list_m {
    display: none;
}

.menu-item a {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-main);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    transition: color var(--transition-fast);
}

.menu-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-smooth);
}

.menu-item a:hover {
    color: var(--color-primary);
    background-color: rgba(26, 86, 190, 0.05);
}

.menu-item a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Special styling for specific menu items based on ID if needed, 
   e.g., 'Register' button style */
#menu-item-572 a {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    box-shadow: 0 4px 10px rgba(26, 86, 190, 0.3);
}

#menu-item-572 a:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(26, 86, 190, 0.4);
}

#menu-item-572 a::after {
    display: none; /* remove underline for button */
}

/* =========================================
   6. Content Area
   ========================================= */
.main-box {
    padding: var(--spacing-lg) 0;
    animation: fadeIn 0.8s ease-out;
}

.content-wrapper {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.content {
    max-width: 65rem; /* Optimum reading width */
    margin: 0 auto;
}

/* Article Typography */
.single__title {
    font-size: var(--font-size-h1);
    color: var(--color-text-main);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.entry p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-main);
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.entry h2, .entry h3 {
    color: var(--color-primary-dark);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.entry h2 { font-size: var(--font-size-h2); }
.entry h3 { font-size: var(--font-size-h3); }

.entry ul {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
}

.entry ul li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.entry ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
}

.entry strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* Links inside content */
.entry a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all var(--transition-fast);
}

.entry a:hover {
    color: var(--color-accent);
    text-decoration-color: transparent;
}

/* Images & Captions */
.wp-caption {
    margin: var(--spacing-lg) auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--color-bg-body);
    text-align: center;
    transition: transform var(--transition-smooth);
}

.wp-caption:hover {
    transform: translateY(-5px);
}

.wp-caption img {
    width: 100%;
    height: auto;
    display: block;
}

.wp-caption-text {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-style: italic;
    background: var(--color-bg-body);
    border-top: 1px solid var(--color-border);
}

/* =========================================
   7. Animations
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* =========================================
   8. Responsive Design (Tablets & Mobile)
   ========================================= */
@media (max-width: 992px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo {
        align-self: center;
        margin-bottom: var(--spacing-sm);
    }
    
    .m-nav {
        align-items: center;
    }
    
    .main-menu__list {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 1.5rem;
    }

    .wrapper {
        padding: 0 var(--spacing-xs);
    }

    /* Hide desktop list, show mobile list (though semantic content is similar in HTML) */
    .main-menu__list {
        display: none;
    }
    
    .main-menu__list_m {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: var(--color-bg-body);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        overflow: hidden;
    }

    .main-menu__list_m .menu-item {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    
    .main-menu__list_m .menu-item:last-child {
        border-bottom: none;
    }

    .main-menu__list_m .menu-item a {
        display: block;
        padding: 1rem;
        width: 100%;
        text-align: center;
    }

    /* Buttons inside mobile menu */
    #menu-item-572 a {
        border-radius: 0; /* Reset rounded button for mobile list style */
        box-shadow: none;
    }

    .search-form {
        max-width: 100%;
    }

    .content-wrapper {
        padding: var(--spacing-sm);
    }
    
    .single__title {
        font-size: 1.75rem;
        text-align: center;
    }
    
    .wp-caption {
        max-width: 100% !important; /* Override inline styles */
    }
}
