/* ==========================================================================
   Payslip Templates - Modern Stylesheet
   ========================================================================== */

:root {
  /* Color Palette */
  --primary-navy: #0f2744;
  --primary-slate: #1e293b;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-dark: #0f172a;
  --bg-subtle: #f1f5f9;
  
  /* Text Colors */
  --text-main: #334155;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --border-card: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  /* Layout & Typography */
  --container-width: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-main);
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  text-wrap: balance;
}

p {
  margin-top: 0;
  margin-bottom: 1.35rem;
  text-wrap: pretty;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--accent-blue-hover);
  text-decoration: underline;
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--accent-blue) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-navy);
  line-height: 1.15;
}

.brand-title a {
  color: var(--primary-navy);
  text-decoration: none;
}

.brand-title span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.brand-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Navigation Bar */
.main-nav-wrapper {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.1rem;
  color: var(--text-dark);
  font-size: 0.975rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-item:hover > .nav-link, .nav-link.active {
  color: var(--accent-blue);
  background-color: var(--accent-light);
  text-decoration: none;
}

.dropdown-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 290px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  z-index: 1100;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: block;
  padding: 0.6rem 0.85rem;
  color: var(--text-dark);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  transition: all 0.12s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-subtle);
  color: var(--accent-blue);
  text-decoration: none;
  padding-left: 1.1rem;
}

/* Desktop Hover */
@media (min-width: 961px) {
  .nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
  }
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 600;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content-wrapper {
  flex: 1 0 auto;
  padding: 2.5rem 0 4rem 0;
}

/* Breadcrumbs */
.breadcrumbs-nav {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.breadcrumbs-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs-item a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.breadcrumbs-separator {
  color: var(--border-card);
}

/* Article Card Surface */
.article-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.article-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--primary-navy);
  line-height: 1.25;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
  max-width: 78ch;
}

.article-body p {
  margin-bottom: 1.4rem;
}

.article-body h2 {
  font-size: 1.55rem;
  color: var(--primary-navy);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  position: relative;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent-blue);
}

.article-body h3 {
  font-size: 1.275rem;
  color: var(--primary-slate);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
}

.article-body h4 {
  font-size: 1.1rem;
  color: var(--primary-slate);
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.article-body ul, .article-body ol {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

/* Image float styling */
img[align="right"], .img-float-right {
  float: right;
  margin: 0.25rem 0 1.5rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Homepage Specific Modern Rows Layout
   ========================================================================== */

.hero-row {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.75rem 3rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.hero-header {
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary-navy);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-main);
}

/* Feature Grid Row */
.features-row {
  margin-bottom: 3rem;
}

.section-label {
  text-align: center;
  margin-bottom: 2rem;
}

.section-badge {
  display: inline-block;
  background-color: var(--accent-light);
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
}

.section-heading {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.feature-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-light);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.feature-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 0.75rem;
}

.feature-card-title a {
  color: var(--primary-navy);
  text-decoration: none;
}

.feature-card-title a:hover {
  color: var(--accent-blue);
}

.feature-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.feature-card-links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.feature-card-links li {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.feature-card-links a {
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feature-card-links a::before {
  content: "→";
  color: var(--accent-blue);
  font-weight: bold;
}

.feature-card-links a:hover {
  color: var(--accent-blue);
}

/* In-Depth Guide Row */
.guide-row {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.75rem 3rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
  flex-shrink: 0;
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 4rem 0 2rem 0;
  font-size: 0.95rem;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

.footer-col h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.footer-col p {
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 1rem;
  font-size: 0.925rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: none;
  padding-left: 0.25rem;
}

.footer-google-box {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.footer-google-box a {
  color: #60a5fa;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.footer-google-box a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin: 0.25rem 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 960px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 0.75rem 0.85rem;
    background-color: var(--bg-subtle);
    justify-content: space-between;
  }

  .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background-color: var(--bg-page);
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    animation: none;
  }

  .nav-item.is-open .dropdown-menu {
    display: block;
  }

  .article-card, .hero-row, .guide-row {
    padding: 1.75rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .article-title {
    font-size: 1.85rem;
  }

  img[align="right"], .img-float-right {
    float: none;
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }
  
  .brand-title span {
    display: block;
    font-size: 0.95rem;
  }

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