/* ==========================================================================
   Hawaii at a Glance — /conditions
   All sizes in px (site base: html { font-size: 62.5% }, 1rem = 10px).
   Scoped to .cn-* to avoid global conflicts.
   ========================================================================== */

/* --- Hero --- */
.cn-hero {
  position: relative;
  border-radius: 80px 80px 80px 20px;
  overflow: hidden;
  clip-path: inset(0 round 80px 80px 80px 20px);
  isolation: isolate;
  margin: 10px 0 0;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center 30%;
  background-color: #0d2a3a;
}
.cn-hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: inherit;
  transform: translateZ(0);
}
.cn-hero-back {
  position: absolute;
  top: 34px;
  left: 38px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 12px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.cn-hero-back:hover,
.cn-hero-back:focus {
  background: rgba(0, 0, 0, 0.62);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateX(-2px);
}
.cn-hero-back i { font-size: 11px; opacity: 0.9; }
@media (prefers-reduced-motion: reduce) {
  .cn-hero-video { display: none; }
}
@media (max-width: 540px) {
  .cn-hero-back { top: 24px; left: 26px; font-size: 12px; padding: 6px 12px 6px 10px; }
}
.cn-hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 60px 5% 28px;
  background: linear-gradient(0deg, rgba(0,0,0,.74) 0%, rgba(0,0,0,.34) 64%, rgba(0,0,0,.08) 100%);
}
.cn-hero h1 {
  color: #fff;
  font-size: 34px;
  margin: 0 0 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  line-height: 1.15;
}
.cn-hero p {
  color: rgba(255,255,255,.92);
  font-size: 19px;
  margin: 0;
  max-width: 640px;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  line-height: 1.5;
}
@media (min-width: 768px) {
  .cn-hero { min-height: 560px; }
  .cn-hero h1 { font-size: 48px; }
  .cn-hero p { font-size: 22px; }
}

/* --- Island Tabs --- */
.cn-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px auto 6px;
  padding: 0 12px;
  max-width: 780px;
}
.cn-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 24px;
  border: 2px solid #ddd;
  border-radius: 40px;
  background: #fff;
  color: #555;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.cn-tab:hover {
  border-color: #bbb;
  color: #333;
  background: #f8f8f8;
}
.cn-tab.is-active {
  background: #0a5e8c;
  border-color: #0a5e8c;
  color: #fff;
}
.cn-tab .fa { font-size: 14px; vertical-align: middle; margin-right: 2px; }
.cn-tab.is-active .fa { color: #fff !important; }

/* --- Last Updated --- */
.cn-updated {
  text-align: center;
  font-size: 14px;
  color: #59636d;
  font-weight: 600;
  margin: 16px 0 4px;
  min-height: 20px;
}

/* --- Island Panels --- */
.cn-panel { display: none; }
.cn-panel.is-active { display: block; }

/* --- Conditions Grid --- */
.cn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 16px 0 32px;
}
@media (min-width: 540px) {
  .cn-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .cn-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- Condition Card --- */
.cn-card {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 16px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}
.cn-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }

/* Status stripe on left edge */
.cn-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 16px 0 0 16px;
  background: #ddd;
}
.cn-card.is-green::before  { background: #1D9771; }
.cn-card.is-yellow::before { background: #d4a017; }
.cn-card.is-orange::before { background: #F27A24; }
.cn-card.is-red::before    { background: #c3232f; }

.cn-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cn-card-icon { font-size: 24px; color: #0a5e8c; line-height: 1; }
.cn-card-dot  { width: 10px; height: 10px; border-radius: 50%; background: #ddd; flex-shrink: 0; }

.cn-card.is-green  .cn-card-dot { background: #1D9771; }
.cn-card.is-yellow .cn-card-dot { background: #d4a017; }
.cn-card.is-orange .cn-card-dot { background: #F27A24; }
.cn-card.is-red    .cn-card-dot { background: #c3232f; }

.cn-card-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cn-card-value {
  font-size: 26px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.15;
  margin-bottom: 4px;
}
.cn-card-sub {
  font-size: 13px;
  color: #777;
  line-height: 1.4;
  flex: 1;
}
.cn-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0a5e8c;
  text-decoration: none;
}
.cn-card-link:hover { text-decoration: underline; }
.cn-card-link i { font-size: 11px; margin-left: 2px; }

/* Loading skeleton */
.cn-card--loading {
  background: #f5f5f5;
  border-color: #eee;
  min-height: 150px;
}
.cn-card--loading::before { background: #e0e0e0; }
.cn-card-skeleton {
  background: linear-gradient(90deg, #eeeeee 25%, #e0e0e0 50%, #eeeeee 75%);
  background-size: 200% 100%;
  animation: cn-pulse 1.4s ease infinite;
  border-radius: 8px;
  height: 100%;
  min-height: 130px;
}
@keyframes cn-pulse {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Intro --- */
.cn-intro {
  max-width: 700px;
  margin: 20px auto 4px;
  text-align: center;
  padding: 0 12px;
}
.cn-intro p {
  font-size: 17px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* --- Status Legend --- */
.cn-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 10px 16px;
  background: #f8f9fa;
  border-radius: 10px;
  font-size: 13px;
  color: #555;
}
.cn-legend-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #59636d;
}
.cn-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.cn-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cn-legend-dot--green  { background: #1D9771; }
.cn-legend-dot--yellow { background: #d4a017; }
.cn-legend-dot--orange { background: #F27A24; }
.cn-legend-dot--red    { background: #c3232f; }

/* --- Related Links --- */
.cn-related {
  margin: 10px 0 30px;
  padding: 22px 20px;
  background: #f8f9fa;
  border-radius: 16px;
}
.cn-related h3 {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin: 0 0 14px;
}
.cn-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .cn-related-grid { grid-template-columns: repeat(3, 1fr); }
}
.cn-related-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  text-decoration: none;
  color: #333;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cn-related-card:hover {
  border-color: #0a5e8c;
  box-shadow: 0 2px 10px rgba(10,94,140,.08);
  color: #333;
  text-decoration: none;
}
.cn-related-card-icon {
  font-size: 20px;
  color: #0a5e8c;
  margin-bottom: 4px;
}
.cn-related-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}
.cn-related-card-desc {
  font-size: 12px;
  color: #777;
  line-height: 1.4;
}

/* --- Print --- */
@media print {
  .cn-hero-back, .cn-tabs, .cn-legend, .cn-related { display: none; }
  .cn-panel { display: block !important; }
}
