/*
 * Infogeeksecurity styles
 *
 * This stylesheet defines the typographic scale, colours, layout and
 * responsive behaviour for the Infogeeksecurity blog. It uses CSS
 * variables for easy theme adjustments and leverages flexbox and grid
 * layouts to create a modern, responsive interface. Accessibility
 * considerations such as focus outlines, high‑contrast colours and
 * screen‑reader‑only text are included throughout.
 */

/* Global reset and box sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Colour palette */
:root {
  --primary-color: #2a5ea7;
  --primary-dark: #224e88;
  --secondary-color: #2f80ed;
  --accent-color: #f5a623;
  --text-color: #2d3748;
  --light-bg: #fdfdfd;
  --muted-bg: #f4f5f7;
  --border-color: #e2e8f0;
  --focus-color: #ffbf47;
}

/* Utility classes */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}
.btn-secondary {
  background-color: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}
.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--primary-color);
  color: #fff;
}

/* Navigation styles */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
.brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
}
.menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.menu a:hover,
.menu a:focus,
.menu a.active {
  color: var(--primary-color);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-color);
  border-radius: 2px;
  position: relative;
  transition: transform 0.3s ease;
}
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle .hamburger::before {
  top: -7px;
}
.nav-toggle .hamburger::after {
  top: 7px;
}

/* Mobile navigation */
@media (max-width: 768px) {
  .menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    width: 200px;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .menu.open {
    max-height: 300px;
  }
  .menu li {
    border-bottom: 1px solid var(--border-color);
  }
  .nav-toggle {
    display: block;
  }
  .navbar {
    padding: 1rem;
  }
}

/* Hero section */
.hero {
  position: relative;
  background-image: url('assets/abstract_network.png');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-overlay {
  background-color: rgba(0, 0, 0, 0.55);
  padding: 2rem;
  text-align: center;
  max-width: 800px;
  border-radius: 8px;
}

/* Special hero variations */
.about-hero .hero-overlay,
.contact-hero .hero-overlay {
  background-color: rgba(0, 0, 0, 0.6);
}
.about-hero {
  background-image: none;
  background-color: var(--primary-dark);
  color: #ffffff;
}
.contact-hero {
  background-image: none;
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Story section */
.story {
  padding: 4rem 1rem;
  background-color: var(--light-bg);
}
.story h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--primary-dark);
}
.story .container {
  max-width: 800px;
  margin: 0 auto;
}
.story p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Values section overrides reused feature grid for about page */
.values {
  padding: 4rem 1rem;
  background-color: var(--muted-bg);
  color: var(--text-color);
}
.values h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--primary-dark);
}

/* Contact section */
.contact-section {
  padding: 4rem 1rem;
  background-color: var(--light-bg);
}
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.contact-details h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}
.contact-details p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.contact-form-wrapper h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}
.contact-form-wrapper form {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}
.hero .btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Features */
.features {
  padding: 4rem 1rem;
  background-color: var(--muted-bg);
}
.features h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--primary-dark);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.feature-item {
  background-color: #fff;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}
.feature-item:hover {
  transform: translateY(-4px);
}
.feature-item img {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
}
.feature-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}
.feature-item p {
  font-size: 0.95rem;
  color: var(--text-color);
}

/* Latest posts */
.latest-posts {
  padding: 4rem 1rem;
  background-color: var(--light-bg);
}
.latest-posts h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--primary-dark);
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.post-card {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
}
.post-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background-color: var(--muted-bg);
  padding: 1rem;
}
.post-content {
  padding: 1rem 1.25rem;
  flex: 1;
}
.post-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}
.post-content p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}
.post-content time {
  font-size: 0.8rem;
  color: #6b7280;
}

.more-posts-link {
  text-align: center;
  margin-top: 2rem;
}

/* Importance section */
.importance {
  padding: 4rem 1rem;
  background-color: var(--muted-bg);
  color: var(--text-color);
}
.importance h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--primary-dark);
}
.importance p {
  max-width: 800px;
  margin: 0.5rem auto;
  font-size: 1rem;
  line-height: 1.6;
}
.importance sup {
  font-size: 0.7rem;
}

/* Subscribe section */
.subscribe {
  padding: 4rem 1rem;
  background-color: var(--primary-color);
  color: #ffffff;
  text-align: center;
}
.subscribe h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.subscribe p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.subscribe-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 240px;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border: none;
  font-size: 1rem;
}
.subscribe-form button {
  border: none;
  cursor: pointer;
}
.form-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #f5f5f5;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer */
.site-footer {
  background-color: var(--primary-dark);
  color: #ffffff;
  padding: 2rem 1rem;
}

/* Blog listing page */
.blog-intro {
  padding: 4rem 1rem;
  background-color: var(--light-bg);
  text-align: center;
}
.blog-intro .container {
  max-width: 800px;
  margin: 0 auto;
}
.blog-intro h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}
.blog-intro p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: var(--text-color);
  line-height: 1.6;
}
.search-form {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 500px;
  margin: 0 auto;
}
.search-form input[type="search"] {
  flex: 1 1 250px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}
.blog-list {
  padding: 4rem 1rem;
  background-color: var(--light-bg);
}

/* Blog article pages */
.article-content {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 1rem;
  line-height: 1.7;
  color: var(--text-color);
}
.post-header {
  margin-bottom: 2rem;
  text-align: left;
}
.post-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.post-meta {
  font-size: 0.9rem;
  color: #6b7280;
}
.article-content section {
  margin-bottom: 2rem;
}
.article-content section h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}
.article-content ul {
  list-style: disc;
  padding-left: 1.5rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}
.article-content strong {
  color: var(--primary-dark);
}
.post-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}
.post-footer p a {
  color: var(--primary-color);
  text-decoration: none;
}
.post-footer p a:hover {
  text-decoration: underline;
}
.footnotes {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #6b7280;
}
.footnotes h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--primary-dark);
}
.footnotes ol {
  padding-left: 1.5rem;
}
.footnotes li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 1.5rem auto;
}
.footer-brand h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.footer-brand p {
  font-size: 0.9rem;
}
.footer-nav ul {
  list-style: none;
  padding: 0;
}
.footer-nav li + li {
  margin-top: 0.5rem;
}
.footer-nav a {
  color: #ffffff;
  text-decoration: none;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-contact h4 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.footer-contact p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: #cbd5e0;
}

/* Responsive typography */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .features h2,
  .latest-posts h2,
  .importance h2,
  .subscribe h2 {
    font-size: 1.75rem;
  }
}