/* Zero-DB Engine (ZDB) Theme Stylesheet - FAIE org ar */

:root {
  --primary: #0066cc;
  --primary-dark: #004488;
  --secondary: #0055bb;
  --accent: #b45309;
  --text-dark: #0f172a;
  --text-muted: #334155;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #cbd5e1;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
}

/* Accessibility Focus Ring for Keyboard & Screen Readers */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #0066cc !important;
  outline-offset: 2px !important;
}

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

a.btn, button, .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

a:hover, a:focus, a:active {
  color: var(--primary);
  text-decoration: none;
}

.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

@media (min-width: 1600px) {
  .container {
    max-width: 1540px;
  }
}

@media (min-width: 1800px) {
  .container {
    max-width: 1680px;
  }
}

/* Native ZDB Preloader (Preloader Plus) */
.zdb-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease-out;
}

.zdb-preloader-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.zdb-preloader-logo {
  max-height: 90px;
  width: auto;
  animation: pulse 1.5s infinite ease-in-out;
}

.zdb-spinner {
  width: 45px;
  height: 45px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.96); }
}

/* Floating Scroll to Top Button */
.zdb-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zdb-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.zdb-scroll-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
}

/* Header Styles */
.site-header {
  background-color: var(--bg-white);
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
}

.site-brand {
  display: flex;
  align-items: center;
}

.site-brand img {
  height: 55px;
  width: auto;
}

/* Navigation - Touch Target & Wrap Protection */
.main-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 8px;
}

.main-nav a {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
  display: inline-block;
  transition: background-color 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
}

/* 100% Full-Width Edge-to-Edge Pro Hero Slider */
.hero-slider-section.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.zdb-slider-wrapper {
  position: relative;
  width: 100%;
  height: 580px;
  min-height: 65vh;
  border-radius: 0; /* Full Edge-to-Edge */
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.zdb-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.zdb-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease-in-out, visibility 0.7s ease-in-out;
}

.zdb-slide.active {
  opacity: 1;
  visibility: visible;
}

.zdb-slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform 7s ease;
}

.zdb-slide.active .zdb-slide-bg {
  transform: scale(1.06);
}

.zdb-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(7, 37, 59, 0.94) 0%, rgba(7, 37, 59, 0.68) 55%, rgba(0, 0, 0, 0.25) 100%);
}

.zdb-slide-container {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 5;
}

.zdb-slide-content {
  max-width: 720px;
  padding: 0 20px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.zdb-slide-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.zdb-slide-badge {
  display: inline-block;
  background: var(--accent);
  color: #000000;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 20px;
}

.zdb-slide-date {
  font-size: 0.9rem;
  opacity: 0.9;
}

.zdb-slide-title {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 18px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.zdb-slide-title a {
  color: #ffffff;
}

.zdb-slide-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.zdb-slide-excerpt {
  font-size: 1.08rem;
  opacity: 0.94;
  margin-bottom: 28px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.zdb-btn-slide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 30px;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.45);
  transition: background 0.2s, transform 0.2s;
}

.zdb-btn-slide:hover {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Control Pill Container Aligned with Container */
.zdb-controls-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.zdb-slider-controls-bar {
  margin-left: auto;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.zdb-slider-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}

.zdb-slider-btn:hover {
  color: var(--accent);
  transform: scale(1.2);
}

.zdb-slider-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zdb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.zdb-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* Content Layout */
.layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 50px;
}

.full-width {
  grid-template-columns: 1fr;
}

/* Section Title */
.section-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Post Cards */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.post-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.post-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background-color: #eee;
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--text-dark);
}

.post-card-title a:hover {
  color: var(--secondary);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  flex: 1;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, color 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background-color: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background-color: #0077ee;
  text-decoration: none;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-white);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 25px;
}

.widget-title {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.widget-list {
  list-style: none;
}

.widget-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.widget-list li:last-child {
  border-bottom: none;
}

.widget-list a {
  font-size: 0.92rem;
  color: var(--text-dark);
}

/* Page / Article View */
.article-container {
  background: var(--bg-white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.article-title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 15px;
  line-height: 1.25;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.article-featured-img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 25px;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #333;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 15px 0;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content h2, .article-content h3, .article-content h4 {
  color: var(--primary);
  margin: 1.5rem 0 1rem 0;
}

.article-content ul, .article-content ol {
  margin-left: 20px;
  margin-bottom: 1.25rem;
}

/* Contact Form */
.contact-form {
  background: var(--bg-white);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(50, 140, 193, 0.2);
}

.vh-trap {
  display: none !important;
}

.alert {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 25px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Footer */
.site-footer {
  background-color: var(--primary-dark);
  color: #dbe4ee;
  padding: 50px 0 25px 0;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 35px;
  margin-bottom: 35px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  display: inline-block;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: #b0c4de;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #8fa3be;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .header-container {
    flex-wrap: wrap;
    gap: 15px;
  }
}

@media (max-width: 900px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .zdb-slider-wrapper {
    height: 440px;
    min-height: 440px;
  }
  .zdb-slide-title {
    font-size: 1.5rem;
  }
  .zdb-controls-container {
    bottom: 20px;
  }
  .zdb-slider-controls-bar {
    margin: 0 auto;
  }
  .nav-toggle {
    display: block;
  }
  .main-nav {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 10px;
  }
  .article-container {
    padding: 20px;
  }
}

/* --- WCAG 2.1 AA Accessibility Features --- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 10px;
  background: #0066cc;
  color: white;
  padding: 10px 18px;
  z-index: 1000;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

.a11y-bar {
  background: #07253b;
  color: #f8fafc;
  padding: 6px 20px;
  font-size: 0.8rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}
.a11y-btn {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.a11y-btn:hover {
  background: #0066cc;
}

/* High Contrast Mode */
body.high-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}
body.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}
body.high-contrast .site-header,
body.high-contrast .card,
body.high-contrast .article-container,
body.high-contrast .sidebar-widget {
  background: #121212 !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

/* Font Size Modifiers */
body.font-lg { font-size: 1.15rem !important; }
body.font-xl { font-size: 1.3rem !important; }

/* Editorial Cards & Grids: Absolute suppression of browser default blue underlines */
.horiz-sub-item,
.horiz-sub-item:hover,
.horiz-sub-item:focus,
.horiz-sub-item:active,
.horiz-sub-item:visited,
.horiz-sub-item *,
.horiz-main-post a,
.horiz-main-post a:hover,
.horiz-main-post a:focus,
.horiz-main-post a:active,
.horiz-main-post a:visited,
.magazine-featured-grid a,
.magazine-featured-grid a:hover,
.cat-badge-line,
.cat-badge-line *,
.sub-cat-badge,
.sub-cat-badge *,
.horiz-sub-title,
.horiz-main-title a,
.horiz-sub-meta,
.card a,
.card a:hover {
  text-decoration: none !important;
}
