/* ============================================================================
   CLEANED STYLESHEET - Deduplicated and Optimized
   W3.CSS Framework + Custom Styles
   ============================================================================ */

/* ============================================================================
   KEYFRAME ANIMATIONS
   ============================================================================ */
@keyframes w3-spin {
    0% { transform: rotate(0deg) }
    to { transform: rotate(359deg) }
}

@keyframes fading {
    0%, to { opacity: 0 }
    50% { opacity: 1 }
}

@keyframes opac {
    0% { opacity: 0 }
    to { opacity: 1 }
}

@keyframes animatetop {
    0% { top: -300px; opacity: 0 }
    to { top: 0; opacity: 1 }
}

@keyframes animateleft {
    0% { left: -300px; opacity: 0 }
    to { left: 0; opacity: 1 }
}

@keyframes animateright {
    0% { right: -300px; opacity: 0 }
    to { right: 0; opacity: 1 }
}

@keyframes animatebottom {
    0% { bottom: -300px; opacity: 0 }
    to { bottom: 0; opacity: 1 }
}

@keyframes animatezoom {
    0% { transform: scale(0) }
    to { transform: scale(1) }
}

/* ============================================================================
   FONT FACE DECLARATIONS
   ============================================================================ */
@font-face {
    font-family: "Cherry Cream Soda";
    font-style: normal;
    font-weight: 400;
    src: url(fonts/cherry-cream-soda-400.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    src: url(fonts/montserrat-400.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 700;
    src: url(fonts/montserrat-700.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    font-style: italic;
    font-weight: 400;
    src: url(fonts/montserrat-400-italic.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Roboto Condensed";
    font-style: normal;
    font-weight: 400;
    src: url(fonts/roboto-condensed-400.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Roboto Condensed";
    font-style: normal;
    font-weight: 700;
    src: url(fonts/roboto-condensed-700.woff2) format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Roboto Condensed";
    font-style: italic;
    font-weight: 400;
    src: url(fonts/roboto-condensed-400-italic.woff2) format("woff2");
    font-display: swap;
}

/* ============================================================================
   BASE HTML ELEMENTS & TYPOGRAPHY SETUP
   ============================================================================ */
html {
    font-size: 100%; /* 1rem = 16px (browser default) - much more readable */
    box-sizing: border-box;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    font-family: Verdana, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

body {
    font-family: "Roboto Condensed", sans-serif;
}

*,
:after,
:before {
    box-sizing: inherit;
}

footer,
header,
main,
section {
    display: block;
}

video {
    display: inline-block;
    width: 100%;
    height: auto;
}

a {
    background-color: transparent;
    color: inherit;
}

a:active,
a:hover {
    outline-width: 0;
}

b,
strong {
    font-weight: bolder;
}

img {
    border-style: none;
    vertical-align: middle;
}

[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
    height: auto;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

/* ============================================================================
   HEADINGS & TYPOGRAPHY CLASSES
   ============================================================================ */
h1,
h2,
h3,
h4,
h5 {
    font-family: "Cherry Cream Soda", serif;
    font-weight: 400;
    margin: 10px 0;
}

h1 {
    font-size: 2.25rem; /* 36px - same visual size as before */
    font-family: 'Cherry Cream Soda', cursive;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 30px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 20px;
    border-top: 1px solid #38b6fe;
}

h5 {
    font-size: 18px;
}

/* Custom Typography Classes */
.montserrat-body {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.roboto-condensed-regular {
    font-family: "Roboto Condensed", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.cherry-cream-soda-regular {
    font-family: "Cherry Cream Soda", system-ui;
    font-weight: 400;
    font-style: normal;
}

.desc {
    text-align: right;
    font-size: 1.875rem; /* 30px - same as before */
    line-height: 1.6;
}

.descl {
    padding-left: 2rem;
    font-size: 1.875rem; /* 30px - same as before */
    line-height: 1.2;
}

.label {
    font-size: clamp(0.8rem, 2.5vw, 1.4rem);
    color: #003366;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    flex: 0 0 20%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.data {
    font-size: clamp(28px, 7vw, 56px);
    font-weight: bold;
    color: #003366;
}

/* ============================================================================
   W3.CSS TABLE SYSTEM
   ============================================================================ */
.w3-table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    display: table;
}

.w3-striped tbody tr:nth-child(even) {
    background-color: #f1f1f1;
}

.w3-table td,
.w3-table th {
    padding: 8px;
    display: table-cell;
    text-align: left;
    vertical-align: top;
    font-size: clamp(12px, 0.9em, 1em);
}

.w3-table td:first-child,
.w3-table th:first-child {
    padding-left: 16px;
}

/* ============================================================================
   W3.CSS BUTTON SYSTEM
   ============================================================================ */
.w3-button {
    border: 0;
    display: inline-block;
    padding: 8px 16px;
    vertical-align: middle;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background-color: inherit;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.w3-button:disabled {
    cursor: not-allowed;
    opacity: .3;
}

:disabled * {
    pointer-events: none;
}

/* ============================================================================
   W3.CSS MODAL SYSTEM
   ============================================================================ */
#main {
    transition: margin-left .4s;
}

.w3-modal {
    z-index: 3;
    display: none;
    padding-top: 100px;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, .4);
}

.w3-overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, .5);
    z-index: 2;
}

/* ============================================================================
   W3.CSS GRID SYSTEM
   ============================================================================ */
.w3-block {
    display: block;
    width: 100%;
}

.w3-responsive {
    display: block;
    overflow-x: auto;
}

.w3-container:after,
.w3-container:before,
.w3-panel:after,
.w3-panel:before,
.w3-row-padding:after,
.w3-row-padding:before,
.w3-row:after,
.w3-row:before {
    content: "";
    display: table;
    clear: both;
}

.w3-col {
    float: left;
    width: 100%;
}

.w3-col.s3 { width: 24.99999%; }
.w3-col.s6 { width: 49.99999%; }
.w3-col.s9 { width: 74.99999%; }
.w3-col.s12 { width: 99.99999%; }

.w3-row-padding,
.w3-row-padding > .w3-col {
    padding: 0 8px;
}

/* ============================================================================
   W3.CSS CONTAINERS & PANELS
   ============================================================================ */
.w3-container,
.w3-panel {
    padding: .01em 16px;
}

.w3-panel {
    margin-top: 16px;
    margin-bottom: 16px;
}

.w3-card {
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12);
}

/* ============================================================================
   W3.CSS UTILITY CLASSES
   ============================================================================ */
.w3-animate-opacity { animation: opac .8s; }
.w3-center { text-align: center !important; }
.w3-border { border: 1px solid #ccc !important; }
.w3-margin-top { margin-top: 16px !important; }
.w3-margin-bottom { margin-bottom: 16px !important; }
.w3-padding-small { padding: 4px 8px !important; }
.w3-padding { padding: 8px 16px !important; }
.w3-padding-large { padding: 12px 24px !important; }
.w3-hide { display: none !important; }
.w3-show { display: block !important; }
.w3-small-line-height { line-height: 1.0; }

/* ============================================================================
   W3.CSS COLOR CLASSES
   ============================================================================ */
.w3-button:hover {
    color: #000 !important;
    background-color: #ccc !important;
}

.w3-amber {
    color: #000 !important;
    background-color: #ffc107 !important;
}

.w3-blue {
    color: #fff !important;
    background-color: #2196f3 !important;
}

.w3-light-blue {
    color: #000 !important;
    background-color: #87ceeb !important;
}

.w3-orange {
    color: #000 !important;
    background-color: #ff9800 !important;
}

.w3-deep-purple {
    color: #fff !important;
    background-color: #673ab7 !important;
}

.w3-pale-yellow {
    color: #000 !important;
    background-color: #ffc !important;
}

.w3-text-blue { color: #2196f3 !important; }
.w3-text-grey { color: #757575 !important; }
.w3-text-white { color: #ffffff !important; }
.w3-border-yellow { border-color: #ffeb3b !important; }

/* ============================================================================
   CUSTOM GRADIENTS AND BACKGROUNDS
   ============================================================================ */
.grad1 {
    height: 100px;
    /* Note: PHP code removed - handle dynamic icons via JavaScript or server-side templating */
    background-repeat: no-repeat;
    background-size: 100px 100px;
    background-position: right;
}

.grad2 {
    background: radial-gradient(farthest-corner at 100% 100%, #38b6fe 0%, #f3b02e 100%);
}

.header-gradient {
    background: linear-gradient(to bottom, #38b6fe 0%, #38b6fe 50%, white 75%, #f3b02e 100%);
}
.mid-gradient {
    background: linear-gradient(to bottom, #fce7c0 0%, #fce7c0 50%, white 75%, #c2e5f9 100%);
}

/* ============================================================================
   CUSTOM CELL & GRID COMPONENTS
   ============================================================================ */
.cell {
    border: 2px solid #38b6fe;
    background-color: #e6f7ff;
    border-radius: 8px;
    text-align: center;
    margin: 4px 0;
    aspect-ratio: 1.6 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.inner {
    border-radius: 4px;
    margin: 4px 0;
    padding: 6px;
    width: 80%;
}

.celldata {
    flex: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: bold;
    color: #003366;
}
.celldata-2 {
    flex: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1rem, 2.5vw, 4rem);
    font-weight: bold;
    color: #003366;
}
.celllabel {
    flex: 0; /* don’t stretch vertically */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    color: #003366;
    width: 100%; /* ensure it spans full width */
}

.square {
    aspect-ratio: 1.5 / 1;
    background-color: #add8e6;
    border: 4px solid #003366;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 8px 0;
}

/* ============================================================================
   SITE BRANDING
   ============================================================================ */
.site-title {
    font-family: 'Cherry Cream Soda', cursive;
    font-size: 3.2em;
    color: #000066;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.site-subtitle {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 2.2em;
    color: #000066;
    margin-top: -5px;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    text-align: center;
}

/* ============================================================================
   NAVIGATION STYLES
   ============================================================================ */
.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.hamburger-btn {
    cursor: pointer;
    padding: 8px;
}

.hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.mobile-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 200px;
    z-index: 1000;
}

.mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    background-color: #f5f5f5;
}

.horizontal-nav {
    background: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.horizontal-nav nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.horizontal-nav a {
    text-decoration: none;
    color: #333;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.horizontal-nav a:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-bottom-color: #f3b02e;
    transform: translateY(-1px);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Medium screens (601px+) */
@media (min-width: 601px) {
    .w3-col.m2 { width: 16.66666%; }
    .w3-col.m3 { width: 24.99999%; }
    .w3-col.m4 { width: 33.33333%; }
    .w3-col.m6 { width: 49.99999%; }
    .w3-col.m8 { width: 66.66666%; }
    .w3-col.m10 { width: 83.33333%; }
    .w3-col.m12 { width: 99.99999%; }
}

/* Large screens (993px+) */
@media (min-width: 993px) {
    .w3-col.l2 { width: 16.66666%; }
    .w3-col.l3 { width: 24.99999%; }
    .w3-col.l4 { width: 33.33333%; }
    .w3-col.l6 { width: 49.99999%; }
    .w3-col.l8 { width: 66.66666%; }
    .w3-col.l9 { width: 74.99999%; }
    .w3-col.l10 { width: 83.33333%; }
}

/* Small screens (max 600px) */
@media (max-width: 600px) {
    .w3-modal { padding-top: 30px; }
    .w3-hide-small { display: none !important; }
    
    /* REMOVE THIS LINE - it was making fonts tiny:
    html { font-size: 70%; } */
    
    /* Instead, adjust specific elements that need to be smaller */
    .desc {
        font-size: 1.5rem; /* 24px on mobile - still readable */
        line-height: 1.5;
    }
    
    .descl {
        font-size: 1.5rem; /* 24px on mobile */
    }
    
    .site-title {
        font-size: 2em; /* Relative to new base */
        text-align: center;
    }
    
    .site-subtitle {
        font-size: 1.5em;
        text-align: center;
    }
    
    /* Ensure table text is readable on mobile */
    .w3-table td,
    .w3-table th {
        font-size: 14px; /* Fixed minimum size */
        padding: 6px;
    }
    
    /* Fix your custom weather cell fonts for mobile */
    .celldata {
        font-size: clamp(2rem, 6vw, 4rem); /* 32px min instead of tiny */
    }
    .celldata1 {
        font-size: clamp(1.5rem, 5vw, 3rem); /* 32px min instead of tiny */
    }
    .celldata2 {
        font-size: clamp(1rem, 4vw, 2rem); /* 16px min */
    }
    
    .celllabel {
        font-size: clamp(0.875rem, 3vw, 1.5rem); /* 14px min */
    }
}
    /* === Square/rectangle container === */
    .square {
      aspect-ratio: 1.5 / 1;
      background-color: #add8e6;
      border: 4px solid #003366;
      border-radius: 16px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin: 8px;
      padding: 4px;
    }
    .nonsquare {
      background-color: #add8e6;
      border: 4px solid #003366;
      border-radius: 16px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin: 8px;
      padding: 4px;
    }
    /* === Responsive Grid === */
    .grid {
      display: flex;
      flex-wrap: wrap;
    }

    /* Mobile portrait: 2 columns */
    .item { flex: 1 0 50%; }

    /* Mobile landscape + tablets: 3 columns */
    @media (min-width: 600px) {
      .item { flex: 1 0 33.333%; }
    }

    /* Large screens: force 4 items row 1, 5 items row 2 */
    @media (min-width: 992px) {
      .grid { justify-content: center; }
      .item { flex: 0 0 auto; }

      /* First row: 4 items, 25% each */
      .item:nth-child(-n+4) { width: 25%; }

      /* Second row: 5 items, 20% each, centered */
      .item:nth-child(n+5) { width: 20%; margin-left: auto; margin-right: auto; }
    }
 /* Fix 4: Add minimum font sizes to W3.CSS classes */
.w3-tiny { font-size: max(12px, 0.875rem) !important; }
.w3-small { font-size: max(14px, 0.925rem) !important; }
.w3-medium { font-size: max(16px, 1rem) !important; }
.w3-large { font-size: max(18px, 1.125rem) !important; }
.w3-xlarge { font-size: max(24px, 1.5rem) !important; }

/* Fix 5: Better button and interactive element sizing */
.w3-button {
    border: 0;
    display: inline-block;
    padding: 12px 24px; /* Increased for better touch targets */
    vertical-align: middle;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background-color: inherit;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    font-size: max(14px, 0.875rem); /* Ensure readable button text */
    min-height: 44px; /* Better touch target size */
}

@media (max-width: 600px) {
    .w3-button {
        padding: 10px 16px;
        font-size: 16px; /* iOS won't zoom if 16px+ */
    }
}

/* Fix 6: Navigation improvements for mobile */
.horizontal-nav a {
    text-decoration: none;
    color: #333;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    font-size: max(14px, 0.875rem);
}

@media (max-width: 600px) {
    .horizontal-nav a {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px 16px;
    }
}
/* Hide on medium screens (601px+) */
@media (min-width: 601px) {
    .w3-hide-medium { display: none !important; }
}

/* Hide on large screens (993px+) */
@media (min-width: 993px) {
    .w3-hide-large { display: none !important; }
}
/* ============================================================================
   HAMBURGER MENU POSITIONING FIX
   Add these rules to fix the hamburger menu positioning issue
   ============================================================================ */

/* Ensure proper grid behavior on small screens */
@media (max-width: 600px) {
    /* Force small screen column widths to be respected */
    .w3-col.s3 { 
        width: 25% !important; 
        float: left;
        box-sizing: border-box;
    }
    
    .w3-col.s6 { 
        width: 50% !important; 
        float: left;
        box-sizing: border-box;
    }
    
    /* Ensure header row contains floated elements properly */
    .w3-row {
        display: block;
        overflow: hidden; /* This will contain the floated elements */
    }
    
    /* Fix the hamburger menu container specifically */
    .hamburger-container {
        width: 25% !important;
        float: right; /* Force it to the right */
        text-align: right;
        position: relative;
        box-sizing: border-box;
    }
    
    /* Override any conflicting large/medium screen rules on mobile */
    .w3-col.l8.m8.s6 {
        width: 50% !important; /* Force the title to stay at 50% on small screens */
    }
    
    .w3-col.l2.m2.s3 {
        width: 25% !important; /* Force logo to stay at 25% */
    }
    
    /* Ensure no margins/padding break the layout */
    .header-row .w3-col {
        padding-left: 8px;
        padding-right: 8px;
        margin: 0;
    }
    
    /* Make sure the mobile menu positions correctly */
    .mobile-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto; /* Force right alignment */
        z-index: 1000;
    }
}

/* Additional fix: Create a specific header row class */
.header-row {
    display: block;
    width: 100%;
    overflow: hidden;
}

.header-row::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure hamburger button is properly aligned within its container */
.hamburger-btn {
    display: inline-block;
    float: right;
    margin-top: 15px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
}

/* Debug helper - add this temporarily to see column boundaries */
.debug-columns .w3-col {
    border: 2px solid red;
    min-height: 60px;
}

/* Alternative approach using flexbox for more reliable behavior */
@media (max-width: 600px) {
    .flex-header {
        display: flex !important;
        width: 100%;
        align-items: center;
    }
    
    .flex-header .logo-section {
        flex: 0 0 25%;
    }
    
    .flex-header .title-section {
        flex: 0 0 50%;
        text-align: center;
    }
    
    .flex-header .menu-section {
        flex: 0 0 25%;
        text-align: right;
        position: relative;
    }
}
