* {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    --green: #1dd284;
    --yellow: #d2cc1d;
    --red: #d22c1d;
    --blue: #3b5f8f;
    --white: #f5f5f7;
    --black: #222;
}
@supports (-moz-appearance: none) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #3b5f8f #ffffff00;
  }
}

/* 2. Chrome, Edge, and Safari will now use these rules */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-track {
  background: #ffffff00;
  border-radius: 15px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--blue);
  border-radius: 15px;
  border: 1px solid #5073a0;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--blue);
}
body {
    min-height: 100dvh;
    max-width: 100dvw;
    padding: 0;
    margin: 0;
    
    display: flex;
    flex-direction: column;
    align-items: top;
    justify-content: flex-start;

    background: linear-gradient(
        170deg in oklch,
        oklch(35.78% 0.11923 266.749) 0%,
        oklch(48.129% 0.10489 268.394) 35%,
        oklch(52.336% 0.06339 253.736) 68%,
        oklch(75.158% 0.05945 254.219) 100%
    );

    background-color: var(--blue);
}
 main {
    display: flex;
    flex-direction: column;
 }
@media (orientation: landscape) {
  body {
    flex-direction: row;
    height: 100dvh;
    overflow: hidden;
  }
  main#header {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 30dvw;
  }
  main#content {
    display: flex;
    flex-direction: column;
    height: 100dvh; 
    overflow-y: auto;
    overflow-x: hidden; 
    width: 70dvw;
  }
  

  main#content > * {
    flex-shrink: 0;
  }

  .tempBox {
    height: 100% !important;
  }
  .locHeader {
    width: 90dvw;
  }
  #locations {
        max-width: none !important;
  }
}

img {
    object-fit: contain;
    height: 80%;
}
.tempBox {
    width: 100%;
    height: 40dvh;

    color: var(--white);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hourlyBox {
    width: 98%;
    height: 20dvh;

    margin: 0.4rem;

    color: var(--white);

    position: relative;
    overflow-y: hidden;
    overflow-x: auto;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}
.hourlyBox {
    -webkit-backdrop-filter: brightness(90%);  /* Safari */
    backdrop-filter: brightness(90%);
    border-radius: 20px;
}
.forcastBox {
    width: 98%;
    min-height: 20dvh;
    height: max-content;
    margin: 0.4rem;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    color: var(--white);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}
.forcastBox {
    -webkit-backdrop-filter: brightness(90%);  /* Safari */
    backdrop-filter: brightness(90%);
    border-radius: 20px;
}
.hourlyBox,
.forcastBox {
  width: calc(100% - 0.8rem); /* Exact fit with 0.4rem left/right margins */
  margin: 0.4rem;
}
.hourlyPeriod {
    flex: 1;
    max-width: 100%;
    min-width: 20%;
    height: 100%;
    padding: 0.25rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    text-align: center;
}
.dailyPeriod {
    max-width: 100%;
    padding: 0.55rem 0.25rem;
    box-sizing: content-box;
    display: grid;
    grid-template-columns: minmax(4rem, 0.8fr) 2.5rem minmax(4rem, 2fr) auto;
    align-items: center;
    gap: 0.5rem;
}
.dailyPeriod + .dailyPeriod {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.dailyPeriod time {
    text-align: left;
}
.dailyIcon {
    width: 2rem;
    height: 2rem;
}
.dailyCondition {
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.dailyTemperatures {
    white-space: nowrap;
    text-align: right;
    font-size: 0.8rem;
}
.hourlyIcon {
    width: 2rem;
    height: 2rem;
}
.hourlyPeriod strong {
    font-size: 1.1rem;
}
@media (max-width: 520px) {
    .dailyPeriod {
        grid-template-columns: minmax(3.5rem, 0.8fr) 2rem minmax(3rem, 1fr) auto;
        gap: 0.3rem;
        padding: 0.45rem 0;
    }

    .dailyIcon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .dailyCondition,
    .dailyTemperatures {
        font-size: 0.65rem;
    }
}

.tempBox > h2 {
    font-size: 4em;
    margin: 0;
    padding-left: 0.45em;
}
.tempBox > p {
    font-size: 1em;
    margin: 0;
    font-weight: 200;
}
.alertRow {
    width: 100%;
    height: 10dvh;

    box-sizing: border-box;
    padding: 0 0.8rem;

    color: var(--white);
    background-color: var(--black);

    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.alertRow:hover {
    opacity: 0.5;
}
.alertArrow {
    width: 0.8rem;
    height: 0.8rem;
    flex: none;
    margin: 0 0.5rem;
    border-right: 0.4rem solid currentColor;
    border-bottom: 0.4rem solid currentColor;
    transform: rotate(-45deg);
}
dialog {
    width: 100dvw;
    height: 95dvh;

    color: var(--white);
    background-color: var(--black);
}
dialog,
dialog * {
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 300 !important;

}
#noLocation {
    all: unset;

    position: fixed;
    top: 0;
    left: 0;
    z-index: 4;

    width: 100dvw;
    height: 100dvh;

    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    -webkit-backdrop-filter: blur(5px); 
    backdrop-filter: blur(5px);
}
#noLocation:open {
    display: flex;
} 
#noLocation > p {
    color: var(--white);
    margin: 0;
    font-size: 3rem;
    font-weight: 500 !important;
}
#noLocation > a {
    color: var(--white);
    margin: 0;
    font-size: 1.5rem;
    outline: none;
    font-weight: 200 !important;
}
button {
    color: var(--white);
}
#map:hover {
    background-color: var(--blue);
}
#map {
    background-color: var(--black);
    outline: none;
    border: solid var(--blue) 4px;
    border-radius: 100%;
    color: var(--white);
    cursor: pointer;

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

    position: fixed;
    top: 0.4rem;
    left: 0.4rem;
    height: 2.5rem;
    width: 2.5rem;
}
strong, h2 {
    font-weight: 900 !important;
}
dialog:open {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alertDialogHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alertDetails + .alertDetails {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.tempBox {
    position: relative;
    overflow: hidden;
    flex-direction: column;   /* stacks location / temp / conditions */
}
#flagBG {
    position: absolute;
    inset: 0;
    z-index: 0;
    transition: background 0.4s;

    -webkit-backdrop-filter: brightness(90%); 
    backdrop-filter: brightness(90%);
}

/* keep the text above the flag */
.tempBox > *:not(#flagBG) {
    position: relative;
    z-index: 1;
    margin: 0;
}

.tempBox h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    transition: color 0.3s;
}


/* dark text on the yellow flag (covers location + conditions too) */
.tempBox.darkText {
    color: #111;
}
ri {
    width: fit-content;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
}

#flagBG {
    --angle: -20deg;  

    position: absolute;
    inset: 0 -40%;    
    display: flex;

}


.flagLayer i {
    flex: 1;
    background: #ffd800;
    transform: skewX(var(--angle, -20deg));
}

/* locations page */
body.mapPage {
    display: block;
    height: auto;
    overflow-y: auto;      
}
#locations { max-width: 640px; margin: 0 auto; padding-bottom: 2rem; color: var(--white); }

.locHeader { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.locHeader h1 { margin: 0; font-size: 1.1rem; }
.locHeader a { color: inherit; text-decoration: none; font-size: 2rem; line-height: 1; }
#editBtn { border: 0; border-radius: 0; background: none; font-size: 1rem; color: var(--white); }
#editBtn:hover { background: none; opacity: 0.6; }

.searchWrap { position: relative; margin: 0 1rem 1rem; }
#searchInput {
    width: 100%; box-sizing: border-box; padding: 0.8rem 1rem;
    border: 0; border-radius: 12px; font-size: 1rem;
    background: rgba(255, 255, 255, 0.2); color: var(--white);
}
#searchInput::placeholder { color: rgba(255, 255, 255, 0.6); }
#results {
    position: absolute; left: 0; right: 0; z-index: 5;
    margin: 4px 0 0; padding: 0; list-style: none;
    border-radius: 12px; overflow: hidden;
    background: rgba(34, 34, 34, 0.9);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
#results button {
    width: 100%; padding: 0.8rem 1rem; text-align: left;
    border: 0; border-radius: 0; background: none; font-size: 1rem;
}
#results button:hover { background: var(--blue); }

#locationList { list-style: none; margin: 0; padding: 0; }
.locCard {
    position: relative; overflow: hidden;
    margin: 0 1rem 0.75rem; border-radius: 20px;
    color: var(--white); background: rgba(0, 0, 0, 0.25);   /* shows until the flag loads */
}
.locCard.darkText { color: #111; }
.locMain {
    position: relative; z-index: 1; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.1rem 1.25rem;
    border: 0; border-radius: 0; background: none;
    color: inherit; font: inherit; text-align: left;
}
.locMain:hover { background: none; opacity: 0.85; }   /* beats the global button:hover */
.locName { display: block; font-size: 1.2rem; }
.locCond { font-weight: 400; }
.locTemp { font-size: 2.6rem; font-weight: 300; }

.locDelete {
    display: none; position: absolute; z-index: 2; top: 8px; right: 8px;
    width: 28px; height: 28px; padding: 0;
    border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, 0.55); color: var(--white);
}
.locDelete:hover { background: var(--red); }
.editing .locDelete { display: block; }
.compoundBox {
    width: calc(100% - 0.8rem);
    margin: 0.4rem;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    color: var(--white);
    -webkit-backdrop-filter: brightness(90%);
    backdrop-filter: brightness(90%);
    border-radius: 20px;
}
.compoundBox[hidden] { display: none; }

.compoundTitle {
    margin: 0 0 0.75rem;
    text-align: center;
}

.compoundRow { display: flex; justify-content: space-around; }

.compound {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.compound.active { opacity: 1; }

.tyre {
    width: 3.4rem;
    aspect-ratio: 1;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    border-radius: 50%;
    border: 0.45rem solid var(--ring);
    background: radial-gradient(circle, #2a2a2a 0 55%, #111 56%);
}
.compound em {
    font-style: normal;
    font-size: 0.65rem;
    font-weight: 400;
    white-space: pre-line;
    min-height: 2.2em;
    text-align: center;
}
footer {
    width: calc(100% - 0.8rem);
    margin: 0.4rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 0 !important;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    color: var(--white);
    font-size: 1rem;
    font-weight: 300;
    text-transform: none !important;
    -webkit-backdrop-filter: brightness(90%);
    backdrop-filter: brightness(90%);
    border-radius: 20px 20px 0 0;
}
footer > a {
    text-transform: none !important;
    font-size: 1rem;
    font-weight: 300;
    color: inherit;
    text-decoration: none;
    opacity: 0.6;
}