/*
Theme Name:        Park Train Tracker Theme
Theme URI:         https://peoriaparks.org
Author:            Willie Howe
Author URI:        https://peoriaparks.org
Description:       A fully customizable companion theme for the Park Train Tracker plugin. Features immersive park aesthetics, live train map integration, and deep Customizer support for colors, typography, logos, and background graphics.
Version:           1.3.1
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       ptt-theme
Tags:              custom-colors, custom-logo, custom-menu, full-width-template, theme-options, two-columns, left-sidebar, right-sidebar, footer-widgets, blog, e-commerce, entertainment, education

*/

/* ────────────────────────────────────────────
   1. CSS Custom Properties (Customizer-driven)
   ──────────────────────────────────────────── */
:root {
  --ptt-theme-primary:      #1a472a;
  --ptt-theme-primary-dark: #0f2d1a;
  --ptt-theme-accent:       #f4a261;
  --ptt-theme-accent-dark:  #e76f51;
  --ptt-theme-bg:           #f9f6f0;
  --ptt-theme-surface:      #ffffff;
  --ptt-theme-text:         #2c2c2c;
  --ptt-theme-text-muted:   #6b6b6b;
  --ptt-theme-border:       #e2ddd5;
  --ptt-theme-header-bg:    #1a472a;
  --ptt-theme-header-text:  #ffffff;
  --ptt-theme-footer-bg:    #0f2d1a;
  --ptt-theme-footer-text:  #c8dfc0;
  --ptt-theme-font-heading: 'Playfair Display', Georgia, serif;
  --ptt-theme-font-body:    'Lato', 'Helvetica Neue', sans-serif;
  --ptt-theme-radius:       10px;
  --ptt-theme-max-width:    1200px;
  --ptt-theme-shadow:       0 4px 24px rgba(0,0,0,.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--ptt-theme-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ptt-theme-text);
  background-color: var(--ptt-theme-bg);
  background-image:
    radial-gradient(circle at 20% 80%, rgba(26,71,42,.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(244,162,97,.04) 0%, transparent 50%);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ptt-theme-primary); text-decoration: none; }
a:hover { color: var(--ptt-theme-accent-dark); text-decoration: underline; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--ptt-theme-font-heading);
  color: var(--ptt-theme-primary);
  line-height: 1.25;
  margin-bottom: .5em;
}

p { margin-bottom: 1rem; }

/* ────────────────────────────────────────────
   3. Layout
   ──────────────────────────────────────────── */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main { flex: 1; }

.container {
  width: 100%;
  max-width: var(--ptt-theme-max-width);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* ────────────────────────────────────────────
   4. Header
   ──────────────────────────────────────────── */
.site-header {
  background: var(--ptt-theme-header-bg);
  color: var(--ptt-theme-header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 14px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.site-logo__placeholder {
  width: 48px;
  height: 48px;
  background: var(--ptt-theme-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.site-logo__name {
  color: var(--ptt-theme-header-text);
  font-family: var(--ptt-theme-font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.site-logo__tagline {
  font-size: .7rem;
  color: rgba(255,255,255,.6);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Nav */
.site-nav { margin-left: auto; }

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 8px 16px;
  color: rgba(255,255,255,.85);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  transition: background .2s, color .2s;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item a {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Live train status chip in header */
.header-train-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .8rem;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}

.header-train-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: ptt-pulsate 1.4s infinite;
  flex-shrink: 0;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

/* ────────────────────────────────────────────
   5. Hero / Page Banner
   ──────────────────────────────────────────── */
.page-hero {
  position: relative;
  padding: clamp(48px, 10vw, 96px) 0;
  background: linear-gradient(135deg, var(--ptt-theme-primary-dark) 0%, var(--ptt-theme-primary) 60%, #2d6a4f 100%);
  color: #fff;
  overflow: hidden;
  text-align: center;
}

/* Animated leaves in hero */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(244,162,97,.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.06) 0%, transparent 40%);
  pointer-events: none;
}

.page-hero__title {
  font-family: var(--ptt-theme-font-heading);
  font-size: clamp(2rem, 6vw, 4rem);
  color: #fff;
  margin-bottom: .4em;
  text-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.page-hero__subtitle {
  font-size: clamp(.95rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.8);
  max-width: 600px;
  margin-inline: auto;
}

/* Track decoration */
.page-hero__track {
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--ptt-theme-accent) 0px,
    var(--ptt-theme-accent) 20px,
    transparent 20px,
    transparent 36px
  );
  opacity: .6;
}

/* ────────────────────────────────────────────
   6. Content Area
   ──────────────────────────────────────────── */
.page-content {
  padding-block: clamp(32px, 6vw, 72px);
}

/* With sidebar layout */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────
   7. Tracker Page Template
   ──────────────────────────────────────────── */
.ptt-page-intro {
  text-align: center;
  padding: clamp(20px, 4vw, 40px) 0;
}

.ptt-page-intro h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.ptt-page-intro p {
  font-size: 1.1rem;
  color: var(--ptt-theme-text-muted);
  max-width: 560px;
  margin-inline: auto;
}

/* Train tracker in full-width context */
.ptt-full-tracker {
  margin-block: 32px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}

/* ────────────────────────────────────────────
   8. Cards & Widgets
   ──────────────────────────────────────────── */
.ptt-card {
  background: var(--ptt-theme-surface);
  border: 1px solid var(--ptt-theme-border);
  border-radius: var(--ptt-theme-radius);
  padding: 24px;
  box-shadow: var(--ptt-theme-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.ptt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.ptt-card__icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.ptt-card__title {
  font-size: 1.1rem;
  margin-bottom: .4em;
}

.ptt-card__body {
  font-size: .9rem;
  color: var(--ptt-theme-text-muted);
}

/* Info grid (e.g., stop cards on home page) */
.ptt-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-block: 24px;
}

/* ────────────────────────────────────────────
   9. Sidebar
   ──────────────────────────────────────────── */
.sidebar-widget {
  background: var(--ptt-theme-surface);
  border: 1px solid var(--ptt-theme-border);
  border-radius: var(--ptt-theme-radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.sidebar-widget__title {
  background: var(--ptt-theme-primary);
  color: #fff;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 18px;
  margin: 0;
}

.sidebar-widget__body { padding: 18px; }

/* ────────────────────────────────────────────
   10. Footer
   ──────────────────────────────────────────── */
.site-footer {
  background: var(--ptt-theme-footer-bg);
  color: var(--ptt-theme-footer-text);
  padding-block: 48px 24px;
  margin-top: auto;
}

.site-footer__widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-widget-title {
  font-family: var(--ptt-theme-font-heading);
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ptt-theme-accent);
  display: inline-block;
}

.site-footer a { color: var(--ptt-theme-footer-text); }
.site-footer a:hover { color: var(--ptt-theme-accent); }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  opacity: .7;
}

/* ────────────────────────────────────────────
   11. Buttons
   ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--ptt-theme-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ptt-theme-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,71,42,.4);
}

.btn-accent {
  background: var(--ptt-theme-accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--ptt-theme-accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244,162,97,.4);
}

/* ────────────────────────────────────────────
   12. Utilities
   ──────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ────────────────────────────────────────────
   13. Animations (shared with plugin)
   ──────────────────────────────────────────── */
@keyframes ptt-pulsate {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

@keyframes ptt-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ────────────────────────────────────────────
   14. Responsive
   ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ptt-theme-primary-dark); padding: 16px; }
  .site-nav.is-open ul { flex-direction: column; gap: 2px; }
  .nav-toggle { display: block; }
  .header-train-status { display: none; }
  .site-footer__widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .site-footer__widgets { grid-template-columns: 1fr; }
  .site-footer__bottom { flex-direction: column; text-align: center; }
}

/* ────────────────────────────────────────────
   15. Google Fonts import
   ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Lato:wght@300;400;700&display=swap');

/* ────────────────────────────────────────────
   16. Footer Enhancements v1.1.0
   ──────────────────────────────────────────── */

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand-emoji { font-size: 1.6rem; line-height: 1; }

.footer-brand-name {
  font-family: var(--ptt-theme-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.footer-tagline {
  font-style: italic;
  opacity: .8;
  margin-bottom: 12px;
}

.footer-about {
  font-size: .85rem;
  opacity: .75;
  margin-bottom: 16px;
}

/* Social icons */
.footer-socials {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--ptt-theme-footer-text);
  transition: background .2s, transform .2s;
}

.footer-social-link:hover {
  background: var(--ptt-theme-accent);
  color: #fff;
  transform: translateY(-2px);
  text-decoration: none;
}

.footer-social-link svg { display: block; }

/* ────────────────────────────────────────────
   17. Conductor Page Template v1.1.0
   ──────────────────────────────────────────── */

/* Full-height conductor page — remove default page padding */
body.page-template-template-conductor .page-hero,
body.page-template-template-conductor .page-content {
  padding: 0;
}

body.page-template-template-conductor .site-main {
  background: #f0f4f0;
}

/* ────────────────────────────────────────────
   18. Live Chip — Offline State v1.1.1
   ──────────────────────────────────────────── */
#header-train-chip.chip-offline {
  border-color: rgba(239,83,80,.4);
}
#header-train-chip.chip-offline .header-train-dot {
  background: #ef5350;
  animation: none;
  box-shadow: none;
}
