/* ================================
   FOOTER – NAVY GOLD THEME
================================ */

.cavalry-footer {
    background: #0A0F1F; /* น้ำเงินกรมท่าเข้ม */
    color: #D4AF37; /* ทองพรีเมียม */
    border-radius: 8px;
    margin-top: 40px;
    padding: 30px 20px;
    border-top: 2px solid rgba(212,175,55,0.35);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.6);
    font-family: "Sarabun", "Segoe UI", sans-serif;
}

/* Layout */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* ซ้าย – กลาง – ขวา */
    align-items: center;
}

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { 
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* ชิดขวาจริง */
}

/* Divider */
.footer-divider {
    margin: 8px 0;
    border-bottom: 1px solid rgba(212,175,55,0.35);
}

/* Links */
.cavalry-footer a {
    color: #F5D77A; /* ทองอ่อน */
    text-decoration: none;
    font-weight: 600;
}

.cavalry-footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* Icon */
.footer-icon {
    font-size: 1.2rem;
    margin-right: 4px;
}
.center-item {
    align-self: center; /* ทำให้เฉพาะรายการนี้อยู่กลาง */
    text-align: center;
}
.footer-db {
    display: block;
    margin-top: 6px;
    color: #F5D77A; /* ทองอ่อน */
    font-weight: 600;
    text-decoration: none;
}

.footer-db:hover {
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* ================================
   Responsive Footer
================================ */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr; /* ซ้าย + ขวา */
        row-gap: 20px;
    }

    .text-center {
        grid-column: 1 / span 2; /* ปุ่มกลับขึ้นบนอยู่กลางเต็มแถว */
        text-align: center;
    }

    .text-right {
        align-items: flex-end;
    }
}
/* ⭐ Mobile Landscape (มือถือเอียงจอ) */
@media (max-height: 500px) and (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: 1fr; /* ให้เรียงลงทั้งหมด */
        text-align: center;
        row-gap: 15px;
    }

    .text-left,
    .text-right {
        text-align: center;
        align-items: center;
    }

    .text-right {
        flex-direction: column;
    }

    .footer-divider {
        width: 60%;
        margin: 10px auto;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    .grid-3 {
        grid-template-columns: 1fr; /* เรียงลงทั้งหมด */
        text-align: center;
    }

    .text-left,
    .text-right {
        text-align: center;
        align-items: center;
    }

    .center-item {
        align-self: center;
    }
}
