/* YouTubeEmbedTool.com: one stylesheet for the whole site (no framework). */
:root {
  --bg: #f5f6f8; --surface: #fff; --soft: #f1f3f5; --line: #e3e6ea;
  --text: #1d2127; --muted: #5d6570; --brand: #e62117; --brand-dark: #b9180f;
  --link: #c4170e; --ok: #127a3e; --warn: #9a6200; --err: #b42318;
  --code-bg: #0f172a; --code-fg: #e2e8f0; --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114; --surface: #171a1f; --soft: #1e2228; --line: #2b3038;
    --text: #e8eaed; --muted: #a2a9b3; --link: #ff6b62; --code-bg: #0a0c10;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: .3em 0 .4em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 1.8em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--soft); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.15rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 1.1rem; white-space: nowrap; }
.logo b { color: var(--brand); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.site-nav a:hover, .site-nav a.active { background: var(--soft); color: var(--brand); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
}
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 64px; padding: 40px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); }
.footer-brand { font-size: 1.1rem; margin: 0 0 8px; }
.footer-brand b, .footer-head { color: var(--brand); }
.footer-head { font-weight: 700; margin: 0 0 8px; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: .85rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Buttons, chips, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost { background: var(--soft); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: var(--err); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.link-btn { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 0; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--text); font-size: .82rem; font-weight: 600; text-decoration: none; }
.chip:hover, .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
.form label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .92rem; }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-weight: 400; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.form legend { font-weight: 700; padding: 0 6px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.notice { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.err { border-color: var(--err); color: var(--err); }
.mono, .mono-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.mono-box { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* Cards and panels */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel { margin: 0 0 20px; padding: 20px; }
.panel h2 { margin-top: 0; font-size: 1.2rem; }

/* Tool pages */
.tool-hero { text-align: center; padding: 32px 0 8px; }
.tool-hero p { max-width: 640px; margin: 0 auto; }
.tool-card { margin: 16px auto 0; max-width: 960px; }
.tool-input-row { display: flex; gap: 8px; }
.tool-input-row input { flex: 1; font-size: 1.05rem; padding: 14px 16px; }
@media (max-width: 560px) { .tool-input-row { flex-direction: column; } }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.hint.err { color: var(--err); }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 16px 0; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); cursor: pointer; }
.opt input { margin-top: 4px; }
.opt span { display: flex; flex-direction: column; font-weight: 600; font-size: .95rem; }
.opt small { font-weight: 400; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.field-row label { font-weight: 600; font-size: .9rem; }
.field-row label input, .field-row label select { margin-top: 6px; font-weight: 400; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg label { padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; }
.output { position: relative; margin-top: 8px; }
.output textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; min-height: 150px; resize: vertical; background: var(--code-bg); color: var(--code-fg); border-color: var(--code-bg); padding-top: 44px; }
.output .btn { position: absolute; top: 8px; right: 8px; }
.preview { background: var(--soft); border-radius: var(--radius); padding: 12px; display: flex; justify-content: center; }
.preview > * { width: 100%; }
.preview .placeholder { color: var(--muted); text-align: center; padding: 48px 16px; }
.result-list { display: grid; gap: 10px; }
.result-item { display: flex; gap: 8px; align-items: center; }
.result-item input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.result-item .label { min-width: 150px; font-weight: 600; font-size: .9rem; }
@media (max-width: 560px) { .result-item { flex-wrap: wrap; } .result-item .label { min-width: 100%; } }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.thumb-card { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thumb-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; }
.thumb-card div { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.big-number { font-size: 2rem; font-weight: 800; color: var(--brand); margin: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat-cards > div { background: var(--soft); border-radius: var(--radius); padding: 16px; }
.content-section { max-width: 820px; margin: 40px auto 0; }
.content-section ul { padding-left: 1.2em; }
.content-section li { margin: 6px 0; }
.faq details, .faq-list details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 10px 0; }
.faq summary, .faq-list summary { font-weight: 700; cursor: pointer; }
.faq details p, .faq-list details p { margin: 10px 0 0; }

/* Tools grid */
.tools-cta { margin-top: 48px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tool-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-tile:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--text); }
.tool-tile strong { color: var(--brand); }
.tool-tile span { color: var(--muted); font-size: .9rem; }

/* Blog list */
.breadcrumbs ol { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.page-hero { padding: 8px 0 16px; }
.search { display: flex; gap: 8px; max-width: 520px; margin: 16px 0; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s; }
.post-card:hover { transform: translateY(-2px); }
.card-img img { aspect-ratio: 1200/630; object-fit: cover; width: 100%; }
.card-body { padding: 16px 18px 20px; }
.card-body h3 { margin: 10px 0 4px; font-size: 1.12rem; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--brand); }
.card-body p { margin: 4px 0; }
.empty { padding: 40px; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 32px 0; gap: 12px; }

/* Single post */
.post-layout { max-width: 860px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px clamp(16px, 5vw, 48px) 32px; margin-top: 16px; box-shadow: var(--shadow); }
.post-header { margin-bottom: 16px; }
.post-header .chip { margin-top: 12px; }
.post-meta { font-size: .9rem; }
.featured { margin: 0 calc(-1 * clamp(16px, 5vw, 48px)) 24px; }
.featured img { width: 100%; aspect-ratio: 1200/630; object-fit: cover; }
.post-content { font-size: 1.07rem; line-height: 1.75; }
.post-content p { margin: 0 0 1.1em; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.post-content li { margin: .35em 0; }
.post-content blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: var(--soft); border-radius: 0 10px 10px 0; }
.post-content blockquote p { margin: 0; }
.post-content img { border-radius: 10px; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.post-figure { margin: 1.6em 0; }
.post-figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; }
.post-figure figcaption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 8px; }
.code-block { position: relative; margin: 1.2em 0; }
.code-block pre { background: var(--code-bg); color: var(--code-fg); border-radius: 10px; padding: 40px 16px 16px; overflow-x: auto; font-size: .88rem; line-height: 1.55; margin: 0; }
.code-block pre code { background: none; padding: 0; color: inherit; overflow-wrap: normal; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px; padding: 4px 10px; font-size: .78rem; cursor: pointer; }
.copy-btn:hover { background: var(--brand); }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--soft); }
.toc { background: var(--soft); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 24px; }
.toc-title { font-weight: 700; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; }
.sources ul { padding-left: 1.2em; }
.cta-box { margin: 32px 0; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.cta-title { font-weight: 800; font-size: 1.15rem; margin: 0 0 6px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0; }
.share-label { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: #fff; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; }
.share-btn:hover { filter: brightness(1.12); color: #fff; }
.share-x { background: #000; }
.share-facebook { background: #1877f2; }
.share-whatsapp { background: #1fa855; }
.share-linkedin { background: #0a66c2; }
.share-telegram { background: #229ed9; }
.share-reddit { background: #ff4500; }
.share-pinterest { background: #e60023; }
.share-email, .share-copy, .share-native { background: #4b5563; }
.post-footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.prev-next a { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.prev-next a:hover { border-color: var(--brand); }
.prev-next .right { text-align: right; }
@media (max-width: 560px) { .prev-next { grid-template-columns: 1fr; } .prev-next .right { text-align: left; } }
.related { margin-top: 40px; }
.prose-page { padding-top: 24px; }
.prose-page h2 { font-size: 1.3rem; }

/* Homepage extras */
.home-latest { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 0; }

/* Admin */
.admin-body { background: var(--bg); }
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.admin-nav a.active, .admin-nav a:hover { background: var(--soft); color: var(--brand); }
.admin-main { padding: 16px 16px 48px; }
.admin-card { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat-n { font-size: 1.6rem; font-weight: 800; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form select { width: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 4px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.tabs a.active { background: var(--brand); color: #fff; }
.admin-table td, .admin-table th { font-size: .9rem; }
.badge { font-size: .7rem; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.status { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); }
.status-live { color: var(--ok); }
.status-scheduled { color: var(--warn); }
.status-draft { color: var(--muted); }
.log { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.log-error { color: var(--err); }
.log-warn { color: var(--warn); }
.edit-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
@media (max-width: 900px) { .edit-grid { grid-template-columns: 1fr; } }
.thumb { border-radius: 8px; margin: 6px 0 10px; }
.label { font-weight: 700; margin: 0 0 6px; }
.danger-zone { margin-top: 24px; }
.char-count { font-weight: 400; font-size: .8rem; color: var(--muted); }
.char-count.over { color: var(--err); }

/* Ad slots */
.ad-slot { margin: 28px auto; text-align: center; min-height: 90px; overflow: hidden; clear: both; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.grid-ad { grid-column: 1 / -1; }
.grid-ad .ad-slot { margin: 0; }
.post-content .ad-slot { margin: 32px 0; }
.admin-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px 20px; }
.slot-grid label small { display: block; font-weight: 400; color: var(--muted); }
