/*
Theme Name: Logica Theme
Author: Agilino
Version: 1.0
*/

/* === Global Settings === */
:root{
  --navy:#20243B;
  --accent:#CA7E52;
  --ice: #E6EEF3;
  --navy-dark: #1A1F33; /* đậm hơn ~7% */
}

/* buttons */
.btn{ display:inline-flex; align-items:center; justify-content:center; height:40px; padding:0 16px; border-radius:6px; font-weight:500; }
.btn-primary{ background:var(--navy); color:#fff; }
.btn-primary:hover{ filter:brightness(1.08); } /* “hơi sáng hơn”, không cần shadow */ 
.btn-secondary{ background:#fff; border:1px solid var(--navy); color:var(--navy); }
.btn-secondary:hover{ border-color:#111827; }

/* nav underline active (PDF) */
.nav-link{ position:relative; padding:6px 0; }
.nav-link.is-active::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-6px;
  height:2px; background:var(--accent);
}

body {
  font-family: var(--font-nunitosans);
  background-color: var(--color-light);
  color: var(--color-black);
  overflow-x: hidden;
}

body.blog,
body.single-post,
body.archive,
body.category {
  background-color: white;
}

a {
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

/* === Header Styles === */
#header {
  position: relative;
  width: 100%;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
}

/* Nhóm 1: LOGO */
.logo-container img {
  max-height: 60px;
  width: auto;
}

/* Nhóm 2: MENU + NGÔN NGỮ (Căn phải) */

/* Dropdown ngôn ngữ */
.lang-switcher {
  position: relative;
}

.lang-switcher .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  border: 1px solid var(--color-secondary);
  /* background-color: var(--color-white); */
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.lang-switcher .dropdown-toggle:hover {
  border-color: var(--color-primary);
}

.lang-switcher .dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 140px;
  border-radius: 8px;
  background-color: var(--color-white);
  display: none;
  z-index: 1000;
}

.lang-switcher .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-white);
  transition: background 0.2s ease-in-out;
}

.lang-switcher .dropdown-menu a:hover {
  background-color: var(--color-light);
}

/* Hiển thị dropdown khi click */
.lang-switcher.open .dropdown-menu {
  display: block;
}

/* Nhóm 3: NÚT CONTACT */
.navbar-right {
  display: flex;
}

.btn-custom {
  padding: 8px 16px;
  font-size: 14px;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 30px;
  transition: all 0.3s ease-in-out;
}

.btn-custom:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* =========================
   DESKTOP TOP NAV ONLY
   ========================= */
.logica-nav a,
.logica-nav-mobile a{
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
}

.logica-nav a.logica-active,
.logica-nav-mobile a.logica-active{
  border-bottom-color:#CA7E52;
}


/* =========================
   MOBILE PANEL NAV ONLY
   ========================= */
/* Mobile menu item layout */
.logica-nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 18px; /* khoảng cách như design premium */
}

/* Link */
.logica-nav-mobile a {
  display: inline-block;      /* quan trọng: để width theo content */
  width: fit-content;         /* underline fit chữ */
  padding: 6px 0;             /* không tạo block to, nhìn gọn */
  font-size: 26px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #fff;
  opacity: .92;
}

.logica-nav-mobile a:hover { opacity: 1; }

/* Underline only on text span, fit đúng chữ */
.logica-nav-mobile a .nav-txt {
  display: inline-block;
  padding-bottom: 10px;
  border-bottom: 2px solid transparent;
}

.logica-nav-mobile a.logica-active .nav-txt {
  border-bottom-color: #CA7E52;
}



/*--------------------contact form 7----------------------------*/
/* Khoảng cách khối trong form */
.cf7-wrapper .wpcf7-form { margin: 0; }
.cf7-wrapper .wpcf7-form > * + * { margin-top: 1rem; }

/* 2 cột cho từng hàng field */
.cf7-wrapper .cf7-row {
  display: grid;
  grid-template-columns: 1fr; /* mobile: 1 cột */
  gap: 1rem;
}
/* >= 640px: 2 cột */
@media (min-width: 640px) {
  .cf7-wrapper .cf7-row { grid-template-columns: 1fr 1fr; }
}

/* Đảm bảo item full width */
.cf7-wrapper .cf7-row > * { width: 100%; }
.cf7-wrapper .wpcf7-form-control-wrap { display: block; width: 100%; }

/* ===== Base: Input / Textarea (desktop & chung) ===== */
.cf7-wrapper .wpcf7-form-control,
.cf7-wrapper input[type="text"],
.cf7-wrapper input[type="email"],
.cf7-wrapper input[type="tel"],
.cf7-wrapper select,
.cf7-wrapper textarea {
  width: 100%;
  background: #fff;
  color: #172554; /* blue-950 */
  border: 1px solid rgba(217, 119, 6, .3); /* amber-600 */
  border-radius: 0.4rem; /* bo vừa phải */
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  box-shadow: 0 1px 0 rgba(17,24,39,.03), 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
}

.cf7-wrapper ::placeholder { color: #9CA3AF; } /* gray-400 */

.cf7-wrapper .wpcf7-form-control:focus,
.cf7-wrapper input[type="text"]:focus,
.cf7-wrapper input[type="email"]:focus,
.cf7-wrapper input[type="tel"]:focus,
.cf7-wrapper select:focus,
.cf7-wrapper textarea:focus {
  border-color: rgba(217, 119, 6, .4);           /* amber-600 */
  box-shadow: 0 0 0 1px rgba(253, 230, 138, .9); /* ring-1 amber-200 */
}

/* Textarea thấp */
.cf7-wrapper textarea,
.cf7-wrapper .cf7-textarea { min-height: 50px; }

/* Nút gửi */
.cf7-wrapper .wpcf7-submit,
.cf7-wrapper input[type="submit"],
.cf7-wrapper button[type="submit"] {
  display: inline-block;   /* tránh full width */
  width: auto;             /* chỉ rộng theo nội dung */
  background-image: linear-gradient(90deg, #f59e0b, #b45309);
  color: #fff;
  padding: 0.7rem 2rem;  /* padding nhỏ hơn nữa */
  border-radius: 0.5rem;   /* bo vừa phải */
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17,24,39,.06), 0 6px 16px rgba(0,0,0,.08);
  transition: filter .15s, transform .02s;
}
.cf7-wrapper .wpcf7-submit:hover { filter: brightness(1.05); }
.cf7-wrapper .wpcf7-submit:active { transform: translateY(1px); }

/* Tip lỗi */
.cf7-wrapper .wpcf7-not-valid-tip { color: #dc2626; font-size: .875rem; margin-top: .25rem; }

/* Ẩn message mặc định + spinner */
.cf7-wrapper .wpcf7-response-output { display: none !important; }
.cf7-wrapper .wpcf7-spinner { display: none !important; }

/* ===== Mobile OVERRIDES ===== */
@media (max-width: 640px) {
  .cf7-wrapper .wpcf7-form-control,
  .cf7-wrapper input[type="text"],
  .cf7-wrapper input[type="email"],
  .cf7-wrapper input[type="tel"],
  .cf7-wrapper select,
  .cf7-wrapper textarea {
    font-size: 0.875rem;      /* ~14px */
    padding: 0.6rem 0.8rem;   /* gọn hơn */
  }

  .cf7-wrapper .wpcf7-submit {
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
  }
}

/* =============================== */
.justify-text {
  text-align: justify;
}
@media screen and (max-width: 768px) {
  .responsive-bg {
    background-size: contain !important;
    background-position: top center !important;
  }
}

@media screen and (min-width: 769px) {
  .responsive-bg {
    background-size: cover !important;
    background-position: center center !important;
  }
}

/* Tailwind không có, cần thêm vào global styles hoặc inline */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ========= TOC ========= */
/* Làm icon 3 gạch có cùng màu với title */
#toc svg rect { fill: #2563eb; } /* blue-600 */
/* Ẩn bullet mặc định (phòng khi theme ép) */
#toc ul { list-style: none; margin: 0; padding: 0; }

/* Bù trừ khi cuộn đến anchor từ TOC */
h2[id^="toc-"], h3[id^="toc-"], h4[id^="toc-"] {
  scroll-margin-top: var(--toc-offset, 120px); /* mặc định 120px */
}

/* Nếu có admin bar WordPress trên desktop (32px) */
body.admin-bar h2[id^="toc-"],
body.admin-bar h3[id^="toc-"],
body.admin-bar h4[id^="toc-"] {
  scroll-margin-top: calc(var(--toc-offset, 120px) + 32px);
}

/* Admin bar trên mobile (46px) – tuỳ theme có thể không cần */
@media (max-width: 782px) {
  body.admin-bar h2[id^="toc-"],
  body.admin-bar h3[id^="toc-"],
  body.admin-bar h4[id^="toc-"] {
    scroll-margin-top: calc(var(--toc-offset, 120px) + 46px);
  }
}

/*phone shake*/
/* Pulse chính */
@keyframes callPulseStrong {
  0%, 100% {
    transform: scale(1);
    color: #d97706; /* Amber-600 */
  }
  50% {
    transform: scale(1.28);
    color: #f59e0b; /* Amber-500 sáng hơn */
  }
}

/* Sóng ripple xung quanh */
@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.phone-call-strong {
  animation: callPulseStrong 1.4s infinite ease-in-out,
             ripple 1.4s infinite ease-out;
  border-radius: 50%;
  padding: 6px;
}

/* Hover hiệu ứng rõ hơn */
.phone-call-strong:hover {
  transform: scale(1.35);
  color: #ffb300;
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.7);
  cursor: pointer;
}

/* Knowledge carousel UI */
.logica-carousel { scroll-snap-type: x mandatory; }
.logica-slide { scroll-snap-align: start; }

/* Hide native scrollbar (cross-browser) */
[data-carousel-track]::-webkit-scrollbar { display: none; }
[data-carousel-track] { scrollbar-width: none; -ms-overflow-style: none; }

/* Progress bar */
.logica-scrollbar {
  height: 4px;
  background-color: #e5e7eb; /* slate-200 */
  border-radius: 9999px;
  overflow: hidden;
}

.logica-scrollbar > span {
  display: block;
  height: 100%;
  width: 100%;
  background-color: #CA7E52; /* accent */
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 120ms linear;
}

/* =========================
   Social icons in footer 
   ========================= */
.logica-social__list{
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.logica-social__link{
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: rgba(255,255,255,.72);            /* grey 200–300 feel */
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

.logica-social__link:hover{
  color: rgba(255,255,255,.90);            /* hover sáng nhẹ */
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.16);
  transform: translateY(-1px);
}

/* SR only helper */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   LOGICA FOOTER
   ========================= */
.logica-footer{
  background: #20243B;
  color: rgba(255,255,255,.74);
}

.logica-footer__inner{
  padding-top: 64px;
  padding-bottom: 64px;
}

/* Grid giữ nguyên */
.logica-footer__grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 40px;
  align-items: start;
}

/* Titles */
.logica-footer__title{
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: .15px;
  color: rgba(255,255,255,.90);
}

/* Lists */
.logica-footer ul{
  list-style: none;
  padding: 0;
  margin: 0;
}
.logica-footer li{
  margin: 0 0 10px;
  font-size: 15.5px;
  line-height: 1.6;
}

/* Links */
.logica-footer a{
  text-decoration: none;
  color: rgba(255,255,255,.68);
  transition: color .15s ease, text-decoration-color .15s ease;
}
.logica-footer a:hover{
  color: rgba(255,255,255,.88);
}

/* ACTIVE underline */
.logica-footer a[aria-current="page"],
.logica-footer .current-menu-item > a,
.logica-footer .current_page_item > a{
  color: rgba(255,255,255,.92);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: #CA7E52;
}

/* NOT active parent */
.logica-footer .current-menu-parent > a,
.logica-footer .current-menu-ancestor > a{
  text-decoration: none;
}

/* Social */
.logica-footer__social{ margin-top: 14px; }

.logica-social__list{
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.logica-social__link{
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.logica-social__link:hover{
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.16);
  transform: translateY(-1px);
}
.logica-social svg{ width: 18px; height: 18px; }

/* Assistant */
.logica-footer__assistant{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #E6F2F7;
  color: #20243B !important;
  font-size: 14.5px;
  font-weight: 650;
  border: 1px solid rgba(255,255,255,.12);
}
.logica-footer__assistant:hover{ filter: brightness(.98); }

/* Divider */
.logica-footer__divider{
  height: 1px;
  background: rgba(255,255,255,.10);
}

/* IMPORTANT:
   Không set max-width/margin/padding-x ở meta nữa
   => Tailwind max-w-7xl mx-auto px-6 lg:px-12 sẽ hoạt động
*/
.logica-footer__meta{
  padding-top: 20px;
  padding-bottom: 40px;

  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  color: rgba(255,255,255,.58);
}

.logica-footer__meta-title{
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.82);
}
.logica-footer__meta-text{
  font-size: 13px;
  line-height: 1.55;
}

.logica-footer__meta-center{ text-align: center; }
.logica-footer__meta-right{ text-align: right; }

/* Responsive */
@media (max-width: 1024px){
  .logica-footer__inner{
    padding-top: 56px;
    padding-bottom: 56px;
  }
  .logica-footer__grid{
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 28px;
  }
  .logica-footer__meta{
    padding-top: 18px;
    padding-bottom: 30px;
    grid-template-columns: 1fr;
  }
  .logica-footer__meta-center,
  .logica-footer__meta-right{ text-align: left; }
}

@media (max-width: 640px){
  .logica-footer__inner{
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .logica-footer__grid{ grid-template-columns: 1fr; }
  .logica-footer__meta{
    padding-top: 16px;
    padding-bottom: 24px;
  }
}
