.post {
  margin: 0 auto;
  padding: 0 1.5rem;
  max-width: 50rem;
  font-size: 1.125rem;
  line-break: normal; /* needed for safari to break long words/urls */
}

.post__topic {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: .875rem;
  font-weight: bold;
  color: #767676;
  text-decoration: none;
}

.post__topic:hover {
  text-decoration: underline;
}

.post__summary {
  margin-bottom: 1rem;
}

.post__meta {
  display: flex;
  color: #767676;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  font-size: 1rem;
}

.post__meta-info {
  display: flex;
  align-items: center;
}

.post__meta-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  line-height: 1.3;
}

/* Separator between the byline and the date while they share a line. */
.post__meta-text .post__date::before {
  content: "\00b7";
  margin: 0 0.4rem;
}

/* On mobile, drop the date below the author name to keep the meta narrow
   so the like/share actions still fit on the right. */
@media only screen and (max-width: 40rem) {
  .post__meta-text {
    flex-direction: column;
    align-items: flex-start;
  }

  .post__meta-text .post__date::before {
    content: none;
  }
}

.post__author-image {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 1.5rem;
  display: inline-block;
  border: 1px solid #aaa;
  margin-right: 0.5rem;
  color: transparent;
  font-size: 0;
}

.post__meta a {
  color: #767676;
  text-decoration: none;
}

.post__meta a:hover {
  text-decoration: underline;
}

.post__image {
  width: 100%;
}

.post p {
  margin: 1rem 0;
}

.post p a {
  text-decoration: underline;
}

/* Button styles */
.post .kg-button-card a.kg-btn,
.post .kg-button-card a.kg-btn:hover {
  background: #2d55a6;
  color: white;
  border-radius: 1.3rem;
  font-weight: normal;
  font-size: 1rem;
  padding: 0.6rem 1.2rem 0.7rem 1.2rem;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  height: auto;
  line-height: 1.1rem;
  display: inline-block;
  text-align: center;
  font-family: "Lato", sans-serif;
}

/* IMAGE GALLERY STYLES */
.kg-gallery-card {
  margin: 0 0 1.5em;
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  margin: 2rem auto;
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kg-gallery-image img {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
}

.kg-gallery-row:not(:first-of-type) {
  margin: 0.75rem 0 0 0;
}

.kg-gallery-image:not(:first-of-type) {
  margin: 0 0 0 0.75rem;
}

/* Embedded */
.kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.kg-embed-card iframe {
  margin: 0 auto !important;
  max-width: 100% !important;
}

/*
Docs can be found here: http://themes.ghost.org/docs/ghost-editor#section-gallery-card

The implementation that Ghost recommends is pretty robust, with one caveat: it needs a few lines of JavaScrpt. Example can be found here:
https://github.com/TryGhost/Casper/pull/475/files#diff-ce5e030f2e2e2a50f18199464f07ea70
*/

/* BOOKMARK CARD STYLES */
.kg-bookmark-card {
  width: auto;
}

.kg-bookmark-container {
  box-shadow: 0 0 1.2rem rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  display: flex;
  overflow: hidden;
  flex-direction: row-reverse;
}

.kg-bookmark-container:hover {
  background-color: #f5f5f5;
}

.kg-bookmark-content {
  width: 85%;
  padding: 0.5rem 1rem;
}

.kg-bookmark-title {
  font-size: 1rem !important;
  margin-bottom: 0.4rem;
  font-weight: bold;
  color: #2d55a6;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.kg-bookmark-thumbnail {
  height: auto;
  display: block;
  width: 25%;
}

.kg-bookmark-thumbnail img {
  object-fit: cover;
  height: 100%; 
  width: 100%; 
}

.kg-bookmark-description {
  opacity: 1;
  font-size: 1rem !important;
  color: black;
}

@media only screen and (max-width: 40rem) {
  .kg-bookmark-thumbnail {
    display: none;
  }

  .kg-bookmark-content {
    width: 100%;
  }
}

.kg-bookmark-metadata {
  color: #767676;
  font-size: 0.85rem !important;
  margin-top: 0.5rem;
}

.kg-bookmark-metadata span {
  opacity: 1 !important;
}

.kg-bookmark-icon {
  margin-right: 0.5rem;
  width: 0.9rem;
  height: 0.9rem;
}

.kg-bookmark-author {
  line-height: 1.5em;
}

.kg-bookmark-publisher:before {
  content: ' · ' !important;
}

/*
Docs can be found here: https://ghost.org/docs/api/v2/handlebars-themes/editor/#bookmark-card

The example implementation in the Ghost docs isn't bad, although you may want to adjust the image styles a bit.

Want something a bit leaner? You can drop the snippet I used in my premium Weblog theme that right in here! Here it is: https://gist.github.com/curiositry/511c84204f136a97d65cf77a39b230bf
*/

/* Read More */
.post__related {
  margin-top: 1.5rem;
  padding: 1.5rem 0;
  background-color: #f0f1f2;
}

.post__related .topic-button {
  top: 15.1rem;
}

figure.kg-image-card {
  width: 100%;
}

.post__header a:hover .topic {
  text-decoration: underline;
}

.post__content {
  padding-bottom: 1.5rem;
}

/* Reader actions (like pill + Share button), aligned right of the author meta */
.post__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

@media only screen and (max-width: 40rem) {
  .post__actions {
    margin-left: 0;
  }
}

.post__share-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.2rem;
  border: 1px solid #d5d7da;
  border-radius: 1.5rem;
  background: #ffffff;
  color: #767676;
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.post__share-toggle:hover {
  color: #ffffff;
  background: #2d55a6;
  border-color: #2d55a6;
}

/* Share dialog */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.share-modal[hidden] {
  display: none;
}

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

.share-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.share-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.share-modal__title {
  margin: 0;
  padding: 0; /* override the global h2 padding that would otherwise inflate the header */
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: bold;
  color: #1a1a1a;
}

.share-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #767676;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.share-modal__close:hover {
  background: #f2f2f2;
  color: #1a1a1a;
}

.share-modal__close svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

/* Article preview inside the dialog */
.share-preview {
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
}

.share-preview__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.share-preview__body {
  padding: 0.75rem 1rem 1rem;
}

.share-preview__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #767676;
  font-size: 0.9rem;
}

.share-preview__brand img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.share-preview__title {
  margin: 0 0 0.5rem;
  padding: 0; /* override the global h3 padding leaking in from .post typography */
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: bold;
  color: #1a1a1a;
}

/* Higher specificity so .post p (margin: 1rem 0) doesn't re-inflate the spacing */
.share-preview .share-preview__desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #767676;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Share options grid */
.share-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.share-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 4rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #4b4b4b;
  font-family: "Lato", sans-serif;
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.share-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #f2f2f2;
  color: #1a1a1a;
  transition: background-color 0.2s ease;
}

.share-option:hover .share-option__icon {
  background: #e2e2e2;
}

.share-option__icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.share-option__label {
  line-height: 1.2;
}

.post__share-feedback {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  background: #222222;
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.post__share-copy.is-copied .post__share-feedback {
  opacity: 1;
}

/* Embedded flights and media */
.post__content iframe {
  height: 30rem;
  height: 40vw;
  max-height: 50rem;
  min-height: 26rem;
  width: 100%;
  outline: none;
  border: none;
  box-sizing: border-box;
  border-radius: 0.4rem;
  box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.1);
}

@media only screen and (min-width: 74rem) {
  figure.kg-width-wide,
  figure.kg-width-full,
  figure.kg-gallery-card {
    width: 70rem;
    margin-left: -10rem;
  }
}

@media only screen and (min-width: 94rem) {

  figure.kg-width-full,
  figure.kg-gallery-card {
    width: 90rem;
    margin-left: -20rem;
  }
}

figcaption {
  color: #767676;
  font-size: 1rem;
}