/* ==========================================================================
   Base Styles & Layout
   ========================================================================== */

/* CSS Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* Site Layout */
#page {
    display: flex;
    flex-direction: column;
    /* min-height: 100vh; */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Screen Reader Text */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto !important;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto !important;
    z-index: 100000;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 15px;
    color: #333;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 20px;
    line-height: 1.7;
}

a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Lists */
ul, ol {
    margin: 0 0 20px;
    padding-left: 30px;
}

li {
    margin-bottom: 5px;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

button,
input[type="submit"],
input[type="button"] {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #005a87;
    transform: translateY(-1px);
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

/* Code */
code,
pre {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    border-radius: 3px;
}

code {
    padding: 3px 6px;
    font-size: 14px;
    color: #d63384;
}

pre {
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Blockquotes */
blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    font-style: italic;
    color: #666;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* HR */
hr {
    border: none;
    height: 1px;
    background: #e9ecef;
    margin: 40px 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mb-3 { margin-bottom: 30px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }
.mt-3 { margin-top: 30px !important; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

/* Layout Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.33333%; max-width: 8.33333%; }
.col-2 { flex: 0 0 16.66667%; max-width: 16.66667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.33333%; max-width: 33.33333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.66667%; max-width: 66.66667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Sidebar Layout */
.content-area {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    flex: 0 0 300px;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* WordPress Classes */
.alignleft {
    float: left;
    margin: 0 20px 15px 0;
}

.alignright {
    float: right;
    margin: 0 0 15px 20px;
}

.aligncenter {
    display: block;
    margin: 20px auto;
    text-align: center;
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 20px;
}

.wp-caption img {
    display: block;
    margin: 0 auto;
}

.wp-caption-text {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 10px 0;
    margin: 0;
    font-style: italic;
}

/* Post Classes */
.sticky {
    background: #fff9c4;
    border: 1px solid #f0e68c;
}

.bypostauthor {
    background: #f0f8ff;
    border-left: 4px solid #007cba;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.grecaptcha-badge {
    visibility: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .content-area {
        gap: 30px;
    }

    .sidebar {
        flex: 0 0 250px;
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .content-area {
        flex-direction: column;
        gap: 20px;
    }

    .sidebar {
        flex: none;
        position: static;
        width: 100%;
    }

    .row {
        margin: 0 -10px;
    }

    .col {
        padding: 0 10px;
    }

    .col-1, .col-2, .col-3, .col-4, .col-6, .col-8, .col-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .alignleft,
    .alignright {
        float: none;
        display: block;
        margin: 15px auto;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    a {
        text-decoration: underline;
    }

    button,
    input[type="submit"],
    input[type="button"] {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .no-print,
    .site-header,
    .site-footer,
    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        max-width: none;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}
