/* File: /assets/css/style.css */

/* ==================================================
1. IMPORTS & VARIABLES
================================================== */
@import url('variables.css');
@import url('normalize.css');
@import url('components/buttons.css');
@import url('components/fields.css');
@import url('components/menu.css');

/* ==================================================
2. BASE STYLES
    Description: Global reset and base typography settings.
================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: none;
    animation: none;
}

html {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--text-size-m);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--body-background-color);
    color: var(--body-text-color-main);
    line-height: var(--line-height-xl);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family);
    font-weight: var(--text-heading-font-weight);
    color: var(--text-heading-color);
    line-height: var(--line-height-m);
    text-rendering: optimizeLegibility;
}

h1 {
    font-size: var(--text-size-xl);
}

h2 {
    font-size: var(--text-size-xl);
}

h3 {
    font-size: var(--text-size-l);
}

h4 {
    font-size: var(--text-size-m);
}

h5 {
    font-size: var(--text-size-s);
    text-transform: uppercase;
}

a {
    color: var(--link-color-base);
    text-decoration: none;
    transition: none;
}

a:hover {
    color: var(--link-color-hover);
    text-decoration: none;
}

strong {
    font-weight: var(--font-weight-semibold);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: var(--text-size-xl);
    }

    h3 {
        font-size: var(--text-size-l);
    }
}

/* ==================================================
3. HEADER & FOOTER
================================================== */
header {
    padding: var(--header-padding);
    background: var(--header-background-color);
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: var(--header-border-color);
    color: var(--header-text-color-base);
}

footer {
    padding: var(--footer-padding);
    background: var(--footer-background-color);
    border-width: 1px 0 0 0;
    border-style: solid;
    border-color: var(--footer-border-color);
    color: var(--footer-text-color-base);
}

.header-container,
.footer-container {
    display: flex;
    align-items: center;
}

.header-container {
    justify-content: space-between;
}

.footer-container {
    justify-content: center;
}

header h1 {
    font-size: var(--text-size-xl);
    text-transform: uppercase;
    line-height: var(--line-height-none);
    color: var(--site-name-color-base);
}

.site-name {
    font-weight: var(--site-name-weight);
    color: var(--site-name-color-base);
    text-decoration: none;
}

.site-name:hover {
    color: var(--site-name-color-hover);
    text-decoration: none;
}

/* ==================================================
4. LAYOUT
================================================== */
.page-width {
    width: 100%;
    max-width: var(--page-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-m);
    padding-right: var(--spacing-m);
}

main {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    width: 100%;
    padding: var(--spacing-xl) 0;
    gap: var(--spacing-l);
}

h2.page-title {
    padding: 0;
    margin: 0;
    font-size: var(--text-size-xl);
    color: var(--color-black);
}

h3.container-heading {
    padding: 0;
    margin: 0;
    font-size: var(--text-size-l);
    color: var(--color-blue-base);
}

.block-center {
    margin-left: auto;
    margin-right: auto;
}

.container {
    margin-top: var(--spacing-m);
}

/* Column Styles */
.columns-1-1,
.columns-1-2,
.columns-2-1 {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

.columns-1-1>div,
.columns-1-2>div,
.columns-2-1>div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

@media (min-width: 769px) {

    .columns-1-1,
    .columns-1-2,
    .columns-2-1 {
        flex-direction: row;
    }

    .columns-1-1>div,
    .columns-1-2>div:first-child,
    .columns-2-1>div:last-child {
        flex: 1;
    }

    .columns-1-2>div:last-child,
    .columns-2-1>div:first-child {
        flex: 2;
    }
}

.width-s,
.width-m,
.width-l,
.width-full {
    width: 100%;
}

@media (min-width: 768px) {
    .width-s {
        width: 400px;
    }

    .width-m {
        width: 600px;
    }

    .width-l {
        width: 800px;
    }
}

/* Responsive split row: Stacks on mobile, spreads to edges on desktop */
.split-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-m);
}

@media (min-width: 768px) {
    .split-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Vertical Stack (Dọc) */
.stack-gap-xs {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.stack-gap-s {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-s);
}

.stack-gap-m {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

.stack-gap-l {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-l);
}

/* Horizontal Group (Ngang) */
.row-gap-xs {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-xs);
}

.row-gap-s {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-s);
}

.row-gap-m {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-m);
}

.row-gap-l {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-l);
}

/* ==================================================
4. UTILITY CLASSES
================================================== */
.invisible {
    visibility: hidden;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-muted {
    color: var(--body-text-color-muted);
}

.width-half {
    width: 50%;
}

.width-third {
    width: 33.3333%;
}

.flex-row {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-xs);
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.gap-xs {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xxs);
}

.gap-sm {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.gap-ms {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-s);
}

.gap-md {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

.gap-lg {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-l);
}

.gap-xl {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.hidden {
    display: none;
}

.color-gray {
    color: var(--color-gray-base);
}

.color-orange {
    color: var(--color-orange-base);
}

.color-green {
    color: var(--color-green-base);
}

.text-small {
    font-size: 0.85rem;
    color: var(--body-text-color-secondary);
}

@media (max-width: 768px) {

    .width-half,
    .width-third {
        width: 100%;
    }

    .mobile-hidden {
        display: none;
    }
}

.nav-actions a:not(:first-child)::before {
    content: "|";
    margin: 0 var(--spacing-xs);
    color: var(--body-text-color-main);
    text-decoration: none;
}

.auto-hide:empty {
    display: none;
}

.width-full-mobile {
    width: 100%;
}

@media (min-width: 768px) {
    .width-full-mobile {
        width: auto;
    }
}

/* ==================================================
5. COMPONENTS
================================================== */
/* Component Section */
section.component {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

@media (min-width: 768px) {
    section.component {
        padding: var(--spacing-m);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
    }
}

/* Message Styles */
.success-message {
    color: var(--color-green-dark);
}

.error-message,
.warning-message {
    color: var(--color-orange-dark);
}

.message--no-data {
    font-size: var(--text-size-m);
    font-weight: var(--font-weight-normal);
    font-style: italic;
    color: var(--color-gray-dark);
}