/* ===== Magazine Layout Shared Styles ===== */
.magazine {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #222;
}

/* ===== Grid for updates.php ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-media img,
.feature-media img {
  max-width: 100%;
  max-height: 80vh; /* scale to 80% of screen height */
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;   /* center horizontally */
  display: block;
}


.media-fallback {
  background: linear-gradient(135deg, #ccc, #eee);
  height: 180px;
}

.ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffcc00;
  color: #000;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 4px;
}

.card-body {
  padding: 1rem;
  flex: 1;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.chip {
  background: #e0e0e0;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.chip.pin {
  background: #ffe5b4;
}

.meta-date {
  color: #777;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.byline {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.75rem;
}

.card-content {
  font-size: 0.95rem;
  color: #444;
}

/* ===== Single Article for update.php ===== */
.feature {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn btn-primary{
  color:white
}

.feature-media img {
  max-height: 400px;
  object-fit: cover;
}

.feature-head {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.feature-title {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.feature-body {
  padding: 1.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.feature-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.feature-body h2, .feature-body h3 {
  margin-top: 1.5rem;
}

.feature-body p {
  margin-bottom: 1rem;
}


/* Hover zoom effect */
.zoomable-img {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
  height: auto; /* keep aspect ratio */
}
.zoomable-img:hover {
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}

/* Modal styles */
.img-modal {
  display: none;
  position: fixed;
  z-index: 1050;
  inset: 0; /* shorthand for top/right/bottom/left */
  background-color: rgba(0,0,0,0.85);
  padding-top: 60px;
  overflow: auto;
}

/* Centered image with aspect ratio preserved */
.img-modal .modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain; /* makes sure wide/tall images never stretch */
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  transition: transform 0.25s ease;
}

.img-modal.show .modal-content {
  transform: scale(1.02);
}

/* Close button */
.img-modal .close {
  position: absolute;
  top: 20px; right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}
.img-modal .close:hover {
  color: #bbb;
}

