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

/* ==== Typography ==== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html { font-family: 'Inter', sans-serif; font-size: 16px; line-height: 1.5; }
body { 
    background-color: var(--color-bg); 
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ==== Utility classes ==== */
.container { max-width: 1240px; margin: 0 auto; padding: 0 1rem; }

/* ==== Flexbox utilities ==== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 1rem; }

/* ==== Responsive utilities ==== */
.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .show-mobile { display: block; }
}

/* ==== Button styles ==== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
}

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
}

/* ==== Link styles ==== */
.drawer-link, .footer-link {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.drawer-link, .footer-link {
    color: var(--color-text-inverse);
}

.drawer-link:hover, .footer-link:hover {
    color: var(--color-secondary);
}

/* ==== Header styles ==== */
.site-header {
    padding: 1rem 0;
    position: relative;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo {
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-desktop ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.nav-desktop li {
    margin: 0;
}

.nav-link {
    color: var(--color-text-inverse);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--color-secondary);
}

.mobile-hamburger {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.mobile-drawer ul {
    list-style: none;
    margin: 0;
    padding: 1rem;
}

.mobile-drawer li {
    margin: 0.5rem 0;
}

.drawer-link {
    display: block;
    padding: 0.75rem 1rem;
}

/* ==== Footer styles ==== */
.site-footer {
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

/* ==== Card styles ==== */
.post-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ==== Form styles ==== */
.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(10, 31, 68, 0.1);
}

/* ==== Alert styles ==== */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.alert-danger {
    background-color: rgba(198, 40, 40, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.alert-success {
    background-color: rgba(46, 125, 50, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

/* ==== Spinner animation ==== */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ==== Shimmer animation for lazy-loading images ==== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==== Page utilities ==== */
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.p-4 { padding: 1.5rem; }
.text-center { text-align: center; }

/* ==== Breadcrumb ==== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 0;
    margin-bottom: 0;
    list-style: none;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding: 0 0.5rem;
    color: var(--color-gray-500);
}

/* ==== Pagination ==== */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 0.5rem;
}

.page-item {
    list-style: none;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    text-decoration: none;
}

.page-link:hover {
    background-color: var(--color-gray-200);
}

.justify-content-center {
    justify-content: center;
}

/* ==== Bootstrap-like form utilities ==== */
.d-flex {
    display: flex;
}

.me-2 {
    margin-right: 0.5rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-gray-600);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--color-gray-300);
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--color-gray-600);
    background-color: #fff;
    border-color: var(--color-primary-light);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(10, 31, 68, 0.25);
}
