/* ===== CSS Variables ===== */
:root {
  --green: #1a5c3a;
  --green-dark: #13442b;
  --green-light: #2a7a52;
  --gold: #c9a84c;
  --gold-dark: #a88a3a;
  --off-white: #f9f7f2;
  --dark: #1c1c1c;
  --gray: #666;
  --gray-light: #e8e4dc;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --transition: 0.3s ease;
  --font-body: 'Lato', sans-serif;
  --font-heading: 'Playfair Display', serif;
  --header-height: 110px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--dark);
  background: var(--off-white);
}

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

a {
  color: var(--green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--green);
}

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

.hidden {
  display: none !important;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover {
  background: var(--green-dark);
  color: var(--white);
}

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

.btn-gold:hover {
  background: var(--gold-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--green);
}

.btn-large {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* ===== Admin Toolbar ===== */
.admin-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--green-dark);
  color: var(--white);
  box-shadow: var(--shadow);
}

.admin-badge {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
}

body.edit-mode {
  padding-top: 48px;
}

body.edit-mode .site-header {
  top: 48px;
}

body.edit-mode .editable-content,
body.edit-mode .editable-text,
body.edit-mode .editable-box,
body.edit-mode [contenteditable="true"] {
  outline: 2px dashed rgba(201, 168, 76, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
  min-height: 1.2em;
}

body.edit-mode .editable-content:focus,
body.edit-mode .editable-text:focus,
body.edit-mode .editable-box:focus,
body.edit-mode [contenteditable="true"]:focus {
  outline-color: var(--gold);
  background: rgba(201, 168, 76, 0.06);
}

/* Hide ALL edit-mode visuals for public visitors */
body:not(.edit-mode) .editable-content,
body:not(.edit-mode) .editable-text,
body:not(.edit-mode) .editable-box,
body:not(.edit-mode) .project-title-box,
body:not(.edit-mode) .project-subtitle-box,
body:not(.edit-mode) .project-description,
body:not(.edit-mode) .pdf-card-title {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  min-height: 0 !important;
}

body:not(.edit-mode) .edit-only,
body:not(.edit-mode) .gallery-edit-overlay,
body:not(.edit-mode) .hero-edit-overlay,
body:not(.edit-mode) .edit-upload-zone,
body:not(.edit-mode) .project-remove-btn,
body:not(.edit-mode) .pdf-remove-btn,
body:not(.edit-mode) .add-image-tile {
  display: none !important;
}

body.edit-mode .edit-only.hidden,
body.edit-mode .add-image-tile.hidden {
  display: flex !important;
}

/* ===== Header & Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 1.25rem 1rem 0.75rem;
  min-height: var(--header-height);
}

.nav-brand {
  flex-shrink: 0;
  margin-right: auto;
}

.nav-brand a {
  display: flex;
  flex-direction: column;
  color: var(--green);
  text-decoration: none;
  gap: 4px;
}

.brand-en {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.brand-ar {
  font-size: 0.9rem;
  color: var(--gray);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: center;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  flex: 1;
  justify-content: flex-end;
}

.nav-link {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  border-radius: var(--radius);
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: var(--green);
  background: rgba(26, 92, 58, 0.08);
  border-bottom-color: var(--gold);
}

.nav-admin-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding-right: 0.25rem;
}

.admin-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.admin-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.2;
}

.admin-nav-btn-login {
  background: var(--gold);
  color: var(--green);
  border: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.35);
}

.admin-nav-btn-login:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.45);
  transform: translateY(-1px);
}

.admin-nav-logged-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: rgba(26, 92, 58, 0.1);
  color: var(--green);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-nav-btn-logout {
  background: transparent;
  color: var(--gray);
  border: 2px solid var(--gray-light);
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
}

.admin-nav-btn-logout:hover {
  background: var(--off-white);
  color: var(--dark);
  border-color: var(--gray);
  transform: none;
  box-shadow: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--green);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero-section {
  padding: 0 !important;
}

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 92, 58, 0.85) 0%,
    rgba(19, 68, 43, 0.75) 50%,
    rgba(26, 92, 58, 0.6) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--white);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle-en {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 300;
  margin-bottom: 0.75rem;
  opacity: 0.95;
}

.hero-subtitle-ar {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--gold);
  opacity: 0.95;
}

/* ===== Sections ===== */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--white);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold);
}

.subsection-title {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  color: var(--green);
}

.section-lead {
  font-size: 1.1rem;
  color: var(--gray);
  text-align: center;
  margin-bottom: 2rem;
}

.section-extra {
  margin-top: 2rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ===== Lists ===== */
.objectives-list {
  list-style: none;
  padding: 0;
}

.objectives-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.75rem;
  border-bottom: 1px solid var(--gray-light);
}

.objectives-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

.awards-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.awards-list li {
  padding: 0.5rem 0;
  font-size: 1.1rem;
}

.awards-note {
  color: var(--gray);
  font-style: italic;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0;
}

.gallery-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid .gallery-tile {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 220px;
  position: relative;
}

.gallery-grid a.gallery-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform var(--transition);
}

.gallery-grid a.gallery-tile:hover img {
  transform: scale(1.03);
}

.gallery-item-wrap {
  position: relative;
}

.gallery-edit-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  z-index: 5;
}

body.edit-mode .gallery-item-wrap:hover .gallery-edit-overlay,
body.edit-mode .members-photo:hover .gallery-edit-overlay {
  display: flex;
}

.gallery-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  background: var(--white);
  color: var(--green);
  border: none;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 80px;
}

.gallery-edit-btn.remove-btn {
  background: #c0392b;
  color: var(--white);
  font-size: 1.1rem;
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
}

.replace-btn input {
  display: none;
}

/* Video tile in gallery grid */
.video-tile-wrap .video-tile {
  height: 220px;
  background: var(--dark);
  position: relative;
}

.video-tile-inner {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
}

.video-tile-inner iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.edit-mode .video-play-badge {
  display: none;
}

/* Add image tile */
.add-image-tile .add-tile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  background: rgba(26, 92, 58, 0.04);
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
  gap: 0.35rem;
}

.add-tile-icon {
  font-size: 2rem;
  line-height: 1;
}

.add-tile-label {
  font-size: 0.9rem;
}

.add-tile-btn input {
  display: none;
}

/* Hero edit overlay */
.hero {
  position: relative;
}

.hero-edit-overlay {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10;
}

.hero-replace-btn {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--shadow);
}

.members-photo {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.members-photo img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* ===== PowerPoint download cards ===== */
.ppt-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.ppt-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ppt-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: var(--radius);
}

.ppt-card-info {
  flex: 1;
  min-width: 0;
}

.ppt-card-name {
  display: block;
  font-weight: 700;
  color: var(--dark);
  word-break: break-word;
}

.ppt-card-size {
  display: block;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 0.15rem;
}

.ppt-download-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.ppt-remove-btn {
  position: static;
  flex-shrink: 0;
}

/* ===== Project blocks ===== */
.project-block {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.project-block:last-of-type {
  border-bottom: none;
}

.editable-box {
  margin-bottom: 1rem;
}

body.edit-mode .editable-box {
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: rgba(26, 92, 58, 0.03);
  min-height: 2.5rem;
}

.project-title-box {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--green);
  text-align: center;
}

.project-subtitle-box {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--gray);
  text-align: center;
}

body.edit-mode .project-subtitle-box {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}

body.edit-mode .project-description {
  min-height: 80px !important;
}

.project-description {
  margin-top: 1.5rem;
  min-height: 80px;
}

.project-description:empty::before {
  content: attr(data-placeholder);
  color: var(--gray);
  font-style: italic;
}

body:not(.edit-mode) .project-description:empty {
  display: none;
}

.project-remove-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 2px solid #c0392b;
  color: #c0392b;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.project-remove-btn:hover {
  background: #c0392b;
  color: var(--white);
}

.add-project-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 2rem auto 0;
}

.edit-upload-inline {
  margin: 1rem 0;
}

/* ===== Rich text toolbar ===== */
.rte-toolbar {
  position: absolute;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  background: var(--dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.rte-toolbar button {
  background: transparent;
  border: none;
  color: var(--white);
  min-width: 32px;
  height: 32px;
  padding: 0 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rte-heading-btn {
  font-size: 0.75rem !important;
  font-weight: 700;
  padding: 0 0.5rem !important;
  white-space: nowrap;
}

.rte-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.rte-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 0.25rem;
}

.rte-colors {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rte-color-swatch {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  padding: 0 !important;
}

.rte-color-custom {
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.rte-color-custom input {
  width: 32px;
  height: 32px;
  border: none;
  padding: 0;
  cursor: pointer;
  margin: -3px;
}

.rt-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--green);
  display: block;
  line-height: 1.3;
  margin: 1rem 0 0.5rem;
}

.rt-subtitle {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--green);
  display: block;
  line-height: 1.35;
  margin: 0.75rem 0 0.35rem;
}

.prose .rt-title,
.prose h3.rt-title,
.project-description .rt-title,
.project-description h3.rt-title,
.editable-content .rt-title,
.editable-content h3.rt-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--green);
}

.prose .rt-subtitle,
.prose h4.rt-subtitle,
.project-description .rt-subtitle,
.project-description h4.rt-subtitle,
.editable-content .rt-subtitle,
.editable-content h4.rt-subtitle {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--green);
}

.video-tile-tiktok .video-tile,
.video-tile-facebook .video-tile {
  height: 280px;
}

.video-tile-tiktok .video-tile-inner iframe {
  object-fit: contain;
}

/* ===== Upload loading ===== */
.upload-loading {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--white);
  font-weight: 600;
}

.upload-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Legacy media section (unused) */
.media-section {
  margin: 2rem 0;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ppt-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-weight: 600;
  margin: 0.5rem 0.5rem 0.5rem 0;
  transition: all var(--transition);
}

.ppt-link:hover {
  background: var(--green);
  color: var(--white);
}

.media-item {
  position: relative;
  margin-bottom: 1rem;
}

.media-remove {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  z-index: 10;
}

body.edit-mode .media-remove,
body.edit-mode .ppt-remove-btn,
body.edit-mode .pdf-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Training Actions ===== */
.training-actions {
  text-align: center;
  margin: 2.5rem 0;
}

/* ===== Lectures Intro ===== */
.lectures-intro:empty::before {
  content: attr(data-placeholder);
  color: var(--gray);
  font-style: italic;
}

body:not(.edit-mode) .lectures-intro:empty {
  display: none;
}

/* ===== Upload Zones ===== */
.edit-upload-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(26, 92, 58, 0.05);
  border: 2px dashed var(--green);
  border-radius: var(--radius);
}

.edit-upload-zone .upload-btn {
  margin: 0;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.upload-btn:hover {
  background: var(--green-dark);
}

/* ===== PDF publication cards ===== */
.pdf-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.pdf-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pdf-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pdf-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}

.pdf-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--green);
  line-height: 1.35;
  word-break: break-word;
}

body.edit-mode .pdf-card-title {
  outline: 2px dashed rgba(201, 168, 76, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
}

.pdf-card-meta {
  font-size: 0.85rem;
  color: var(--gray);
}

.pdf-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.pdf-view-btn {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.pdf-remove-btn {
  position: static;
  flex-shrink: 0;
}

.publications-subsection {
  margin-bottom: 2rem;
}

/* ===== Contact Form ===== */
.contact-form {
  max-width: 600px;
  margin: 2rem auto 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--green);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
}

.form-status {
  margin-top: 1rem;
  font-weight: 600;
}

.form-status.success {
  color: var(--green);
}

.form-status.error {
  color: #c0392b;
}

.form-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--green-dark);
  color: var(--white);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-en {
  font-family: var(--font-heading);
  font-size: 1rem;
}

.footer-ar {
  font-size: 0.85rem;
  opacity: 0.8;
}

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  position: relative;
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 420px;
  z-index: 1;
}

.modal-dialog h3 {
  margin-bottom: 0.5rem;
}

.modal-desc {
  color: var(--gray);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
}

.modal-close:hover {
  color: var(--dark);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 4000;
  padding: 1rem 1.5rem;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: #c0392b;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .gallery-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition);
    pointer-events: none;
    gap: 0;
  }

  body.edit-mode .navbar-menu {
    top: calc(var(--header-height) + 48px);
  }

  .navbar-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    position: static;
    flex-direction: column;
    padding: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  body.edit-mode .nav-links {
    top: auto;
  }

  .nav-link {
    padding: 0.75rem 1rem;
  }

  .nav-admin-item {
    margin-left: 0;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    padding-right: 0;
    border-top: 1px solid var(--gray-light);
    width: 100%;
  }

  .admin-nav-controls,
  .admin-nav-logged-in {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-nav-btn-login,
  .admin-nav-btn-logout {
    width: 100%;
    justify-content: center;
  }

  .admin-nav-badge {
    width: 100%;
    justify-content: center;
  }

  .gallery-grid-2,
  .gallery-grid-3 {
    grid-template-columns: 1fr;
  }

  .gallery-grid img {
    height: 200px;
  }

  .hero {
    min-height: 55vh;
  }

  .section {
    padding: 3.5rem 0;
  }

  .admin-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .brand-en {
    font-size: 1.5rem;
  }

  .brand-ar {
    font-size: 0.75rem;
  }

  .nav-link {
    font-size: 1rem;
  }

  .hero-title {
    letter-spacing: 0.08em;
  }

  .ppt-card {
    flex-wrap: wrap;
  }
}
