/* PCG-specific styles - matches FAA production PCG */

/* Reset body margin to remove white row at top */
html, body {
  margin: 0;
  padding: 0;
}

#atc-body {
  margin: 0;
  padding: 0;
}

/* Typography - Headers use Roboto Condensed */
h1, h2, h3, h4, h5, h6,
.pcg-letter-heading,
.pcg-publication-name,
.pcg-sidebar-title,
.pcg-main-title {
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
}

/* Layout */
.pcg-layout {
  display: flex;
  min-height: calc(100vh - 120px);
}

.pcg-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 1rem;
}

.pcg-main {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 900px;
}

/* Header - matches FAA production */
.pcg-header {
  background: #1a3a5c;
  color: white;
  padding: 0;
}

.pcg-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.pcg-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pcg-nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.pcg-brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 400;
  font-size: 0.95rem;
  text-decoration: none;
}

.pcg-brand-link:hover {
  text-decoration: underline;
}

/* Home icon */
.pcg-home-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.pcg-search {
  display: flex;
  align-items: center;
}

.pcg-search input {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 0;
  width: 220px;
  font-size: 0.875rem;
}

.pcg-search input::placeholder {
  color: #666;
}

.pcg-search button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: #2563eb;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 0.875rem;
}

.pcg-search button:hover {
  background: #1d4ed8;
}

.pcg-search button img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

.pcg-search-text {
  font-size: 0.875rem;
}

.pcg-sections-label {
  color: white;
  font-size: 0.9rem;
}

.pcg-nav-right a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
}

.pcg-nav-right a:hover {
  text-decoration: underline;
}

/* Sidebar Navigation - matches FAA production */
.pcg-sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a3a5c;
}

.pcg-sidebar-title a {
  color: #1a3a5c;
  text-decoration: none;
}

.pcg-sidebar-title a:hover {
  text-decoration: underline;
}

.pcg-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pcg-nav-section {
  margin-bottom: 0.5rem;
}

.pcg-nav-section summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  color: #374151;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pcg-nav-section summary::-webkit-details-marker {
  display: none;
}

.pcg-nav-toggler {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #374151;
  background: none;
  border-bottom: none;
  padding: 0;
  margin-right: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.pcg-nav-section[open] .pcg-nav-toggler {
  transform: rotate(180deg);
}

.pcg-letter-nav {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.pcg-letter-nav li a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: #1a3a5c;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.pcg-letter-nav li a:hover {
  background-color: #e2e8f0;
  text-decoration: none;
}

.pcg-letter-nav li a.active {
  font-weight: 600;
  background-color: #1a3a5c;
  color: white;
}

.pcg-letter-nav li a.active:hover {
  background-color: #2d4a6f;
}

/* Related publications in sidebar */
.pcg-related-pub {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.pcg-related-pub a {
  display: block;
  color: #1a3a5c;
  text-decoration: none;
}

.pcg-related-pub a:hover {
  text-decoration: underline;
}

.pcg-related-pub h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: #1a3a5c;
}

/* Breadcrumb - matches FAA production */
.pcg-breadcrumb-nav {
  margin-bottom: 1rem;
}

.pcg-breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #374151;
}

.pcg-breadcrumb li {
  display: inline;
}

.pcg-breadcrumb a {
  color: #1a3a5c;
  text-decoration: none;
}

.pcg-breadcrumb a:hover {
  text-decoration: underline;
}

/* Publication name heading */
.pcg-publication-name {
  font-size: 1.5rem;
  font-weight: 400;
  color: #1a3a5c;
  margin-bottom: 1.5rem;
}

/* Publication summary box */
.pcg-publication-summary {
  margin-top: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
}

.pcg-publication-summary p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #374151;
}

.pcg-pub-dates {
  text-align: left;
}

.pcg-pub-agency {
  text-align: right;
}

/* Content */
.pcg-letter-heading {
  font-size: 2rem;
  font-weight: 400;
  color: #1a3a5c;
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

/* Term definitions */
.glossary-term-definition {
  margin: 1.5rem 0 0.25rem;
  scroll-margin-top: 100px;
}

.glossary-term-entry {
  margin: 1.25rem 0 0.5rem;
  line-height: 1.6;
}

/* Term name styling (dfn element) */
dfn.term-name {
  font-style: normal;
  font-weight: 600;
  color: #1e3a5f;
  background: linear-gradient(180deg, transparent 60%, rgba(30, 58, 95, 0.1) 60%);
  padding: 0 2px;
}

dfn.term-name.frequently-used {
  color: #0d47a1;
  font-weight: 700;
}

.glossary-cross-reference {
  margin: 0.5rem 0 0.5rem 1rem;
  font-size: 0.95rem;
}

/* Cross-reference styling */
.cross-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.cross-ref-label {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.85rem;
}

.cross-ref-link,
.cross-ref-term {
  color: #1e3a5f;
  font-weight: 600;
  text-decoration: none;
}

.cross-ref-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

/* See references (internal glossary links) */
.see-ref {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

.see-ref .cross-ref-label::before {
  content: '→';
  margin-right: 0.25rem;
  color: #0284c7;
}

/* ICAO term references */
.icao-ref {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
}

.icao-ref .cross-ref-label::before {
  content: '✈';
  margin-right: 0.25rem;
}

/* Refer to (external references) */
.refer-ref {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-color: #d1d5db;
}

.refer-ref .cross-ref-label::before {
  content: '📖';
  margin-right: 0.25rem;
}

/* External links */
.external-ref-link {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.external-ref-link:hover {
  text-decoration: underline;
}

.external-ref-link::after {
  content: '↗';
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

/* CFR link specific */
.cfr-link {
  color: #7c3aed;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ordered list sub-items */
ol.glossary-sub-list {
  margin: 0.75rem 0 0.75rem 1.5rem;
  padding-left: 1.25rem;
  line-height: 1.6;
}

ol.glossary-sub-list li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

ol.glossary-sub-list li::marker {
  font-weight: 600;
  color: #1e3a5f;
}

/* Legacy sub-item fallback */
.glossary-sub-item {
  margin: 0.25rem 0 0.25rem 1.5rem;
}

.glossary-sub-item-2 {
  margin: 0.25rem 0 0.25rem 2.5rem;
}

/* Semantic note element */
aside.glossary-note {
  margin: 0.75rem 0 0.75rem 1rem;
  padding: 0.75rem 1rem;
  background: #f0f9ff;
  border-left: 3px solid #0284c7;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
  color: #374151;
}

aside.glossary-note .note-label {
  font-weight: 600;
  color: #0369a1;
  margin-right: 0.5rem;
}

aside.glossary-note .note-content {
  font-style: italic;
}

/* Frequently used terms */
.frequently-used-term b i,
.frequently-used-term B I {
  color: #1e3a5f;
}

/* Footer - matches FAA production */
.pcg-footer {
  background: #1a3a5c;
  color: white;
  padding: 0.75rem 1.5rem;
  text-align: center;
}

.pcg-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pcg-pagination a,
.pcg-pagination span {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
}

.pcg-pagination a:hover {
  text-decoration: underline;
}

.pcg-nav-prev,
.pcg-nav-next,
.pcg-nav-top {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pcg-nav-prev.disabled,
.pcg-nav-next.disabled {
  opacity: 0.5;
  cursor: default;
}

.pcg-divider {
  color: white;
  padding: 0 0.25rem;
}

/* Arrow icons for pagination */
.pcg-arrow-left,
.pcg-arrow-right {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
}

.pcg-arrow-left {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/%3E%3C/svg%3E");
}

.pcg-arrow-right {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E");
}

.pcg-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.pcg-footer-links li {
  display: inline;
}

.pcg-footer-links a {
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
}

.pcg-footer-links a:hover {
  text-decoration: underline;
}

/* Home page */
.pcg-main-title {
  font-size: 2rem;
  color: #1e3a5f;
  margin-bottom: 0.5rem;
}

.pcg-effective-date {
  color: #6b7280;
  margin-bottom: 2rem;
}

.pcg-letter-grid h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.pcg-letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.pcg-letter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.pcg-letter-card:hover {
  background: #1e3a5f;
  color: white;
  border-color: #1e3a5f;
}

.pcg-letter-card .pcg-letter {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a5f;
}

.pcg-letter-card:hover .pcg-letter {
  color: white;
}

.pcg-letter-card .pcg-term-count {
  font-size: 0.75rem;
  color: #6b7280;
}

.pcg-letter-card:hover .pcg-term-count {
  color: rgba(255, 255, 255, 0.8);
}

.pcg-intro-section,
.pcg-stats {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 8px;
}

.pcg-intro-section h2,
.pcg-stats h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #1e3a5f;
}

.pcg-tag {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
}

.pcg-tag.icao {
  background: #dbeafe;
  color: #1e40af;
}

.pcg-tag.fss {
  background: #dcfce7;
  color: #166534;
}

/* Responsive */
@media (max-width: 768px) {
  .pcg-layout {
    flex-direction: column;
  }

  .pcg-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .pcg-main {
    padding: 1rem;
  }

  .pcg-search input {
    width: 150px;
  }
}
