/*
Theme Name: Walk & Roll to School
Theme URI: https://walkroll.emporiamoves.org
Author: Eric Morrell
Description: Custom theme for Walnut Elementary's Walk and Roll to School Day, built from the 2026 Google Sites page. Includes a native WordPress registration form and a real-time Google Translate widget in place of a duplicate Spanish site.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: walkroll
*/

:root{
    --wr-blue: #1a73c1;
    --wr-blue-dark: #0f4c81;
    --wr-yellow: #f9b233;
    --wr-green: #3aa655;
    --wr-text: #222;
    --wr-bg: #ffffff;
    --wr-muted: #f4f7fa;
    --wr-border: #e1e6ea;
    --wr-max: 900px;
}

*{ box-sizing: border-box; }

body{
    margin:0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--wr-text);
    background: var(--wr-bg);
    line-height: 1.55;
}

img{ max-width:100%; height:auto; display:block; border-radius:8px; }

a{ color: var(--wr-blue); }
a:hover{ color: var(--wr-blue-dark); }

.wr-wrap{ max-width: var(--wr-max); margin:0 auto; padding: 0 20px; }

/* Top announcement bar */
.wr-topbar{
    background: var(--wr-blue-dark);
    color:#fff;
    font-size: 0.95rem;
}
.wr-topbar .wr-wrap{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding-top:10px;
    padding-bottom:10px;
}
.wr-topbar a{ color:#fff; text-decoration: underline; }
.wr-topbar strong{ font-weight:600; }

/* Site header — full-width photo banner with the site title centered over it.
   The image is cropped top/bottom (background-size:cover) so it always fills
   the width, at whatever height looks best for the current viewport. */
.wr-header-photo{
    position:relative;
    background-color: var(--wr-blue-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: clamp(200px, 32vw, 380px);
}
.wr-header-overlay{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background: linear-gradient(180deg, rgba(15,76,129,0.55) 0%, rgba(15,76,129,0.35) 100%);
}
.wr-header-overlay .wr-wrap{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    text-align:center;
    width:100%;
}
.wr-site-title{
    font-size: clamp(1.6rem, 4.5vw, 2.6rem);
    font-weight:700;
    color:#fff;
    text-decoration:none;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

/* Google Translate widget — reskinned as a small pill button in the topbar.
   Google's own markup only carries "Select Language" as a title/tooltip, not
   visible text, and ships its own flag icon + dropdown-arrow images — we hide
   all of that and draw our own compact "🌐 Translate ▾" label instead. */
#google_translate_element{
    display:inline-flex;
    align-items:center;
}
#google_translate_element .goog-te-gadget-simple{
    display:inline-flex !important;
    align-items:center;
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.45) !important;
    border-radius: 999px !important;
    padding: 5px 14px !important;
    font-family: inherit !important;
    font-size: 0 !important; /* zero out Google's own (invisible) text so only our label shows */
    line-height: 1 !important;
    cursor:pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
#google_translate_element .goog-te-gadget-simple:hover{
    background: rgba(255,255,255,0.22) !important;
    border-color: rgba(255,255,255,0.7) !important;
}
/* Hide every image Google renders inside the widget (flag icon + dropdown caret) */
#google_translate_element .goog-te-gadget-simple img,
#google_translate_element .goog-te-gadget-icon{
    display:none !important;
}
/* Our own label, drawn once on the outer gadget so it isn't duplicated per inner span */
#google_translate_element .goog-te-gadget-simple::before{
    content: "\1F310  Translate \25BE"; /* 🌐 Translate ▾ */
    font-size: 0.85rem;
    font-family: inherit;
    color:#fff;
    line-height:1;
}
#google_translate_element a.goog-logo-link,
#google_translate_element .goog-te-gadget span[style*="color: #a3a3a3"]{
    display:none !important; /* hide "Powered by Google" attribution text if rendered inline */
}
/* Google injects a full-width banner iframe at the top of <body> once a translation is
   active, plus offsets body with inline "top" — neutralize both so layout never jumps. */
.goog-te-banner-frame.skiptranslate{ display:none !important; }
body{ top: 0 !important; position: static !important; }
/* The little "Select Language" gadget WP sometimes duplicates at the very top of body */
body > .skiptranslate.goog-te-gadget{ display:none !important; }

/* Hero */
.wr-hero{
    background: linear-gradient(135deg, var(--wr-blue) 0%, var(--wr-blue-dark) 100%);
    color:#fff;
    padding: 48px 0;
    text-align:center;
}
.wr-hero h1{
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}
.wr-hero .wr-eyebrow{
    text-transform:uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    opacity: 0.9;
}
.wr-hero .wr-tagline{
    font-size: 1.1rem;
    max-width: 700px;
    margin: 12px auto 0;
    opacity: 0.95;
}

/* Content sections */
.wr-section{ padding: 40px 0; }
.wr-section + .wr-section{ border-top: 1px solid var(--wr-border); }
.wr-section h2{
    color: var(--wr-blue-dark);
    font-size: 1.5rem;
    margin-top:0;
}
.wr-section h3{ color: var(--wr-blue); }

.wr-gallery{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap:14px;
    margin: 20px 0;
}

.wr-groups{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap:18px;
    margin-top:20px;
}
.wr-group-card{
    background: var(--wr-muted);
    border: 1px solid var(--wr-border);
    border-radius: 10px;
    padding: 18px;
}
.wr-group-card h4{
    margin:0 0 8px;
    color: var(--wr-blue-dark);
}
.wr-group-card p{ margin: 0 0 10px; font-size: 0.96rem; }

.wr-callout{
    background: #fff8e6;
    border: 1px solid #f3d98b;
    border-radius: 10px;
    padding: 16px 18px;
    margin: 18px 0;
}

/* Registration form */
.wr-form{
    background: var(--wr-muted);
    border: 1px solid var(--wr-border);
    border-radius: 12px;
    padding: 26px;
    max-width: 620px;
    margin: 20px auto 0;
}
.wr-field{ margin-bottom: 18px; }
.wr-field label{
    display:block;
    font-weight:600;
    margin-bottom:6px;
}
.wr-field input[type="text"],
.wr-field input[type="email"]{
    width:100%;
    padding: 10px 12px;
    border: 1px solid var(--wr-border);
    border-radius: 6px;
    font-size: 1rem;
}
.wr-radio-options label{
    font-weight:400;
    display:flex;
    align-items:flex-start;
    gap:8px;
    margin-bottom:8px;
    cursor:pointer;
}
.wr-radio-options input{ margin-top:4px; }
.wr-submit{
    background: var(--wr-green);
    color:#fff;
    border:none;
    padding: 12px 28px;
    font-size: 1.05rem;
    border-radius: 6px;
    cursor:pointer;
    font-weight:600;
}
.wr-submit:hover{ background: #2f8c47; }

.wr-form-message{
    max-width:620px;
    margin: 20px auto;
    padding: 16px 18px;
    border-radius: 8px;
    font-weight:600;
    text-align:center;
}
.wr-form-message.success{ background:#e6f6ea; color:#1e7a34; border:1px solid #bfe6c9; }
.wr-form-message.error{ background:#fdecec; color:#a12626; border:1px solid #f3bcbc; }

/* Contact / footer */
.wr-contact p{ margin: 4px 0; }

.wr-sponsors{
    background: var(--wr-muted);
    text-align:center;
    padding: 40px 0;
}
.wr-sponsors h3{ color: var(--wr-blue-dark); }
.wr-sponsors img{ margin: 0 auto; }

.wr-footer{
    text-align:center;
    padding: 24px 0;
    font-size: 0.85rem;
    color:#777;
}

@media (max-width: 600px){
    .wr-topbar .wr-wrap{ flex-direction:column; align-items:flex-start; }
}
