/* ── Fort Nashville Calendar v1.1 ── */

.fnc-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

/* ── Header ── */
.fnc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    color: #fff;
    padding: 12px 18px;
    border-radius: 4px 4px 0 0;
}

.fnc-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
    border: none;
    padding: 0;
}

.fnc-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 3px;
    color: #fff;
    background: none;
    font-size: 1.5rem;
    text-decoration: none;
    line-height: 1;
    font-weight: bold;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.fnc-nav:hover,
.fnc-nav:focus {
    background: #fff;
    color: #1a1a2e;
    text-decoration: none;
}

/* ── Day-of-week row ── */
.fnc-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #2c2c54;
}

.fnc-dow span {
    text-align: center;
    color: #fff;
    font-weight: 700;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Show full names on desktop, single letters on mobile */
.fnc-dow-full  { font-size: .78rem; display: block; }
.fnc-dow-short { font-size: .75rem; display: none; }

/* ── Grid ── */
.fnc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-left: 1px solid #d0d0d0;
    border-top: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.fnc-cell {
    border-right: 1px solid #d0d0d0;
    border-bottom: 1px solid #d0d0d0;
    min-height: 90px;
    padding: 6px 6px 4px;
    box-sizing: border-box;
}

.fnc-cell.fnc-other { background: #f9f9f9; }

.fnc-cell.fnc-today .fnc-day-num {
    background: #c0392b;
    color: #fff;
    border-radius: 50%;
}

.fnc-day-num {
    font-size: .82rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 3px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fnc-cell.fnc-other .fnc-day-num { color: #bbb; }

/* ── Event badges ── */
.fnc-event {
    display: block;
    width: 100%;
    background: #2c2c54;
    color: #fff;
    font-size: .68rem;
    line-height: 1.35;
    border-radius: 3px;
    padding: 2px 5px;
    margin-bottom: 2px;
    cursor: pointer;
    word-break: break-word;
    border: none;
    text-align: left;
    transition: background .15s;
    font-family: inherit;
    white-space: normal;
    overflow: hidden;
}

.fnc-event:hover,
.fnc-event:focus {
    background: #c0392b;
    color: #fff;
    outline: none;
}

/* ── Popup (title + date only — no notes) ── */
.fnc-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    padding: 14px 36px 14px 14px;
    width: 240px;
    z-index: 99999;
    display: none;
}

.fnc-popup.fnc-popup-visible { display: block; }

.fnc-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}

.fnc-popup-close:hover { color: #c0392b; }

.fnc-popup-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 5px;
}

.fnc-popup-date {
    font-size: .8rem;
    color: #555;
    line-height: 1.4;
}

/* ── Error notice ── */
.fnc-error {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 14px;
    color: #721c24;
    font-size: .88rem;
}

/* ── Tablet (≤ 600px) ── */
@media (max-width: 600px) {
    .fnc-header h2  { font-size: 1rem; }
    .fnc-nav        { width: 30px; height: 30px; font-size: 1.2rem; }
    .fnc-cell       { min-height: 70px; padding: 4px 3px; }
    .fnc-day-num    { font-size: .75rem; width: 20px; height: 20px; }
    .fnc-event      { font-size: .62rem; padding: 2px 3px; }
    .fnc-dow-full   { display: none; }
    .fnc-dow-short  { display: block; }
}

/* ── Mobile (≤ 400px) ── */
@media (max-width: 400px) {
    .fnc-header     { padding: 10px 12px; }
    .fnc-header h2  { font-size: .9rem; letter-spacing: .02em; }
    .fnc-nav        { width: 28px; height: 28px; font-size: 1.1rem; border-width: 1px; }
    .fnc-cell       { min-height: 54px; padding: 3px 2px; }
    .fnc-day-num    { font-size: .7rem; width: 18px; height: 18px; margin-bottom: 2px; }
    .fnc-event      { font-size: .55rem; padding: 1px 2px; margin-bottom: 1px; border-radius: 2px; }
    .fnc-dow span   { font-size: .7rem; padding: 6px 0; }

    /* On very small screens show popup full-width at bottom of calendar */
    .fnc-popup {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        top: auto !important;
        width: calc(100vw - 32px);
        max-width: 340px;
        box-shadow: 0 -2px 20px rgba(0,0,0,.25);
    }
}
