/* ==========================================================================
   Cabbeje.casa — Official Government Portal Styles (Flat Design)
   Colors sampled directly from the National Flag of Cabbeje
   ========================================================================== */

:root {
  /* Flag Stripe Colors */
  --flag-navy: #0e1364;
  --bar-navy: #070a38;
  --flag-sky: #00a8f3;
  --flag-gold: #f7b722;
  --flag-white: #ffffff;
  --flag-pink: #feaec7;
  --flag-purple: #803399;
  --flag-crimson: #89001c;

  /* Cabbage Emblem Colors */
  --cabbage-leaf: #086922;
  --cabbage-sage: #77b989;

  /* UI Neutrals */
  --bg-page: #f7f8fb;
  --bg-surface: #ffffff;
  --text-primary: #0e1364;
  --text-body: #2c3149;
  --text-muted: #5a607a;
  --border-subtle: #dfe3ee;

  --font-sans: "Encode Sans Expanded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Encode Sans Expanded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

button {
  font-family: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Official Top Gov Banner */
.gov-banner {
  background-color: var(--bar-navy);
  color: var(--flag-white);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.gov-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  flex-wrap: wrap;
}

.gov-banner-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.gov-banner-flag {
  width: 20px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: block;
}

/* Language Toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn:hover:not(.active) {
  border-color: var(--flag-sky);
  color: var(--flag-white);
}

.lang-btn.active {
  background-color: var(--flag-white);
  color: var(--flag-navy);
  border-color: var(--flag-white);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--flag-gold);
  outline-offset: 2px;
}

.lang-flag {
  width: 18px;
  height: 12px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}

/* 7-Stripe Flag Accent Ribbon (uniform thickness top and bottom) */
.flag-ribbon {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 6px;
  width: 100%;
}

.stripe-navy { background-color: var(--flag-navy); }
.stripe-sky { background-color: var(--flag-sky); }
.stripe-gold { background-color: var(--flag-gold); }
.stripe-white { background-color: var(--flag-white); }
.stripe-pink { background-color: var(--flag-pink); }
.stripe-purple { background-color: var(--flag-purple); }
.stripe-crimson { background-color: var(--flag-crimson); }

/* Header & Navigation Bar */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-symbol {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--flag-navy);
  letter-spacing: -0.01em;
}

/* Navigation Buttons */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 0.4rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--flag-navy);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-btn:nth-child(1):hover {
  background-color: var(--flag-navy);
  color: var(--flag-white);
}

.nav-btn:nth-child(2):hover {
  background-color: var(--flag-sky);
  color: var(--flag-white);
}

.nav-btn:nth-child(3):hover {
  background-color: var(--flag-gold);
  color: var(--flag-navy);
}

.nav-btn:nth-child(4):hover {
  background-color: var(--flag-pink);
  color: var(--flag-navy);
}

.nav-btn:nth-child(5):hover {
  background-color: var(--flag-purple);
  color: var(--flag-white);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--flag-navy);
  outline-offset: 2px;
}

/* Scrolling Headlines Ticker */
.ticker-bar {
  display: flex;
  align-items: stretch;
  background-color: var(--flag-navy);
  color: var(--flag-white);
  border-bottom: 2px solid var(--bar-navy);
  font-size: 0.82rem;
  line-height: 1;
  overflow: hidden;
}

.ticker-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  background-color: var(--flag-crimson);
  color: var(--flag-white);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 210s linear infinite;
}

.ticker-bar:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.ticker-item {
  padding: 0.6rem 0;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
}

.ticker-sep {
  padding: 0 1.25rem;
  color: var(--flag-gold);
  font-weight: 700;
}

@keyframes tickerScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Main Hero */
.main-content {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bar-navy);
}

.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero-bg-dim {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 10, 56, 0.55);
  z-index: 1;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 4rem 0;
}

.hero-inner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 360px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3.5rem 3rem;
}

.hero-flag-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 56%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.hero-flag-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    var(--bg-surface) 0%,
    var(--bg-surface) 44%,
    rgba(255, 255, 255, 0.85) 54%,
    rgba(255, 255, 255, 0) 72%
  );
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 56%;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.9vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--flag-navy);
  margin: 0 0 1rem 0;
  white-space: nowrap;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-body);
  margin: 0 0 1.65rem 0;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hero-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--flag-navy);
}

.hero-btn-primary {
  background-color: var(--flag-navy);
  color: var(--flag-white);
}

.hero-btn-primary:hover {
  background-color: var(--bar-navy);
  border-color: var(--bar-navy);
}

.hero-btn-secondary {
  background-color: var(--bg-surface);
  color: var(--flag-navy);
}

.hero-btn-secondary:hover {
  background-color: var(--flag-gold);
  border-color: var(--flag-gold);
  color: var(--flag-navy);
}

.hero-btn:focus-visible {
  outline: 2px solid var(--flag-sky);
  outline-offset: 2px;
}

.hero-contact {
  margin: 1.15rem 0 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-phone {
  color: var(--flag-navy);
  text-decoration: none;
  font-weight: 700;
}

.hero-phone:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background-color: var(--bar-navy);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.footer-symbol {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Bottom-Right Notice Pop-up */
.notice-popup {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 100;
  width: min(300px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  background-color: var(--bar-navy);
  color: var(--flag-white);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

.notice-popup[hidden] {
  display: none;
}

.notice-popup:not([hidden]) {
  animation: noticeSlideIn 0.28s ease-out;
}

@keyframes noticeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.notice-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--flag-gold);
}

.notice-close {
  border: none;
  background: transparent;
  color: var(--flag-white);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.25rem;
  cursor: pointer;
}

.notice-close:hover {
  color: var(--flag-pink);
}

.notice-body {
  margin: 0;
  padding: 1rem 0.95rem 1.15rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

/* News Page */
.nav-btn.nav-active-news {
  background-color: var(--flag-sky);
  color: var(--flag-white);
}

.news-main {
  flex: 1;
  background-color: var(--bg-page);
  padding: 3rem 0;
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--flag-navy);
  margin-bottom: 2rem;
}

.news-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  color: var(--flag-navy);
}

.news-count {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  background-color: var(--flag-sky);
  color: var(--flag-white);
  border-radius: 4px;
}

.news-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 2rem;
}

.news-item-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.news-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #eef1f7;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.news-media > img:not(.news-media-placeholder) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-media > img.news-media-portrait {
  object-position: center 20%;
}

.news-media > img.news-media-contain {
  object-fit: contain;
  padding: 1rem;
  background-color: var(--bg-surface);
}

.news-media-placeholder {
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0.22;
}

.news-card-body {
  padding: 1.5rem 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.news-index {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--flag-crimson);
}

.news-text {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--flag-navy);
  line-height: 1.48;
}

/* Responsive */
@media (max-width: 860px) {
  .hero {
    padding: 2rem 0;
  }

  .hero-inner {
    min-height: 400px;
    align-items: flex-start;
    padding: 2rem 1.5rem 10rem;
    text-align: center;
  }

  .hero-flag-bg {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 55%;
    object-position: center bottom;
  }

  .hero-flag-fade {
    background: linear-gradient(
      180deg,
      var(--bg-surface) 0%,
      var(--bg-surface) 44%,
      rgba(255, 255, 255, 0.72) 64%,
      rgba(255, 255, 255, 0) 90%
    );
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-copy h1 {
    white-space: normal;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .header-inner {
    justify-content: center;
  }

  .nav-bar {
    justify-content: center;
  }
}
