/*
Theme Name: Rou Light
Theme URI: https://example.com/
Author: AI Assistant
Description: A fast, ultra-clean, minimal light theme inspired by editorial sites like Rou.ro.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: rou-light
*/

/* ==========================================================================
   1. DESIGN TOKENS (VARIABLES)
   ========================================================================== */
:root {
  --bg-main: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a; /* Sharp, high-contrast dark slate */
  --text-muted: #64748b;   /* Muted gray */
  --border-color: #e2e8f0; /* Crisp divider line */
  --accent-color: #0f172a;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width-content: 720px;
  --max-width-site: 1140px;
  --radius: 6px;
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

/* Screen reader text helper */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   3. STYLISH HEADER & RESPONSIVE MOBILE NAVIGATION
   ========================================================================== */
.site-header {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.site-title a {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-title a::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--text-primary);
  border-radius: 2px;
}

/* DESKTOP MENU STYLES */
.main-navigation ul,
.main-navigation div > ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.main-navigation li {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.main-navigation > ul > li > a,
.main-navigation > div > ul > li > a {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-navigation > ul > li:hover > a,
.main-navigation > div > ul > li.current-menu-item > a {
  background-color: var(--text-primary);
  color: #ffffff;
}

.main-navigation li.menu-item-has-children > a::after {
  content: '▾';
  font-size: 0.7rem;
  opacity: 0.6;
}

/* DESKTOP DARK SUBMENU CARD */
.main-navigation ul.sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #0f172a;
  border-radius: 8px;
  padding: 0.5rem;
  margin: 0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.main-navigation ul.sub-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}

.main-navigation li.menu-item-has-children:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.main-navigation ul.sub-menu a {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  border-radius: 5px;
  transition: all 0.15s ease;
}

.main-navigation ul.sub-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding-left: 1.15rem;
}

/* HAMBURGER BUTTON (Hidden on Desktop) */
.menu-toggle {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.menu-toggle .hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.2s ease;
}

/* Animated "X" when Mobile Menu is Active */
.menu-toggle.is-active .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-toggle.is-active .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-active .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   MOBILE & TABLET BREAKPOINT (FIXED SCROLL & COMPACT SIZE)
   ========================================================================== */
@media (max-width: 768px) {
  /* Compact mobile header bar */
  .header-container {
    padding: 0.75rem 1rem;
  }

  .site-title a {
    font-size: 1.15rem;
  }

  .menu-toggle {
    display: flex;
    padding: 0.45rem 0.6rem;
  }

  /* Fixed Scrollable Mobile Drawer */
  .main-navigation {
    display: none;
    position: fixed; /* Binds menu to screen viewport */
    top: 54px;      /* Anchors right under the compact header */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100vh - 54px); /* Restrain to available screen height */
    overflow-y: auto;               /* ENABLES VERTICAL SCROLLING */
    -webkit-overflow-scrolling: touch;
    background: var(--bg-main);
    padding: 0.85rem 1rem 2rem 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
  }

  /* Active State */
  .main-navigation.is-active {
    display: block;
  }

  /* Compact Menu Links */
  .main-navigation ul,
  .main-navigation div > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem; /* Reduced gap */
  }

  .main-navigation > ul > li > a,
  .main-navigation > div > ul > li > a {
    width: 100%;
    justify-content: space-between;
    padding: 0.55rem 0.85rem; /* Reduced padding */
    font-size: 0.82rem;        /* Sleek, smaller font size */
    border-radius: 5px;
  }

  /* Compact Mobile Submenus */
  .main-navigation ul.sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-top: 0.2rem;
    margin-bottom: 0.35rem;
    padding: 0.25rem;
    border-radius: 5px;
  }

  .main-navigation ul.sub-menu a {
    color: var(--text-primary);
    padding: 0.45rem 0.75rem; /* Compact sub-menu height */
    font-size: 0.8rem;
  }

  .main-navigation ul.sub-menu a:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
    padding-left: 0.75rem;
  }
}
/* ==========================================================================
   4. LAYOUT & ROUNDED ARTICLE BOXES (LIST / GRID)
   ========================================================================== */
.site-main {
  max-width: var(--max-width-site);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Individual Rounded Article Box */
.post-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px; /* Smooth rounded shape */
  padding: 1.25rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Card Hover Elevation */
.post-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.08);
}

.post-card .post-thumbnail {
  margin-bottom: 1rem;
  border-radius: 8px; /* Matching rounded corners for thumbnail */
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-secondary);
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.03);
}

.post-card .entry-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card .entry-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.6rem 0;
  letter-spacing: -0.02em;
}

.post-card .entry-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}


/* ==========================================================================
   5. WORDPRESS PAGINATION (STYLING FIX)
   ========================================================================== */
.navigation.pagination {
  margin-top: 4rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.navigation.pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.navigation.pagination a.page-numbers:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.navigation.pagination .page-numbers.current {
  background-color: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.navigation.pagination .page-numbers.dots {
  border: none;
  background: transparent;
}

/* ==========================================================================
   6. SINGLE POST WITH FADE BACKGROUND & BORDER
   ========================================================================== */
.single-post-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

/* Single Article Card Box */
.single-post-container article {
  /* Subtle fade gradient from top soft slate to pure white */
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 400px);
  border: 1px solid var(--border-color);
  border-radius: 16px; /* Smooth outer rounded corners */
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

.single .entry-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.entry-content p {
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .single-post-container article {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .entry-header h1 {
    font-size: 1.85rem;
  }
}

/* ==========================================================================
   7. FOOTER & RESPONSIVE
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 5rem;
  padding: 3rem 1.5rem;
  background-color: var(--bg-secondary);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1.25rem;
  }
  .entry-header h1 {
    font-size: 2rem;
  }
}