/* =====================================================
   PORT MORESBY GENERAL HOSPITAL (PMGH)
   RBWH-style homepage theme
   ===================================================== */

/* ---------------- COLOR SYSTEM ---------------------- */

:root {
  --pmgh-navy: #003b73;
  --pmgh-blue: #0077c8;
  --pmgh-blue-dark: #005a96;
  --pmgh-teal: #0a9ca6;
  --pmgh-yellow: #f2e744;

  --bg-page: #f5f7fa;
  --bg-white: #ffffff;

  --text-main: #1f2937;
  --text-muted: #6b7280;

  --radius-sm: 8px;
  --radius: 12px;
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* ---------------- RESET ----------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------------- LAYOUT HELPERS -------------------- */

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.section {
  padding: 4rem 0;
}

.section-light {
  background: var(--bg-white);
  padding: 4rem 0;
}

.section-gradient {
  background: radial-gradient(circle at top left, #e9f5ff 0, #f5f7fa 40%, #f5f7fa 100%);
  padding: 4rem 0;
}

.container.narrow {
  width: min(900px, 92%);
  margin: 0 auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

/* ---------------- HEADER ---------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0;
}

.site-header.scrolled {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

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

/* Brand */

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--pmgh-navy);
}

.brand-logo {
  height: 46px;
  width: auto;
}

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

.brand-title {
  font-size: 0.96rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Navigation */

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2.1rem;
  margin: 0;
  padding: 0;
}

.main-nav ul li a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
  color: var(--pmgh-blue);
  border-bottom-color: var(--pmgh-blue);
}

/* ---------------- BUTTONS -------------------------- */

.btn {
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.93rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: var(--pmgh-blue);
  border-color: var(--pmgh-blue);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--pmgh-blue-dark);
  border-color: var(--pmgh-blue-dark);
}

.btn.ghost {
  border-color: var(--pmgh-blue);
  color: var(--pmgh-blue);
  background: transparent;
}

.btn.ghost:hover {
  background: #e5f1fb;
}

/* =====================================================
   HOME PAGE  — RBWH STYLE
   ===================================================== */

/* ------------ HERO (blue bar + split layout) -------- */

.hero-home {
  background: linear-gradient(120deg, #003b73, #006aa8);
  color: #ffffff;
  padding: 3.5rem 0;
}

.hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
}

.hero-text {
  max-width: 560px;
}

.hero-label {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pmgh-yellow);
  margin-bottom: 0.4rem;
}

.hero-text h1 {
  font-size: 2.3rem;
  margin: 0;
}

.hero-text p {
  margin-top: 0.55rem;
  color: #e5edf7;
  max-width: 520px;
  font-size: 0.98rem;
}

.hero-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero-media {
  flex: 0 0 360px;
}

.hero-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* ------------ HOME TILES (4 nav buttons) ----------- */

.home-tiles {
  background: #e9f4fb;
  border-top: 1px solid #d3e3f5;
  border-bottom: 1px solid #d3e3f5;
  padding: 1.7rem 0;
}

.home-tiles-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.home-tile {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.home-tile-title {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
}

.home-tile p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.home-tile a {
  margin-top: 0.4rem;
  font-size: 0.86rem;
}

/* ------------ HOME NEWS GRID ----------------------- */

.home-news {
  background: var(--bg-white);
}

.home-news h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.home-news-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.1fr;
  gap: 1.8rem;
  align-items: flex-start;
}

/* Feature news (big image + text) */

.home-news-feature {
  background: #f9fafb;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1.5fr;
}

.home-news-feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-news-feature-body {
  padding: 1.1rem 1.3rem;
}

.home-news-feature-body h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.home-news-feature-body p {
  margin-bottom: 0.55rem;
}

/* Secondary news list */

.home-news-list article + article {
  margin-top: 1rem;
}

.home-news-list h3 {
  margin: 0;
  font-size: 0.98rem;
}

.home-news-list .news-meta {
  margin-top: 0.15rem;
}

/* News aside card */

.home-news-aside {
  background: #edf7ff;
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
}

.home-news-aside h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* =====================================================
   INNER PAGES (shared styles)
   ===================================================== */

.card {
  background: var(--bg-white);
  padding: 1.6rem 1.7rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card-grid {
  display: grid;
  gap: 1.8rem;
}

.card-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

/* Icon pill */

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, var(--pmgh-blue) 0, var(--pmgh-teal) 100%);
  color: #ffffff;
  font-size: 1.1rem;
}

/* -------- PAGE HERO / BREADCRUMBS ------------------ */

.page-hero {
  background: linear-gradient(135deg, var(--pmgh-navy), #002448);
  padding: 3.6rem 0;
  color: #ffffff;
  margin-bottom: 1.9rem;
}

.page-hero h1 {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.page-hero p {
  margin: 0;
  max-width: 600px;
}

.breadcrumbs {
  background: #ebeef3;
  padding: 0.8rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--pmgh-blue);
  text-decoration: none;
}

/* -------- PAGE LAYOUT / SIDEBAR -------------------- */

.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.2rem;
}

.side-nav h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pmgh-navy);
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.side-nav a {
  text-decoration: none;
  color: var(--text-main);
  padding: 0.35rem 0;
  border-left: 3px solid transparent;
  padding-left: 0.65rem;
  font-size: 0.94rem;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--pmgh-blue);
  border-left-color: var(--pmgh-blue);
}

.page-content h2 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.page-content p {
  margin-bottom: 0.9rem;
}

.styled-list {
  padding-left: 1.1rem;
}

/* -------- GENERIC IMAGES --------------------------- */

.page-image {
  margin-bottom: 1.7rem;
}

.page-image img,
.hero-photo img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-photo {
  margin-bottom: 1.5rem;
}

/* -------- NEWS GENERIC (news.html) ----------------- */

.news-list {
  display: grid;
  gap: 1.6rem;
}

.news-item {
  padding-bottom: 1.3rem;
  border-bottom: 1px solid #e5e7eb;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-image {
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.news-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* -------- CONTACT LAYOUT --------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
}

.contact-cards .card {
  margin-bottom: 1.7rem;
}

.contact-detail {
  font-size: 1.05rem;
}

.contact-form-wrapper h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.contact-form label {
  display: block;
  font-size: 0.94rem;
  margin-bottom: 0.85rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font: inherit;
  margin-top: 0.25rem;
  background: #f9fafb;
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--pmgh-teal);
  outline-offset: 1px;
  background: #ffffff;
}

.contact-form button {
  margin-top: 1.1rem;
}

.contact-warning {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* -------- LINKS ------------------------------------ */

.link-arrow {
  color: var(--pmgh-blue);
  text-decoration: none;
  font-weight: 500;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* -------- FOOTER ----------------------------------- */

.site-footer {
  background: var(--pmgh-navy);
  color: #ffffff;
  padding: 2.8rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.2rem;
}

.footer-col h4 {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

.footer-col p {
  margin: 0.15rem 0;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li + li {
  margin-top: 0.35rem;
}

.footer-col a {
  color: #e0ecf9;
  text-decoration: none;
  font-size: 0.93rem;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  margin-top: 1.8rem;
  padding-top: 0.7rem;
  font-size: 0.85rem;
  color: #c8d5e8;
}

/* ---------------- RESPONSIVE ----------------------- */

@media (max-width: 1024px) {
  .home-news-grid {
    grid-template-columns: 1.7fr 1.3fr;
    grid-template-rows: auto auto;
  }

  .home-news-aside {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-media {
    width: 100%;
    max-width: 480px;
  }

  .home-tiles-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-layout {
    grid-template-columns: 1fr;
    gap: 2.3rem;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .main-nav ul {
    display: none; /* simple mobile nav for now */
  }

  .site-header {
    padding: 0.65rem 0;
  }

  .brand-logo {
    height: 40px;
  }

  .home-tiles-inner {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   CAREERS EXTRAS
   ===================================================== */

/* Working at PMGH photo banner */
.careers-photo-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-soft);
}

.careers-photo-banner img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.careers-photo-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(to top, rgba(0, 36, 72, 0.9), rgba(0, 36, 72, 0.15));
  color: #ffffff;
}

.careers-photo-caption h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.careers-photo-caption p {
  margin: 0;
  font-size: 0.9rem;
}

/* Job details meta row */
.job-details-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.6rem;
  border-radius: var(--radius-sm);
  background: #f3f5f9;
  border: 1px solid #dde2ec;
  font-size: 0.92rem;
}

/* Careers job cards spacing */
.careers-jobs-grid .card h3 {
  margin-top: 0;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .careers-photo-banner img {
    height: 190px;
  }

  .job-details-meta {
    flex-direction: column;
  }
}

/* ===============================
   RBWH-STYLE HERO (PMGH Version)
   =============================== */

.hero-rbwh {
  position: relative;
  background: url('pmgh-hero-bg.png') center/cover no-repeat;
  color: #ffffff;
  padding: 80px 0 90px;
  overflow: hidden;
}

/* Optional dark gradient overlay so text stays readable on any design */
.hero-rbwh .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 59, 115, 0.85),
    rgba(0, 106, 156, 0.4),
    rgba(0, 106, 156, 0.15)
  );
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  position: relative;
  z-index: 1; /* above overlay */
}

.hero-left {
  width: 50%;
  max-width: 560px;
}

.hero-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.85;
  margin-bottom: 0.4rem;
  color: var(--pmgh-yellow);
}

.hero-rbwh h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.8rem;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.98;
  margin: 0 0 1.4rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* Right Image (hospital photo) */
.hero-right {
  width: 45%;
  text-align: right;
}

.hero-image {
  width: 420px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

/* Responsive behaviour for hero */
@media (max-width: 960px) {
  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-left {
    width: 100%;
  }

  .hero-right {
    width: 100%;
    text-align: left;
    margin-top: 1.5rem;
  }

  .hero-image {
    max-width: 360px;
  }
}

@media (max-width: 600px) {
  .hero-rbwh {
    padding: 60px 0 70px;
  }

  .hero-rbwh h1 {
    font-size: 1.9rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }
}

/* HERO-SPECIFIC BUTTON OVERRIDES */
.hero-rbwh .btn.ghost {
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  background: transparent !important;
}

.hero-rbwh .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

/* =========================================================
   APPLY PMGH HERO BACKGROUND TO ALL PAGE HERO SECTIONS
   ========================================================= */

.page-hero {
  position: relative;
  background: url('pmgh-hero-bg.png') center/cover no-repeat !important;
  padding: 90px 0;
  color: #ffffff;
  overflow: hidden;
}

/* Dark overlay so text remains readable */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 59, 115, 0.85),
    rgba(0, 106, 156, 0.3),
    rgba(0, 106, 156, 0.15)
  );
  z-index: 1;
  pointer-events: none;
}

/* Ensure hero text stays above overlay */
.page-hero .container {
  position: relative;
  z-index: 2;
}

/* ===========================================
   MOBILE — HOME TILES
   =========================================== */
@media (max-width: 768px) {
  .home-tiles-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .home-tile {
    padding: 1rem;
  }
}

/* ===========================================
   MOBILE — NEWS GRID
   =========================================== */
@media (max-width: 768px) {
  .home-news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .home-news-feature {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .home-news-feature img {
    height: 180px;
    object-fit: cover;
  }
}

/* ===========================================
   MOBILE — FOOTER
   =========================================== */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .site-footer {
    padding: 2rem 0 1rem;
  }
}
