/* =========================================================
   Sunil Abraham Project
   ========================================================= */
/* Hide default GitHub Pages banner */
#banner, .page-header, .site-footer {
  display: none !important;
}

/* =========================================================
   Base Layout
   ========================================================= */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a1a1a;
  background: linear-gradient(180deg, #fdfdfd 0%, #f8fafc 100%);
  margin: 0 auto;
  padding: 0 1.5rem 0 1.5rem; /* Change 0.5rem to 0 */
  max-width: min(92%, 1280px); /* was 1000px; */
  line-height: 1.8;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================================
   Header (Enhanced Animated Gradient)
   ========================================================= */
.site-header {
  position: relative;
  overflow: hidden;
  text-align: center;
  margin: 0.2rem 0 0.8rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #eaecef;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

/* Brighter, balanced gradient */
background: linear-gradient(
  270deg,
  #e8f1ff,  /* light blue */
  #f5e8ff,  /* lavender */
  #fff0e8,  /* peach */
  #fff8e8,  /* soft yellow */
  #ffe8e8,  /* pale red */
  #e8fff0,  /* mint green */
  #e8f8ff   /* icy blue */
);

  background-size: 800% 800%;
  animation: headerGradient 20s ease infinite;
}

/* Keyframes for smooth looping color flow */
@keyframes headerGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* =========================================================
   Site Title Enhanced Animation (Accessible & Subtle)
   ========================================================= */
.site-header h1 {
  position: relative;
  display: inline-block;
  font-size: 2.6rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  background: linear-gradient(
    90deg,
    #0a2e57,
    #287c7c,
    #0a2e57
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    fadeUpTitle 1.2s ease-out,
    shimmerTitle 15s ease-in-out infinite;
}

/* Soft hover glow */
.site-header h1:hover {
  text-shadow: 0 0 8px rgba(40, 124, 124, 0.25);
  transform: translateY(-1px);
  transition: text-shadow 0.4s ease, transform 0.3s ease;
}

/* Fade-up on load */
@keyframes fadeUpTitle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slow gradient shimmer through the text */
@keyframes shimmerTitle {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

/* Respect reduced-motion user preferences */
@media (prefers-reduced-motion: reduce) {
  .site-header h1 {
    animation: fadeUpTitle 1.2s ease-out;
    background-position: center;
  }
}

/* =========================================================
   Site Description Animation (Subtle, Calm, Accessible)
   ========================================================= */
.site-header p {
  font-size: 1rem;
  color: #444;
  margin: 0;
  opacity: 0;
  letter-spacing: 0.2px;
  animation:
    fadeInDescription 1.4s ease-out 0.4s forwards,
    breatheDescription 10s ease-in-out 1.8s infinite;
}

/* Fade in with slight letter-spacing expansion */
@keyframes fadeInDescription {
  0% {
    opacity: 0;
    letter-spacing: 1.2px;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    letter-spacing: 0.2px;
    transform: translateY(0);
  }
}

/* Gentle breathing opacity cycle */
@keyframes breatheDescription {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.93;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .site-header p {
    animation: fadeInDescription 1.4s ease-out 0.4s forwards;
  }
}

/* =========================================================
   Navbar (Stylish Tabs)
   ========================================================= */
.navbar {
  background: linear-gradient(to bottom, #3b5998 0%, #2a3f72 100%);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  margin: 1.2rem 0 0.6rem;
  padding: 0;
  overflow: hidden;
  animation: slideDown 0.8s ease;
}

.navbar ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.navbar li {
  margin: 0;
  padding: 0;
}

.navbar a {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.4px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.navbar a:hover {
  background: linear-gradient(to bottom, #287c7c 0%, #1f5f5f 100%);
  color: #fff;
  transform: translateY(-2px);
}

.navbar a:focus {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.navbar a.active {
  background: linear-gradient(to bottom, #2f9e9e 0%, #237373 100%);
  color: #fff;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.navbar li:last-child a {
  border-right: none;
}

/* Hide mobile menu button on desktop */
.navbar-toggle {
  display: none;
}

/* =========================================================
   Mobile Dropdown Navbar (Refined, Stylish, Accessible)
   ========================================================= */

@media (max-width: 768px) {

  .navbar {
    margin: 0.5rem 0;
    padding: 0;
    border-radius: 6px;
  }

  /* Toggle button (header of dropdown) */
  .navbar-toggle {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: linear-gradient(to bottom, #6e8ce6 0%, #4c6cc4 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    letter-spacing: 0.2px;
  }

  .navbar-toggle[aria-expanded="false"]::after { content: " ▾"; }
  .navbar-toggle[aria-expanded="true"]::after  { content: " ▴"; }

  /* Dropdown container */
  .navbar ul {
    display: none;
    flex-direction: column;

    /* lighter drawer that matches toggle button family */
    background: linear-gradient(to bottom, #8fa6f0 0%, #6e8ce6 100%);

    margin: 0;
    padding: 0;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    max-height: 0;

    /* smooth slide + fade */
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
  }

  .navbar ul.open {
    display: flex;
    max-height: 600px;
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12); /* soft shadow */
  }

  /* Individual menu items */
  .navbar a {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    white-space: normal;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.25);

    /* subtle spacing like iOS menus */
    margin: 1px 0;
    border-radius: 4px;
    backdrop-filter: blur(0px); /* keeps clean edges */
    transition: background 0.2s ease;
  }

  .navbar a:active {
    background: rgba(255,255,255,0.20); /* tap feedback */
  }

  .navbar a:focus {
    outline: 2px solid rgba(255,255,255,0.7);
    outline-offset: -2px;
  }

  .navbar li:last-child a {
    border-bottom: none;
  }

  /* reduced-motion accessibility */
  @media (prefers-reduced-motion: reduce) {
    .navbar ul {
      transition: none;
    }
  }
}

/* =========================================================
   Main Content
   ========================================================= */
.main-content {
  background: #fff;
  border-radius: 12px;
  padding: 2.2rem;
  margin-top: 0.6rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  animation: fadeUp 1s ease-in-out;
  transition: background-color 0.4s ease;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #0a2e57;
  line-height: 1.4;
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
}

/* Site title (in header) */
.site-header h1 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.4rem;
}

/* Page title (main content) */
main h1 {
  border-bottom: 2px solid #eaecef;
  padding-bottom: 0.3em;
  margin-top: 0;
}

/* Automatic underline for H2 (Wikipedia-style) */
h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid #d8dee4; /* soft grey underline */
  padding-bottom: 0.25em;           /* space between text and line */
  margin-bottom: 0.8em;             /* space below line */
}

/* Optional hover effect for subtle emphasis */
h2:hover {
  border-bottom-color: #b6c2d2;
}

h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* Links */
a {
  color: #005cc5;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover, a:focus {
  text-decoration: underline;
  color: #0366d6;
}

/* =========================================================
   Footer (Compact Layout)
   ========================================================= */
footer {
  margin-top: 0px;
  padding: 24px 10px;
  text-align: center;
  font-size: 0.9em;
  color: #555;
  border-top: 1px solid #eaecef;
  background: #fafafa;
  line-height: 1.6;
  opacity: 0;
  animation: fadeInFooter 0.8s ease-in forwards;
  will-change: opacity, transform;
}

footer p {
  margin: 6px 0 8px;
  padding: 0;
}

footer a {
  color: #0366d6;
  text-decoration: none;
  display: inline-block;
  margin: 0 3px;
  white-space: nowrap;
  transition: color 0.25s ease, text-decoration 0.25s ease;
}

footer a:hover, footer a:focus {
  color: #024b9a;
  text-decoration: underline;
}

footer p::before {
  margin-right: 4px;
}

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

/* =========================================================
   Responsive Footer Adjustments
   ========================================================= */
@media (max-width: 600px) {
  footer {
    font-size: 0.85em;
    padding: 18px 8px;
  }

  footer p {
    margin: 4px 0 6px;
  }

  footer a {
    margin: 0 2px;
  }
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* =========================================================
   Tables
   ========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.05);
  border-radius: 6px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

thead:first-child tr:first-child th:first-child {
  border-top-left-radius: 6px;
}
thead:first-child tr:first-child th:last-child {
  border-top-right-radius: 6px;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

th {
  background-color: #f2f2f2;
  font-weight: 600;
  color: #333;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f9f9f9;
}

td, th {
  word-wrap: break-word;
  white-space: normal;
}

/* =========================================================
   Responsive Adjustments
   ========================================================= */
@media (max-width: 768px) {
  body {
    padding: 0 1rem 3rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .main-content {
    padding: 1.5rem;
  }
}

/* =========================================================
   Section Header Permalinks (🔗 beside headings)
   ========================================================= */
h2[id], h3[id], h4[id], h5[id], h6[id] {
  position: relative;
  display: block;
  margin: 1.2rem 0 0.6rem;
  line-height: 1.4;
}

.header-link {
  margin-left: 0.35em;
  opacity: 0;
  font-size: 0.9em;
  color: #888;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

h2:hover .header-link,
h3:hover .header-link,
h4:hover .header-link,
h5:hover .header-link,
h6:hover .header-link {
  opacity: 1;
}

.header-link:hover {
  color: #007acc;
}

/* =========================================================
   Breadcrumb Navigation
   ========================================================= */
.breadcrumb {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.8rem;
  padding-bottom: 0.2rem;
   color: #555;
  border-bottom: 1px solid #eee;
}

.breadcrumb + * {
  margin-top: 0 !important;
}

.breadcrumb a {
  color: #005cc5;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: #0366d6;
}

.breadcrumb span {
  color: #666;
}

/* =========================================================
   Button
   ========================================================= */
.btn {
  display: inline-block;
  background-color: #004b23;   /* Normal state: dark green */
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Slightly brighter on hover for feedback */
.btn:hover {
  background-color: #00854d;   /* Hover state: accessible green */
  transform: translateY(-1px); /* Subtle lift effect for interactivity */
}

/* Ensure buttons are not affected by normal link hover styles */
a.btn,
a.btn:hover,
a.btn:focus {
  color: #fff;
  text-decoration: none;
  border: none;
  outline: none;
}

/* Optional: active/focus state for accessibility */
.btn:active,
.btn:focus {
  background-color: #006837;
  box-shadow: 0 0 0 3px rgba(0, 133, 77, 0.3);
}
