/* Public-site styles for HTML written in the admin editor. Wrap the content:
     <div class="rte-content"><?= $post['content'] ?></div>
   Rules use :where() so the site's own CSS always wins; tune with the variables below, e.g.
     .rte-content { --rte-accent: #d977ad; --rte-radius: 16px; } */
.rte-content {
  --rte-accent: currentColor;      /* quote bar */
  --rte-radius: 12px;              /* image/video corners */
  --rte-caption: #64748b;          /* figure captions */
  --rte-border: #e2e8f0;           /* table + divider lines */
  --rte-th-bg: #f8fafc;            /* table header */
  --rte-gap: 1.5rem;               /* space around images/videos/tables */
}
.rte-content::after { content: ""; display: table; clear: both; }

:where(.rte-content) p.lead { font-size: 1.25em; line-height: 1.7; }
:where(.rte-content) blockquote { border-left: 4px solid var(--rte-accent); padding: .25rem 0 .25rem 1rem; margin: var(--rte-gap) 0; font-style: italic; }
:where(.rte-content) hr { border: 0; border-top: 1px solid var(--rte-border); margin: var(--rte-gap) 0; opacity: 1; }

/* images + YouTube videos: <figure class="rte-img|rte-video rte-w-{small|medium|full} rte-align-{left|center|right}"> */
:where(.rte-content) figure.rte-img, :where(.rte-content) figure.rte-video { margin: var(--rte-gap) auto; max-width: 100%; }
:where(.rte-content) figure.rte-img img { display: block; margin: 0; width: 100%; height: auto; border-radius: var(--rte-radius); }
:where(.rte-content) figure.rte-video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--rte-radius); background: #000; }
:where(.rte-content) figure.rte-w-full { width: 100%; }
:where(.rte-content) figure.rte-w-medium { width: 60%; }
:where(.rte-content) figure.rte-w-small { width: 33%; }
:where(.rte-content) figure.rte-align-center { margin-left: auto; margin-right: auto; }
:where(.rte-content) figure.rte-align-left { float: left; margin: .4rem 1.5rem 1rem 0; }
:where(.rte-content) figure.rte-align-right { float: right; margin: .4rem 0 1rem 1.5rem; }
:where(.rte-content) figcaption { text-align: center; font-size: .9rem; color: var(--rte-caption); margin-top: .6rem; }
:where(.rte-content) figure.rte-zoom img { cursor: zoom-in; }

/* tables scroll sideways on narrow screens instead of breaking the layout */
:where(.rte-content) figure.rte-table { margin: var(--rte-gap) 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
:where(.rte-content) figure.rte-table table { width: 100%; border-collapse: collapse; margin: 0; }
:where(.rte-content) figure.rte-table th, :where(.rte-content) figure.rte-table td { border: 1px solid var(--rte-border); padding: .55rem .8rem; vertical-align: top; text-align: left; }
:where(.rte-content) figure.rte-table th { background: var(--rte-th-bg); font-weight: 600; }

@media (max-width: 575.98px) {
  .rte-content figure.rte-w-medium, .rte-content figure.rte-w-small,
  .rte-content figure.rte-align-left, .rte-content figure.rte-align-right { float: none; width: 100% !important; margin: 1.25rem 0; }
  :where(.rte-content) figure.rte-table th, :where(.rte-content) figure.rte-table td { padding: .45rem .6rem; white-space: nowrap; }
}

/* lightbox for images marked "Tıklayınca büyüsün" (built by rte-content.js) */
.rte-lb { position: fixed; inset: 0; z-index: 2000; background: rgba(15,12,25,.92); display: none; align-items: center; justify-content: center; padding: 3.5rem 3.5rem 4rem; touch-action: pan-y; }
.rte-lb.open { display: flex; }
.rte-lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.rte-lb-cap { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; color: #fff; font-size: .92rem; padding: 0 4rem; }
.rte-lb-btn { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.rte-lb-btn:hover { background: rgba(255,255,255,.28); }
.rte-lb-close { top: 1rem; right: 1rem; }
.rte-lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.rte-lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 575.98px) {
  .rte-lb { padding: 3.5rem .75rem 5rem; }
  .rte-lb-prev, .rte-lb-next { top: auto; bottom: 1rem; transform: none; }
  .rte-lb-cap { bottom: 1.6rem; padding: 0 4.25rem; }
}

/* buttons from the editor: <p class="rte-btns rte-btns--center"><a class="rte-btn rte-btn--dolu rte-btn--lg" href="…">…</a></p>
   Default colour / corners follow the site:  .rte-content { --rte-btn: #FF6A1A; --rte-btn-text: #fff; --rte-btn-radius: 999px; }
   Icons: link admin/assets/public/rte-ikonlar.css as well. */
.rte-content { --rte-btn: #111827; --rte-btn-text: #fff; --rte-btn-radius: 10px; }
:where(.rte-content) p.rte-btns { display: flex; flex-wrap: wrap; gap: .75rem; margin: var(--rte-gap) 0; }
:where(.rte-content) p.rte-btns--center { justify-content: center; }
:where(.rte-content) p.rte-btns--right { justify-content: flex-end; }
/* rte-btn--site = the site's own button classes (config editor.buton_siniflari): only layout here, the site's CSS draws it */
:where(.rte-content) a.rte-btn--site { display: inline-flex; align-items: center; justify-content: center; gap: .5em; text-decoration: none; }
:where(.rte-content) a.rte-btn:not(.rte-btn--site) { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: .7em 1.4em; border: 1.5px solid var(--rte-btn);
  border-radius: var(--rte-btn-radius); font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center; transition: filter .2s, transform .2s; }
:where(.rte-content) a.rte-btn--dolu { background: var(--rte-btn); color: var(--rte-btn-text); }
:where(.rte-content) a.rte-btn--cerceve { background: transparent; color: var(--rte-btn); }
:where(.rte-content) a.rte-btn--yazi { background: transparent; border-color: transparent; color: var(--rte-btn); padding-left: 0; padding-right: 0; min-height: 0; }
:where(.rte-content) a.rte-btn:not(.rte-btn--site):hover { filter: brightness(.92); transform: translateY(-1px); }
:where(.rte-content) a.rte-btn--sm { min-height: 36px; padding: .45em 1em; font-size: .9em; }
:where(.rte-content) a.rte-btn--lg { min-height: 56px; padding: .9em 1.8em; font-size: 1.1em; }
:where(.rte-content) a.rte-btn--blok { display: flex; width: 100%; }
