/* Additions layered on top of the original dream.css (kept intact for the
   overall look/colors). This file: (1) replaces the old Cufon JS font
   replacement with real @font-face / Google Fonts, (2) styles the new
   dependency-free nav that replaces the old FSMenu script, (3) adds light
   responsive behavior for phones/tablets, (4) styles shared UI added in the
   rebuild (pagination, forms, admin panel, alerts) that didn't exist before. */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Alex+Brush&display=swap');

/* dream.css sets body text at 11px, which reads very small on modern
   screens - bump the default reading size up. */
body { font-size: 16px; line-height: 26px; }

#left h1, #right h1 {
  font-family: 'Alex Brush', 'Garamond', serif;
}
#left h2, #left h3, #right h3 {
  font-family: 'EB Garamond', Garamond, serif;
}

/* ---- Top navigation (replaces the old table + FSMenu markup) ----
   Same colors as before; this pass just gives the bar itself more
   breathing room and a slightly cleaner, more modern feel. */
#navigation { text-align: left; height: auto; padding: 0; border-bottom: 1px solid #1f2555; }
#navigation-left, #navigation-right { display: none; }

#site-nav { width: 920px; margin: 0 auto; }
#nav-toggle { display: none; background: #1a2350; color: #fff; border: 1px solid #3b3f7a;
  padding: 8px 12px; font-size: 14px; cursor: pointer; border-radius: 4px; margin: 10px 0; }
#nav-list { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
#nav-list li { position: relative; }
#nav-list > li > a {
  display: block; padding: 18px 16px; color: #d9d9d9; text-decoration: none;
  font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold;
  letter-spacing: 0.03em; border-radius: 4px; transition: background-color 0.15s ease, color 0.15s ease;
}
#nav-list > li > a:hover, #nav-list > li > a.is-active { background: #1a2350; color: #fff; }
.submenu { list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%;
  background: #0a1031; border: 1px solid #2b2f5f; border-radius: 0 0 6px 6px; min-width: 200px;
  display: none; z-index: 20; box-shadow: 0 10px 24px rgba(0,0,0,0.4); }
.has-children:hover .submenu, .has-children:focus-within .submenu { display: block; }
.submenu li a { display: block; padding: 8px 16px; color: #d9d9d9; text-decoration: none; font-size: 12px; }
.submenu li a:hover { background: #1a2350; }

/* ---- Horse / gallery grids ---- */
.horse-grid, .gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.horse-card, .gallery-card { width: 200px; }
.horse-card img, .gallery-card img { width: 100%; height: auto; display: block; border: 2px solid #3b3f7a; }
.horse-card .name, .gallery-card .caption { display: block; margin-top: 4px; text-align: center; }

.pedigree-table td { padding: 2px 6px; font-size: 11px; }

/* ---- Forms shared by contact / newsletter / admin ---- */
.dgf-field { margin-bottom: 12px; }
.dgf-field label { display: block; margin-bottom: 4px; }
.dgf-field input[type=text], .dgf-field input[type=email], .dgf-field input[type=tel],
.dgf-field input[type=password], .dgf-field textarea, .dgf-field select {
  width: 100%; max-width: 420px; padding: 6px 8px; box-sizing: border-box;
}
.dgf-btn { background: #3b3f7a; color: #fff; border: none; padding: 8px 18px; cursor: pointer; border-radius: 3px; }
.dgf-btn:hover { background: #4d52a0; }

.alert { padding: 10px 14px; border-radius: 3px; margin-bottom: 14px; }
.alert-success { background: #1f4d2b; color: #d5ffe0; }
.alert-error { background: #5a1f1f; color: #ffd9d9; }

.pagination { margin: 16px 0; }
.pagination a, .pagination span { display: inline-block; padding: 4px 10px; margin-right: 4px; color: #d9d9d9; text-decoration: none; }
.pagination a:hover { text-decoration: underline; }
.pagination .current { font-weight: bold; text-decoration: underline; }

/* ---- Homepage hero fade (replaces the old "Ultimate Fade-In Slideshow" DHTML script) ---- */
#flash1.hero-fade { position: relative; width: 540px; height: 344px; overflow: hidden; }
#flash1.hero-fade .hero-slide {
  position: absolute; top: 0; left: 0; width: 540px; height: 344px; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease-in-out;
}
#flash1.hero-fade .hero-slide.active { opacity: 1; }

/* ---- Pedigree chart (replaces the old handcrafted colspan table) ----
   Two branching trees (sire line / dam line), each ancestor box connected
   to its own two parent boxes by a bracket line, going 4 generations deep. */
.pedigree-chart { display: flex; gap: 40px; margin: 12px 0 30px; overflow-x: auto; padding-bottom: 8px; }
.pedigree-side { flex: 1 1 0; min-width: 300px; }
.pedigree-side-label {
  font-family: 'EB Garamond', Garamond, serif; font-size: 15px; font-weight: bold;
  color: #d9d9d9; margin-bottom: 10px; border-bottom: 1px solid #3b3f7a; padding-bottom: 4px;
}
.ped-node { display: flex; align-items: center; }
.ped-box {
  background: #131b45; border: 1px solid #3b3f7a; color: #d9d9d9;
  font-size: 11px; line-height: 1.3; padding: 5px 9px; border-radius: 3px;
  white-space: nowrap; min-width: 110px; text-align: center;
}
.ped-empty { color: #6a6f9a; font-style: italic; }
.ped-children { display: flex; flex-direction: column; justify-content: center; margin-left: 18px; position: relative; }
.ped-children::before {
  content: ''; position: absolute; left: -18px; top: 0; bottom: 0; width: 0;
  border-left: 1px solid #3b3f7a;
}
.ped-children > .ped-node { position: relative; padding: 3px 0; }
.ped-children > .ped-node::before {
  content: ''; position: absolute; left: -18px; top: 50%; width: 18px; height: 0;
  border-top: 1px solid #3b3f7a;
}

/* ---- Admin nav logout button (a <form>/<button> now, was a GET <a>) ---- */
.admin-nav-logout {
  background: none; border: none; color: #cfd2ff; text-decoration: none;
  margin-right: 14px; font-size: 12px; padding: 0; cursor: pointer; font-family: inherit;
}
.admin-nav-logout:hover { color: #fff; text-decoration: underline; }

/* ---- Scrolling news ticker (replaces the old <marquee> tag) ---- */
.news-ticker { width: 100%; height: 100%; overflow: hidden; white-space: nowrap; }
.news-ticker-track {
  display: inline-block; padding-left: 100%;
  animation: news-ticker-scroll 20s linear infinite;
}
.news-ticker:hover .news-ticker-track { animation-play-state: paused; }
@keyframes news-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---- Lightbox (replaces the old "thickbox" plugin) ---- */
#lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out;
}
#lightbox-overlay[hidden] { display: none; }
#lightbox-img { max-width: 90vw; max-height: 90vh; border: 4px solid #fff; }

/* ---- Responsive ---- */
@media (max-width: 940px) {
  #main-wrapper, #sub-content-wrapper, #site-nav { width: 100%; max-width: 920px; padding: 0 10px; box-sizing: border-box; }
  #left, #right { float: none; width: 100% !important; }
  #nav-toggle { display: block; }
  #nav-list { display: none; flex-direction: column; }
  #nav-list.open { display: flex; }
  .submenu { position: static; display: block; border: none; }
}
