/*
Theme Name: OVYBL
Theme URI: https://ovybl.com
Description: Custom WordPress theme for the OVYBL youth baseball organization.
Version: 1.1.0
Author: OVYBL
Text Domain: ovybl
*/

:root {
  --accent: #015aaf;
  --accent-dark: #00488d;
  --accent-light: #e8f1fb;
  --text: #1f2937;
  --muted: #6b7280;
  --background: #f8fbff;
  --surface: #ffffff;
  --border: #dbe6f2;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(1, 90, 175, 0.08);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

a {
  color: var(--accent);
}

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

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

/* Accessibility helpers */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: var(--accent);
  padding: 0.6rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Header & Navigation ---------- */
.site-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.site-logo img {
  height: 40px;
  width: auto;
  max-width: 220px;
  display: block;
}

.site-titles {
  display: flex;
  flex-direction: column;
  color: #fff;
  text-decoration: none;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
}

.site-description {
  font-size: 0.9rem;
  opacity: 0.9;
}

.main-navigation {
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  background: rgba(255, 255, 255, 0.18);
}

/* Sub-menus */
.nav-menu ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  list-style: none;
  margin: 0.4rem 0 0;
  z-index: 50;
}

.nav-menu li:hover > ul.sub-menu,
.nav-menu li:focus-within > ul.sub-menu {
  display: block;
}

.nav-menu ul.sub-menu a {
  color: var(--text);
}

.nav-menu ul.sub-menu a:hover {
  background: var(--accent-light);
}

/* Mobile toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: flex;
  }

  .main-navigation .nav-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--accent-dark);
    padding: 0.5rem 1rem 1rem;
    z-index: 40;
  }

  .site-header {
    position: relative;
  }

  .main-navigation.is-open .nav-menu {
    display: flex;
  }

  .nav-menu a {
    border-radius: 8px;
  }

  .nav-menu ul.sub-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding-left: 1rem;
  }

  .nav-menu ul.sub-menu a {
    color: #fff;
  }
}

/* ---------- Main ---------- */
.site-main {
  padding: 2.5rem 0 1rem;
}

section {
  margin-bottom: 3rem;
}

h1, h2, h3 {
  line-height: 1.2;
}

/* Hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
}

.hero-content {
  max-width: 640px;
}

.hero-split {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero-split .hero-content {
  flex: 1 1 55%;
  max-width: none;
}

.hero-media {
  flex: 1 1 45%;
}

.hero-media img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

@media (max-width: 760px) {
  .hero-split {
    flex-direction: column;
    align-items: stretch;
    gap: 1.75rem;
  }
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: 2.5rem;
  color: var(--accent-dark);
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid var(--accent);
  transition: background 0.15s ease, color 0.15s ease;
}

.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-outline {
  background: transparent;
  color: var(--accent);
}

.button-outline:hover {
  background: var(--accent);
  color: #fff;
}

.button-light {
  background: #fff;
  color: var(--accent-dark);
  border-color: #fff;
}

.button-light:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--accent-dark);
}

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.link-card h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.link-card p {
  margin: 0;
  color: var(--muted);
}

.link-card-static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.card-cta {
  display: inline-block;
  margin-top: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.card-cta-muted {
  color: var(--muted);
  font-weight: 600;
}

.section-intro {
  max-width: 720px;
  margin: -0.5rem 0 1.5rem;
  color: var(--muted);
}

/* Mission */
.mission {
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.mission-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.mission h2 {
  margin-top: 0;
  color: var(--accent-dark);
}

.mission-text {
  text-align: left;
  margin-top: 1.25rem;
}

.mission-text p {
  margin: 0 0 1rem;
}

.mission-text p:last-child {
  margin-bottom: 0;
}

/* Section heads */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
  color: var(--accent-dark);
}

.section-link {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* News cards */
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.news-body {
  padding: 1.25rem;
}

.news-date {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.news-card h3 {
  margin: 0 0 0.5rem;
}

.news-card h3 a {
  color: var(--accent);
  text-decoration: none;
}

.news-excerpt {
  color: var(--muted);
}

/* Homepage photo band */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.photo-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 860px) {
  .photo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .photo-strip {
    grid-template-columns: 1fr;
  }
}

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
}

.cta-inner h2 {
  margin: 0 0 0.5rem;
  color: #fff;
}

.cta-inner p {
  margin: 0 0 1.5rem;
  opacity: 0.92;
}

/* Generic article (single/index) */
.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.entry h2 {
  margin-top: 0;
}

.entry h2 a {
  color: var(--accent);
  text-decoration: none;
}

.entry-content {
  margin-top: 1rem;
}

.entry-thumb {
  margin: 1rem 0;
}

.entry-thumb img {
  border-radius: var(--radius);
}

.entry-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Page header (pages, archives) */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  color: var(--accent-dark);
  margin: 0 0 0.5rem;
}

.page-intro {
  color: var(--muted);
}

/* ---------- League Documents ---------- */
.document-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.document-item {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.document-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.document-icon {
  flex: 0 0 auto;
}

.document-icon .file-icon {
  display: block;
}

.document-body {
  flex: 1 1 auto;
  min-width: 0;
}

.document-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.document-title a {
  color: var(--accent);
  text-decoration: none;
}

.document-title a:hover {
  text-decoration: underline;
}

.document-description {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.document-description p:last-child {
  margin-bottom: 0;
}

.document-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  flex-wrap: wrap;
}

.document-download {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}

.document-download:hover {
  color: var(--accent-dark);
}

.document-size {
  font-size: 0.85rem;
  color: var(--muted);
}

.document-nofile {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Fields ---------- */
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--accent-dark);
  background-size: cover;
  background-position: center;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 26, 51, 0.45) 0%, rgba(0, 26, 51, 0.9) 100%);
}

.page-hero-inner {
  position: relative;
  padding: 1.5rem 2rem;
  color: #fff;
  max-width: 720px;
}

.page-hero-inner h1 {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 2rem;
}

.page-hero-inner p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.95;
}

.page-hero-inner .page-intro,
.page-hero-inner .page-intro p {
  color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 700px) {
  .page-hero-inner {
    padding: 1.25rem 1.5rem;
  }
}

.field-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.field-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.field-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
}

.field-name {
  margin: 0;
  color: var(--accent);
}

.field-association {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.field-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.field-address {
  margin: 0 0 0.9rem;
}

.field-map-link {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  margin-left: 0.4rem;
}

.field-directions-body {
  color: var(--text);
}

.field-directions-body p:last-child {
  margin-bottom: 0;
}

/* Field detail: aerial map + directions tool */
.field-map,
.field-directions-tool {
  margin-bottom: 1.25rem;
  max-width: 560px;
}

.field-directions-tool {
  background: #f1f3f5;
  border: 1px solid #e5e8eb;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.field-map-embed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.field-map-embed iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
}

.directions-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.directions-origin {
  flex: 1 1 240px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.directions-origin:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.directions-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.field-more {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.field-directions-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}

.field-directions-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.field-name a {
  color: var(--accent);
  text-decoration: none;
}

.field-name a:hover {
  text-decoration: underline;
}

/* ---------- Board Members ---------- */
.board-list {
  margin-top: 1rem;
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.board-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.6rem;
}

.board-col {
  min-width: 0;
}

.board-name {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  color: var(--accent-dark);
}

.board-position {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.board-contact-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.board-col a {
  text-decoration: none;
  word-break: break-word;
}

.board-col a:hover {
  text-decoration: underline;
}

.board-empty {
  color: var(--muted);
}

.board-profile {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.board-profile p:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .board-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 2rem 0;
}

.pagination .page-numbers,
.nav-links .page-numbers {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0d2438;
  color: #cbd5e1;
  margin-top: 3rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
}

.footer-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.footer-tagline {
  margin: 0.5rem 0 0;
  color: #94a3b8;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  list-style: none;
}

.footer-nav a {
  display: block;
  padding: 0.3rem 0;
  color: #cbd5e1;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-contact a {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero {
    padding: 2rem 1.5rem;
  }

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