/**
 * Phoenix Creations: Core Stylesheet
 * Replaces the bloated legacy Nicepage CSS with an optimized, lightweight CSS design framework.
 */

/* ==========================================================================
   1. Design Variables & Global Resets
   ========================================================================== */
:root {
  --primary-color: #848b92;
  --secondary-color: #2d3136;
  --bg-light: #fafbfc;
  --text-dark: #2d3136;
  --text-muted: #616e7c;
  --border-color: #cbd5e1;
  --font-display: 'Expletus Sans', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.u-body {
  font-family: var(--font-display);
  background-color: #ffffff;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Base typography pairings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--secondary-color);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   2. Layout Utilities
   ========================================================================== */
.u-clearfix::after {
  content: "";
  clear: both;
  display: table;
}

.u-sheet {
  position: relative;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Responsive utility widths */
@media (max-width: 1200px) {
  .u-sheet { max-width: 960px; }
}
@media (max-width: 991px) {
  .u-sheet { max-width: 720px; }
}
@media (max-width: 767px) {
  .u-sheet { max-width: 540px; padding: 0 15px; }
}

/* ==========================================================================
   3. Header & Elegant Navigation Menu Styles
   ========================================================================== */
header.u-header {
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  z-index: 1000;
}

header.u-sticky {
  position: sticky;
  top: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

header.u-header .u-sheet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 85px;
}

/* Logo Sizing & Placement */
header.u-header a img {
  height: 52px;
  width: auto;
  transition: transform 0.2s ease;
}
header.u-header a img:hover {
  transform: scale(1.03);
}

/* Navigation layout classes */
.u-menu {
  display: flex;
  align-items: center;
}

.u-nav-container {
  display: block;
}

.u-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.u-nav-item {
  position: relative;
}

.u-nav-link {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary-color);
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s, color 0.2s;
}

.u-nav-link:hover,
.u-nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Dropdown Menu Popup (Desktop) */
.u-nav-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  min-width: 200px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
  z-index: 1010;
}

.u-nav-item:hover .u-nav-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.u-nav-popup .u-nav-item {
  width: 100%;
}

.u-nav-popup .u-nav-link {
  padding: 8px 18px;
  border-bottom: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dark);
}

.u-nav-popup .u-nav-link:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
}

/* Mobile Hamburger Menu icon toggler style */
.menu-collapse {
  display: none;
}

.menu-collapse a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--secondary-color);
}

.menu-collapse svg {
  width: 24px;
  height: 24px;
}

/* Off-canvas collapse slide menu overlay panel (Mobile View) */
.u-nav-container-collapse {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100%;
  background: #0f172a; /* Premium Dark Navy */
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 80px 30px;
}

.u-nav-container-collapse.open {
  right: 0;
  display: block;
}

.u-menu-close {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.u-menu-close::before,
.u-menu-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
}

.u-menu-close::before {
  transform: rotate(45deg);
}

.u-menu-close::after {
  transform: rotate(-45deg);
}

.u-nav-container-collapse .u-nav {
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.u-nav-container-collapse .u-nav-link {
  color: #f1f5f9;
  font-size: 1.15rem;
  border-bottom: none;
  font-weight: 600;
  text-transform: capitalize;
  width: 100%;
  padding: 6px 0;
}

.u-nav-container-collapse .u-nav-link:hover {
  color: var(--primary-color);
}

.u-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99990;
}

.u-menu-overlay.open {
  display: block;
}

/* Hide desktop elements and show burger collapse on smaller screens */
@media (max-width: 991px) {
  .u-nav-container {
    display: none;
  }
  .menu-collapse {
    display: block;
  }
}

/* ==========================================================================
   4. Footer Styles
   ========================================================================== */
footer.u-footer {
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 55px 0 40px;
  border-top: 1px solid #334155;
  text-align: center;
}

footer.u-footer .u-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.u-file-icon.u-icon img {
  transition: transform 0.2s;
}

.u-file-icon.u-icon img:hover {
  transform: translateY(-3px) scale(1.05);
}

footer.u-footer p {
  line-height: 1.7;
}

footer.u-footer p.u-text-palette-2-base {
  font-size: 0.95rem;
  font-weight: 500;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   5. Interactive Audio Player (Thoughts.mp3)
   ========================================================================== */
.u-audio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid #e2e8f0;
}

.player-play-btn {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background-color 0.2s;
}

.player-play-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

/* ==========================================================================
   6. RTL Symmetry Directives
   ========================================================================== */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] body {
  text-align: right;
}

/* Flip margins & absolute items in RTL context page flow */
html[dir="rtl"] .u-nav-popup {
  left: auto;
  right: 0;
}

html[dir="rtl"] .u-nav-container-collapse {
  right: auto;
  left: -100%;
}

html[dir="rtl"] .u-nav-container-collapse.open {
  left: 0;
  right: auto;
}

html[dir="rtl"] .u-menu-close {
  right: auto;
  left: 25px;
}

html[dir="rtl"] .menu-collapse {
  float: right;
}

/* Align text direction for forms inputs */
html[dir="rtl"] input,
html[dir="rtl"] textarea {
  text-align: right !important;
}

/* Responsive grid layout helpers */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}
