/* =====================================================================
   style.css — Main homepage and Admin Login page
   Formal look: navy, white, and a gold accent.
   ===================================================================== */


/* =====================================================================
   1. COLORS AND BASIC SETTINGS
   ===================================================================== */
:root {
  --navy: #13286b;
  --navy-deep: #0a1a4a;
  --blue: #2f55c9;
  --gold: #f5c518;
  --gold-dark: #b8860b;
  --ink: #1b1f2a;
  --muted: #5b6475;
  --line: #dfe4ee;
  --tint: #f4f6fb;
}

* {
  box-sizing: border-box;
}

/* Menu links scroll a bit higher so the sticky header doesn't cover the section title */
section[id] {
  scroll-margin-top: 90px;
}

/* Elements hidden by main.js stay hidden */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
}

p {
  margin: 0;
}

a:focus-visible {
  outline: 3px solid #7fa2ff;
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--blue);
}


/* =====================================================================
   2. BUTTONS
   ===================================================================== */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 15.5px;
}

.btn-navy {
  background: var(--navy);
  color: #fff;
}

.btn-navy:hover {
  background: var(--navy-deep);
}

.btn-outline {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn-gold:hover {
  background: #ffd84a;
}

/* White outline button on the dark hero */
.btn-ghost {
  border-color: #fff;
  color: #fff;
}

.btn-ghost:hover {
  background: #fff;
  color: var(--navy);
}


/* =====================================================================
   3. TOP BAR AND HEADER
   ===================================================================== */
.gov-bar {
  padding: 5px 0;
  background: var(--navy-deep);
  color: #c7d1ec;
  font-size: 12px;
}

.gov-bar-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.gov-bar a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.gov-bar a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 10px rgba(10, 26, 74, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  color: var(--navy);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-transform: uppercase;   /* "City of Bacoor" shows as "CITY OF BACOOR" */
}

/* Keep the logo round and filled even if the uploaded picture isn't square */
.brand-seal,
.footer-brand img {
  object-fit: cover;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.main-nav a {
  padding: 8px 14px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--blue);
}

/* Gold underline on the current page */
.main-nav a.active {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.header-actions {
  display: flex;
  gap: 8px;
}


/* =====================================================================
   4. HERO
   ===================================================================== */
/* Dark blue background so the white text stays readable */
.hero {
  background:
    linear-gradient(90deg, rgba(10, 26, 74, 0.92) 0%, rgba(19, 40, 107, 0.75) 55%, rgba(19, 40, 107, 0.35) 100%),
    var(--navy);
  color: #fff;
}

/* Text on the left, photo frame on the right */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 80px;
}

/* Link to the official city website */
.city-site-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--gold);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 197, 24, 0.5);
}

.city-site-link:hover {
  border-bottom-color: var(--gold);
}

/* ---------- Photo frame (picture uploaded by the Super Admin) ---------- */
.hero-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border: 6px solid #fff;
  border-radius: 12px;
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-frame img {
  display: none;   /* hidden until main.js gives it a picture */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shown while there is no picture yet */
.hero-frame-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  color: #dde4f6;
  text-align: center;
}

.hero-frame-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-frame-empty span {
  font-weight: 700;
}

.hero-frame-empty small {
  color: #aeb9d8;
  font-size: 13px;
}

/* main.js adds "has-photo" once a picture is loaded */
.hero-frame.has-photo img {
  display: block;
}

.hero-frame.has-photo .hero-frame-empty {
  display: none;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hero-tagline {
  margin-top: 8px;
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 520px;
  margin-top: 18px;
  color: #dde4f6;
  font-size: 17px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}


/* =====================================================================
   5. ANNOUNCEMENTS (posted by the Municipality Admin)
   ===================================================================== */
.news {
  padding: 64px 0;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.news-head {
  margin-bottom: 24px;
}

.news-head h2 {
  color: var(--navy);
  font-size: 30px;
  font-weight: 800;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 10px;
}

/* Urgent announcements get a red top line */
.news-card.urgent {
  border-top-color: #c62f2f;
}

.news-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-card-body {
  padding: 18px 20px 20px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.news-chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: #e1e9fb;
  color: #1f4aa8;
  font-size: 12px;
  font-weight: 700;
}

.news-chip.urgent {
  background: #fbe1e1;
  color: #a01f1f;
}

.news-date {
  color: var(--muted);
  font-size: 13px;
}

.news-title {
  color: var(--navy);
  font-size: 18px;
}

.news-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  white-space: pre-line;   /* keep the line breaks the admin typed */
  word-break: break-word;
}

.news-empty {
  padding: 28px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

/* =====================================================================
   6. ABOUT
   ===================================================================== */
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 72px;
}

/* Photo frame (picture uploaded by the admin) */
.about-photo {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9d6f2, #8fa7dd);
  box-shadow: 14px 14px 0 var(--gold);
}

.about-photo img {
  display: none;   /* hidden until main.js gives it a picture */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shown while there is no picture yet */
.about-frame-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  color: var(--navy);
  text-align: center;
}

.about-frame-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-frame-empty span {
  font-weight: 700;
}

.about-frame-empty small {
  color: #3c4f86;
  font-size: 13px;
}

/* main.js adds "has-photo" once a picture is loaded */
.about-photo.has-photo img {
  display: block;
}

.about-photo.has-photo .about-frame-empty {
  display: none;
}

.about-text h2 {
  color: var(--navy);
  font-size: 32px;
  font-weight: 800;
}

.about-text p:last-child {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16.5px;
}


/* ---------- Community: how to get sector IDs ---------- */
.community {
  padding: 64px 0 72px;
  background: var(--tint);
  border-top: 1px solid var(--line);
}

.community h2 {
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
}

.community-lead {
  max-width: 640px;
  margin-top: 8px;
  color: var(--muted);
}

.community-lead a {
  color: var(--blue);
  font-weight: 700;
}

.id-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.id-card {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 10px;
}

.id-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.id-card-head img {
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.id-card h3 {
  color: var(--navy);
  font-size: 18px;
}

.id-card-head span {
  color: var(--muted);
  font-size: 12.5px;
}

.id-who {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
}

.id-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.id-card li + li {
  margin-top: 4px;
}

.community-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}


/* =====================================================================
   7. FOOTER
   ===================================================================== */
.site-footer {
  background: var(--navy-deep);
  color: #c7d1ec;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr 1fr;
  gap: 32px;
  padding-top: 44px;
  padding-bottom: 36px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.footer-brand strong {
  color: #fff;
  font-size: 16px;
}

.site-footer h3 {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.footer-bottom {
  padding: 10px 0;
  background: #050f2e;
  color: #8f9bbd;
  font-size: 12.5px;
}


/* =====================================================================
   8. SMALLER SCREENS
   ===================================================================== */
@media (max-width: 960px) {
  /* Menu moves under the logo */
  .header-inner {
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 10px;
  }

  .header-actions {
    margin-left: auto;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .site-header {
    position: static;
  }

  .news-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .id-grid {
    grid-template-columns: 1fr;
  }

  .about-inner,
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 600px) {
  .brand-sub {
    display: none;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-seal {
    width: 44px;
    height: 44px;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
  }

  .header-actions .btn {
    flex: 1;
  }

  .hero-inner {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-tagline {
    font-size: 14px;
    letter-spacing: 2px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    box-shadow: 8px 8px 0 var(--gold);
  }

  .about-text h2 {
    font-size: 26px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
