/* Girard Borough - Static Site Styles */
/* Clean, accessible government website styling */

:root {
  --primary-blue: #1a4b7c;
  --primary-dark: #0d2840;
  --accent-blue: #2d6cb5;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #333;
  --text-color: #222;
  --white: #fff;
  --success-green: #28a745;
  --warning-yellow: #ffc107;
  --error-red: #dc3545;
  --disabled-bg: #e9ecef;
  --disabled-text: #6c757d;
  --max-width: 1200px;
  --header-height: 80px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--primary-blue);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  padding-left: 1.5rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.page-content {
  min-height: calc(100vh - var(--header-height) - 300px);
  padding: 2rem 0;
  background-color: white;
}

/* Top Bar - scrolls away naturally */
.header-top {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.header-top .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.header-top a {
  color: var(--white);
}

.header-top a:hover {
  color: var(--medium-gray);
}

/* Main header - sticky with scroll animations */
.header-main {
  padding: 1rem 0;
  background-color: var(--primary-blue);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s ease;
  will-change: transform;
}

/* Hidden state - slides up smoothly */
.header-main.header-hidden {
  transform: translateY(-100%);
}

/* Subtle shadow peek when header is hidden */
.header-main.header-hidden::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), transparent);
  transform: translateY(100%);
  pointer-events: none;
}

/* Enhanced shadow when scrolled past top */
.header-main.header-scrolled {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo img {
  height: 50px;
  width: auto;
}

.site-logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

.site-logo-text small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.nav-list li {
  position: relative;
}

.nav-list a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--white);
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.nav-list a:hover,
.nav-list a.active {
  background-color: rgba(255,255,255,0.1);
  text-decoration: none;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after {
  content: " ▾";
  font-size: 0.75rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 200px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.5rem 0;
  z-index: 100;
  list-style: none;
}

.dropdown-menu li {
  width: 100%;
  list-style: none;
}

.dropdown-menu a {
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background-color: var(--light-gray);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: block;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--white);
  margin: 5px 0;
  transition: 0.3s;
}

/* Pay Bill Button */
.btn-pay {
  background-color: var(--success-green);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 4px;
  font-weight: 600;
}

.btn-pay:hover {
  background-color: #218838;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(26, 75, 124, 0.85), rgba(13, 40, 64, 0.9)),
              url('/images/hero.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero-attribution {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.7rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.hero-attribution:hover {
  opacity: 1;
}

.hero-attribution a {
  color: var(--white);
  text-decoration: none;
}

.hero-attribution a:hover {
  text-decoration: underline;
}

/* Page Headers */
.page-header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 2rem 0;
}

.page-header h1 {
  font-size: 2rem;
  margin: 0;
}

/* Cards & Sections */
.section {
  padding: 2rem 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-blue);
}

.section-header .section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.unofficial-notice {
  font-size: 0.875rem;
  color: var(--error-red);
  font-weight: 500;
  order: -1; /* ensures notice appears first */
}

.unofficial-notice a {
  color: var(--error-red);
  text-decoration: underline;
}

.unofficial-notice a:hover {
  color: var(--primary-dark);
}

.section-title {
  font-size: 1.75rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-blue);
}

/* Fade border to transparent on right - use on section-title when floated image overlaps */
@media (min-width: 769px) {
  .section-title.border-fade-right {
    border-bottom: none;
    background-image: linear-gradient(to right, var(--primary-blue) 50%, transparent 100%);
    background-size: 100% 2px;
    background-position: bottom left;
    background-repeat: no-repeat;
  }
}

.card {
  background-color: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Content Images */
.content-image {
  margin: 0 0 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.content-image img {
  width: 100%;
  height: auto;
  display: block;
}

.content-image figcaption {
  background-color: var(--light-gray);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--disabled-text);
  text-align: right;
}

.content-image figcaption a {
  color: var(--accent-blue);
}

/* News/Posts List */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--medium-gray);
}

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

.post-item h3 {
  margin-bottom: 0.5rem;
}

.post-item h3 a {
  color: var(--primary-dark);
}

.post-meta {
  font-size: 0.875rem;
  color: var(--disabled-text);
}

.post-excerpt {
  margin-top: 0.5rem;
  color: var(--dark-gray);
}

/* CTA Banner */
.cta-banner {
  background-color: var(--accent-blue);
  color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  margin: 2rem 0;
}

.cta-banner h2 {
  margin-bottom: 1rem;
}

.cta-banner .btn {
  background-color: var(--white);
  color: var(--accent-blue);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  margin-top: 1rem;
}

.cta-banner .btn:hover {
  background-color: var(--light-gray);
  text-decoration: none;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--medium-gray);
}

.data-table th {
  background-color: var(--primary-blue);
  color: var(--white);
  font-weight: 600;
}

.data-table tr:hover {
  background-color: var(--light-gray);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-gray);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(45, 108, 181, 0.2);
}

.form-control:disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn-submit {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-submit:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-submit:disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

/* Alert/Notice Boxes */
.notice {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.notice-warning {
  background-color: #fff3cd;
  border: 1px solid var(--warning-yellow);
  color: #856404;
}

.notice-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

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

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background-color: var(--white);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  background: linear-gradient(135deg, var(--error-red), #a71d2a);
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-header .warning-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.modal-body {
  padding: 2rem;
  text-align: center;
}

.modal-body p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.modal-body .official-link {
  display: inline-block;
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  margin: 1rem 0;
  transition: background-color 0.2s ease;
}

.modal-body .official-link:hover {
  background-color: var(--primary-dark);
  text-decoration: none;
}

.modal-footer {
  padding: 1.5rem 2rem;
  background-color: var(--light-gray);
  border-top: 1px solid var(--medium-gray);
  font-size: 0.85rem;
  color: var(--dark-gray);
}

.modal-footer p {
  margin-bottom: 0.5rem;
}

.modal-footer a {
  color: var(--accent-blue);
  font-weight: 500;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  opacity: 1;
}

.modal-header {
  position: relative;
}

/* FAQ Tiles */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.faq-tile {
  background-color: var(--light-gray);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.faq-tile h3 {
  color: var(--primary-dark);
  margin: 0;
}

/* Footer */
.site-footer {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
}

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

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--white);
}

.footer-section address {
  font-style: normal;
  line-height: 1.8;
}

.footer-section a {
  color: rgba(255,255,255,0.8);
}

.footer-section a:hover {
  color: var(--white);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.footer-social a:hover {
  background-color: rgba(255,255,255,0.2);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* External Link Icon */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.75em;
}

/* Responsive */
@media (max-width: 768px) {
  .header-main .container {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }

  .main-nav.active {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    padding: 1rem 0;
  }

  .nav-list a {
    padding: 0.75rem 1rem;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    background-color: rgba(255,255,255,0.05);
    padding-left: 1rem;
  }

  .nav-dropdown:hover .dropdown-menu {
    display: block;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 0.75rem;
  }

  .site-logo-text {
    font-size: 1rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .cta-banner {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .page-content {
    padding: 0;
  }
}

/* Reduced Motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
  .header-main {
    transition: none;
  }
  
  .header-main.header-hidden {
    transform: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Float right on desktop, centered on mobile */
.float-right-desktop {
  float: right;
}

@media (max-width: 768px) {
  .float-right-desktop {
    float: none;
    display: block;
    margin: 1rem auto !important;
  }
}
