/* ----------------------------------
   Formosa Running Club – Brand Theme
------------------------------------- */

:root {
    --blue: #3C86FF;
    --hotpink: #E61660;
    --lightpink: #F7C3DB;
    --orange: #F47C20;
    --black: #000000;
    --bg-light: #ffffff;
}

/* Base */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--black);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

h1, h2, h3 {
    font-weight: bold;
}

.visually-hidden {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ----------------------------------
   Navigation
------------------------------------- */

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--blue);
    padding: 15px 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

nav a:hover {
    opacity: 0.75;
}

/* ----------------------------------
   HERO SECTION
------------------------------------- */

.hero {
    background: var(--hotpink);
    padding-top: 60px;
    padding-bottom: 10px;
    text-align: center;
    color: white;
}

.logo-wrapper {
    background: white;
    padding: 10px;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.frc-logo-wide {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 10px;
}

.tagline {
    font-size: 22px;
    max-width: 800px;
    margin: 0 auto 20px;
    color: white;
    line-height: 1.5;
}

.btn {
    display: inline-block;
    margin-top: 25px;
    padding: 14px 28px;
    background: var(--orange);
    color: white;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.85;
}

/* ----------------------------------
   SECTIONS (tight spacing)
------------------------------------- */

section {
    padding: 40px 20px !important;
    max-width: 1100px;
    margin: auto;
}

section h2 {
    text-align: center;
    color: var(--blue);
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 36px;
}

/* ----------------------------------
   ABOUT
------------------------------------- */

#about p {
    max-width: 800px;
    margin: 0 auto 10px !important;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
}

/* ----------------------------------
   TRAINING
------------------------------------- */

.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

.training-grid.lang.active {
    display: grid !important;
}

.training-box {
    background: var(--lightpink);
    padding: 25px;
    border-radius: 8px;
    transition: transform 0.25s ease;
}

.training-box:hover {
    transform: translateY(-5px);
}

.training-box h3 {
    color: var(--hotpink);
    margin-bottom: 10px;
}

/* ----------------------------------
   GALLERY: 3-column (desktop)
------------------------------------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 on desktop */
    gap: 15px;
    margin-top: 10px !important;
}

.gallery-grid img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.gallery-grid img:hover {
    transform: scale(1.03);
}

/* Tablet = 2 columns */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile = 1 column */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------
   LIGHTBOX (Instagram-style)
------------------------------------- */

#lightbox {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#lightbox.active {
    display: flex;
}

#lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(3px);
}

/* Lightbox content sizing (new improved version) */
#lightbox-content {
    position: relative;
    z-index: 3;
    max-width: 80%;
    max-height: 80%;
}

/* Desktop: prevent oversized images */
@media (min-width: 900px) {
    #lightbox-img {
        max-width: 70vw;      /* no wider than 70% of the viewport */
        max-height: 80vh;     /* no taller than 80% of the viewport */
        object-fit: contain;
        border-radius: 10px;
        animation: zoomIn 0.25s ease;
    }
}

/* Mobile + tablet: keep large but not overwhelming */
@media (max-width: 900px) {
    #lightbox-img {
        max-width: 95vw;
        max-height: 90vh;
        object-fit: contain;
        border-radius: 10px;
        animation: zoomIn 0.25s ease;
    }
}


/* Smooth zoom animation */
@keyframes zoomIn {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* X close button */
#lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: black;
    border: none;
    font-size: 26px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

#lightbox-close:hover {
    background: var(--lightpink);
}

/* ----------------------------------
   CONTACT
------------------------------------- */

.contact-item {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    background-size: cover;
}

/* SVG icons (data URIs) */
.email-icon {
    background-image: url("data:image/svg+xml,%3Csvg fill='black' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2zm8 7l8-5H4l8 5zm0 2l-8-5v10h16V8l-8 5z'/%3E%3C/svg%3E");
}

.insta-icon {
    background-image: url("data:image/svg+xml,%3Csvg fill='black' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2C4.2 2 2 4.2 2 7v10c0 2.8 2.2 5 5 5h10c2.8 0 5-2.2 5-5V7c0-2.8-2.2-5-5-5H7zm10 2c1.7 0 3 1.3 3 3v10c0 1.7-1.3 3-3 3H7c-1.7 0-3-1.3-3-3V7c0-1.7 1.3-3 3-3h10zm-5 3.5A4.5 4.5 0 1016.5 12 4.5 4.5 0 0012 7.5zm0 2A2.5 2.5 0 1114.5 12 2.5 2.5 0 0112 9.5zm4.8-3.7a1 1 0 11-1 1 1 1 0 011-1z'/%3E%3C/svg%3E");
}

.strava-icon {
    background-image: url("data:image/svg+xml,%3Csvg fill='%23F47C20' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.7 2l3.9 7.6H8.8L12.7 2zm4.6 9.6l3.9 7.6h-7.8l3.9-7.6zM6.7 13.4l2.3 4.5H4.4l2.3-4.5z'/%3E%3C/svg%3E");
}

.whatsapp-icon {
    background-image: url("data:image/svg+xml,%3Csvg fill='%2333cc33' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3C9.4 3 4 8.4 4 15c0 2.6.8 5 2.1 7.1L4 29l7.2-2.1C13.2 28.5 14.6 29 16 29c6.6 0 12-5.4 12-12S22.6 3 16 3zm7 17.6c-.3.9-1.5 1.6-2.4 1.8-.6.1-1.4.2-2.3-.1-.5-.2-1.1-.3-1.9-.7-3.3-1.6-5.4-4.5-5.6-4.7-.2-.3-1.3-1.7-1.3-3.2s.8-2.3 1.1-2.6c.3-.3.7-.4 1-.4h.7c.2 0 .5-.1.7.6.3.9 1 3 1.1 3.2.1.2.1.4 0 .6-.1.2-.2.4-.4.6l-.6.7c-.2.2-.4.4-.2.7.2.3.9 1.5 2.1 2.5 1.5 1.3 2.7 1.7 3 .1.3-.3.6-.4.8-.3.3.1 1.9.9 2.2 1.1.3.2.5.3.6.5.1.2.1.9-.2 1.8z'/%3E%3C/svg%3E");
}

/* Footer */
footer {
    text-align: center;
    padding: 25px;
    background: var(--blue);
    color: white;
}

/* ----------------------------------
   BILINGUAL FADE SYSTEM
------------------------------------- */

.lang {
    opacity: 0;
    transition: opacity 0.4s ease;
    display: none;
}

.lang.active {
    display: block;
    opacity: 1;
}

/* ----------------------------------
   HERO ANIMATIONS
------------------------------------- */

.animate-logo,
.animate-tagline,
.animate-btn {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: all 0.8s ease;
}

.animate-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.animate-tagline.animate-show {
    transition-delay: 0.15s;
}

.animate-btn.animate-show {
    transition-delay: 0.3s;
}

/* ----------------------------------
   MOBILE
------------------------------------- */

@media (max-width: 768px) {
    nav ul { gap: 18px; }
}
