/* === Lê Mai Library — Shared CSS ===
   Single source of truth for header, footer, navigation, typography.
   Edit this file once → applies to all pages instantly. */

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

/* === BASE === */
body {
  background: #f7f3ec;
  color: #1f1812;
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.jp { font-family: 'Noto Serif JP', 'EB Garamond', serif; }
a { color: inherit; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
}

hr.divider {
  border: none;
  border-top: 1px solid #d8d0c4;
  margin: 0;
}

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 500; }

/* === SECTION + HEADING === */
section { padding: 56px 24px; }
h2 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0 0 32px;
  opacity: 1;
  line-height: 1.6;
}
h2 .en { opacity: 0.85; margin: 0 6px; }
h2 .jp {
  font-family: 'Noto Serif JP', serif;
  opacity: 0.7;
  margin-left: 4px;
  letter-spacing: 0.05em;
}
h2 .sep { opacity: 0.6; }

/* === BILINGUAL BLOCKS === */
.lang-vn { margin-bottom: 28px; }
.lang-en {
  opacity: 0.9;
  padding-top: 18px;
  border-top: 1px dotted #d8d0c4;
}
.lang-en::before {
  content: "EN";
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 0.7;
  margin-bottom: 12px;
}

/* === UTILITY BAR (top, dim, Lê Mai external link) === */
.utility-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 32px;
  border-bottom: 1px solid #e5dcce;
  background: rgba(31, 24, 18, 0.025);
}
.util-main {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.95;
  white-space: nowrap;
  transition: transform 0.22s ease-out;
}
.util-main:hover { transform: scale(1.05); }
.util-main img { height: 60px; width: auto; display: block; }
.util-main .goto {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-right: 12px;
}

/* === MAIN NAV (logo left, menu right) === */
nav.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  padding: 20px 32px;
  position: relative;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
nav.top a, nav.top .dropdown-toggle, nav.top .nav-home {
  text-decoration: none;
  opacity: 0.92;
  display: inline-block;
  transition: transform 0.22s ease-out;
}
nav.top a.current, nav.top .dropdown-toggle.current { opacity: 1; }
nav.top a:hover, nav.top .dropdown-toggle:hover,
nav.top .dropdown:hover .dropdown-toggle { transform: scale(1.08); }
nav.top .sep { margin: 0 14px; opacity: 0.55; }

/* Logo */
.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 1;
  transition: transform 0.22s ease-out;
}
.nav-logo:hover { transform: scale(1.03); }
.nav-logo img { height: 120px; width: auto; display: block; }

.nav-right { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; flex-wrap: wrap; }
.nav-menu .sep { margin: 0 14px; opacity: 0.55; }

/* Dropdown */
.dropdown { position: relative; display: inline-flex; align-items: center; }
.dropdown-toggle { cursor: pointer; user-select: none; }
.dropdown-toggle .caret {
  display: inline-block;
  margin-left: 3px;
  font-size: 0.9em;
  opacity: 0.85;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #f7f3ec;
  border: 1px solid #d8d0c4;
  padding: 8px 0;
  margin-top: 12px;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(31, 24, 18, 0.08);
  letter-spacing: 0.18em;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0.92;
  transition: transform 0.22s ease-out, background 0.15s;
}
.dropdown-menu a:hover {
  transform: scale(1.04);
  background: rgba(31, 24, 18, 0.05);
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  width: 22px;
  height: 16px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 1.2px;
  background: #1f1812;
  position: absolute;
  left: 0;
  transition: transform 0.25s, opacity 0.25s, top 0.25s;
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { top: 14px; }
.hamburger.open span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* === FOOTER === */
footer.site {
  text-align: center;
  padding: 72px 32px 64px;
  border-top: 1px solid #e5dcce;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
footer.site .footer-logo {
  display: inline-block;
  margin-bottom: 24px;
  opacity: 0.95;
  transition: transform 0.22s ease-out;
}
footer.site .footer-logo:hover { transform: scale(1.05); }
footer.site .footer-logo img {
  height: 224px;
  width: auto;
  display: block;
  max-width: 90vw;
}
footer.site .footer-links {
  margin-bottom: 16px;
  font-size: 12px;
}
footer.site .footer-links a {
  text-decoration: none;
  opacity: 0.88;
  transition: transform 0.22s ease-out;
  display: inline-block;
}
footer.site .footer-links a:hover { transform: scale(1.05); }
footer.site .footer-copy {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.24em;
}

/* === RESPONSIVE — Mobile === */
@media (max-width: 720px) {
  .utility-bar { padding: 7px 20px; }
  .util-main img { height: 44px; }
  nav.top { padding: 12px 20px; }
  .nav-logo img { height: 84px; }
  .hamburger { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f7f3ec;
    border-top: 1px solid #d8d0c4;
    border-bottom: 1px solid #d8d0c4;
    padding: 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(31, 24, 18, 0.06);
    font-size: 12px;
  }
  .nav-menu.open { display: flex; }
  .nav-menu .sep { display: none; }
  .nav-menu > a, .nav-menu > .dropdown {
    padding: 10px 0;
    width: 100%;
  }
  .nav-menu .dropdown {
    flex-direction: column;
    align-items: flex-start;
  }
  .dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    padding: 8px 0 0 16px;
    margin-top: 0;
    min-width: 0;
    background: transparent;
  }
  .dropdown.open .dropdown-menu { display: block; }
  .dropdown:hover .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu { display: block; }
  .dropdown-menu a { padding: 8px 0; white-space: normal; }
  footer.site { padding: 48px 24px 56px; }
  footer.site .footer-logo img { height: 168px; }
}

@media (max-width: 540px) {
  section { padding: 40px 20px; }
  .container { padding: 0 20px; }
}

/* Disable hover-show on touch devices */
@media (hover: none) {
  .dropdown:hover .dropdown-menu { display: none; }
  nav.top a:hover, nav.top .dropdown-toggle:hover { transform: none; }
}
