
/* =========================================
   1. Reset & Variables
   ========================================= */
:root {
    /* Color Palette */
    --color-primary: #1e293b; /* Dark Slate */
    --color-secondary: #3b82f6; /* Bright Blue */
    --color-accent: #0ea5e9; /* Sky Blue */
    --color-success: #10b981; /* Emerald Green */
    --color-text-main: #334155;
    --color-text-light: #64748b;
    --color-bg-body: #f8fafc;
    --color-bg-surface: #ffffff;
    --color-border: #e2e8f0;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-btn: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Typography */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    --line-height-heading: 1.2;

    /* Spacing & Layout */
    --container-width: 1100px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.75rem;
    --border-radius-lg: 1rem;

    /* Shadows */
    --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);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.5);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* =========================================
   2. Layout & Containers
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.site-content {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
    display: grid;
    gap: var(--spacing-md);
}

.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;
    width: 1px;
    word-wrap: normal !important;
}

/* =========================================
   3. Typography
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    line-height: var(--line-height-heading);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

h1.entry-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: var(--spacing-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-top: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--spacing-xs);
}

p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.0625rem; /* 17px approx */
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

a:hover, a:focus {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--color-secondary);
    background: #fff;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-md) 0;
    font-style: italic;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    box-shadow: var(--shadow-sm);
    color: var(--color-primary);
}

/* =========================================
   4. Interactive Elements (Buttons)
   ========================================= */
.wp-block-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.btn-box {
    display: inline-block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white !important;
    background: var(--gradient-btn);
    border-radius: 50px;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5);
    filter: brightness(110%);
}

.btn:active {
    transform: translateY(0);
}

/* Variant for "Registration" or key actions using green */
.btn:nth-child(even), 
.btn[href*="registration"] {
    background: var(--gradient-success);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.btn:nth-child(even):hover {
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.5);
}

/* =========================================
   5. Content Elements (Images & Tables)
   ========================================= */
/* Images */
figure {
    margin: var(--spacing-md) 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
    display: block;
    margin: 0 auto;
}

img:hover {
    transform: scale(1.01);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    background: var(--color-bg-surface);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

thead {
    background-color: var(--color-primary);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tbody tr:nth-child(even) {
    background-color: #f1f5f9;
}

tbody tr:hover {
    background-color: #e2e8f0;
}

/* Lists */
ul, ol {
    margin-bottom: var(--spacing-sm);
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* =========================================
   6. Comments Section
   ========================================= */
#comments {
    margin-top: var(--spacing-lg);
    background: var(--color-bg-surface);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    border-bottom: none;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-box {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
    transition: border-color var(--transition-fast);
}

.comment-box:hover {
    border-color: var(--color-secondary);
}

.comment-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid var(--color-bg-body);
    box-shadow: 0 0 0 1px var(--color-border);
    margin: 0;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.comment-author {
    font-weight: 700;
    color: var(--color-primary);
    font-style: normal;
}

.comment-time {
    color: var(--color-text-light);
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-secondary);
    font-weight: 600;
}

/* Comment Form */
#respond {
    margin-top: var(--spacing-md);
    background: #f8fafc;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

.comment-form-author,
.comment-form-email,
.comment-form-url,
.comment-form-comment {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.comment-form label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--color-primary);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-focus);
}

.form-submit input[type="submit"] {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.form-submit input[type="submit"]:hover {
    background: #334155;
    transform: translateY(-1px);
}

/* =========================================
   7. Footer
   ========================================= */
.site-footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-lg);
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.site-footer a:hover {
    border-bottom-color: #fff;
    text-decoration: none;
}

/* =========================================
   8. Responsive Design
   ========================================= */
@media (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
    }

    /* Content Layout */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1.entry-title {
        text-align: left;
    }

    /* Table Scrolling */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Stacked Buttons */
    .wp-block-buttons {
        flex-direction: column;
    }

    .btn-box, .btn {
        width: 100%;
        display: flex;
    }

    /* Comments */
    .comment-box {
        flex-direction: column;
    }

    .comment-avatar {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .comment-avatar img {
        width: 40px;
        height: 40px;
    }
}

/* =========================================
   9. Micro-animations & Utils
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

article {
    animation: fadeIn 0.6s ease-out;
}

.scrolltop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--color-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.scrolltop.is-active {
    opacity: 1;
    transform: translateY(0);
}

.scrolltop::after {
    content: "↑";
    color: white;
    font-size: 1.5rem;
    line-height: 3rem;
    display: block;
    text-align: center;
}
