/* PLGC Golf Weather Widget v2.5.2 — Aviatrix Communications */

/* ── Shared base ─────────────────────────────────────────────────────────── */

.plgc-wx { font-family: 'Open Sans', sans-serif; font-size: 1rem; position: relative; box-sizing: border-box; }
.plgc-wx *, .plgc-wx *::before, .plgc-wx *::after { box-sizing: inherit; }
.plgc-wx--dark  { color: #fff; }
.plgc-wx--light { color: #1a1a1a; }
.plgc-wx__icon svg, .plgc-wx__popup-icon svg, .plgc-wx__current-icon svg, .plgc-wx__day-icon svg { display: block !important; overflow: visible; }

/* ── Playability badges ───────────────────────────────────────────────────── */

.plgc-wx__play-badge, .plgc-wx__day-play {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/*
 * Contrast ratios (WCAG 2.1 AA — requires 4.5:1 for small text):
 * perfect  #22c55e bg + #14532d text = 7.85:1 ✓
 * great    #84cc16 bg + #1a2e0e text = 6.63:1 ✓
 * ok       #FFAE40 bg + #1a1a1a text = 9.43:1 ✓
 * fair     #c2410c bg + #fff text    = 5.18:1 ✓
 * poor     #b91c1c bg + #fff text    = 6.47:1 ✓
 * danger   #991b1b bg + #fff text    = 8.31:1 ✓
 */
.plgc-wx-play--perfect { background: #22c55e; color: #14532d; }
.plgc-wx-play--great   { background: #84cc16; color: #1a2e0e; }
.plgc-wx-play--ok      { background: #FFAE40; color: #1a1a1a; }
.plgc-wx-play--fair    { background: #c2410c; color: #fff; }
.plgc-wx-play--poor    { background: #b91c1c; color: #fff; }
.plgc-wx-play--danger  { background: #991b1b; color: #fff; animation: plgc-wx-flash 1.5s ease-in-out infinite; }
/* Course status overrides */
.plgc-wx-play--closed    { background: #991b1b; color: #fff; }
.plgc-wx-play--limited   { background: #FFAE40; color: #1a1a1a; }
.plgc-wx-play--offseason { background: #374151; color: #e5e7eb; }

/* Used in full card below the badge */
.plgc-wx__play-tip {
    font-size: 0.8rem;
    opacity: 0.75;
    margin: 0.25rem 0 0;
    font-style: italic;
    line-height: 1.4;
}
/* Inside popup badge-row: reset margin, handled by row gap */
.plgc-wx__popup-badge-row .plgc-wx__play-tip { margin: 0; }

/* ── Compact widget (footer inline) ─────────────────────────────────────────*/

.plgc-wx--compact {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.plgc-wx__label { font-weight: 600; white-space: nowrap; }

.plgc-wx__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    line-height: 1.5;
}

.plgc-wx__trigger:focus-visible {
    outline: 3px solid #FFAE40;
    outline-offset: 3px;
    border-radius: 4px;
}

.plgc-wx__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px; min-width: 52px;
    flex-shrink: 0;
    vertical-align: middle;
}

.plgc-wx__reading { font-weight: 400; white-space: nowrap; }

.plgc-wx__chevron {
    font-size: 1.1rem; line-height: 1;
    transition: transform 200ms ease;
    opacity: 0.7;
}
.plgc-wx__trigger[aria-expanded="true"] .plgc-wx__chevron { transform: rotate(180deg); }

/* Compact popup */
.plgc-wx__popup {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 1.5rem);
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    padding: 1rem;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
}

.plgc-wx__popup[hidden] { display: none; }

.plgc-wx__popup-inner { position: relative; }

/* ── Hero row: icon left, temp/desc/badge right ──────────────────────────── */
.plgc-wx__popup-hero {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.plgc-wx__popup-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center; justify-content: center;
    width: 64px; height: 64px;
}

.plgc-wx__popup-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.plgc-wx__popup-desc {
    font-weight: 600;
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
}

.plgc-wx__popup-temp {
    font-size: 1.6rem;
    font-weight: 700;
    color: #FFAE40;
    margin: 0;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.plgc-wx__popup-temp .plgc-wx__feels-inline {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
}

/* Badge on its own line, tip text capped to 2 lines beneath it */
.plgc-wx__popup-badge-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
}
.plgc-wx__popup-badge-row .plgc-wx__play-tip {
    font-size: 0.72rem;
    font-style: italic;
    color: rgba(255,255,255,0.55);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plgc-wx__close {
    position: absolute; top: -0.125rem; right: -0.125rem;
    background: transparent; border: none;
    color: rgba(255,255,255,0.45); font-size: 1.1rem;
    line-height: 1; cursor: pointer; padding: 0.25rem;
}
.plgc-wx__close:hover { color: #fff; }
.plgc-wx__close:focus-visible { outline: 2px solid #FFAE40; border-radius: 4px; }

.plgc-wx__popup-details {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.75rem; text-align: left;
    margin: 0 0 0.625rem; font-size: 0.78rem;
    padding-top: 0.625rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.plgc-wx__popup-details div { display: flex; flex-direction: column; gap: 1px; }
.plgc-wx__popup-details dt { color: rgba(255,255,255,0.45); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; }
.plgc-wx__popup-details dd { margin: 0; font-weight: 600; }

/* Condition advisory — plain language for notable weather */
.plgc-wx__condition-advisory {
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.06);
    border-left: 3px solid #FFAE40;
    border-radius: 0 5px 5px 0;
    padding: 0.3rem 0.5rem;
    margin: 0.25rem 0 0.5rem;
}

/* 3-day strip inside popup */
.plgc-wx__popup-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.625rem;
}

.plgc-wx__popup-forecast .plgc-wx__day {
    height: 130px;
    background: rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.3rem 0.2rem 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    overflow: hidden;
}

.plgc-wx__popup-forecast .plgc-wx__day-name {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.55);
}

.plgc-wx__popup-forecast .plgc-wx__day-temp {
    font-size: 0.8rem;
    font-weight: 700;
}
.plgc-wx__popup-forecast .plgc-wx__day-temp em {
    font-style: normal;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
    margin-left: 3px;
}

.plgc-wx__popup-forecast .plgc-wx__day-pop {
    font-size: 0.65rem;
    color: #A8C8E8;
    font-weight: 600;
}

.plgc-wx__popup-forecast .plgc-wx__day-play {
    font-size: 0.48rem;
    padding: 0.1rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
    display: block;
    text-align: center;
}

.plgc-wx__forecast-link, .plgc-wx__more-link {
    display: inline-block; color: #FFAE40; font-size: 0.875rem;
    font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
.plgc-wx__forecast-link:hover, .plgc-wx__more-link:hover { opacity: 0.8; }

/* ── Full golf forecast card ─────────────────────────────────────────────── */

.plgc-wx--full { display: block; }

.plgc-wx__card {
    background: linear-gradient(135deg, #1a2e0e 0%, #243d13 60%, #1a2e0e 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 3px solid #FFAE40;
    border-radius: 16px;
    padding: 1.25rem 1.5rem 1.5rem;
    color: #fff;
    max-width: 600px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.plgc-wx__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.plgc-wx__header-label {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FFAE40;
}

/* Current conditions row */
.plgc-wx__current {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.plgc-wx__current-icon { flex-shrink: 0; }

.plgc-wx__current-info { flex: 1; }

.plgc-wx__current-temp {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.2rem;
    color: #fff;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* "Feels X°F" shown inline next to the big temp on the full card */
.plgc-wx__feels-sub {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.plgc-wx__current-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    margin: 0 0 0.625rem;
}

/* Stats row */
.plgc-wx__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.875rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
    .plgc-wx__stats { grid-template-columns: repeat(2, 1fr); }
    .plgc-wx__current-temp { font-size: 2.25rem; }
}

.plgc-wx__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.plgc-wx__stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

.plgc-wx__stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* 3-day forecast strip */
.plgc-wx__forecast-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.plgc-wx__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.plgc-wx__day-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.6);
}

.plgc-wx__day-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.plgc-wx__day-temp {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}
.plgc-wx__day-temp em { font-style: normal; font-weight: 400; color: rgba(255,255,255,0.5); margin-left: 4px; }

.plgc-wx__day-pop {
    font-size: 0.7rem;
    color: #A8C8E8;
    font-weight: 600;
}

.plgc-wx__day-play {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    margin-top: 0.1rem;
}

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes plgc-wx-flash {
    0%, 80%, 100% { opacity: 1; }
    90% { opacity: 0.4; }
}

/* ── Admin notice ────────────────────────────────────────────────────────── */
.plgc-wx-notice { font-size: 0.875rem; color: #b00; font-style: italic; }

@media (prefers-reduced-motion: reduce) {
    .plgc-wx__icon svg *, .plgc-wx__popup-icon svg *,
    .plgc-wx__current-icon svg *, .plgc-wx__day-icon svg *,
    .plgc-wx__popup-forecast .plgc-wx__day-icon svg * {
        animation-play-state: paused !important;
    }
    .plgc-wx-play--danger { animation: none !important; }
}

/* ── Course Status Banner ─────────────────────────────────────────────────── */

.plgc-course-status {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    border-left: 4px solid transparent;
}

.plgc-course-status__icon { font-size: 1.25rem; flex-shrink: 0; }

.plgc-course-status--open {
    background: #f0fdf4;
    border-left-color: #22c55e;
    color: #15532a;
}

.plgc-course-status--limited {
    background: #fffbeb;
    border-left-color: #FFAE40;
    color: #7c4a00;
}

.plgc-course-status--closed {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #7f1d1d;
}

.plgc-course-status--offseason {
    background: #f0f4ff;
    border-left-color: #6b7280;
    color: #1e2a47;
}
