/* ============================================================
   PUBLIC SECTION — Common Styles
   ============================================================ */

/* ---------- CSS VARIABLES ---------- */

:root
{
    --pub-primary: #FF8F00;
    --pub-primary-dark: #D84315;
    --pub-bg: #FAFAFA;
    --pub-card: #FFFFFF;
    --pub-text: #212121;
    --pub-text-light: #757575;
    --pub-border: #E0E0E0;
    --pub-nav-height: 64px;
    --pub-max-width: 1200px;
}

/* ---------- RESET / BASE ---------- */

.public-body
{
    margin: 0;
    padding: 0;
    background: var(--pub-bg);
    color: var(--pub-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- NAVIGATION BAR ---------- */

.pub-nav
{
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--pub-primary), var(--pub-primary-dark));
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

/* Top row: brand + login */
.pub-nav-top
{
    max-width: var(--pub-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.pub-nav-brand
{
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 2.1em;
    letter-spacing: 0.3px;
}

.pub-nav-brand img
{
    height: 63px;
    border-radius: 6px;
}

.pub-nav-login
{
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.15s;
}

.pub-nav-login:hover
{
    background: rgba(255,255,255,0.3);
}

/* Bottom row: navigation links */
.pub-nav-bottom
{
    background: rgba(0,0,0,0.12);
}

.pub-nav-links
{
    max-width: var(--pub-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 2px;
}

.pub-nav-link
{
    padding: 10px 16px;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.88em;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.pub-nav-link:hover
{
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.pub-nav-link.active
{
    color: #fff;
    border-bottom-color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Mobile menu toggle */
.pub-nav-toggle
{
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #fff;
    cursor: pointer;
    padding: 4px;
}

/* ---------- MAIN CONTENT ---------- */

.pub-main
{
    flex: 1;
    max-width: var(--pub-max-width);
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- PAGE HEADER ---------- */

.pub-page-header
{
    margin-bottom: 32px;
    background: var(--pub-card);
    border-radius: 14px;
    padding: 28px 32px;
    border-left: 5px solid var(--pub-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.pub-page-title
{
    font-size: 2em;
    font-weight: 700;
    color: var(--pub-text);
    margin: 0 0 6px;
}

.pub-page-title .fa-fw
{
    color: var(--pub-primary);
}

.pub-page-subtitle
{
    font-size: 1.05em;
    color: var(--pub-text-light);
    margin: 0;
}

/* ---------- CARDS ---------- */

.pub-card
{
    background: var(--pub-card);
    border-radius: 12px;
    border: 1px solid var(--pub-border);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pub-card:hover
{
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.pub-card-body
{
    padding: 20px;
}

.pub-card-title
{
    font-size: 1.1em;
    font-weight: 600;
    color: var(--pub-text);
    margin: 0 0 8px;
}

.pub-card-meta
{
    font-size: 0.85em;
    color: var(--pub-text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pub-card-meta i
{
    color: var(--pub-primary);
}

.pub-card-text
{
    font-size: 0.92em;
    color: var(--pub-text);
    line-height: 1.6;
}

/* ---------- GRID LAYOUTS ---------- */

.pub-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ---------- BADGE ROW (shared by event/course cards) ---------- */

.card-badge-row
{
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* ---------- BADGES ---------- */

.pub-badge
{
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-badge-orange { background: #FFF3E0; color: #E65100; }
.pub-badge-green  { background: #E8F5E9; color: #2E7D32; }
.pub-badge-blue   { background: #E3F2FD; color: #1565C0; }
.pub-badge-purple { background: #F3E5F5; color: #7B1FA2; }

/* ---------- EMPTY STATE ---------- */

.pub-empty
{
    text-align: center;
    padding: 60px 20px;
    color: var(--pub-text-light);
}

.pub-empty i
{
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.4;
}

.pub-empty p
{
    font-size: 1.05em;
}

/* ---------- FOOTER ---------- */

.pub-footer
{
    background: var(--pub-card);
    border-top: 1px solid var(--pub-border);
    margin-top: auto;
}

.pub-footer-inner
{
    max-width: var(--pub-max-width);
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pub-footer-info
{
    font-size: 0.88em;
    color: var(--pub-text-light);
    line-height: 1.6;
}

.pub-footer-info strong
{
    color: var(--pub-text);
}

.pub-footer-social
{
    display: flex;
    gap: 12px;
}

.pub-footer-social a
{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pub-bg);
    color: var(--pub-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    text-decoration: none;
    transition: all 0.15s;
}

.pub-footer-social a:hover
{
    background: var(--pub-primary);
    color: #fff;
}

.pub-footer-custom
{
    width: 100%;
    text-align: center;
    font-size: 0.88em;
    color: var(--pub-text-light);
    padding-top: 12px;
}

.pub-footer-copy
{
    width: 100%;
    text-align: center;
    padding-top: 20px;
    margin-top: 12px;
    border-top: 1px solid var(--pub-border);
    font-size: 0.8em;
    color: var(--pub-text-light);
}

/* ---------- LIGHTBOX ---------- */

.pub-lightbox
{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.pub-lightbox.open
{
    display: flex;
}

.pub-lightbox img
{
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.pub-lightbox-close
{
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.pub-lightbox-close:hover
{
    opacity: 1;
}

.pub-lightbox-nav
{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.15s;
}

.pub-lightbox-nav:hover
{
    background: rgba(255,255,255,0.3);
}

.pub-lightbox-prev { left: 20px; }
.pub-lightbox-next { right: 20px; }

/* ---------- PHOTO GRID ---------- */

.pub-photo-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.pub-photo-thumb
{
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.pub-photo-thumb img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.pub-photo-thumb:hover img
{
    transform: scale(1.05);
}

.pub-photo-caption
{
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: #fff;
    font-size: 0.82em;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.2s;
}

.pub-photo-thumb:hover .pub-photo-caption
{
    opacity: 1;
}

/* ---------- LOADING SPINNER ---------- */

.pub-loading
{
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.pub-loading::after
{
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--pub-border);
    border-top-color: var(--pub-primary);
    border-radius: 50%;
    animation: pubSpin 0.7s linear infinite;
}

@keyframes pubSpin
{
    to { transform: rotate(360deg); }
}

/* ---------- ENTRY ANIMATIONS ---------- */

@keyframes pubFadeIn
{
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pub-card
{
    animation: pubFadeIn 0.3s ease-out both;
}

.pub-grid .pub-card:nth-child(2) { animation-delay: 0.05s; }
.pub-grid .pub-card:nth-child(3) { animation-delay: 0.1s; }
.pub-grid .pub-card:nth-child(4) { animation-delay: 0.15s; }
.pub-grid .pub-card:nth-child(5) { animation-delay: 0.2s; }
.pub-grid .pub-card:nth-child(6) { animation-delay: 0.25s; }

.pub-page-header
{
    animation: pubFadeIn 0.4s ease-out both;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 768px)
{
    .pub-nav-bottom
    {
        display: none;
    }

    .pub-nav-bottom.open
    {
        display: block;
    }

    .pub-nav-bottom.open .pub-nav-links
    {
        flex-direction: column;
        padding: 8px 12px;
        gap: 0;
    }

    .pub-nav-bottom.open .pub-nav-link
    {
        border-bottom: none;
        padding: 12px 16px;
        border-radius: 8px;
    }

    .pub-nav-bottom.open .pub-nav-link.active
    {
        background: rgba(255,255,255,0.2);
    }

    .pub-nav-toggle
    {
        display: block;
    }

    .pub-nav-login
    {
        text-align: center;
    }

    .pub-main
    {
        padding: 20px 16px;
    }

    .pub-grid
    {
        grid-template-columns: 1fr;
    }

    .pub-page-header
    {
        padding: 20px 20px;
    }

    .pub-page-title
    {
        font-size: 1.5em;
    }

    .pub-footer-inner
    {
        flex-direction: column;
        text-align: center;
    }

    .pub-photo-grid
    {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px)
{
    .pub-main
    {
        padding: 16px 12px;
    }

    .pub-photo-grid
    {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- PUBLIC DOCUMENT DOWNLOADS ---------- */

.pub-doc-area
{
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pub-border);
}

.pub-doc-header
{
    font-size: 0.78em;
    font-weight: 600;
    color: var(--pub-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pub-doc-link
{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--pub-bg);
    border: 1px solid var(--pub-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--pub-text);
    font-size: 0.88em;
    transition: all 0.15s;
}

.pub-doc-link:hover
{
    border-color: var(--pub-primary);
    background: #FFF3E0;
}

.pub-doc-link i:first-child
{
    color: var(--pub-primary);
    font-size: 1.1em;
    flex-shrink: 0;
}

.pub-doc-link-title
{
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.pub-doc-link-size
{
    font-size: 0.8em;
    color: var(--pub-text-light);
    flex-shrink: 0;
}

.pub-doc-link-dl
{
    color: var(--pub-text-light);
    font-size: 0.85em;
    flex-shrink: 0;
    transition: color 0.15s;
}

.pub-doc-link:hover .pub-doc-link-dl
{
    color: var(--pub-primary);
}
