*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Lora', Georgia, serif;
  background: #00372e;
  color: #fff;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.65;
}

/* ── Header ── */
header {
  background: #001f18;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
header h1 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}
header span {
  color: rgba(255,255,255,0.4);
  font-size: 0.9rem;
  line-height: 1;
}

/* ── Tile grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; padding: 16px; } }

.tile {
  background: #111;
  border: none;
  border-radius: 8px;
  padding: 16px 18px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
  transition: box-shadow 0.15s, transform 0.15s;
}
.tile:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

/* source row: logo + name + time */
.tile-source {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.source-logo {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.source-logo-fallback {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
  text-transform: uppercase;
}
.source-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tile-time {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  margin-left: auto;
}

.tile-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal {
  background: #1c1c1c;
  border-radius: 10px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  line-height: 1;
}
.modal-close:hover { color: #fff; }

.modal-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.modal-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.modal-source-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.modal-time {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-left: auto;
  padding-right: 28px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  color: #f5f0e8;
}
.modal-summary {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #b8b0a0;
  margin-bottom: 24px;
}
.modal-summary strong {
  color: #cec8bc;
  font-weight: 700;
}
.modal-summary p + p {
  margin-top: 12px;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  gap: 12px;
}
.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6ee7b7;
  text-decoration: none;
}
.modal-link:hover { color: #fff; }
.modal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  padding: 0;
}
.modal-share-btn .linkedin-icon { color: #0A66C2; }
.modal-share-btn:hover:not(:disabled) { opacity: 0.8; }
.modal-share-btn--disabled { opacity: 0.3; cursor: not-allowed; }
.linkedin-limit-msg {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin: 6px 0 0;
  text-align: right;
}
.modal-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  padding: 0;
  margin-bottom: 20px;
  display: block;
}
.modal-back:hover { color: #fff; }
.linkedin-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}
.linkedin-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #0A66C2;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.linkedin-preview textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #e0dbd0;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 14px 16px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.linkedin-preview textarea:focus {
  border-color: rgba(255,255,255,0.25);
}
.linkedin-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1c1c1c;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.linkedin-btn .linkedin-icon { color: #0A66C2; }
.linkedin-btn:hover { border-color: rgba(255,255,255,0.3); }
.linkedin-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin: 0;
}
.linkedin-btn:hover { background: #0958a8; }

/* ── Pagination ── */
.pagination {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.12s, color 0.12s;
}
.page-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.page-btn--active { background: #fff; color: #001f18; border-color: transparent; }
.page-btn--active:hover { background: #fff; color: #001f18; }
.page-btn--disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* ── Footer ── */
footer {
  background: #001f18;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 48px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; padding: 32px 16px 24px; gap: 28px; }
}
.footer-logo {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 14px;
}
.footer-email {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
}
.footer-email:hover { color: rgba(255,255,255,0.8); }
.footer-col-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.footer-col ul a:hover { color: rgba(255,255,255,0.85); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
@media (max-width: 700px) {
  .footer-bottom { flex-direction: column; gap: 6px; padding: 16px; text-align: center; }
}

[x-cloak] { display: none !important; }
