/* Common styles for Rugby Maps pages */

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 60px auto;
  padding: 0 20px;
  line-height: 1.6;
  color: #333;
  background: #f9f9f9;
}

h1 {
  font-size: 2.2em;
  margin-bottom: 0.3em;
  color: #2c3e50;
  text-align: center;
}

body > p {
  text-align: center;
  color: #666;
  margin-bottom: 2em;
}

ul {
  list-style: none;
  padding: 0;
  text-align: center;
  background: white;
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

li {
  margin: 0.7em 0;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
}

li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
}

a {
  display: block;
  color: #2c3e50;
  text-decoration: none;
  font-size: 1.05em;
  transition: color 0.2s;
  padding: 0.8em 1.5em;
}

li:hover a {
  color: #0066cc;
}

/* Reset list item styling for special cases */
ul.club-teams {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  text-align: left;
}

.club-teams li {
  background: none;
  border: none;
  box-shadow: none;
  transition: none;
  margin: 0;
}

.club-teams li:hover {
  transform: none;
  box-shadow: none;
  border: none;
}

.all-tiers {
  background: #0066cc;
  border-color: #0066cc;
}

.all-tiers a {
  color: white;
  font-weight: 600;
}

.all-tiers:hover {
  background: #0052a3;
  border-color: #0052a3;
}

.all-tiers:hover a {
  color: white;
}

.separator {
  margin: 2em 0;
  border-bottom: 2px solid #e0e0e0;
}

.back-link {
  text-align: center;
  margin: 2em 0;
}

.back-link a {
  color: #0066cc;
  text-decoration: none;
  font-size: 1em;
  padding: 0.8em 1.5em;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  display: inline-block;
  transition: all 0.2s;
}

.back-link a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
}

.footer {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
  color: #666;
  text-align: center;
  background: white;
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.footer a {
  display: inline;
  color: #0066cc;
  font-size: 1em;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  transition: color 0.2s;
}

.footer a:hover {
  color: #004499;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.footer p {
  margin: 0.5em 0;
}

.faq {
  background: white;
  border-radius: 8px;
  padding: 1.5em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: 2em;
  text-align: left;
}

.faq h2 {
  color: #2c3e50;
  font-size: 1.8em;
  margin-bottom: 1em;
  text-align: center;
}

.faq-item {
  margin-bottom: 1em;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1em;
}

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

.faq-question {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5em;
  cursor: pointer;
  padding: 0.5em;
  background: #f5f7fa;
  border-radius: 4px;
  transition: background 0.2s;
}

.faq-question:hover {
  background: #e8ecf0;
}

.faq-question::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.2s;
}

.faq-question.active::before {
  transform: rotate(90deg);
}

.faq-answer {
  display: none;
  color: #666;
  padding: 0.5em 0.5em 0.5em 1.5em;
  line-height: 1.6;
}

.faq-answer.active {
  display: block;
}

.faq-answer a {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  color: #0066cc;
  font-size: inherit;
}

.faq-answer a:hover {
  background: none;
  border: none;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

/* Layout modifiers */
body.wide-layout {
  max-width: 1200px;
  margin: 40px auto;
}

/* Card components - base styles for card-like containers */
.card {
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 1em 1.5em;
  transition: all 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
}

/* Links styled as cards (clickable white cards) */
.card-link {
  display: block;
  color: #2c3e50;
  text-decoration: none;
  padding: 0.8em 1.5em;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
}

.card-link:hover {
  color: #0066cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
}

/* Inline card links (for lists) - smaller padding */
.card-link.card-inline {
  display: inline-block;
  padding: 0.3em 0.8em;
  border-radius: 4px;
}

.card-link.card-inline:hover {
  transform: translateY(-1px);
}

/* Card with nested link (link inherits from card) */
.card a {
  color: #2c3e50;
  text-decoration: none;
  display: block;
  padding: 0;
  background: none;
  border: none;
  transition: color 0.2s;
}

.card:hover a {
  color: #0066cc;
}

/* Info sections - white card containers for content */
.info-section {
  background: white;
  border-radius: 8px;
  padding: 1.5em;
  margin: 1.5em 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.info-section h2 {
  color: #2c3e50;
  font-size: 1.3em;
  margin-top: 0;
  margin-bottom: 1em;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 0.5em;
}

/* Links inside info sections (not in lists) are inline text links */
.info-section a:not(.card-link) {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

.info-section a:not(.card-link):hover {
  color: #004499;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

/* Table wrapper for horizontal scrolling on small screens */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Pyramid section — uses the base ul/li styles */
.pyramid-section {
  margin: 0 0 1.5em;
}

/* Merit section */
.merit-section {
  margin: 1.5em 0;
}

.merit-section h3 {
  color: #5a6a7a;
  font-size: 1.1em;
  margin-bottom: 0.8em;
}

.all-leagues-btn {
  display: block;
  text-align: center;
  background: #2c3e50;
  color: white !important;
  font-weight: 600;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  text-decoration: none;
  margin-bottom: 1em;
  font-size: 0.95em;
  transition: background 0.2s;
}

.all-leagues-btn:hover {
  background: #1a252f;
  transform: none;
  box-shadow: none;
}

.merit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7em;
}

.merit-card {
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  transition: border-color 0.2s;
}

.merit-card[open] {
  border-color: #0066cc;
}

.merit-card summary {
  padding: 0.7em 1em;
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
  font-size: 0.95em;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.merit-card summary::-webkit-details-marker {
  display: none;
}

.merit-card summary::after {
  content: "+";
  font-size: 1.2em;
  color: #999;
  transition: transform 0.2s;
}

.merit-card[open] summary::after {
  content: "-";
}

.merit-card summary:hover {
  background: #f5f7fa;
}

.merit-card-body {
  padding: 0 1em 0.8em;
}

.merit-all-tiers {
  display: block;
  text-align: center;
  background: #e8f4fd;
  color: #0066cc !important;
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
  margin-bottom: 0.5em;
  transition: background 0.2s, color 0.2s;
}

.merit-all-tiers:hover {
  background: #0066cc;
  color: white !important;
  transform: none;
  box-shadow: none;
}

.merit-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.merit-card li {
  margin: 0;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #f0f0f0;
}

.merit-card li:last-child {
  border-bottom: none;
}

.merit-card li:hover {
  transform: none;
  box-shadow: none;
  border-color: #f0f0f0;
  background: #f8fbff;
}

.merit-card li a {
  display: block;
  padding: 0.35em 0.5em;
  color: #0066cc;
  font-size: 0.85em;
}

.merit-card li:hover a {
  color: #004fa3;
}

/* Hero links (current season + teams) */
.hero-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin-bottom: 2em;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5em 1em;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  transition: all 0.2s;
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
}

.hero-card--primary {
  background: #0066cc;
  border-color: #0066cc;
}

.hero-card--primary:hover {
  background: #0052a3;
  border-color: #0052a3;
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.35);
}

.hero-card__label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 0.3em;
}

.hero-card--primary .hero-card__label {
  color: rgba(255, 255, 255, 0.8);
}

.hero-card__title {
  font-size: 1.4em;
  font-weight: 700;
  color: #2c3e50;
}

.hero-card--primary .hero-card__title {
  color: white;
}

.past-heading {
  font-size: 1.1em;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.6em;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6em;
}

.season-card {
  display: block;
  text-align: center;
  padding: 0.7em 0.5em;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.season-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
  color: #0066cc;
}

/* Tier table (pyramid / +merit columns) */
.tier-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4em;
  background: white;
  border-radius: 8px;
  padding: 1em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tier-table__head {
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  padding: 0 0.5em 0.3em;
  text-align: left;
}

.tier-link {
  display: block;
  padding: 0.6em 1em;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.95em;
  transition: all 0.2s;
  text-align: center;
}

.tier-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
  border-color: #0066cc;
  color: #0066cc;
}

.tier-link--primary {
  background: #0066cc;
  border-color: #0066cc;
  color: white;
  font-weight: 600;
}

.tier-link--primary:hover {
  background: #0052a3;
  border-color: #0052a3;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.35);
}

.tier-table td {
  padding: 0 0.3em;
}

/* Responsive styles */
@media (max-width: 768px) {
  body,
  body.wide-layout {
    margin: 20px auto;
    padding: 0 15px;
  }

  .info-section {
    padding: 1em;
    margin: 1em 0;
  }

  .hero-links {
    grid-template-columns: 1fr;
  }


  .hero-card__title {
    font-size: 1.2em;
  }

  .season-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
