/* ==========================================
   WeatherLink Harbour Display v2.9.0
   Bootstrap 5 responsive layouts
   Hero LEFT + Metrics RIGHT
   Tide Times LEFT + Chart RIGHT
   Inherits theme fonts · Animated icons
   ========================================== */

/* ── Scope — prevent Bootstrap bleed into rest of theme ── */
.wlh-weather-dashboard,
.wlh-tide-dashboard {
    max-width: 1200px;
    margin: 0 auto 32px;
    font-family: inherit;
    color: #1F2937;
}


/* ══════════════════════════════════════════════════
   HERO CARD (vertical layout inside left column)
   ══════════════════════════════════════════════════ */

.wlh-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #1B2A4A 0%, #2D4A7A 100%);
    border-radius: 14px;
    padding: 24px 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* Subtle wave overlay */
.wlh-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 80 Q50 60 100 80 T200 80 V200 H0Z' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E") repeat-x bottom;
    background-size: 200px 100px;
    pointer-events: none;
}

.wlh-hero > * {
    position: relative;
    z-index: 1;
}

/* Top row: location + time */
.wlh-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: auto;
}

.wlh-hero-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
}

.wlh-hero-location svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.wlh-hero-time {
    background: rgba(255,255,255,0.12);
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

/* Body: icon + temp + condition */
.wlh-hero-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 8px 0 4px;
}

.wlh-weather-icon {
    margin-bottom: 8px;
}

.wlh-weather-icon svg {
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.wlh-hero-temp {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 2px;
}

.wlh-hero-temp span {
    font-size: 1.5rem;
    opacity: 0.55;
    margin-left: -2px;
    font-weight: 400;
}

.wlh-hero-condition {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 2px;
}

.wlh-hero-feels {
    font-size: 0.8125rem;
    opacity: 0.5;
    margin-top: 4px;
}


/* ══════════════════════════════════════════════════
   ANIMATED WEATHER ICONS
   ══════════════════════════════════════════════════ */

@keyframes wlh-spin-rays {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.wlh-anim-sun .wlh-sun-rays {
    animation: wlh-spin-rays 20s linear infinite;
    transform-origin: 50px 50px;
}

.wlh-anim-partcloud .wlh-sun-rays-sm {
    animation: wlh-spin-rays 25s linear infinite;
    transform-origin: 62px 32px;
}

@keyframes wlh-drift {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(5px); }
}

.wlh-cloud-drift {
    animation: wlh-drift 4s ease-in-out infinite;
}

.wlh-cloud-back {
    animation-duration: 5.5s;
    animation-direction: reverse;
}

@keyframes wlh-fall {
    0%   { transform: translateY(0); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}

.wlh-drop { animation: wlh-fall 1s ease-in infinite; }
.wlh-d2   { animation-delay: 0.3s; }
.wlh-d3   { animation-delay: 0.6s; }

@keyframes wlh-glow {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1; }
}

.wlh-pc-sun {
    animation: wlh-glow 3s ease-in-out infinite;
}


/* ══════════════════════════════════════════════════
   METRIC CARDS
   ══════════════════════════════════════════════════ */

.wlh-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: wlh-card-in 0.4s ease-out both;
}

.wlh-card:nth-child(1) { animation-delay: 0.05s; }
.wlh-card:nth-child(2) { animation-delay: 0.10s; }
.wlh-card:nth-child(3) { animation-delay: 0.15s; }
.wlh-card:nth-child(4) { animation-delay: 0.20s; }
.wlh-card:nth-child(5) { animation-delay: 0.25s; }
.wlh-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes wlh-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wlh-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}

/* Icon circle — themed colours */
.wlh-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wlh-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wlh-card-wind .wlh-card-icon     { background: #E0F7FA; color: #0097A7; }
.wlh-card-humidity .wlh-card-icon  { background: #E3F2FD; color: #1976D2; }
.wlh-card-pressure .wlh-card-icon  { background: #EDE7F6; color: #5E35B1; }
.wlh-card-dew .wlh-card-icon       { background: #E0F2F1; color: #00897B; }
.wlh-card-uv .wlh-card-icon        { background: #FFF8E1; color: #F9A825; }
.wlh-card-solar .wlh-card-icon     { background: #FFF3E0; color: #EF6C00; }

/* Tide cards — same base .wlh-card style, themed colours */
.wlh-card-tide-high .wlh-card-icon { background: #ECFDF5; color: #10B981; }
.wlh-card-tide-low  .wlh-card-icon { background: #EFF6FF; color: #3B82F6; }

/* Extended metric card colours */
.wlh-card-heat    .wlh-card-icon { background: #FEE2E2; color: #DC2626; }
.wlh-card-chill   .wlh-card-icon { background: #E0F2FE; color: #0284C7; }
.wlh-card-rain    .wlh-card-icon { background: #E0E7FF; color: #4F46E5; }
.wlh-card-indoor  .wlh-card-icon { background: #F3E8FF; color: #7C3AED; }

/* ── Weather Grid (CSS Grid) ────────────────────── */
.wlh-weather-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.wlh-hero-cell {
    grid-row: span 3;
}

.wlh-hero-cell .wlh-hero {
    height: 100%;
}

.wlh-metric-cell .wlh-card {
    height: 100%;
}

/* Wide metric: spans 2 grid columns */
.wlh-metric-wide {
    grid-column: span 2;
}


/* ── Enhanced Card: Wind Compass ───────────────── */

.wlh-card-enhanced {
    padding: 16px 20px;
}

.wlh-enhanced-row {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.wlh-compass {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.wlh-compass-svg {
    width: 100%;
    height: 100%;
}

.wlh-enhanced-data {
    flex: 1;
    min-width: 0;
}

.wlh-enhanced-data .wlh-card-value {
    font-size: 1.75rem;
}

.wlh-beaufort-bar {
    width: 100%;
    height: 6px;
    background: #F1F5F9;
    border-radius: 3px;
    margin: 8px 0 6px;
    overflow: hidden;
}

.wlh-bft-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.wlh-bft-label {
    font-size: 0.6875rem;
    color: #64748B;
    font-weight: 500;
}

.wlh-bft-label strong {
    color: #1B2A4A;
}


/* ── Enhanced Card: Humidity Gauge ──────────────── */

.wlh-card-gauge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

.wlh-gauge-svg {
    width: 100%;
    max-width: 140px;
    height: auto;
}


/* ── Enhanced Card: Rain Bars ──────────────────── */

.wlh-rain-bar {
    width: 100%;
    height: 4px;
    background: #F1F5F9;
    border-radius: 2px;
    margin: 4px 0 2px;
    overflow: hidden;
}

.wlh-rain-fill {
    height: 100%;
    background: #4F46E5;
    border-radius: 2px;
    transition: width 0.6s ease-out;
}

.wlh-card-alt {
    color: #94A3B8;
    font-size: 0.625rem;
    font-weight: 400;
}

.wlh-card-data { flex: 1; min-width: 0; }

.wlh-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1B2A4A;
    line-height: 1;
    letter-spacing: -0.02em;
}

.wlh-card-value small {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94A3B8;
    margin-left: 2px;
    letter-spacing: 0;
}

.wlh-card-label {
    font-size: 0.6875rem;
    color: #64748B;
    margin-top: 4px;
    font-weight: 500;
}


/* ══════════════════════════════════════════════════
   TIDE DASHBOARD — combined layout
   ══════════════════════════════════════════════════ */

.wlh-tide-dashboard {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 28px 30px;
}

/* Shared nav bar */
.wlh-tide-dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #F1F5F9;
}

.wlh-tide-nav-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.wlh-tide-dash-title {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wlh-tide-dash-title h3,
.wlh-tide-dashboard .wlh-tide-dash-title h3 {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0;
    font-size: 1.125rem;
    font-weight: normal;
    color: #1B2A4A;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.wlh-tide-btn {
    background: #fff;
    color: #1B2A4A;
    padding: 7px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem;
    border: 1px solid #E2E8F0;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4;
}

.wlh-tide-btn:hover {
    background: #1B2A4A;
    color: #fff;
    border-color: #1B2A4A;
}

.wlh-tide-btn-today {
    background: #1B2A4A;
    color: #fff;
    border-color: #1B2A4A;
}

.wlh-tide-btn-today:hover {
    background: #2D4A7A;
    border-color: #2D4A7A;
}


/* ── 5-Day Forecast Strip ─────────────────────── */

.wlh-tide-forecast {
    margin-top: 16px;
    padding-top: 18px;
    border-top: 1px solid #F1F5F9;
}

.wlh-forecast-strip {
    animation: wlh-card-in 0.4s ease-out both;
}

.wlh-forecast-day {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    height: 100%;
}

.wlh-forecast-day:hover {
    background: #fff;
    border-color: #3B82F6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.wlh-forecast-date {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #1B2A4A;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
}

.wlh-forecast-tides {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wlh-forecast-tide {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    line-height: 1.2;
}

.wlh-forecast-high { color: #10B981; }
.wlh-forecast-low  { color: #3B82F6; }

.wlh-forecast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.wlh-forecast-time {
    font-weight: 700;
    color: #1B2A4A;
}

.wlh-forecast-height {
    color: #94A3B8;
    font-weight: 500;
}

.wlh-forecast-none {
    color: #CBD5E1;
    font-size: 0.75rem;
    padding: 8px 0;
}

/* Left panel — tide times */
.wlh-tide-times-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wlh-tide-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wlh-tide-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #F8FAFC;
    border-radius: 10px;
    border-left: 3px solid transparent;
    transition: background 0.15s, box-shadow 0.15s;
}

.wlh-tide-high { border-left-color: #10B981; }
.wlh-tide-low  { border-left-color: #3B82F6; }

.wlh-tide-item:hover {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.wlh-tide-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wlh-tide-high .wlh-tide-icon { color: #10B981; }
.wlh-tide-low  .wlh-tide-icon { color: #3B82F6; }

.wlh-tide-info { flex: 1; }

.wlh-tide-label {
    font-size: 0.625rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 2px;
}

.wlh-tide-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1B2A4A;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.wlh-tide-height-info { text-align: right; }

.wlh-tide-height-main {
    font-size: 1rem;
    font-weight: 700;
    color: #1B2A4A;
}

.wlh-tide-height-alt {
    font-size: 0.625rem;
    color: #94A3B8;
    margin-top: 2px;
}

/* Right panel — chart */
.wlh-tide-chart-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wlh-chart-wrap {
    background: #FAFBFD;
    border-radius: 8px;
    padding: 12px 8px 4px;
    flex: 1;
}


/* ══════════════════════════════════════════════════
   STANDALONE TIDE DISPLAY (backward compat)
   ══════════════════════════════════════════════════ */

.wlh-tide-simple {
    max-width: 1200px;
    margin: 0 auto 20px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 28px 32px;
    font-family: inherit;
}

.wlh-tide-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F1F5F9;
}

.wlh-tide-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1B2A4A;
}

.wlh-tide-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.wlh-tide-date {
    font-weight: 600;
    color: #1B2A4A;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

/* Standalone graph */
.wlh-tide-graph-widget {
    max-width: 1200px;
    margin: 0 auto 20px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 28px 32px;
    font-family: inherit;
}

.wlh-tide-graph-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F1F5F9;
}

.wlh-tide-graph-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1B2A4A;
}


/* ══════════════════════════════════════════════════
   DEBUG PANEL — admin-only, collapsible
   ══════════════════════════════════════════════════ */

.wlh-debug-panel {
    max-width: 1200px;
    margin: 16px auto 0;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8125rem;
    overflow: hidden;
}

.wlh-debug-toggle {
    padding: 10px 16px;
    background: #F8FAFC;
    cursor: pointer;
    font-weight: 600;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.wlh-debug-toggle:hover {
    background: #F1F5F9;
}

.wlh-debug-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.wlh-debug-open .wlh-debug-arrow {
    transform: rotate(90deg);
}

.wlh-debug-body {
    display: none;
    padding: 16px;
}

.wlh-debug-open .wlh-debug-body {
    display: block;
}

.wlh-debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.wlh-debug-table th,
.wlh-debug-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #F1F5F9;
}

.wlh-debug-table th {
    font-weight: 600;
    color: #64748B;
    background: #F8FAFC;
    text-transform: uppercase;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
}

.wlh-debug-table td em {
    color: #CBD5E1;
}

.wlh-debug-ok   { color: #10B981; }
.wlh-debug-warn { color: #F59E0B; }
.wlh-debug-info { color: #94A3B8; }

.wlh-debug-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #F1F5F9;
    font-size: 0.6875rem;
    color: #94A3B8;
}


/* ══════════════════════════════════════════════════
   ERROR / EMPTY / MEMBER STATES
   ══════════════════════════════════════════════════ */

.wlh-tide-no-data,
.wlh-tide-error {
    text-align: center;
    padding: 32px;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    color: #64748B;
    font-size: 0.9375rem;
}

.wlh-tide-loading {
    text-align: center;
    padding: 32px;
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 500;
}

.wlh-member-only {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #92400E;
}

.wlh-member-only a {
    color: #D97706;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* ══════════════════════════════════════════════════
   RESPONSIVE — Bootstrap handles columns,
   these handle inner component tweaks
   ══════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
    /* Tablet: 2 columns, hero spans 2 rows */
    .wlh-weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wlh-hero-cell {
        grid-row: span 2;
    }

    .wlh-metric-wide {
        grid-column: span 2;
    }

    /* Forecast: tighter text */
    .wlh-forecast-tide {
        font-size: 0.625rem;
        gap: 3px;
    }
}

@media (max-width: 767.98px) {
    .wlh-weather-dashboard,
    .wlh-tide-dashboard {
        margin-left: 12px;
        margin-right: 12px;
    }

    .wlh-tide-dashboard {
        padding: 20px 16px;
    }

    /* Mobile: single column, hero no longer spans */
    .wlh-weather-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wlh-hero-cell {
        grid-row: span 1;
    }

    .wlh-metric-wide {
        grid-column: span 1;
    }

    .wlh-compass {
        width: 80px;
        height: 80px;
    }

    .wlh-hero {
        padding: 24px 20px;
    }

    .wlh-hero-temp {
        font-size: 2.75rem;
    }

    .wlh-tide-dash-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .wlh-tide-dash-title {
        order: -1;
        flex-basis: 100%;
        margin-bottom: 4px;
    }

    .wlh-tide-nav-buttons {
        gap: 6px;
    }

    .wlh-tide-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    /* Forecast: scroll horizontal on small screens */
    .wlh-forecast-strip .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .wlh-forecast-strip .col {
        flex: 0 0 45%;
        max-width: 45%;
        scroll-snap-align: start;
    }
}

/* ── Container alignment ────────────────────────── */
.container .wlh-weather-dashboard,
.container .wlh-tide-dashboard,
.entry-content .wlh-weather-dashboard,
.entry-content .wlh-tide-dashboard {
    max-width: 100%;
}
