/* Sovereign Map Filter — natural OSM colors (blue water, soft green parks),
   just gently softened to sit well against the light theme. No hue-rotate:
   that was shifting the tiles' natural blue toward pink/magenta. */
.dark-sovereign-tiles {
    filter: saturate(85%) brightness(107%) contrast(95%);
}

body, html {
    margin: 0;
    padding: 0;
    background-color: #eaf4f8;
    background-image: linear-gradient(180deg, #eaf4f8 0%, #f6fbfc 400px, #f6fbfc 100%);
    color: #16323f;
    font-family: 'Open Sans', sans-serif;
}

/* Masthead Nav Buttons */
.nav-item-btn {
    background: transparent;
    border: none;
    color: #dcebf1;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 8px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-item-btn:hover { color: #ffffff; }
.nav-item-btn.active { color: #d4a655; border-bottom-color: #d4a655; }

/* Submenu Tabs */
.news-tab-item, .crew-tab-item {
    color: #55707d;
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.news-tab-item:hover, .crew-tab-item:hover { color: #16323f; }
.news-tab-item.active, .crew-tab-item.active {
    color: #a9772e;
    background: rgba(169, 119, 46, 0.12);
}

/* News Hover Effects */
.featured-news-item {
    display: block; 
    text-decoration: none; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #cfe0e8; 
    padding-bottom: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.featured-news-item:hover h3 { color: #a9772e !important; }
.featured-news-item:hover { opacity: 0.85; }

.news-list-item {
    display: flex; 
    gap: 15px; 
    text-decoration: none; 
    margin-bottom: 10px; 
    padding: 10px; 
    border-radius: 6px; 
    transition: background 0.2s;
    cursor: pointer;
}
.news-list-item:hover { background: rgba(15, 122, 118, 0.07); }

/* News: 1/4 - 2/4 (featured) - 1/4 three-column layout */
.news-three-col {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
}
.news-featured-col { grid-column: 2; }
.news-side-col { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) {
    .news-three-col { grid-template-columns: 1fr; }
    .news-featured-col { grid-column: 1; order: -1; }
}
.news-list-item-stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 8px;
}
.news-list-item-stacked img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
}
.news-list-item-stacked h4 {
    color: #16323f;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.3;
}
.news-list-item-stacked span {
    font-size: 0.75rem;
    color: #6b8593;
}

/* Custom Map Tooltip Styling — unchanged: stays a crisp white card regardless
   of page theme, since it floats over map tiles rather than the page body. */
.leaflet-tooltip.custom-map-tooltip {
    background-color: #fff;
    border: 1px solid #cfe0e8;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(22,50,63,0.18);
    color: #000;
    padding: 6px;
    max-width: 150px;
}

/* Crew Quarters Forms */
.crew-panel-section {
    background: #ffffff;
    border: 1px solid #d7e6ec;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(22,50,63,0.05);
}
.crew-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.crew-table th, .crew-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e1edf1;
}
.crew-table th { color: #a9772e; font-family: 'Oswald', sans-serif; font-weight: normal; }
.expiry-alert { color: #c0293a; font-weight: bold; background: rgba(192,41,58,0.08); padding: 2px 6px; border-radius: 3px; }
.expiry-ok { color: #0f7a76; }

/* Cart Icon */
.cart-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    color: #16323f;
    font-size: 1.3rem;
    cursor: pointer;
    margin-right: 20px;
    padding: 4px;
}
.cart-count-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #c0293a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.4;
}

/* Shop */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}
.shop-item-card {
    background: #ffffff;
    border: 1px solid #d7e6ec;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(22,50,63,0.04);
}
.shop-item-card:hover { border-color: #a9772e; box-shadow: 0 4px 14px rgba(22,50,63,0.1); }
.shop-item-card img { width: 100%; height: 170px; object-fit: cover; }
.shop-item-card .shop-item-body { padding: 15px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.shop-origin-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 3px;
    align-self: flex-start;
    font-family: 'Oswald', sans-serif;
}
.shop-origin-badge.origin-tsc { background: rgba(169,119,46,0.14); color: #a9772e; }
.shop-origin-badge.origin-ship { background: rgba(15,122,118,0.12); color: #0f7a76; }
.shop-origin-badge.origin-other { background: rgba(107,133,147,0.14); color: #55707d; }
.shop-stock-note { font-size: 0.75rem; color: #6b8593; }
.shop-stock-note.low { color: #c0293a; }
.qty-input {
    width: 55px;
    padding: 8px;
    background: #eef4f7;
    border: 1px solid #cfe0e8;
    color: #16323f;
    border-radius: 4px;
    text-align: center;
}

/* Fleet Registry */
.ship-registry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 900px) {
    .ship-registry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ship-registry-grid { grid-template-columns: 1fr; }
}
.ship-registry-card {
    background: #ffffff;
    border: 1px solid #d7e6ec;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(22,50,63,0.04);
    transition: box-shadow 0.2s;
}
.ship-registry-card:hover { box-shadow: 0 4px 14px rgba(22,50,63,0.1); }
.ship-registry-card img { width: 100%; height: 140px; object-fit: cover; }
.ship-registry-card-noimg {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: #eef4f7;
    color: #cfe0e8;
}
.ship-registry-card-body { padding: 14px; }
.ship-registry-name {
    display: block;
    color: #a9772e;
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 8px;
}
.ship-registry-name:hover { text-decoration: underline; }
.ship-registry-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
    color: #55707d;
}
