:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #38bdf8;
  --accent-soft: rgba(56,189,248,0.15);
  --text: #e5e7eb;
  --muted: #9ca3af;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #020617, var(--bg));
  color: var(--text);
  line-height: 1.7;
}
header {
  padding: 5rem 2rem 4rem;
  text-align: center;
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
header p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
}
nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
nav a {
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: transparent;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}
nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-2px);
}
main {
  max-width: none;
  width: 100%;
  padding: 3rem 8vw 5rem;
  display: grid;
  gap: 3rem;
  margin: 0 auto;
}
@media (max-width: 800px) {
  main {
    padding: 3rem 1.5rem 5rem;
  }
}
section {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  font-family: 'Playfair Display', serif;
}
.about {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: center;
}
.about img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-soft);
}
.about p {
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--card);
  border-radius: 1.2rem;
  padding: 1.8rem;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}
.card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}
.card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}
li {
  margin-bottom: 0.5rem;
  color: var(--muted);
}
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (max-width: 700px) {
  .about {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about img {
    margin: 0 auto;
  }
}
/* CONTACT ICONS & TOOLTIP */
.contact-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1.5rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}
.contact-item i {
  font-size: 1.1rem;
  color: var(--accent);
}
.contact-item:hover {
  background: var(--accent-soft);
  transform: translateY(-3px);
}
.contact-item::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #020617;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
.contact-item:hover::after {
  opacity: 1;
}
/* Publications enhancements */
.pub-date {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.abstract-details {
  margin: 1.2rem 0;
  cursor: pointer;
}
.abstract-details summary {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  padding: 0.6rem 0;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.abstract-details summary::marker {
  color: var(--accent);
}
.abstract-details[open] summary {
  margin-bottom: 0.8rem;
}
.abstract-content {
  background: rgba(255,255,255,0.04);
  padding: 1rem 1.2rem;
  border-radius: 0.8rem;
  border-left: 3px solid var(--accent);
  font-size: 0.92rem;
  line-height: 1.6;
}
.abstract-content p {
  margin-bottom: 0.8rem;
}
.keywords {
  color: var(--muted);
  font-style: italic;
  margin-top: 1rem !important;
}
.pub-links {
  margin-top: 1rem;
  font-size: 0.95rem;
}
.pub-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-right: 0.5rem;
}
.pub-links a:hover {
  text-decoration: underline;
}
.pub-links i {
  margin-right: 0.4rem;
  font-size: 1rem;
}
/* Arabic Romantic Poetry - 2 Wide Cards Side by Side */
.poetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Always 2 columns */
  gap: 1.2rem;
  margin-top: 0rem;
}
.poem-card-wrapper {
  cursor: pointer;
}
.poem-card {
  position: relative;
  background: var(--card);
  border-radius: 1.0rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(56,189,248,0.2);
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  transition: all 0.5s ease;
  transform: perspective(1000px) rotateX(2deg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.poem-card.expanded {
  transform: translateY(-8px) perspective(1000px) rotateX(0deg);
  box-shadow: 0 25px 50px rgba(56,189,248,0.2);
  border-color: var(--accent);
}
.poem-card:hover {
  transform: translateY(-12px) perspective(1000px) rotateX(0deg);
  box-shadow: 0 25px 50px rgba(56,189,248,0.2);
  border-color: var(--accent);
}
/* Corner decorations */
.poem-card::before,
.poem-card::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 30px;
  border: 2px solid var(--accent);
  opacity: 0.25;
  transition: opacity 0.4s ease;
}
.poem-card::before {
  top: 18px;
  left: 18px;
  border-right: none;
  border-bottom: none;
}
.poem-card::after {
  bottom: 18px;
  right: 18px;
  border-left: none;
  border-top: none;
}
.poem-card:hover::before,
.poem-card:hover::after {
  opacity: 0.5;
}
.poem-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 0rem;
  color: var(--accent);
  font-weight: 200;
}
.poem-preview,
.poem-full {
  font-family: 'Playfair Display', sans-serif;
  font-size: 0.85rem;
  line-height: 1.0;
  font-weight: 5;
  color: var(--text);
  text-align: right;
  white-space: pre-line; /* Respects your <br> tags */
  padding-left: 0.05rem;   
  padding-right: 0.6rem;
  margin-top: -1.0rem;     /* ← ADD THIS: pulls text upward */
  /* your existing padding if any */
}
.poem-full {
  display: none;
}
.poem-card.expanded .poem-preview {
  display: none;
}
.poem-card.expanded .poem-full {
  display: block;
  animation: fadeIn 0.6s ease;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(56,189,248,0.2);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.expand-toggle {
  text-align: center;
  margin-top: 0rem; /* Reduced gap from last line to "اقرأ المزيد" */
  color: var(--accent);
  font-weight: 600;
  font-size: 0.6rem;
}
.poem-card.expanded .expand-toggle {
  color: var(--muted);
  margin-top: 0.5rem;
}
/* Responsive: Stack on mobile */
@media (max-width: 900px) {
  .poetry-grid {
    grid-template-columns: 1fr;
  }
  .poem-card {
    padding: 2.5rem 2rem;
  }
}
.expand-toggle {
  text-align: center;
  margin-top: 0.1rem;
  color: var(--accent);
  font-weight: 100;
  font-size: 0.6rem;
}

.poem-card.expanded .expand-toggle {
  display: none;   /* ← ADD THIS BLOCK */
}
.poem-card.expanded .poem-full {
  display: block;
  animation: fadeIn 0.6s ease;
  margin-top: 0.8rem;                 /* Keeps top spacing */
  padding-top: 0.8rem;
  padding-bottom: 2.5rem;             /* ← ADD THIS: adds space at the bottom */
  border-top: 1px solid rgba(56,189,248,0.2);
  white-space: pre-line;
}
.poetry-page .poetry-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 4 on wide, 3 on medium, 2/1 on small */
  gap: 2rem;
  max-width: none; /* Full space */
  padding: 0 2rem; /* Breathing room on sides */
}
/* Natural bottom breathing room for short poems (no toggle) */
.poem-card:not(.expanded) .poem-content {
  padding-bottom: 1.5rem; /* Soft space at bottom for 1-3 line poems */
}

/* When expanded (long poems), keep normal padding */
.poem-card.expanded .poem-content {
  padding-bottom: 1rem;
}

/* "اقرأ المزيد" only appears on long poems (those with toggle in HTML) */
.expand-toggle {
  text-align: center;
  margin-top: -1.5rem;
  color: var(--accent);
  font-weight: 100;
  font-size: 0.7rem;
  opacity: 0.7;
}

.poem-card.expanded .expand-toggle {
  display: none;
}

/* .....*/

.poetry-header {
  text-align: left;
  margin-bottom: 1.0rem;
}

.poetry-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;           /* Matches your other section titles */
  font-weight: 700;
  color: var(--text);
  display: inline-block;
  margin: 0;
}

.collection-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;           /* Slightly smaller but still prominent */
  color: var(--accent);        /* Your beautiful blue */
  font-weight: 800;
  margin-left: 1.2rem;
  opacity: 0.8;
}

.poetry-description em {
  font-style: normal;
  color: var(--accent);
  font-weight: 200;
}
.desc-en {
  display: block;
}

.desc-ar {
  display: block;
  direction: rtl;              /* Makes Arabic start from the right */
  text-align: right;           /* Aligns the whole line to the right */
  margin-top: 0.0rem;
}
.poetry-description {
  font-size: 1rem;
  color: var(--muted);
  margin: 1.0rem 0 2.0rem 0;   /* Space below title, space before poems */
  line-height: 1.7;
}



.poetry-link {
  text-align: center;
  margin: 2.5rem auto 0.2rem;
}

.full-collection-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1.2rem;              /* Smaller padding → smaller button */
  font-size: 1.0rem;                  /* Slightly smaller text */
  font-weight: 400;
  color: var(--accent);
  background: rgba(201, 217, 224, 0.15); /* Much softer background (was 0.15+) */
  border: 1px solid rgb(57, 107, 129); /* Softer, less bright border */
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.4s ease;
  box-shadow: 0 4px 12px rgba(14, 70, 94, 0.08); /* Very subtle shadow */
}

.full-collection-btn:hover {
  transform: translateY(-3px);         /* Smaller lift on hover */
  background: rgba(56, 189, 248, 0.18); /* Slightly stronger on hover, still soft */
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15);
  color: white;
}

.full-collection-btn i {
  font-size: 1.2rem;                   /* Slightly smaller icon */
}

.btn-en, .btn-ar {
  font-size: inherit;
}

.btn-separator {
  font-weight: 400;
  opacity: 0.7;
}


/* Remove the pulse animation if you don't want any "light" movement */


/* .......*/



.title-lines {
  display: flex;
  justify-content: center;
  gap: 1rem;                   /* Space between the two lines */
  margin: 0rem auto 0rem;  /* Reduced top/bottom space → brings poems closer */
}

.title-lines .line {
  width: 80px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

/* Optional: make the lines slightly thicker or softer */
.title-lines .line {
  height: 1.0px;
  border-radius: 1px;
}




header {
  position: relative;           /* Important - allows absolute positioning inside */
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.back-nav {
  position: absolute;
  top: 6.0rem;                  /* Distance from top */
  right: 10rem;                  /* Distance from right edge - adjust 2rem to 6rem as needed */
}

.back-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: rgba(17,24,39,0.7);
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}

.back-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}



.collection-link {
  color: var(--accent);            /* Your beautiful blue */
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05em;               /* Slightly larger to stand out */
  transition: all 0.3s ease;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.collection-link:hover {
  color: whitesmoke;
  background: rgba(56, 189, 248, 0.15); /* Soft glow on hover */
  text-decoration: underline;
  text-underline-offset: 4px;
}