/* ==========================================================================
   MEDIVH.GG - MASTER SHARED STYLESHEET (style.css)
   Contains: Global Resets, Background, Header Tier 1, Guide Buttons,
             Search Box, Card Hover Portal, and Site Footer.
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  color: #f3f4f6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Atmosphere */
body::before {
  content: "";
  position: fixed;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  background: 
    radial-gradient(circle at center, rgba(10, 13, 18, 0.25) 0%, rgba(9, 11, 16, 0.78) 100%),
    url('Assets/bg.webp') no-repeat center center;
  background-size: cover;
  filter: blur(12px) brightness(0.60);
  transform: scale(1.06);
  z-index: -1;
}

/* ==========================================================================
   STICKY HEADER (TIER 1: Title, Expansions, Nav, Search)
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 13, 20, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85);
  width: 100%;
}

/* Tier 1 Bar: Locked to exact same height, padding, and 2px border across all pages */
.header-top-wrap {
  width: 100%;
  border-bottom: 2px solid rgba(212, 163, 64, 0.4);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 40px;
  padding: 0 1.5rem;
  box-sizing: border-box;
  position: relative;
}

/* Site Title / Logo: High-Impact Chiseled Fantasy Brand */
.site-title {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 1.48rem;
  line-height: 1;
  position: relative;
  top: 2px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff5dc;
  text-shadow: 0 0 14px rgba(248, 205, 85, 0.28), 0 2px 8px rgba(0, 0, 0, 0.95);
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, text-shadow 0.15s ease;
}

.site-title:hover {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(248, 205, 85, 0.45), 0 2px 8px rgba(0, 0, 0, 0.95);
  opacity: 0.9;
  transform: scale(1.02);
}

/* Expansion Badges (Used in index.html Row 2) */
.exp-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid #2e3440;
  background: rgba(16, 20, 29, 0.85);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
  position: relative;
}

.exp-icon-link:hover {
  transform: translateY(-1px) scale(1.06);
  border-color: #f8cd55;
  filter: drop-shadow(0 0 8px rgba(248, 205, 85, 0.6));
}

.exp-icon-link.active {
  border: 1.5px solid #f8cd55;
  background: #0e121a;
  box-shadow: 0 0 10px rgba(248, 205, 85, 0.45);
}

.exp-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-icon-link[data-mode="all-standard"] {
  padding: 2px 5px;
}

.exp-icon-link[data-mode="all-standard"] .exp-icon-img {
  object-fit: contain;
}

.exp-icon-fallback {
  display: none;
  font-size: 0.65rem;
  font-weight: 900;
  color: #f8cd55;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.exp-divider {
  width: 1px;
  height: 16px;
  background: rgba(212, 163, 64, 0.35);
  margin: 0 0.15rem;
}

/* Header Top Right */
.header-top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Guide Buttons: Locked dead-center in the top bar across the entire site */
.guide-nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(26, 32, 46, 0.85);
  border: 1px solid #334155;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 0.80rem;
  font-weight: 800;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .header-guide-btn:hover {
    background: rgba(45, 55, 75, 0.95);
    border-color: #f8cd55;
    color: #f8cd55;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(248, 205, 85, 0.3);
  }
}

.header-guide-btn:focus {
  outline: none;
}

/* Active Button: Glowing Gold Border with Crisp Gold Text */
.header-guide-btn.active {
  background: rgba(248, 205, 85, 0.12);
  color: #f8cd55;
  border: 1.5px solid #f8cd55;
  box-shadow: 0 0 12px rgba(248, 205, 85, 0.35);
}

/* Search Box (28px height) */
.search-box-inner {
  position: relative;
  width: 220px;
}

.search-input {
  width: 100%;
  height: 28px;
  background: rgba(10, 13, 20, 0.85);
  border: 1px solid #334155;
  border-radius: 5px;
  padding: 0 0.75rem 0 1.9rem;
  color: #f3f4f6;
  font-size: 0.76rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: #f8cd55;
  box-shadow: 0 0 10px rgba(248, 205, 85, 0.35);
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.74rem;
  pointer-events: none;
}

/* ==========================================================================
   CARD HOVER PREVIEW PORTAL & COMMENT LINKS
   ========================================================================== */
.card-ref-link {
  color: #f8cd55;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline;
  vertical-align: baseline;
  padding: 0;
  margin: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card-ref-link:hover {
    color: #ffffff;
    background-color: rgba(248, 205, 85, 0.18);
    text-shadow: 0 0 6px rgba(248, 205, 85, 0.6);
  }
}

.portal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999998;
  display: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.portal-backdrop.active {
  display: block;
}

.card-hover-portal {
  position: fixed;
  display: none;
  width: 265px;
  max-height: calc(100vh - 20px);
  padding: 6px;
  background: rgba(10, 13, 20, 0.96);
  border: 2px solid #f8cd55;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95);
  z-index: 999999;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
}

.card-hover-portal img {
  width: 100%;
  max-height: calc(100vh - 36px);
  object-fit: contain;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* ==========================================================================
   RESPONSIVE HEADER - TABLET (769px to 1200px)
   ========================================================================== */
@media (max-width: 1200px) and (min-width: 769px) {
  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1.25rem;
    gap: 0.75rem;
    height: auto;
  }

  .site-title {
    font-size: 1.25rem;
    margin: 0;
    flex-shrink: 0;
  }

  .header-top-right {
    display: flex;
    align-items: center;
    gap: 0.50rem;
    flex-shrink: 0;
  }

  .header-guide-btn {
    height: 30px;
    padding: 0 0.55rem;
    font-size: 0.70rem;
  }

  .search-box-inner {
    width: 165px;
  }

  .search-input {
    height: 30px;
    font-size: 0.76rem;
    padding-left: 1.8rem;
  }

  .search-icon {
    font-size: 0.74rem;
    left: 0.55rem;
  }
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid rgba(212, 163, 64, 0.3);
  background: rgba(10, 13, 18, 0.98);
  padding: 0.95rem 1.25rem;
  text-align: center;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.45;
  margin-top: auto;
  width: 100%;
}

.footer-title {
  font-weight: 800;
  color: #f8cd55;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 0.2rem 0;
  font-size: 0.78rem;
}

.footer-disclaimer {
  max-width: 720px;
  margin: 0 auto;
}

/* ==========================================================================
   MASTER GUIDE PAGE STYLES (dust.html, packs.html, & 404.html)
   ========================================================================== */

/* Main Container */
.guide-container {
  max-width: 960px;
  margin: 2.5rem auto 4rem auto;
  padding: 0 1.5rem;
  flex: 1 0 auto;
  width: 100%;
}

/* Hero Banner */
.guide-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.guide-title {
  font-size: 2.3rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.6rem 0;
  line-height: 1.2;
}

/* Guide Section Cards */
.guide-card {
  background: rgba(16, 20, 29, 0.88);
  backdrop-filter: blur(10px);
  border: 1.5px solid #232a38;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease;
}

.guide-card:hover {
  border-color: #3b4559;
}

/* Guide Mobile Portrait (Under 768px) */
@media (max-width: 768px) {
  .header-top {
    height: auto;
  }

  body.guide-page header {
    border-bottom: 1px solid rgba(212, 163, 64, 0.25);
  }

  body.guide-page .header-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0.45rem 0.75rem;
    gap: 0.4rem;
  }

  body.guide-page .site-title {
    order: 1;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 0.8px;
    margin: 0;
    width: 100%;
    display: block;
  }

  body.guide-page .header-top-right {
    display: none;
  }

  body.guide-page .guide-nav-links {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    position: static;
    transform: none;
  }

  body.guide-page .header-guide-btn {
    flex: 1;
    max-width: 140px;
    height: 30px;
    font-size: 0.70rem;
    justify-content: center;
    padding: 0 0.4rem;
  }

  .guide-container {
    margin: 1.25rem auto 3rem auto;
    padding: 0 1rem;
  }

  .guide-title {
    font-size: 1.65rem;
  }

  .guide-card {
    padding: 1.15rem 1rem;
    margin-bottom: 1.2rem;
  }
}

/* Guide Mobile Landscape (Short Viewports / Sideways Phones) */
@media (orientation: landscape) and (max-height: 500px) {
  .header-top {
    height: auto;
  }

  body.guide-page .header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    padding: 0.35rem 0.85rem !important;
    gap: 0.75rem !important;
  }

  body.guide-page .site-title {
    font-size: 1.15rem !important;
    margin: 0 !important;
    width: auto !important;
    text-align: left !important;
  }

  body.guide-page .header-top-right {
    display: none !important;
  }

  body.guide-page .guide-nav-links {
    position: static !important;
    transform: none !important;
    width: auto !important;
    display: flex !important;
    gap: 0.40rem !important;
  }

  body.guide-page .header-guide-btn {
    height: 26px !important;
    font-size: 0.68rem !important;
    padding: 0 0.55rem !important;
    max-width: none !important;
    flex: none !important;
  }

  .guide-container {
    margin: 1rem auto 2.5rem auto !important;
    padding: 0 1rem !important;
  }

  .guide-hero {
    margin-bottom: 1.25rem !important;
  }

  .guide-title {
    font-size: 1.5rem !important;
  }
}