/*
Theme Name: Validly Corporate
Theme URI: http://example.com/validly-corporate
Author: Gemini CLI
Description: A premium corporate theme with dark blue aesthetics and list layout.
Version: 1.0
Text Domain: validly-corporate
*/

:root {
  /* Modern Corporate Blue Palette */
  --brand-dark: #0f172a; /* Slate 900 (Header/Footer) */
  --brand-primary: #3b82f6; /* Blue 500 (Accents/Buttons) */
  --brand-hover: #2563eb; /* Blue 600 */
  --brand-surface: #ffffff; /* White */

  --bg-body: #f8fafc; /* Slate 50 */
  --text-main: #334155; /* Slate 700 */
  --text-dark: #1e293b; /* Slate 800 */
  --text-light: #94a3b8; /* Slate 400 */

  --border-light: #e2e8f0; /* Slate 200 */

  --container-width: 1000px; /* Sligthly narrower for reading focus */
  --font-main: "Manrope", system-ui, -apple-system, sans-serif;

  --shadow-soft:
    0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-hover:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7; /* Softer reading experience */
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--brand-hover);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
header.site-header,
header#masthead,
header:not(.entry-header):not(.page-header) {
  background: var(--brand-dark);
  color: var(--brand-surface);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.entry-header,
.page-header {
  background: transparent !important;
  padding: 0;
  margin-bottom: 20px;
}

.header-inner {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px; /* Wider container specifically for header */
  margin: 0 auto;
  padding: 0 40px;
}

.logo a {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-surface);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.site-title {
  color: var(--brand-surface);
}

/* Strictly limit logo size to prevent header overflow */
.logo img,
.custom-logo {
  max-height: 45px;
  width: auto;
  display: block;
  object-fit: contain;
}

.custom-logo-link {
  display: flex;
  align-items: center;
}

.nav-search-wrapper {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-grow: 1; /* Allow wrapper to take space */
  justify-content: flex-end;
}

/* Navigation */
nav {
    margin-right: 20px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px; /* More gap between items */
    white-space: nowrap; /* Keep items in one line */
}

nav a, 
.desktop-nav a,
.desktop-nav ul li a {
    color: #cbd5e1 !important; /* Slate 300 */
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
}

nav a:hover,
.desktop-nav a:hover {
    color: var(--brand-surface) !important;
}

/* Mobile Sidebar Links */
.mobile-sidebar a,
.mobile-sidebar ul li a { 
    color: #ffffff !important; 
    display: block; 
    padding: 15px 0; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    text-decoration: none;
}

.mobile-sidebar a:hover {
    color: var(--brand-primary) !important;
}
/* Search Bar (Modern Pill) */
.search-form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1); /* Glassy on dark */
  border-radius: 50px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.search-form:focus-within {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.search-input {
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 0.9rem;
  width: 150px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
}

/* --- Main Content (List Layout) --- */
main {
  padding: 100px 0 80px 0; /* Increased top padding for better spacing from sticky header */
}

.home main {
  padding-top: 120px; /* Even more spacing on home page as requested */
}

.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 80px; /* Space between posts */
}

/* Highlighted Post Card Style */
.post-card {
  background: var(--brand-surface); /* White background */
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;

  display: grid;
  grid-template-columns: 400px 1fr; /* Fixed Image Width | Content */
  min-height: 250px;
  align-items: center;
  gap: 0; /* Gap managed by padding now */
  border: none;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.post-thumbnail {
  height: 100%; /* Fill card height */
  width: 100%;
  overflow: hidden;
  border-radius: 0; /* Let the card handle rounding */
  background-color: #f1f5f9; /* Fallback color */
  display: flex;
}

.post-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

.post-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important; /* Force cover to fill space */
  object-position: center;
  transition: transform 0.5s ease;
  display: block;
}

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

.post-content-wrapper {
  padding: 40px; /* Internal padding for white background */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card h2,
.entry-title,
.page-title {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--brand-dark); /* Dark Slate 900 */
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: transparent !important;
  padding: 0;
  box-shadow: none !important;
}

.post-card h2 a {
  color: var(--brand-dark) !important;
  background: transparent !important;
}

/* Ensure images scroll normally and remove any potential fixed backgrounds */
.post-thumbnail img,
.single-post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  background-attachment: scroll !important; /* Force scroll behavior */
}

.single-post-thumbnail {
  margin-bottom: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.post-card .excerpt {
  color: var(--text-main);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.btn-read-more {
  align-self: flex-start;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-read-more:hover {
  gap: 12px;
}

/* --- Pagination --- */
.pagination {
  margin-top: 80px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.pagination .nav-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.nav-links a,
.nav-links span {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  color: var(--brand-dark);
  font-weight: 700;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  text-decoration: none;
}

.nav-links .current,
.nav-links a:hover {
  background: var(--brand-dark);
  color: white;
  border-color: var(--brand-dark);
}

/* --- Mobile / Responsive --- */
@media (max-width: 1024px) {
  .nav-search-wrapper nav,
  .search-form {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .post-card {
    grid-template-columns: 300px 1fr;
  }
}

@media (max-width: 768px) {
  .post-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
  }

  .post-thumbnail {
    height: 200px;
  }
  .post-card h2 {
    font-size: 1.6rem;
  }
  .post-card:hover {
    transform: translateY(-5px);
  }
}

/* Mobile Sidebar */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--brand-dark);
  z-index: 10000;
  padding: 100px 40px;
  transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
}
.mobile-sidebar.is-open {
  right: 0;
}

.close-menu {
  position: absolute;
  top: 25px;
  right: 25px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.close-menu:hover {
  opacity: 0.7;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Single & Page Containers with Background */
.page-container,
.single-post-container {
  max-width: 900px;
  padding: 60px;
  background: var(--brand-surface); /* White background */
  margin-top: 40px;
  margin-bottom: 80px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.entry-content {
  font-size: 1.15rem;
  color: var(--text-dark);
}
.entry-content ul, 
.entry-content ol {
  margin-left: 30px;
  margin-bottom: 30px;
  margin-top: 10px;
}
.entry-content li {
  margin-bottom: 12px;
  padding-left: 5px;
}
.entry-content h2 {
  margin-top: 2em;
  color: var(--brand-dark);
}

footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--brand-primary);
}

.footer-copy {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }
}
