/* =========================================================
   W9VA WEATHER - FINAL MOBILE LAYOUT
   Target: approved iPhone mockup
   ========================================================= */

@media (max-width: 600px) {

  /* Hide desktop-only page structure on phones */
  body > .topbar,
  body > .page,
  body > footer {
    display: none !important;
  }

  body {
    margin: 0;
    background: #f5f8fb;
    color: #173d66;
    font-family: Arial, Helvetica, sans-serif;
  }

  .mobile-weather {
    display: block !important;
    width: 100%;
    min-height: 100vh;
    background: #f5f8fb;
  }

  /* =====================================================
     HEADER
     ===================================================== */

  .mobile-header {
    background: linear-gradient(90deg, #1f568c, #11375d);
    color: #ffffff;
    padding: 12px 14px 9px;
  }

  .mobile-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-brand {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.5px;
  }

  .mobile-menu {
    font-size: 1.85rem;
    line-height: 1;
  }

  .mobile-subnav {
    margin-top: 8px;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.96;
  }

  /* =====================================================
     SCENIC MASTHEAD
     ===================================================== */

  .mobile-banner {
    height: 78px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    background-image:
      linear-gradient(
        rgba(10, 35, 60, 0.14),
        rgba(10, 35, 60, 0.20)
      ),
      url("images/masthead.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-bottom: 1px solid #d3e0ea;
  }

  .mobile-banner-title {
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.55);
  }

  .mobile-banner-location {
    margin-top: 3px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0,0,0,0.55);
  }

  /* =====================================================
     LOCAL WEATHER TITLE BAR
     ===================================================== */

  .mobile-weather-title {
    margin: 6px 10px 0;
    padding: 6px 10px;

    background: linear-gradient(90deg, #153f6d, #0f345b);
    color: #ffffff;

    border-radius: 8px;
  }

  .mobile-weather-title strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.1;
    margin-bottom: 3px;
  }

  .mobile-weather-title div {
    font-size: 0.76rem;
    line-height: 1.2;
    opacity: 0.96;
  }

  /* =====================================================
     COMPOSITE PANEL
     ===================================================== */

  .mobile-composite {
    margin: 5px 10px 0;
  }

  .mobile-composite-main {
    display: grid;
    grid-template-columns: 0.95fr 1.35fr 1.05fr;

    background: #ffffff;
    border: 1px solid #dbe6f1;
    border-radius: 10px;
    overflow: hidden;

    box-shadow: 0 3px 10px rgba(20, 55, 90, 0.06);
  }

  .mobile-composite-left,
  .mobile-composite-details,
  .mobile-refresh-area {
    min-width: 0;
  }

  .mobile-composite-left {
    padding: 7px 8px;

    background: linear-gradient(
      180deg,
      #e9f7ed,
      #e1f2e6
    );
  }

  .mobile-label {
    color: #31577f;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-temp {
    margin-top: 5px;
    color: #123d69;
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap;
  }

  .mobile-composite-details {
    display: grid;
    align-content: center;
    gap: 4px;

    padding: 7px 8px;
  }

  .mobile-composite-details > div {
    display: grid;
    grid-template-columns: 17px 1fr auto;
    align-items: center;
    gap: 4px;

    font-size: 0.64rem;
    line-height: 1.1;
  }

  .mobile-composite-details strong {
    color: #173d66;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .mobile-refresh-area {
    grid-column: 3;
    grid-row: 1;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;

    padding: 8px 7px;
    border-left: 1px solid #dbe6f1;
  }

  #mobileRefreshBtn {
    width: 100%;
    height: 34px;

    background: #2fa64f;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    padding: 0 4px;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-capture,
  .mobile-next {
    color: #667b91;
    font-size: 0.50rem;
    line-height: 1.1;
  }

  .mobile-capture strong,
  .mobile-next strong {
    display: block;

    margin-top: 1px;

    color: #173d66;
    font-size: 0.55rem;
    line-height: 1.1;
  }

  .mobile-next {
    margin-top: 0;
  }

  /* =====================================================
     SECTION TITLE
     ===================================================== */

  .mobile-section-title {
    margin: 7px 10px 5px;
    padding: 6px 10px;

    background: linear-gradient(90deg, #153f6d, #0f345b);
    color: #ffffff;

    border-radius: 7px;

    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.1;
  }

  /* =====================================================
     STATION ROWS
     ===================================================== */

  .mobile-station-list {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 0 10px 6px;
  }

  .mobile-station-row {
    display: grid;
    grid-template-columns: 76px 1fr 15px;

    min-height: 50px;

    background: #ffffff;
    border: 1px solid #dbe6f1;
    border-radius: 8px;

    overflow: hidden;

    box-shadow: 0 2px 7px rgba(20, 55, 90, 0.04);
  }

  .mobile-station-code {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 5px 6px;

    background: #dff4e5;
  }

  .mobile-station-row.airport .mobile-station-code {
    background: linear-gradient(180deg, #1f73c8, #2363a6);
    color: #ffffff;
  }

  .mobile-station-code strong {
    font-size: 0.90rem;
    line-height: 1;
  }

  .mobile-station-code span {
    margin-top: 3px;
    font-size: 0.57rem;
    line-height: 1;
  }

  .mobile-station-content {
    padding: 5px 6px;
  }

  .mobile-station-name {
    margin-bottom: 3px;

    color: #173d66;
    font-size: 0.67rem;
    line-height: 1.05;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-station-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }

  .mobile-station-values div {
    color: #718498;
    font-size: 0.49rem;
    line-height: 1.08;
  }

  .mobile-station-values strong {
    display: block;

    margin-bottom: 1px;

    color: #173d66;
    font-size: 0.57rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .mobile-station-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    color: #244e78;
    font-size: 1rem;
  }

  /* =====================================================
     MAP
     ===================================================== */

  .mobile-map-section {
    display: block;

    margin-top: 2px;
    padding: 0 10px 18px;
  }

  .mobile-map-title {
    margin: 0;
    padding: 6px 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 7px 7px 0 0;
  }

  .mobile-map-caption {
    font-size: 0.58rem;
    font-weight: 500;
    opacity: 0.88;
  }

  #mobileStationMap {
    display: block;

    width: 100%;
    height: 235px;
    min-height: 235px;

    background: #e8eef3;

    border: 1px solid #dbe6f1;
    border-top: none;

    overflow: hidden;
  }

  .mobile-map-legend {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 6px;

    padding: 7px 8px;

    background: #ffffff;

    border: 1px solid #dbe6f1;
    border-top: none;

    border-radius: 0 0 8px 8px;

    color: #45617e;
    font-size: 0.55rem;
  }

  .mobile-map-legend span {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .legend-airport-dot,
  .legend-cwop-dot {
    display: inline-block;

    width: 8px;
    height: 8px;

    border-radius: 50%;
  }

  .legend-airport-dot {
    background: #2f6cae;
  }

  .legend-cwop-dot {
    background: #2f8a4f;
  }

  .legend-home-dot {
    color: #d62828;
    font-size: 0.78rem;
  }

  /* =====================================================
     LEAFLET MOBILE TUNING
     ===================================================== */

  .north-arrow {
    padding: 4px 6px;

    background: rgba(255,255,255,0.96);
    border: 1px solid #cbd8e6;
    border-radius: 7px;

    color: #173d66;
    font-weight: 800;

    box-shadow: 0 2px 7px rgba(0,0,0,0.10);
  }

  .north-letter {
    font-size: 0.72rem;
    line-height: 1;
  }

  .north-pointer {
    margin-top: 1px;

    font-size: 0.80rem;
    line-height: 1;
  }

  .mobile-station-label {
    padding: 2px 4px;

    background: rgba(255,255,255,0.95);
    border: 1px solid #d4dfeb;
    border-radius: 4px;

    color: #163d67;

    font-size: 0.50rem;
    line-height: 1.05;
    font-weight: 700;

    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
  }

  .leaflet-tooltip.mobile-station-label::before {
    display: none;
  }

  .leaflet-control-zoom a {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
  }

  .leaflet-control-scale-line {
    font-size: 0.52rem;
  }
}
