/*
 * Layout: base elements and the parts shared by the site and the forum
 * (header, navigation, buttons, footer, ad slot). Uses only tokens.
 */
@layer layout {

body {
  background: var(--yac-bg);
  color: var(--yac-text);
  font: 450 1.0625rem/1.65 var(--yac-font);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
img { max-width: 100%; height: auto; }
a { color: var(--yac-link); text-decoration: none; }
a:hover { color: var(--yac-link-hover); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--yac-accent); outline-offset: 3px; }
/* form fields show focus with their own border + soft ring: no extra outline on top */
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus-visible { outline: none; }

.yac-wrap { width: min(100% - 2 * var(--yac-gutter), var(--yac-max)); margin-inline: auto; }
.yac-icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
.yac-skip { position: absolute; left: -999px; top: 0; }
.yac-skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--yac-accent); color: var(--yac-accent-ink); padding: 8px 12px; border-radius: 8px; }
.yac-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.yac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; line-height: 1.2; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--yac-line); background: var(--yac-bg); color: var(--yac-text);
}
.yac-btn:hover { background: var(--yac-surface); color: var(--yac-text); text-decoration: none; }
.yac-btn--dark { background: var(--yac-text); color: var(--yac-bg); border-color: transparent; }
.yac-btn--dark:hover { background: var(--yac-text); color: var(--yac-bg); opacity: .88; }
.yac-btn--accent { background: var(--yac-accent); color: var(--yac-accent-ink); border-color: transparent; }
.yac-btn--accent:hover { background: var(--yac-accent); color: var(--yac-accent-ink); filter: brightness(1.05); }
.yac-btn--lg { min-height: 54px; padding: 12px 28px; font-size: 1.05rem; }
.yac-icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 50%; border: 0; background: var(--yac-surface); color: var(--yac-text); cursor: pointer;
}
.yac-icon-btn:hover { background: var(--yac-surface-2); color: var(--yac-text); }
.yac-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

/* theme toggle icon: moon in light, sun in dark */
.yac-icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .yac-icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .yac-icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .yac-icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .yac-icon-btn .i-moon { display: none; }
}

/* ---------- Bootstrap forms and buttons (site + forum): one focus style = the field's own border ---------- */
.form-control, .form-select { background-color: var(--yac-bg); color: var(--yac-text); border-color: var(--yac-line); border-radius: var(--yac-radius-s); }
.form-control::placeholder { color: var(--yac-muted); opacity: .8; }
.form-control:focus, .form-select:focus { background-color: var(--yac-bg); color: var(--yac-text); border-color: var(--yac-accent); box-shadow: none; }
.form-check-input { background-color: var(--yac-bg); border-color: var(--yac-line); }
.form-check-input:checked { background-color: var(--yac-accent); border-color: var(--yac-accent); }
.form-check-input:focus { border-color: var(--yac-accent); box-shadow: none; }
.btn { --bs-btn-border-radius: 999px; --bs-btn-font-weight: 700; --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .5rem; }
.btn-primary {
  --bs-btn-color: var(--yac-accent-ink); --bs-btn-bg: var(--yac-accent); --bs-btn-border-color: var(--yac-accent);
  --bs-btn-hover-color: var(--yac-accent-ink); --bs-btn-hover-bg: var(--yac-accent); --bs-btn-hover-border-color: var(--yac-accent);
  --bs-btn-active-color: var(--yac-accent-ink); --bs-btn-active-bg: var(--yac-accent); --bs-btn-active-border-color: var(--yac-accent);
  --bs-btn-disabled-color: var(--yac-accent-ink); --bs-btn-disabled-bg: var(--yac-accent); --bs-btn-disabled-border-color: var(--yac-accent);
  --bs-btn-focus-shadow-rgb: 245, 176, 12;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary {
  --bs-btn-color: var(--yac-text); --bs-btn-bg: var(--yac-surface); --bs-btn-border-color: var(--yac-line);
  --bs-btn-hover-color: var(--yac-text); --bs-btn-hover-bg: var(--yac-surface-2); --bs-btn-hover-border-color: var(--yac-line);
  --bs-btn-active-color: var(--yac-text); --bs-btn-active-bg: var(--yac-surface-2); --bs-btn-active-border-color: var(--yac-line);
}
.input-group > .btn { border-radius: 0 var(--yac-radius-s) var(--yac-radius-s) 0; }
/* input groups: joined field + button (our field radius would otherwise win over Bootstrap's group rules) */
.input-group > :not(:last-child):not(.dropdown-menu) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :not(:first-child):not(.dropdown-menu) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
/* Joomla's password show/hide icons use the Font Awesome font (not loaded): draw them with an SVG mask */
.input-password-toggle { display: inline-grid; place-items: center; min-width: 44px; }
.input-password-toggle [class^="icon-"], .input-password-toggle [class*=" icon-"] {
  display: inline-block; width: 1.1em; height: 1.1em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.input-password-toggle [class^="icon-"]::before, .input-password-toggle [class*=" icon-"]::before { content: none; }
.input-password-toggle .icon-eye-slash { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.53 13.53 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.53 13.53 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E"); }

/* ---------- header ---------- */
.yac-top {
  position: sticky; top: 0; z-index: 1020;
  background: color-mix(in srgb, var(--yac-bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.yac-top.is-scrolled, body:not(.is-home) .yac-top { border-bottom-color: var(--yac-line); }
.yac-top .yac-wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.yac-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--yac-text); }
.yac-brand:hover { color: var(--yac-text); text-decoration: none; }
.yac-brand img { width: 32px; height: 32px; border-radius: 8px; }
.yac-nav { margin-inline: auto; }
.yac-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.yac-nav a { color: var(--yac-muted); font-weight: 600; font-size: .95rem; }
.yac-nav a:hover, .yac-nav a[aria-current] { color: var(--yac-text); text-decoration: none; }
.yac-tools { display: flex; align-items: center; gap: 10px; }
.yac-menu { display: none; }

@media (max-width: 960px) {
  .yac-top .yac-nav, .yac-tools .yac-donate { display: none; }
  .yac-tools { margin-left: auto; }
  .yac-menu { display: block; position: relative; }
  .yac-menu summary { list-style: none; }
  .yac-menu summary::-webkit-details-marker { display: none; }
  .yac-menu[open] .yac-menu__panel { display: block; }
  .yac-menu__panel {
    display: none; position: absolute; right: 0; top: 52px; width: min(88vw, 320px);
    background: var(--yac-bg); border: 1px solid var(--yac-line); border-radius: var(--yac-radius-m);
    padding: 8px; box-shadow: var(--yac-shadow-lg);
  }
  .yac-menu__panel ul { display: grid; list-style: none; margin: 0; padding: 0; }
  .yac-menu__panel a { display: block; padding: 12px 14px; border-radius: var(--yac-radius-s); color: var(--yac-text); font-weight: 650; }
  .yac-menu__panel a:hover { background: var(--yac-surface); text-decoration: none; }
}

/* ---------- system messages (Joomla <joomla-alert>) ---------- */
.yac-messages:empty { display: none; }
.yac-messages { margin-block: 24px; }
joomla-alert {
  --yac-alert-edge: var(--yac-accent);
  position: relative; display: block; margin: 0 0 12px; padding: 14px 52px 14px 16px;
  background: var(--yac-surface); color: var(--yac-text);
  border: 1px solid var(--yac-line); border-left: 3px solid var(--yac-alert-edge); border-radius: var(--yac-radius-s);
  box-shadow: none; font-size: .95rem; line-height: 1.5;
}
joomla-alert[type="danger"], joomla-alert[type="error"] { --yac-alert-edge: #e5484d; }
joomla-alert[type="info"], joomla-alert[type="notice"] { --yac-alert-edge: var(--yac-muted); }
joomla-alert .alert-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
joomla-alert .alert-wrapper, joomla-alert .alert-message { background: none; color: inherit; padding: 0; margin: 0; }
joomla-alert .joomla-alert--close {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--yac-muted);
  font-size: 1.35rem; line-height: 1; opacity: 1; cursor: pointer;
}
joomla-alert .joomla-alert--close:hover { background: var(--yac-surface-2); color: var(--yac-text); }
joomla-alert .joomla-alert--close span { font-size: 1.4rem; font-weight: 400; line-height: 1; }

/* ---------- dialogs (download thank-you) ---------- */
.yac-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 32px clamp(20px, 5vw, 36px) 28px; border: 1px solid var(--yac-line); border-radius: var(--yac-radius-l);
  background: var(--yac-bg); color: var(--yac-text); box-shadow: var(--yac-shadow-lg); text-align: center;
}
.yac-dialog::backdrop { background: rgb(8 10 14 / .55); backdrop-filter: blur(3px); }
.yac-dialog[open] { animation: yac-dialog-in .18s ease-out; }
@keyframes yac-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.yac-dialog__close { position: absolute; top: 14px; right: 14px; }
.yac-dialog__icon { display: block; margin: 0 auto 14px; border-radius: 26%; box-shadow: 0 10px 30px var(--yac-glow); }
.yac-dialog h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); font-weight: 800; letter-spacing: -.03em; margin: 0; }
.yac-dialog__lead { color: var(--yac-muted); margin: 6px 0 0; }
.yac-dialog__section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--yac-line); }
.yac-dialog h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; }
.yac-dialog h3 .yac-icon { color: var(--yac-link); }
.yac-dialog p { color: var(--yac-muted); font-size: .95rem; margin: 0 0 10px; }
.yac-dialog__small { font-size: .85rem !important; }
.yac-dialog__badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 14px 0 12px; }
.yac-dialog__badges img { display: block; height: 40px; width: auto; }
.yac-dialog__cta { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .yac-dialog[open] { animation: none; } }

/* ---------- ad slot: fixed height, so the page does not move when the ad loads ---------- */
.yac-ad { padding-block: 24px 40px; }
.yac-ad__slot {
  display: grid; place-items: center; min-height: 100px; overflow: hidden;
  background: var(--yac-surface); border-radius: var(--yac-radius-m);
}
.yac-ad__label { color: var(--yac-muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
@media (min-width: 768px) { .yac-ad__slot { min-height: 90px; } }

/* ---------- footer ---------- */
.yac-footer { border-top: 1px solid var(--yac-line); padding-block: 56px 36px; color: var(--yac-muted); font-size: .95rem; }
.yac-footer__cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.yac-footer h2 { color: var(--yac-text); font-size: .95rem; font-weight: 800; margin: 0 0 12px; }
.yac-footer ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.yac-footer a { color: inherit; }
.yac-footer a:hover { color: var(--yac-text); }
.yac-footer p { margin: 12px 0 0; max-width: 34ch; }
.yac-social { display: flex; gap: 8px; margin-top: 16px; }
.yac-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--yac-line); font-size: .85rem; }
@media (max-width: 760px) {
  .yac-footer__cols { grid-template-columns: 1fr 1fr; }
  .yac-footer__cols > :first-child { grid-column: 1 / -1; }
}

} /* @layer layout */
