/* GASC Arakkonam home page. All selectors are prefixed gx- so they do not
   clash with the existing home.css / common.css. Load this file last. */

:root {
  --gx-navy: #092f75;
  --gx-navy-dark: #061f4f;
  --gx-maroon: #7a1f2b;
  --gx-gold: #e0b43a;
  --gx-paper: #f4f6fb;
  --gx-card: #ffffff;
  --gx-ink: #1c2433;
  --gx-muted: #5b667a;
  --gx-line: #d9deea;
  --gx-radius: 6px;
  --gx-focus: 0 0 0 3px rgba(224, 180, 58, 0.75);
}

html { overflow-x: hidden; }
.gx-page {
  background: var(--gx-paper); color: var(--gx-ink);
  overflow-x: clip;               /* no sideways scrollbar at the bottom of the page */
}
.gx-page img, .gx-page iframe { max-width: 100%; }
.gx-main, .gx-footer, .gx-ticker { max-width: 100%; }

.gx-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.gx-skip {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  background: var(--gx-navy); color: #fff; padding: 10px 16px; border-radius: var(--gx-radius);
}
.gx-skip:focus { top: 8px; color: #fff; box-shadow: var(--gx-focus); }

.gx-page a:focus-visible,
.gx-page button:focus-visible,
.gx-page input:focus-visible,
.gx-list--scroll:focus-visible { outline: none; box-shadow: var(--gx-focus); }

/* ---------- Ticker ---------- */
.gx-ticker {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--gx-navy); color: #fff; font-size: 0.95rem;
}
.gx-ticker__label {
  background: var(--gx-maroon); padding: 8px 16px; font-weight: 700; white-space: nowrap;
}
.gx-ticker__viewport { flex: 1; overflow: hidden; display: flex; align-items: center; min-width: 0; }
.gx-ticker__list {
  display: flex; gap: 48px; margin: 0; padding: 0 0 0 100%; list-style: none; white-space: nowrap;
  animation: gx-scroll 40s linear infinite;
}
.gx-ticker__list a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.gx-ticker:hover .gx-ticker__list,
.gx-ticker:focus-within .gx-ticker__list,
.gx-ticker.is-paused .gx-ticker__list { animation-play-state: paused; }
.gx-ticker__toggle {
  background: transparent; color: #fff; border: 0; padding: 0 16px; cursor: pointer; font: inherit;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}
@keyframes gx-scroll { to { transform: translateX(-100%); } }

/* ---------- Layout ---------- */
.gx-main { padding-top: 24px; padding-bottom: 24px; max-width: 1320px; margin-left: auto; margin-right: auto; }

.gx-panel {
  background: var(--gx-card); border: 1px solid var(--gx-line); border-top: 4px solid var(--gx-maroon);
  border-radius: var(--gx-radius); padding: 16px; height: 100%;
}
.gx-panel__title { font-size: 1.15rem; font-weight: 700; color: var(--gx-navy); margin: 0 0 12px; }

.gx-list { list-style: none; margin: 0; padding: 0; }
.gx-list > li { padding: 8px 0; border-bottom: 1px solid var(--gx-line); line-height: 1.4; }
.gx-list > li:last-child { border-bottom: 0; }
.gx-list a { color: var(--gx-ink); text-decoration: none; }
.gx-list a:hover { color: var(--gx-maroon); text-decoration: underline; }
.gx-list__group { display: block; font-weight: 600; margin-bottom: 4px; }
.gx-list--nested { padding-left: 14px; }
.gx-list--nested > li { border-bottom: 0; padding: 3px 0; }
.gx-list--scroll { max-height: 320px; overflow-y: auto; overflow-x: hidden; }
.gx-list a { overflow-wrap: anywhere; }

.gx-tag {
  display: inline-block; font-size: 0.72rem; padding: 1px 6px; margin-left: 4px;
  border: 1px solid var(--gx-line); border-radius: 3px; color: var(--gx-muted); vertical-align: middle;
}
.gx-new {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; margin-left: 4px;
  background: var(--gx-gold); color: #3b2a00; border-radius: 3px; vertical-align: middle;
}

.gx-search {
  width: 100%; padding: 8px 10px; margin-bottom: 8px; font: inherit;
  border: 1px solid var(--gx-line); border-radius: var(--gx-radius); background: #fff; color: var(--gx-ink);
}
.gx-empty { color: var(--gx-muted); margin: 8px 0 0; }

/* ---------- Carousel ---------- */
.gx-carousel {
  position: relative; background: #000; border-radius: var(--gx-radius); overflow: hidden;
  border: 1px solid var(--gx-line);
}
.gx-carousel__stage { position: relative; aspect-ratio: 4 / 3; }
.gx-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0.6s; }
.gx-slide.is-active { opacity: 1; visibility: visible; }
.gx-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 44px; padding: 28px 16px 10px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); font-size: 1rem;
}

.gx-carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(9, 47, 117, 0.85); color: #fff; cursor: pointer;
}
.gx-carousel__btn:hover { background: var(--gx-maroon); }
.gx-carousel__btn--prev { left: 10px; }
.gx-carousel__btn--next { right: 10px; }

.gx-carousel__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(6, 31, 79, 0.92); color: #fff; font-size: 0.85rem;
}
.gx-carousel__pause { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 3px; padding: 2px 10px; cursor: pointer; font: inherit; }
.gx-carousel__dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.gx-carousel__dots button {
  width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative;
}
.gx-carousel__dots button::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.45);
}
.gx-carousel__dots button[aria-current="true"]::before { background: var(--gx-gold); }
.gx-carousel__count { min-width: 44px; text-align: right; }

/* ---------- Quick links ---------- */
.gx-section-title { font-size: 1.3rem; font-weight: 700; color: var(--gx-navy); margin: 8px 0 12px; }
.gx-quick__grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.gx-quick__grid a {
  display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; height: 100%; padding: 14px;
  background: var(--gx-card); border: 1px solid var(--gx-line); border-left: 4px solid var(--gx-navy);
  border-radius: var(--gx-radius); color: var(--gx-ink); text-decoration: none;
}
.gx-quick__grid a:hover { border-left-color: var(--gx-maroon); background: #fff8f8; }
.gx-quick__grid .fa { grid-row: span 2; font-size: 1.5rem; color: var(--gx-maroon); align-self: center; }
.gx-quick__title { font-weight: 700; }
.gx-quick__text { color: var(--gx-muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.gx-footer { background: var(--gx-navy-dark); color: #dfe6f5; margin-top: 32px; }
.gx-footer__social { background: var(--gx-navy); padding: 14px 0; }
.gx-social { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.gx-social a {
  display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff;
}
.gx-social a:hover { background: var(--gx-maroon); }
.gx-footer__cols { padding-top: 28px; }
.gx-footer__title { font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 12px; }
.gx-footer__list { list-style: none; margin: 0; padding: 0; line-height: 1.9; }
.gx-footer__address { font-style: normal; }
.gx-footer__address p { margin: 0 0 8px; }
.gx-footer a { color: #fff; }
.gx-footer__address .fa { width: 20px; color: var(--gx-gold); }

.gx-stats { background: var(--gx-navy); padding: 24px 12px; }
.gx-stats__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 64px; margin: 0; }
.gx-stats__grid > div { text-align: center; }
.gx-stats dt { font-weight: 400; font-size: 1rem; }
.gx-stats dd { margin: 4px 0 0; font-size: 2.5rem; font-weight: 700; color: var(--gx-gold); font-variant-numeric: tabular-nums; }
.gx-footer__copy { margin: 0; padding: 14px; text-align: center; font-size: 0.9rem; }

/* ---------- Back to top ---------- */
.gx-top {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--gx-maroon); color: #fff; cursor: pointer; z-index: 1500;
}
.gx-top[hidden] { display: none; }

/* ---------- Small screens, motion, print ---------- */
@media (max-width: 575.98px) {
  .gx-slide figcaption { font-size: 0.9rem; padding-top: 20px; }
  .gx-carousel__count { display: none; }
  .gx-ticker__label { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .gx-ticker__list { animation: none; padding-left: 0; flex-wrap: wrap; white-space: normal; }
  .gx-slide { transition: none; }
}

@media print {
  .gx-ticker, .gx-carousel, .gx-top, .gx-search, .gx-skip { display: none !important; }
  .gx-list--scroll { max-height: none; overflow: visible; }
}

/* ======================================================================
   Animations (all disabled for visitors who prefer reduced motion)
   ====================================================================== */
.gx-carousel__progress {
  position: absolute; left: 0; bottom: 44px; height: 3px; width: 100%; z-index: 2;
  background: var(--gx-gold); transform: scaleX(0); transform-origin: left;
}

@media (prefers-reduced-motion: no-preference) {
  /* Page-load entrance: one staggered sequence for the top of the page */
  .gx-enter { animation: gx-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .gx-enter--0 { animation-name: gx-fade; }
  .gx-enter--1 { animation-delay: 0.10s; }
  .gx-enter--2 { animation-delay: 0.22s; }
  .gx-enter--3 { animation-delay: 0.34s; }
  @keyframes gx-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes gx-fade { from { opacity: 0; } to { opacity: 1; } }

  /* Scroll reveal for content below the fold (class added by JS) */
  .gx-js [data-reveal] {
    opacity: 0; transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .gx-js [data-reveal].is-visible { opacity: 1; transform: none; }

  /* Gallery: slow zoom on the active photo and a progress bar to the next one */
  .gx-slide.is-active img { animation: gx-zoom 9s ease-out both; }
  @keyframes gx-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
  .gx-slide.is-active figcaption { animation: gx-caption 0.7s 0.25s ease both; }
  @keyframes gx-caption { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .gx-carousel__progress.is-running { animation: gx-progress linear infinite; }
  @keyframes gx-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .gx-carousel__btn { transition: background 0.2s, transform 0.2s; }
  .gx-carousel__btn:hover { transform: translateY(-50%) scale(1.1); }
  .gx-carousel__dots button::before { transition: transform 0.2s, background 0.2s; }
  .gx-carousel__dots button[aria-current="true"]::before { transform: scale(1.5); }

  /* Notifications and forms */
  .gx-list a { display: inline-block; transition: transform 0.2s, color 0.2s; }
  .gx-list a:hover { transform: translateX(4px); }
  .gx-new { animation: gx-pulse 2s ease-in-out infinite; }
  @keyframes gx-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 180, 58, 0.7); }
    50% { box-shadow: 0 0 0 6px rgba(224, 180, 58, 0); }
  }
  .gx-panel { transition: box-shadow 0.25s, transform 0.25s; }
  .gx-panel:hover { box-shadow: 0 10px 24px rgba(9, 47, 117, 0.12); transform: translateY(-2px); }
  .gx-panel__title { position: relative; padding-bottom: 6px; }
  .gx-panel__title::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 36px;
    background: var(--gx-gold); transition: width 0.35s ease;
  }
  .gx-panel:hover .gx-panel__title::after { width: 100%; }

  /* Ticker label */
  .gx-ticker__label { animation: gx-label 2.4s ease-in-out infinite; }
  @keyframes gx-label { 0%, 100% { background: var(--gx-maroon); } 50% { background: #a12b3a; } }

  /* Quick links */
  .gx-quick__grid a { transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s; }
  .gx-quick__grid a:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(9, 47, 117, 0.14); }
  .gx-quick__grid .fa { transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .gx-quick__grid a:hover .fa { transform: scale(1.25) rotate(-8deg); }

  /* Footer */
  .gx-social a { transition: transform 0.25s, background 0.25s; }
  .gx-social a:hover { transform: translateY(-3px) rotate(8deg); }
  .gx-footer a { transition: color 0.2s; }
  .gx-footer__address a:hover { color: var(--gx-gold); }

  /* Back to top */
  .gx-top:not([hidden]) { animation: gx-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .gx-top { transition: transform 0.2s, background 0.2s; }
  .gx-top:hover { transform: translateY(-4px); background: var(--gx-navy); }
  @keyframes gx-pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .gx-carousel__progress { display: none; }
}

/* ======================================================================
   Mobile view
   ====================================================================== */
#notifications, #forms, #contact { scroll-margin-top: 12px; }
.gx-bottomnav { display: none; }

/* Tablets and phones */
@media (max-width: 991.98px) {
  .gx-main { padding-top: 14px; padding-bottom: 8px; }
  .gx-panel { height: auto; }
  .gx-list--scroll { max-height: 300px; }
}

/* Phones */
@media (max-width: 767.98px) {
  body.gx-page { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Ticker */
  .gx-ticker { font-size: 0.85rem; gap: 8px; }
  .gx-ticker__toggle { padding: 0 10px; }

  /* Gallery: edge to edge, wider crop so it takes less of the screen */
  .gx-carousel { border-radius: 0; border-left: 0; border-right: 0; margin: 0 -15px; }
  .gx-carousel__stage { aspect-ratio: 16 / 11; }
  .gx-carousel__btn { width: 38px; height: 38px; }
  .gx-carousel__btn--prev { left: 6px; }
  .gx-carousel__btn--next { right: 6px; }
  .gx-slide figcaption { font-size: 0.9rem; padding: 20px 12px 8px; }

  /* Panels and lists: bigger touch targets, 16px input so iOS does not zoom */
  .gx-panel { padding: 14px; }
  .gx-list > li { padding: 0; }
  .gx-list a { display: block; padding: 11px 0; min-height: 44px; }
  .gx-list--nested > li { padding: 0; }
  .gx-list--nested a { padding: 9px 0; }
  .gx-search { font-size: 16px; padding: 10px 12px; }
  .gx-list--scroll { max-height: 260px; }

  /* Quick links: two compact tiles per row */
  .gx-quick__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gx-quick__grid a { grid-template-columns: 1fr; row-gap: 2px; padding: 12px; border-left-width: 1px; border-top: 4px solid var(--gx-navy); }
  .gx-quick__grid a:hover { border-left-color: var(--gx-line); border-top-color: var(--gx-maroon); }
  .gx-quick__grid .fa { grid-row: auto; font-size: 1.4rem; margin-bottom: 4px; }
  .gx-quick__text { font-size: 0.82rem; }

  /* Footer */
  .gx-footer { margin-top: 16px; }
  .gx-footer__social .container { justify-content: center !important; text-align: center; gap: 10px; }
  .gx-footer__list { columns: 2; column-gap: 16px; line-height: 1.8; }
  .gx-stats { padding: 18px 8px; }
  .gx-stats__grid { flex-wrap: nowrap; gap: 8px; justify-content: space-around; }
  .gx-stats__grid > div { flex: 1; }
  .gx-stats dt { font-size: 0.8rem; }
  .gx-stats dd { font-size: 1.8rem; }

  /* Bottom navigation bar (app style) */
  .gx-bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--gx-navy-dark); border-top: 3px solid var(--gx-gold);
  }
  .gx-bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 56px; color: #fff; font-size: 0.72rem; text-decoration: none;
  }
  .gx-bottomnav .fa { font-size: 1.2rem; }
  .gx-bottomnav a:active { background: var(--gx-maroon); }
  .gx-bottomnav a:focus-visible { box-shadow: inset var(--gx-focus); }

  /* Back to top sits above the bar */
  .gx-top { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 12px; }
}

/* Small phones */
@media (max-width: 359.98px) {
  .gx-quick__grid { grid-template-columns: 1fr; }
  .gx-footer__list { columns: 1; }
}

/* Touch screens: no hover lifts that stay stuck after a tap */
@media (hover: none) {
  .gx-panel:hover, .gx-quick__grid a:hover, .gx-list a:hover, .gx-top:hover { transform: none; box-shadow: none; }
  .gx-quick__grid a:hover .fa, .gx-social a:hover { transform: none; }
}

@media print { .gx-bottomnav { display: none !important; } }
