/* ========================================
   CMS BLOCK TEMPLATE STYLES
   Used by t1–t6 block templates
   loaded via AjaxLoadBlocks
   ======================================== */

/* ── Default CSS variables (pages that set their own override these) ── */
:root {
  --gold: #C6A15B;
  --head-font: 'Newsreader', serif;
  --body-font: 'IBM Plex Sans', sans-serif;
}
html[lang="ar"]:root {
  --head-font: 'El Messiri', serif;
  --body-font: 'IBM Plex Sans Arabic', sans-serif;
}

/* ========================================
   SHARED: Empty blocks message
   ======================================== */
.block-empty-message {
  text-align: center;
  padding: 40px;
  color: #6b7d78;
}

/* ========================================
   SHARED: Block title (used across t1, t4, t5, t6)
   ======================================== */
.block-title {
  font-family: var(--head-font);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 30px);
  color: #0B4A43;
  margin: 0 0 18px;
  line-height: 1.25;
}

/* ========================================
   T1: Content (title + description + image)
   ======================================== */
.block-content-wrap {
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}

.block-content-wrap--with-image {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
}

.block-content-image-wrap {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px -12px rgba(7, 51, 46, .22);
}

.block-content-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   T4: Accordion
   ======================================== */
.block-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.block-accordion .block-title {
  margin-bottom: 4px;
}

.block-accordion-item {
  background: #fff;
  border: 1px solid rgba(11, 74, 67, .12);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .2s;
}

.block-accordion-toggle {
  cursor: pointer;
  width: 100%;
  background: #fff;
  border: none;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-family: var(--body-font);
  transition: background .15s;
}

html[dir="rtl"] .block-accordion-toggle {
  text-align: right;
}

.block-accordion-label {
  font-size: 16px;
  font-weight: 600;
  color: #0B4A43;
}

.block-accordion-icon {
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform .25s;
  transform: rotate(0deg);
}

.block-accordion-body {
  display: none;
  padding: 0 24px 22px;
  font-size: 15.5px;
  color: #55605c;
  line-height: 1.8;
}

/* ========================================
   T5: Cards grid (image + title + desc)
   ======================================== */
.block-cards {
  margin-bottom: 40px;
}

.block-cards .block-title {
  margin-bottom: 28px;
}

.block-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.block-card {
  background: #fff;
  border: 1px solid rgba(11, 74, 67, .1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.block-card-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.block-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.block-card-body {
  padding: 22px;
  flex: 1;
}

.block-card-title {
  font-family: var(--head-font);
  font-weight: 500;
  font-size: 18px;
  color: #0B4A43;
  margin: 0 0 10px;
}

.block-card-desc {
  font-size: 14.5px;
  color: #55605c;
  line-height: 1.75;
}

/* ========================================
   T6: Links grid (image + title + url)
   ======================================== */
.block-links {
  margin-bottom: 40px;
}

.block-links .block-title {
  margin-bottom: 28px;
}

.block-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.block-link-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(11, 74, 67, .1);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow .2s;
}

.block-link-card:hover {
  box-shadow: 0 8px 24px -8px rgba(7, 51, 46, .18);
}

.block-link-img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.block-link-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 16px;
}

.block-link-label {
  padding: 14px 16px;
  background: #0B4A43;
  text-align: center;
}

.block-link-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .block-content-wrap--with-image {
    grid-template-columns: 1fr;
  }
}
