/* ============================================
   COMPANY.CSS - EngSiteTools Company Styles
   ============================================ */

/* --- News Cards Rail --- */
.news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.news-head h2 {
  margin: 0;
}

.news-more {
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  opacity: 0.8;
}

.news-more:hover {
  text-decoration: underline;
}

.news-rail-wrap {
  position: relative;
}

.news-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.news-rail::-webkit-scrollbar {
  height: 8px;
}

@media (min-width: 900px) {
  .news-rail {
    grid-auto-columns: calc((100% - 48px) / 3);
  }
}

/* Entire card is a link with hover/focus animations */
.news-card {
  scroll-snap-align: start;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.news-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.news-img {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e8e8, #d5d5d5);
}

@media (prefers-color-scheme: dark) {
  .news-img {
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
  }
}

.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

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

.news-body {
  padding: 14px 16px 18px;
  display: grid;
  gap: 8px;
}

.news-title {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.news-date {
  font-size: 12px;
  color: var(--muted);
}

.news-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.news-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.1);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .news-arrow {
    border-color: rgba(255,255,255,.15);
  }
}

.news-arrow:hover {
  background: rgba(0,0,0,.05);
}

@media (prefers-color-scheme: dark) {
  .news-arrow:hover {
    background: rgba(255,255,255,.06);
  }
}

.news-card:hover .news-arrow {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Rail nav buttons */
.news-rail-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.news-rail-btn {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,.5);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin: 0 6px;
  backdrop-filter: blur(4px);
}

@media (max-width: 899px) {
  .news-rail-nav {
    display: none;
  }
}

/* Header & Hero */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-section h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.logo-section img {
  height: 50px;
  width: auto;
  display: block;
}

.logo-section a {
  display: block;
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo-section a:hover {
  opacity: 0.8;
}

nav {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 0.8;
}

.nav-cta {
  background: var(--brand);
  padding: 8px 20px;
  border-radius: 6px;
  color: white !important;
}

.nav-cta:hover {
  background: #3367d6;
  opacity: 1 !important;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 20px;
  margin: 0 0 32px;
  opacity: 0.95;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 36px;
  }
  
  .hero p {
    font-size: 18px;
  }
  
  .header-content {
    justify-content: center;
  }
}

/* Enhanced Footer */
footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 60px 20px 30px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

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

.footer-section li {
  margin-bottom: 10px;
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-brand p {
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.footer-bottom a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin: 0 8px;
}

.footer-bottom a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Accessibility Controls */
.accessibility-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 10001; /* Higher than cookie banner (10000) */
  display: grid;
  place-items: center;
  font-size: 24px;
  transition: all 0.3s;
}

.accessibility-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.accessibility-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  padding: 20px;
  width: 280px;
  z-index: 10001; /* Higher than cookie banner (10000) */
  display: none;
}

.accessibility-panel.open {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accessibility-panel h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

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

.control-group:last-child {
  margin-bottom: 0;
}

.control-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.button-group {
  display: flex;
  gap: 8px;
}

.control-btn {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.control-btn:hover {
  background: var(--brand);
  color: white;
}

.control-btn.active {
  background: var(--brand);
  color: white;
}

@media (max-width: 768px) {
  .accessibility-panel {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    max-width: 320px;
  }
  
  .accessibility-btn {
    right: 12px;
    bottom: 12px;
  }
}

/* Google Translate Widget Styling */
#google_translate_element {
  padding: 0;
}

.goog-te-banner-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

.goog-te-gadget {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px;
}

.goog-te-gadget-simple {
  background-color: var(--card-bg) !important;
  border: 2px solid var(--brand) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  color: var(--text) !important;
  transition: all 0.2s;
}

.goog-te-gadget-simple:hover {
  background-color: var(--brand) !important;
  color: white !important;
}

.goog-te-gadget-simple .goog-te-menu-value span {
  color: var(--text) !important;
}

.goog-te-gadget-simple:hover .goog-te-menu-value span {
  color: white !important;
}

.goog-te-menu-frame {
  max-height: 400px !important;
}

/* Hide Google Translate branding */
.goog-logo-link {
  display: none !important;
}

.goog-te-gadget span {
  display: none !important;
}

.goog-te-gadget-simple .goog-te-menu-value span:first-child {
  display: inline !important;
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 10000;
  display: none;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  /* Ensure cookie banner doesn't overlap with accessibility button */
  padding-right: 100px; /* Add padding to leave space for accessibility button */
}

.cookie-consent-banner.show {
  display: block !important;
  transform: translateY(0) !important;
}

@media (prefers-color-scheme: dark) {
  .cookie-consent-banner {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }
}

@media (max-width: 768px) {
  .cookie-consent-banner {
    /* On mobile, reduce padding to fit smaller screens */
    padding-right: 20px;
  }
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-consent-text {
  flex: 1;
  min-width: 250px;
}

.cookie-consent-text h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.cookie-consent-text p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.cookie-consent-text a {
  color: var(--brand);
  text-decoration: underline;
}

.cookie-consent-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: var(--brand);
  color: white;
}

.cookie-btn-primary:hover {
  background: #3367d6;
  transform: translateY(-1px);
}

.cookie-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--brand);
}

.cookie-btn-secondary:hover {
  background: var(--brand);
  color: white;
}

.cookie-btn-link {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  padding: 10px 12px;
}

.cookie-btn-link:hover {
  color: var(--text);
}

.cookie-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.cookie-close-btn:hover {
  color: var(--text);
}

.cookie-preferences-panel {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .cookie-preferences-panel {
    border-top-color: rgba(255, 255, 255, 0.1);
  }
}

.cookie-pref-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  .cookie-pref-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
}

.cookie-pref-item:last-child {
  border-bottom: none;
}

.cookie-pref-label {
  flex: 1;
}

.cookie-pref-label strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.cookie-pref-label p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.cookie-pref-toggle {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-pref-toggle.active {
  background: var(--brand);
}

.cookie-pref-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-pref-toggle.active::after {
  transform: translateX(20px);
}

.cookie-pref-toggle input[type="checkbox"] {
  display: none;
}

@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cookie-consent-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .cookie-btn {
    width: 100%;
  }
}

