@import url('https://fonts.googleapis.com/css2?family=Bellota&family=Bellota+Text:wght@300;400&display=swap');
* {
    box-sizing: border-box;
}

/* =============================
   Body
============================= */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background: #212121;
    font-family: Bellota, sans-serif;
    font-size: 18px;
}

body {
    display: flex;
    flex-direction: column; /* Sắp xếp các phần tử theo cột */
    min-height: 100vh;      /* Đảm bảo body có chiều cao tối thiểu bằng màn hình */
}

/* =============================
   Header
============================= */

header {
    width: 100%;
    max-width: 100vw;
    padding: 10px;
    text-align: center;
}

header {
    background: #7971EA;
    color: white;
}

header nav a.nav-link {
  color: #ffff;
}

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

header h1 {
    font-size: 24px;
    margin: 0;
}

/* =============================
   Nav
============================= */

nav {
    display: flex;
    gap: 20px;
    align-items: center; /* Căn giữa theo chiều dọc */
    padding: 10px 20px;
    justify-content: center; /* Căn giữa theo chiều ngang */
}

nav a {
    margin: 0 10px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}
nav a:hover {
    text-decoration: underline;
}

nav ul {
    list-style: none; /* Xóa các dấu chấm */
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline; /* Đặt các mục nằm trên cùng một dòng */
    margin: 0 0px; /* Thêm khoảng cách giữa các mục margin: 0 10px; */
}

nav a {
    text-decoration: none;
    font-size: 18px; /*16px;*/
}

.nav-link {
    display: inline-block;
    position: relative;
    text-decoration: none;
    border-radius: 10px; /* bo tròn */
    transition: transform 0.15s ease; /* mượt khi nhấn */
}

    /* hiệu ứng khi nhấn */
.nav-link:active {
    transform: scale(0.92); /* chữ + nền nhỏ lại */
}

/* =============================
   Main
============================= */

main {
    flex: 1; /* Cho phép main tự động co giãn để chiếm không gian trống */
}

main.image {
    width: 700px; /* Chiều rộng cố định, tối ưu cho blog */
    /*margin: 0 auto;*/
    margin: 20px auto;  /* cách lề trên dưới 20px, căn giữa ngang */
    padding: 20px;
    background-color: #f5f5f5;
    background-image: url('/images/flower1.11.png'); /* Hoa 8 cánh - Nhọn - Có nụ */
    background-size: cover;
    background-position: bottom right;
    background-repeat: no-repeat;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #eee;
    font-family: Bellota, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

main.image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2); /* Lớp trắng bán trong suốt */
    z-index: 1;
}

main.image > * {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

    main.image1 {
        background-image: url('/images/flower1.2.png'); /* Hoa 8 cánh - Tròn - Không nụ */
    }
    
    main.image2 {
        background-image: url('/images/flower1.41.png'); /* Hoa 8 cánh - Tròn - Có nụ */
    }
    
    main.image3 {
        background-image: url('/images/flower1.5.png'); /* Hoa 8 cánh - Nhọn - Có nụ */
    }
    
    main.image4 {
        background-image: url('/images/flower1.3.png'); /* Hoa 5 cánh - Tròn - Không nụ */
    }

main h2 {
    font-size: 24px;
    margin: 0 0 15px;
    text-align: center;
    font-weight: bold;
}

main img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    object-fit: contain;
}

main p {
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: justify;
    font-size: 18px;
    margin-bottom: 15px;
    padding-left: 10px; /* Lề trái 50px */
}

/* =============================
   Footer
============================= */

footer {
    background: #333;
    color: white;
    width: 100%;
    max-width: 100vw;
    text-align: center;
    padding: 10px;
    margin-top: auto;
}

/* =============================
   a
============================= */

a {
    display: inline-block; /* cho transform hoạt động */
    transition: transform 0.1s ease-in-out; /* mượt khi nhấn */
    -webkit-tap-highlight-color: transparent; /* bỏ highlight khi chạm trên mobile */
}

a:active {
    transform: scale(0.92); /* co chữ + nền */
}

a:link {
    color: #7971EA; /*#8756A9;*/
    background-color: transparent;
    text-decoration: none;
}

a:hover {
    color: #7971EA; /* Màu sẽ thay đổi thành đỏ khi di chuột */
    text-decoration: underline; /* Sẽ gạch chân khi di chuột */
    transition: color 0.3s ease; /* Áp dụng hiệu ứng chuyển tiếp */
}

a:visited {
    color: #7971EA;
    background-color: transparent;
    text-decoration: none;
}

a img {
  border-radius: 50%; /* hoặc 10px tuỳ bạn */
  display: block;     /* tránh inline-gap */
}

a:active img {
  opacity: 0.7;  /* hiệu ứng nhấn giữ lại cảm giác click, không bị nền vuông */
}

/* =============================
   Highlight
============================= */

.highlight1 {
    background-color: #A8A4F2; /* Purple nhạt hơn*/
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
}

.highlight2 {
    background-color: #D6D3F9; /* Purple rất nhạt*/
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
}

.highlight3 {
    background-color: #f3f3f3; /* Grey rất nhạt*/
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
}

/* =============================
   Quote
============================= */

.quote {
    border-left: 6px solid #7971EA;
    /*background-color: #f3f3f3;8*/
    padding: 15px;
    padding: 12px 16px
}

/* =============================
   Branding (Logo)
============================= */

.branding {
    display: flex;
    display: inline-block; /* cho transform hoạt động */
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s ease-in-out; /* mượt khi nhấn */
}
    
.branding img {
    height: 50px; /* Điều chỉnh kích thước logo */
    width: auto; /* Chiều rộng sẽ tự động điều chỉnh để giữ tỷ lệ */
    border-radius: 100%;
    background-color: transparent;
    -webkit-tap-highlight-color: transparent; /* iOS Safari & Chrome */
    -webkit-focus-ring-color: transparent;    /* Safari */
    border: none;
    outline: none;
}

.branding:active {
    transform: scale(0.92); /* chữ + nền nhỏ lại */
}

/* =============================
   Paragraph
============================= */

p {
  font-family: 'Bellota Text', sans-serif;
}

p.text-indent {
    text-indent: 2em;
}

p.text-align {
    font-size: 14px;
    /*text-align: right;*/
    font-weight: normal;
    margin-bottom: 50px; /* hoặc một giá trị khác phù hợp hơn */
}

p.last-of-type {
    margin-bottom: 50px; /* hoặc một giá trị khác phù hợp hơn */
}

p.last-text-indent {
    margin-bottom: 50px;
    text-indent: 2em;
}

p.first-of-type {
    margin-top: 50px; /* hoặc một giá trị khác phù hợp hơn */
}

p.first-of-type-center {
    margin-top: 50px; /* hoặc một giá trị khác phù hợp hơn */
    text-align: center;
}

p.last-first-of-type {
    margin-bottom: 50px;
    margin-top: 50px;
    color: #7971EA;
}

/* =============================
   h1, h2
============================= */

h1.last-first-of-type {
    margin-bottom: 50px;
    margin-top: 50px;
    text-align: center;
}

h2.last-of-type {
    margin-bottom: 50px; /* hoặc một giá trị khác phù hợp hơn */
}

h2.last-first-of-type {
    margin-bottom: 50px;
    margin-top: 50px;
}

/* =============================
   ul
============================= */

ul {
  font-family: 'Bellota Text', sans-serif;
  padding-left: 50px; /* Thêm khoảng đệm 20px ở lề trái */
}

ul li {
    padding-bottom: 10px; /* Thêm khoảng đệm 10px bên dưới */
}

li.last-of-type {
    margin-bottom: 50px; /* hoặc một giá trị khác phù hợp hơn */
}

/* =============================
   Utilities
============================= */

.list-square {
    list-style-type:square;
}

.font-normal {
  font-weight: normal;
}

/* =============================
   Back to Top Button
============================= */

.back-to-top {
    position: fixed;
    bottom: 20px;
    left: calc(50% - 350px - 14px); /* thò ra ngoài 15px */
    margin-bottom: 120px; /* cách footer 20px */
    background-image: url('/images/bee1.png');
    background-color: transparent;
    /* background-color: #7971EA; Màu tím hoa cà */
    -webkit-tap-highlight-color: transparent; /* iOS Safari & Chrome */
    -webkit-focus-ring-color: transparent;    /* Safari */
    color:  white;
    border: none;
    outline: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.3; /* Làm nút mờ đi một chút */
    /*visibility: hidden;*/
    transition: opacity 0.3s ease-in-out; /*visibility 0.3s;*/
    transition: transform 0.1s ease-in-out; /* mượt khi nhấn */
    background-size: cover;
    z-index: 99;
}

.back-to-top.show {
    opacity: 0.3;
    visibility: visible;
}

.back-to-top:hover {
    opacity: 1;
}

.back-to-top:active {
    background-color: transparent;
    outline: none; /* Xóa bỏ đường viền nổi bật (outline) */
    transform: scale(0.92); /* chữ + nền nhỏ lại */
}

.back-to-top:focus {
    outline: none;
}

/* =============================
    Mobile (Responsive)
============================= */

        @media screen and (max-width: 768px) {
            
            /* =============================
            Header (Mobile)
            ============================= */
            
            header {
                padding: 10px;
            }

            .branding {
                flex-direction: column;
                gap: 5px;
            }

            header img {
                max-width: 80px;
            }

            header h1 {
                font-size: 20px;
            }

            /* =============================
            Nav (Mobile)
            ============================= */
            
            /*nav {
                flex-direction: column;
                gap: 10px;
            }*/

            nav a {
                font-size: 18px; /*14px;*/
            }

            /* =============================
            Main (Mobile)
            ============================= */
            
            main.image {
                width: 100%;
                max-width: 100vw;
                /*margin: 0;*/
                margin: 20px auto;  /* cách lề trên dưới 20px, căn giữa ngang */
                padding: 15px;
                box-shadow: none;
                border: none;
                overflow-x: hidden;
                background-image: url('/images/flower1.11.png'); /* Hoa 8 cánh - Nhọn - Có nụ */
                background-size: cover;
                background-position: bottom right;
                background-repeat: no-repeat;
            }

            main.image::before {
                background: rgba(255, 255, 255, 0.2);
            }
            
                main.image1 {
                    background-image: url('/images/flower1.2.png'); /* Hoa 8 cánh - Tròn - Không nụ */
                }
            
                main.image2 {
                    background-image: url('/images/flower1.41.png'); /* Hoa 8 cánh - Tròn - Có nụ */
                }
            
                main.image3 {
                    background-image: url('/images/flower1.5.png'); /* Hoa 8 cánh - Nhọn - Có nụ */
                }
            
                main.image4 {
                    background-image: url('/images/flower1.3.png'); /* Hoa 5 cánh - Tròn - Không nụ */
                }
            
            main h2 {
                font-size: 24px;
            }

            main img {
                width: 100%;
                max-width: 100%;
                height: auto;
                /*margin: 0 auto 15px;*/
                object-fit: contain;
            }

            main p {
                font-size: 18px;
                line-height: 1.4;
                text-align: justify;
                padding-left: 10px; /* Lề trái 50px */
            }

            nav ul li {
                display: inline; /* Đặt các mục nằm trên cùng một dòng */
                margin: 0 0px; /* Thêm khoảng cách giữa các mục margin: 0 10px; */
            }

            /* =============================
            ul (Mobile)
            ============================= */
            
            ul li {
                padding-bottom: 10px; /* Thêm khoảng đệm 10px bên dưới */
            }

            ul {
                padding-left: 50px; /* Thêm khoảng đệm 20px ở lề trái */
            }
        }

        /* =============================
            Mobile (Back to Top Button)
        ============================= */

        @media screen and (max-width: 768px) {
            header {
                flex-direction: column;
                justify-content: center;
                text-align: center;
            }
            .logo-container {
                justify-content: center;
            }
            .back-to-top {
                width: 40px;
                height: 40px;
                font-size: 20px;
                bottom: 20px;
                left: -12px; /* lấn ra ngoài màn hình 12px */
                background-color: transparent;
                -webkit-tap-highlight-color: transparent; /* iOS Safari & Chrome */
                -webkit-focus-ring-color: transparent;    /* Safari */
                border: none;
                outline: none;
                transition: opacity 0.3s ease-in-out; /*visibility 0.3s;*/
                transition: transform 0.1s ease-in-out; /* mượt khi nhấn */
            }
            .back-to-top.show {
                opacity: 0.3;
                visibility: visible;
            }
            .back-to-top:hover {
                opacity: 1;
            }
            .back-to-top:active {
                background-color: transparent;
                outline: none; /* Xóa bỏ đường viền nổi bật (outline) */
                transform: scale(0.92); /* chữ + nền nhỏ lại */
            }
            /* Ẩn đường viền nổi bật khi dùng phím Tab */
            .back-to-top:focus {
                outline: none;
            }
        }