/* ============================================================
   MIRROR DIARIES — GLOBAL CSS
   Header + Footer styles that load on EVERY page
   TheMirrorDiaries.com
============================================================ */

/* ── ANNOUNCEMENT BAR ──────────────────────────────────── */
#md-ann-bar {
  background: #4A1C14;
  color: rgba(255,255,255,0.88);
  text-align: center;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.4;
}
#md-ann-bar a {
  color: #F5C4B0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s;
}
#md-ann-bar a:hover { color: #ffffff; }

/* ── HEADER ─────────────────────────────────────────────── */
#md-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(253,250,248,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #EAD8D0;
  transition: box-shadow 0.3s;
}
#md-header.md-scrolled {
  box-shadow: 0 2px 24px rgba(28,17,16,0.09);
}

.md-hdr-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 40px;
  height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

/* ── LOGO ───────────────────────────────────────────────── */
.md-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.md-logo-mark {
  width: 34px;
  height: 42px;
  flex-shrink: 0;
  transition: transform 0.3s;
}
.md-logo:hover .md-logo-mark { transform: scale(1.06); }
.md-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.md-logo-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  color: #1C1110;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
  display: block;
}
.md-logo-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #C4856A;
  font-weight: 400;
  white-space: nowrap;
  display: block;
}

/* ── PRIMARY NAV ────────────────────────────────────────── */
#md-nav { display: flex; justify-content: center; }
.md-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}
.md-nav-list > li { position: relative; }

.md-nav-a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 18px;
  height: 74px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #1C1110;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}
.md-nav-a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: #C4856A;
  transform: scaleX(0);
  transition: transform 0.3s;
}
.md-nav-a:hover { color: #C4856A; }
.md-nav-a:hover::after,
.md-nav-a:focus::after { transform: scaleX(1); }

/* Active page indicator */
.current-menu-item .md-nav-a,
.current-page-ancestor .md-nav-a { color: #C4856A; }
.current-menu-item .md-nav-a::after,
.current-page-ancestor .md-nav-a::after { transform: scaleX(1); }

.md-chevron {
  font-size: 13px;
  color: #C4856A;
  transition: transform 0.25s;
  line-height: 1;
}
.md-has-sub:hover .md-chevron,
.md-has-sub:focus-within .md-chevron { transform: rotate(180deg); }

/* ── DROPDOWN ───────────────────────────────────────────── */
.md-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 210px;
  background: #FFFFFF;
  border: 1px solid #EAD8D0;
  border-top: 2.5px solid #C4856A;
  box-shadow: 0 8px 40px rgba(76,28,20,0.13);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
  z-index: 99999;
}
.md-has-sub:hover .md-dropdown,
.md-has-sub:focus-within .md-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.md-dropdown li { margin: 0; padding: 0; }
.md-dropdown a {
  display: block;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1C1110;
  text-decoration: none;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
  transition: all 0.18s;
}
.md-dropdown a:hover {
  background: #F5EBE6;
  color: #7C3B2A;
  border-left-color: #C4856A;
  padding-left: 24px;
}

/* ── HEADER RIGHT ACTIONS ───────────────────────────────── */
.md-hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.md-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid transparent;
  color: #1C1110;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.md-icon-btn:hover {
  background: #F5EBE6;
  border-color: #EAD8D0;
  color: #C4856A;
}
.md-hdr-cta {
  background: #7C3B2A;
  color: #FFFFFF !important;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.22s;
  white-space: nowrap;
}
.md-hdr-cta:hover {
  background: #4A1C14;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(76,28,20,0.25);
}

/* ── MOBILE TOGGLE ──────────────────────────────────────── */
.md-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
}
.md-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #1C1110;
  transition: all 0.3s;
  transform-origin: center;
}
.md-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.md-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.md-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE OVERLAY ─────────────────────────────────────── */
#md-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s;
}
#md-overlay.show { opacity: 1; pointer-events: all; }

/* ── MOBILE DRAWER ──────────────────────────────────────── */
#md-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(340px, 100vw);
  height: 100dvh;
  background: #FDFAF8;
  z-index: 99998;
  padding: 20px 28px 40px;
  overflow-y: auto;
  transition: right 0.38s cubic-bezier(0.77,0,0.175,1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 48px rgba(0,0,0,0.12);
}
#md-drawer.open { right: 0; }

.md-drawer-close {
  align-self: flex-end;
  width: 40px;
  height: 40px;
  background: #F5EBE6;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1C1110;
  margin-bottom: 20px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.md-drawer-close:hover { background: #EAD8D0; }

.md-drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 20px;
  border-bottom: 1px solid #EAD8D0;
  margin-bottom: 8px;
}
.md-drawer-brand .md-logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #1C1110;
  display: block;
}
.md-drawer-brand .md-logo-tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #C4856A;
  font-family: 'DM Sans', sans-serif;
  display: block;
}

.md-drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.md-drawer-list li { border-bottom: 1px solid #EAD8D0; }
.md-drawer-list a {
  display: block;
  padding: 15px 0;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 400;
  color: #1C1110;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}
.md-drawer-list a:hover { color: #C4856A; padding-left: 8px; }

/* ── FOOTER ─────────────────────────────────────────────── */
#md-footer {
  background: #1C1110;
  margin-top: auto;
}

.md-ft-top {
  max-width: 1380px;
  margin: 0 auto;
  padding: 68px 40px 52px;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr;
  gap: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.md-ft-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 18px;
}
.md-ft-logo-mark { width: 30px; height: 38px; flex-shrink: 0; }
.md-ft-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  display: block;
  line-height: 1.1;
}
.md-ft-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #C4856A;
  display: block;
  margin-top: 2px;
}
.md-ft-about {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14.5px;
  color: rgba(255,255,255,0.42);
  line-height: 1.78;
  margin-bottom: 22px;
  max-width: 275px;
}
.md-ft-socials { display: flex; gap: 8px; }
.md-soc {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.42);
  text-decoration: none;
  transition: all 0.2s;
}
.md-soc:hover {
  background: #C4856A;
  border-color: #C4856A;
  color: #FFFFFF;
  transform: translateY(-2px);
}
.md-ft-col-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  font-weight: 500;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.md-ft-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.md-ft-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}
.md-ft-links a:hover { color: #C4856A; padding-left: 5px; }

.md-ft-bottom {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.md-ft-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.03em;
  margin: 0;
}
.md-ft-copy a { color: rgba(255,255,255,0.38); text-decoration: none; }
.md-ft-copy a:hover { color: #C4856A; }
.md-ft-legal {
  display: flex;
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.md-ft-legal a {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.22);
  text-decoration: none;
  transition: color 0.2s;
}
.md-ft-legal a:hover { color: #C4856A; }

/* ── RESPONSIVE HEADER / FOOTER ─────────────────────────── */
@media (max-width: 1100px) {
  .md-ft-top { grid-template-columns: 1fr 1fr 1fr; }
  .md-ft-brand { grid-column: span 3; }
}

@media (max-width: 900px) {
  .md-hdr-inner { padding: 0 20px; gap: 16px; }
  #md-nav { display: none; }
  .md-hdr-cta { display: none; }
  .md-toggle { display: flex; }
}

@media (max-width: 640px) {
  .md-ft-top { grid-template-columns: 1fr 1fr; padding: 44px 20px 36px; gap: 28px; }
  .md-ft-brand { grid-column: span 2; }
  .md-ft-bottom { padding: 16px 20px; flex-direction: column; text-align: center; gap: 10px; }
  .md-ft-legal { justify-content: center; flex-wrap: wrap; gap: 14px; }
  #md-ann-bar { font-size: 11px; padding: 8px 16px; }
}

@media (max-width: 400px) {
  .md-ft-top { grid-template-columns: 1fr; }
  .md-ft-brand { grid-column: 1; }
}
