/* ==================================================
   Home page (front-page.php, Figma «Homepage — الصفحة الرئيسية (جديد)»)
   Loaded on the front page only (functions/home.php).
   Colours and sizes use the theme variables; the few values the theme has
   no variable for are written as they are.
   ================================================== */

.home-page {
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding-bottom: 80px;
}

.home-section {
  padding: 0 var(--padding-horizontal);
}

/* No slider (nothing picked): keep the first section off the header */
.home-page > .home-section:first-child {
  margin-top: 48px;
}

/* Section title + «المزيد» link, line under */
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 8px 28px;
  border-bottom: 2px solid var(--text-700);
  margin-bottom: 38px;
}

.home-section-title {
  margin: 0;
  color: var(--heading-color);
  font-size: 28px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.home-section-more {
  color: var(--primary-500);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  line-height: 17px;
  text-decoration: underline;
  white-space: nowrap;
}

.home-section-more:hover {
  color: var(--text-900);
}

/* Label and big name (prime minister, secretary general) */
.home-label {
  color: var(--heading-color);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: 17px;
}

.home-name {
  margin: 0;
  color: var(--heading-color);
  font-size: 44px;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

/* ---------- Slider ---------- */

.home-hero {
  position: relative;
  height: 592px;
  overflow: hidden;
  background-color: var(--text-900);
  /* swiping sideways changes slide (js/home-slider.js), up/down scrolls */
  touch-action: pan-y;
  cursor: grab;
}

.home-hero.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}

.home-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

/* a slide with a phone image: <picture> around the image, same box */
.home-hero-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero-image--top {
  object-position: top;
}

.home-hero-image--bottom {
  object-position: bottom;
}

.home-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
}

/* the text box: on the right, half the slider's width at most */
.home-hero-box {
  position: absolute;
  right: var(--padding-horizontal);
  bottom: 48px;
  box-sizing: border-box;
  width: min(50%, 640px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px;
  border-radius: 0;
  background-color: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.home-hero-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-hero-text[hidden] {
  display: none;
}

.home-hero-title {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
}

.home-hero-title a {
  color: #fff;
  text-decoration: none;
}

.home-hero-title a:hover {
  text-decoration: underline;
}

.home-hero-summary {
  margin: 0;
  color: #fff;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-hero-date {
  color: var(--neutrals-700);
  font-size: 13px;
  line-height: var(--line-height-xs);
}

.home-hero-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 21px;
  background-color: rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: width .3s ease, background-color .3s ease;
}

.home-hero-dot:hover {
  background-color: rgba(255, 255, 255, .4);
}

.home-hero-dot.is-active {
  width: 32px;
  background-color: var(--primary-200);
}

/* ---------- News cards ---------- */

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

/* نشاطات الحكومة اللبنانية: the GOL page's colours and font (same values as
   body.brand-gol in css/gol.css, which is not loaded on the home page) */
.home-news--gol {
  /* the GOL palette: the primary shades the site uses, in the GOL browns,
     so everything inside keeps the GOL colours */
  --primary-50: #f5f1f0;
  --primary-100: #c7bbb7;
  --primary-200: #9d8a84;
  --primary-300: #78605a;
  --primary-500: #3d221d;
  --text-900: #3d221d;
}

/* its title line in the GOL brown, as on the GOL page */
.home-news--gol .home-section-head {
  border-bottom-color: var(--primary-300);
}

/* Section link as on the GOL page */
.home-news--gol .home-section-more {
  font-weight: var(--font-weight-medium);
  text-underline-offset: 4px;
}

/* Cards: the GOL page news cards (base styles in style.css, GOL changes
   copied from css/gol.css) */
.home-news--gol article.archive-post-grid {
  border-color: var(--primary-100);
}

.home-news--gol .archive-post-grid-date {
  font-weight: var(--font-weight-regular);
}

.home-news--gol .archive-post-grid-content {
  flex: 1;
}

.home-news--gol h2.archive-post-grid-title {
  font-size: 22px;
}

.home-news--gol p.archive-post-grid-excerpt {
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--primary-300);
}

.home-news--gol .archive-post-grid-mark {
  display: block;
  width: auto;
  height: 24px;
  align-self: flex-end;
  margin-top: auto;
  padding-top: 14px;
  opacity: 0.55;
}

/* ---------- Documents: three columns ---------- */

.home-docs-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  padding-top: 38px;
  border-top: 1px solid var(--text-700);
}

.home-docs-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-docs-column + .home-docs-column {
  position: relative;
}

/* the line between two columns, in the middle of the 48px gap */
.home-docs-column + .home-docs-column::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: -24px;
  width: 1px;
  background-color: var(--neutrals-700);
  opacity: .5;
}

.home-docs-title {
  margin: 0;
  color: var(--heading-color);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 32px;
}

.home-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0;
  border-bottom: 1px solid var(--text-700);
}

.home-doc-date {
  color: var(--neutrals-900);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 17px;
}

.home-doc-title {
  color: var(--heading-color);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: 28px;
  text-decoration: none;
}

a.home-doc-title:hover {
  text-decoration: underline;
}

.home-docs-more {
  margin-top: 16px;
  color: var(--primary-500);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: 17px;
  text-decoration: none;
}

.home-docs-more:hover {
  text-decoration: underline;
}

/* ---------- Prime minister and secretary general: same card ----------
   photo 320px wide and as tall as the card; label, name, then the text
   with a line on its right and the «المزيد …» button */

.home-profile {
  display: flex;
  gap: 48px;
  padding: 24px;
  border-radius: 0;
  background-color: #f9f9f9;
}

.home-profile-photo {
  flex: 0 0 320px;
  align-self: stretch;
  min-height: 300px;
  border-radius: 0;
  overflow: hidden;
  background-color: #eae2d4;
}

.home-profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.home-profile-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 742px;
  padding-top: 24px;
}

.home-profile-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* the name on one line on desktop */
@media (min-width: 1101px) {
  .home-profile-head .home-name {
    white-space: nowrap;
  }
}

.home-profile-about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-inline-start: 28px;
  padding-inline-end: 3px;
  border-inline-start: 3px solid var(--text-700);
}

.home-profile-question {
  margin: 0;
  color: var(--heading-color);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-sm);
}

.home-profile-bio {
  margin: 0 0 10px;
  color: var(--text-900);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-sm);
}

.home-profile-bio + .home-profile-bio {
  margin-top: 0;
}

/* a text typed with paragraphs (the «نبذة» and الأمانة العامة fields) */
.home-profile-text p {
  margin: 0;
}

.home-profile-text p + p {
  margin-top: 10px;
}

/* ---------- Secretary general: a smaller card + «صدر عن الأمين العام» ----------
   two halves: the card on the right, the documents list on the left */

.home-sg--with-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 48px;
}

.home-profile--small {
  gap: 28px;
  padding: 16px;
}

.home-profile--small .home-profile-photo {
  flex-basis: 200px;
  min-height: 240px;
}

.home-profile--small .home-profile-body {
  justify-content: center;
  gap: 16px;
  min-width: 0;
  padding: 8px 0;
}

.home-profile--small .home-profile-head {
  gap: 10px;
}

.home-profile--small .home-name {
  font-size: 32px;
  white-space: normal;
}

.home-profile--small .home-profile-about {
  gap: 16px;
}

.home-profile--small .home-profile-bio {
  margin: 0;
}

/* ---------- Government: photo with the name and buttons on it ---------- */

.home-gov {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  height: 580px;
  padding: 48px 24px 56px;
  border-radius: 0;
  overflow: hidden;
  background-color: var(--text-900);
  text-align: center;
}

.home-gov-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

/* dark at the bottom so the white name stays readable */
.home-gov-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(70, 17, 26, .85) 0%, rgba(70, 17, 26, .35) 40%, rgba(70, 17, 26, 0) 70%);
}

.home-gov-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.home-gov-title {
  margin: 0;
  color: #fff;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

.home-gov-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.home-gov-buttons .archive-post-pdf-btn-download {
  color: var(--text-900);
  font-weight: var(--font-weight-regular);
  background-color: #fff;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1100px) {
  .home-hero {
    height: 520px;
  }

  .home-hero-box {
    width: min(70%, 600px);
    padding: 24px;
  }

  .home-cards,
  .home-news--gol .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .home-docs-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-docs-column + .home-docs-column::before {
    display: none;
  }

  .home-profile {
    flex-direction: column;
  }

  .home-profile-photo {
    flex: none;
    width: 100%;
    max-width: 450px;
  }

  .home-profile-body {
    padding-top: 0;
  }

  .home-gov {
    height: 460px;
    padding: 32px 24px 40px;
  }
}

@media (max-width: 767px) {
  .home-page {
    gap: 32px;
    padding-bottom: 48px;
  }

  .home-hero {
    height: 480px;
  }

  .home-hero-box {
    right: 16px;
    left: 16px;
    bottom: 16px;
    width: auto;
    gap: 16px;
    padding: 20px;
  }

  .home-section-head {
    padding: 0 0 16px;
    margin-bottom: 24px;
  }

  .home-section-title {
    font-size: var(--font-size-2xl);
  }

  .home-section-more {
    font-size: var(--font-size-sm);
  }

  .home-cards,
  .home-news--gol .home-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-name {
    font-size: 32px;
  }

  .home-gov {
    height: 380px;
    padding: 24px 16px 32px;
  }

  .home-gov-content {
    gap: 20px;
  }

  .home-gov-title {
    font-size: var(--font-size-2xl);
  }

  .home-profile {
    gap: 24px;
    padding: 16px;
  }

  .home-profile-photo {
    height: 300px;
    max-width: none;
  }

  .home-profile-about {
    padding-inline-start: 16px;
  }

  .home-profile-body {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-slide,
  .home-hero-dot {
    transition: none;
  }
}
