/* =========================================================
   FreeCAD site styles (based on freecad.org css/style.css)
   ========================================================= */

html, body { height: 100%; font-family: "Roboto", sans-serif; }
body { font-size: 16px; color: #ffffff; background-color: #27343f; }
h1, h2, h3, h4, h5, h6 { font-family: "Montserrat", sans-serif; font-weight: 700; }

#main {
  padding: 4vw 8vw 8vw 8vw;
  background-color: #27343f;
  background-image: url("../../svg/pattern-background.svg");
  background-repeat: repeat-y;
  background-size: 100% auto;
}

/* ---------- Navbar ---------- */
.navbar-custom {
  background-color: rgba(52, 58, 64, 0.7);
  padding: 0 6vw;
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}
.navbar-custom .nav-pills .nav-link {
  font-family: "Montserrat", sans-serif; font-weight: 700;
  font-size: 1em; color: #ffffff; transition: all 0.3s ease; margin: 3px;
}
.navbar .nav-link:hover, .navbar .nav-link:focus { background-color: rgba(255, 255, 255, 0.2); }
.navbar .nav-link.active { background-color: #ffffff; color: #404040 !important; }
.navbar .dropdown-menu { overflow: auto; font-size: 1em; max-height: 80vh; }
.navbar .dropdown-menu a:hover, .navbar .dropdown-menu a.active { background-color: #e4e4e4; }
.navbar-brand { margin-right: 0; }
.navbar-brand img { height: 2.2em; }
@media all and (max-width: 650px) {
  .dropdown-menu.show { right: unset; }
  .dropdown-menu-mobile-left { right: 0 !important; }
}

/* ---------- Generic ---------- */
img { height: auto; }
.navbar-brand img { width: auto; }
.icon-social { height: auto; }
.btn { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 1em; padding: 0.4em 1.6em; }
.btn.btn-sm { padding: .25em .5em; }
.hidden { display: none; }
[data-bs-toggle="modal"] { cursor: pointer; }
.whitelinks a { color: #fff; text-decoration: underline; font-weight: bold; }
code { color: #fff; background: #1F425C; padding: 3px; border-radius: 2px; }

/* ---------- Sections ---------- */
#main .section-cover { margin-top: 4em; }
#main .section { margin: 4em 0; background-color: rgba(52, 58, 64, 0.5); }
.section-title { font-size: 2em; }
.section-body { font-size: 1em; }
.features-title, .downloads-notes-title { font-size: 2em; margin-bottom: 0.5em; }
.download-notes { margin-top: 3em; margin-bottom: 4em; }

/* ---------- Home ---------- */
.home-title { font-family: "Montserrat", sans-serif; font-weight: 900; font-size: 3em; }
.home-image { width: 430px; max-width: 100%; height: auto; }
.home-subtitle { font-size: 1.2em; font-family: "Roboto", sans-serif; font-weight: 400; }
#floating-arrow { width: 3em; height: auto; margin: 1em 0 4em 0; cursor: pointer; }

/* ---------- Sprites (scroll animations) ---------- */
.animated-sprite { background-repeat: no-repeat; }
/* Below-the-fold sections are rendered only when needed (faster first load) */
#main > .section:nth-of-type(n+4) { content-visibility: auto; contain-intrinsic-size: auto 600px; }

/* ---------- Downloads ---------- */
.card { border-radius: 0.8em; }
.download-platform .card-footer { border-bottom-left-radius: 0.8em; border-bottom-right-radius: 0.8em; }
.download-platform-name { font-size: 1.4em; }
.download-platform .card img.w-100 { max-height: 220px; object-fit: contain; }
.download-notes a.badge { font-size: 0.85em; vertical-align: middle; }

/* ---------- Blog ---------- */
.blog-header { margin-top: 3em; margin-bottom: 2em; }
.blog-card {
  display: flex; flex-direction: column; height: 100%;
  background: rgba(52, 58, 64, 0.65); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.8em; overflow: hidden; color: #fff; text-decoration: none;
  transition: transform .2s ease, border-color .2s ease;
}
.blog-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.25); color: #fff; }
.blog-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #1f2932; }
.blog-card .blog-card-body { padding: 1em 1.2em 1.3em; display: flex; flex-direction: column; flex: 1; }
.blog-card h3 { font-size: 1.1em; margin: .3em 0 .5em; }
.blog-card p { font-size: .85em; color: rgba(255,255,255,0.8); margin: 0; }
.blog-meta { font-size: .72em; color: rgba(255,255,255,0.6); }
.blog-empty { padding: 3em 1em; background: rgba(52,58,64,0.5); border-radius: .8em; }
.pagination .page-link { background: rgba(52,58,64,0.8); border-color: rgba(255,255,255,0.15); color: #fff; }
.pagination .page-item.active .page-link { background: #fff; color: #333; border-color: #fff; }

.post-wrap { max-width: 900px; margin: 3em auto 0; }
.post-wrap .post-cover { width: 100%; border-radius: .8em; margin-bottom: 1.5em; }
.post-title { font-size: 2.1em; line-height: 1.2; }
.post-content { font-size: .92em; line-height: 1.75; background: rgba(39,52,63,0.85); padding: 1.5em; border-radius: .8em; }
.post-content img, .post-content video, .post-content iframe { max-width: 100%; height: auto; border-radius: .5em; }
.post-content a { color: #8fd3ff; }
.post-content pre { background: #1b242c; padding: 1em; border-radius: .5em; overflow-x: auto; }
.post-content blockquote { border-left: 4px solid #418FDE; padding-left: 1em; color: rgba(255,255,255,.85); }
.post-back { color: rgba(255,255,255,.8); text-decoration: none; font-size: .8em; }
.post-back:hover { color: #fff; }

/* ---------- Ads ---------- */
.ad-slot { margin: 2em auto; text-align: center; max-width: 100%; overflow: hidden; clear: both; }
.ad-slot-header { margin-top: 3em; }

/* ---------- Footer & newsletter ---------- */
.footer-custom { padding: 4em 6vw; }
.icon-social { width: 1.8em; }
.footer-links a, .footer-custom a { color: rgba(255,255,255,0.85); }
.footer-links { font-size: .85em; }
.footer-disclaimer { font-size: .7em; color: rgba(255,255,255,0.55); max-width: 760px; margin: 1em auto 0; }
.subscribe-box { max-width: 620px; margin: 0 auto 2em; }
.subscribe-title { font-size: 1.4em; }
.subscribe-text { font-size: .85em; color: rgba(255,255,255,0.75); }
.subscribe-form { display: flex; gap: .5em; flex-wrap: wrap; justify-content: center; }
.subscribe-form .form-control { flex: 1 1 240px; border-radius: 2em; padding: .5em 1.2em; background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.subscribe-form .form-control::placeholder { color: rgba(255,255,255,0.55); }
.subscribe-form .form-control:focus { background: rgba(255,255,255,0.12); color: #fff; box-shadow: 0 0 0 .2rem rgba(65,143,222,.4); }
.subscribe-msg { min-height: 1.5em; margin-top: .6em; font-size: .85em; }
.subscribe-msg.ok { color: #7ee2a8; }
.subscribe-msg.err { color: #ff9b9b; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Donate button glow ---------- */
.donate-btn { position: relative; overflow: hidden; z-index: 0; }
.donate-btn::before, .donate-btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(45deg, #418FDE, #76428a, #337bba, #CB333B, #9b59b6, #FF585D);
  background-size: 400%; z-index: -1; animation: glow 8s ease-in-out infinite; border-radius: inherit;
}
.donate-btn::after { filter: blur(15px); }
@keyframes glow { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.donate-btn:hover { transform: scale(1.08); box-shadow: 0 0 15px rgba(118, 66, 138, 0.8); }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ---------- Responsive (same breakpoints as freecad.org) ---------- */
@media (min-width: 400px) {
  body { font-size: 18px; }
  #floating-arrow { width: 3em; margin: 2em 0; }
}
@media (min-width: 992px) {
  #main .section { margin: 6em 0; background-color: transparent; }
  .navbar-custom .nav-pills .nav-link { font-size: 0.6em; }
  .navbar .dropdown-menu { font-size: 0.8em; }
  .btn { font-size: 0.8em; }
  .model-backround, .text-backround { background-color: rgba(52, 58, 64, 0.5); }
}
@media (min-width: 1200px) {
  body { font-size: 22px; }
  .navbar-custom .nav-pills .nav-link { font-size: 0.65em; }
  #main .section-cover { margin-top: 2em; }
  #main .section { margin: 8em 0; }
  .home-title { font-size: 3.6em; }
}
@media (min-width: 1800px) {
  body { font-size: 28px; }
  .home-title { font-size: 4em; }
  .home-subtitle { font-size: 1.4em; }
  #floating-arrow { width: 2em; margin: 4em 0; }
  .download-platform { max-width: 70vw; }
}
@media (min-width: 2400px) {
  body { font-size: 32px; }
  #main .section { margin: 10em 0; }
  .download-platform { max-width: 60vw; }
}
@media (prefers-reduced-motion: reduce) {
  .donate-btn::before, .donate-btn::after { animation: none; }
  .blog-card { transition: none; }
}

/* ---------- Download waiting pages (simple) ---------- */
.dls { max-width: 640px; margin: 3em auto 0; }
.dls-card { border: 0; border-radius: 1em; }
.dls-card .card-body { padding: 2em 1.5em 2.2em; }
.dls-step { font-size: .65em; letter-spacing: .12em; text-transform: uppercase; color: #6c757d; margin-bottom: .4em; }
.dls-title { font-size: 1.35em; margin-bottom: .1em; }
.dls-sub { font-size: .8em; color: #6c757d; margin-bottom: 0; }

.dls-loader { width: 120px; height: 120px; margin: 1.4em auto .6em; }
.dls-gif, .dls-done-icon { width: 120px; height: 120px; object-fit: contain; }
.dls-loader.is-done { animation: dlsPop .4s ease-out; }
@keyframes dlsPop { 50% { transform: scale(1.08); } }

.dls-timer { font-family: "Montserrat", sans-serif; font-weight: 900; line-height: 1; }
.dls-timer span { font-size: 2.6em; color: #212529; font-variant-numeric: tabular-nums; }
.dls-timer small { display: block; font-size: .7em; font-weight: 700; color: #6c757d; margin-top: .2em; }
.dls-status { font-size: .85em; color: #495057; margin: 1em 0 0; }
.dls-status.ok { color: #198754; font-weight: 700; }
.dls-dots i { font-style: normal; animation: dlsBlink 1.2s infinite; }
.dls-dots i:nth-child(2) { animation-delay: .2s; }
.dls-dots i:nth-child(3) { animation-delay: .4s; }
.dls-status.ok .dls-dots { display: none; }
@keyframes dlsBlink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
#dlwAction, .dls-action { margin-top: 1.2em; visibility: hidden; opacity: 0; transition: opacity .3s; }
#dlwAction.is-ready, .dls-action.is-ready { visibility: visible; opacity: 1; }
.dls-timer.is-done span { color: #198754; font-size: 1.8em; }
/* Keep the ad under the button clearly separated, to avoid accidental clicks */
.ad-slot-dl_button { margin-top: 3em; padding-top: 1em; }
.dls-btn { padding: .65em 3em; }
.dls-note { font-size: .65em; color: #6c757d; margin: .8em 0 0; word-break: break-all; }

.dls-info { margin-top: 2em; font-size: .85em; line-height: 1.7; }
.dls-info h2 { font-size: 1.15em; margin: 1.2em 0 .5em; }
.dls-info a { color: #8fd3ff; }
.dls-info code { font-size: .9em; }

/* Ads on waiting pages are labelled and kept apart from the download button */
.ad-labelled { margin: 2em auto; }
.ad-labelled.ad-loaded::before { content: "Advertisement"; display: block; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: .4em; }
@media (prefers-reduced-motion: reduce) {
  .dls-dots i, .dls-loader.is-done { animation: none; }
}

/* ---------- Banner ---------- */
.site-banner { position: relative; margin-top: 56px; padding: .7em 3em .7em 1.2em; text-align: center; font-size: .85em; z-index: 5; }
.site-banner-info { background: #418FDE; color: #fff; }
.site-banner-success { background: #198754; color: #fff; }
.site-banner-warning { background: #ffc107; color: #212529; }
.site-banner-danger { background: #dc3545; color: #fff; }
.site-banner-dark { background: #111820; color: #fff; }
.site-banner-text { font-weight: 700; }
.site-banner-btn { display: inline-block; margin-left: .8em; padding: .2em 1em; border-radius: 2em; background: rgba(255,255,255,.92); color: #212529; font-weight: 700; text-decoration: none; }
.site-banner-btn:hover { background: #fff; color: #000; }
.site-banner-img { display: block; max-width: 100%; height: auto; margin: 0 auto .4em; border-radius: .4em; }
.site-banner-close { position: absolute; top: .35em; right: .6em; background: none; border: 0; color: inherit; font-size: 1.5em; line-height: 1; opacity: .8; cursor: pointer; }
.site-banner-close:hover { opacity: 1; }
.site-banner + #main { padding-top: 2vw; }
@media (min-width: 1200px) { .site-banner { margin-top: 60px; } }

/* ---------- Guides ---------- */
.doc-wrap { max-width: 900px; }
.author-box { font-size: .75em; color: rgba(255,255,255,.75); margin: .5em 0 1.5em; }
.author-box p { margin: 0 0 .2em; }
.author-name { font-weight: 700; color: #fff; }
.author-name a { color: #8fd3ff; }
.author-ai { font-style: italic; color: rgba(255,255,255,.6); }
.doc-toc { background: rgba(39,52,63,0.85); border-radius: .8em; padding: 1em 1.3em; margin-bottom: 1.5em; font-size: .8em; }
.doc-toc ol { margin: .5em 0 0; padding-left: 1.3em; }
.doc-toc a { color: #8fd3ff; }
.post-content h2 { font-size: 1.35em; margin-top: 1.4em; scroll-margin-top: 80px; }
.post-content h3 { font-size: 1.1em; margin-top: 1.1em; }
.post-content kbd { background: #1b242c; color: #fff; border: 1px solid #3a4652; }
.doc-related { margin-top: 2.5em; font-size: .85em; }
.doc-related h2 { font-size: 1.2em; }
.doc-related a { color: #8fd3ff; }
.doc-grid .blog-card h2 { font-size: 1.05em; margin: 0 0 .5em; }

/* ---------- Home: intro + guides ---------- */
.home-intro { max-width: 1000px; margin: 0 auto; }
.home-intro h2 { font-size: 1.6em; }
.home-intro p, .home-intro li { font-size: .9em; line-height: 1.7; }
.home-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8em; margin: 1.5em 0; padding: 0; list-style: none; }
.home-facts li { background: rgba(39,52,63,.85); border-radius: .7em; padding: .9em 1em; font-size: .8em; }
.home-facts strong { display: block; font-size: 1.15em; }

/* ---------- Custom donate ---------- */
.donate-method { margin-bottom: .6em; }
.donate-note { font-size: .8em; color: rgba(255,255,255,.75); margin: .4em 0 0; white-space: normal; }
.donate-disclosure { font-size: .72em; color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.15); padding-top: .8em; margin: 1em 0 0; }

/* ---------- Breadcrumbs ---------- */
.dlx-crumbs { font-size: .75em; color: rgba(255,255,255,.65); margin-bottom: 1em; }
.dlx-crumbs a { color: rgba(255,255,255,.85); text-decoration: none; }
.dlx-crumbs a:hover { color: #fff; text-decoration: underline; }
.dlx-crumbs span { margin: 0 .35em; }

/* ---------- Tables in articles ---------- */
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .85em; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid rgba(255,255,255,.18); padding: .5em .7em; text-align: left; vertical-align: top; }
.post-content thead th { background: rgba(255,255,255,.08); }
.post-content tbody tr:nth-child(even) { background: rgba(255,255,255,.03); }

/* Ads stay hidden until the protection check has passed */
.ad-slot:not(.ad-loaded) { display: none; }

/* ---------- Contact & legal ---------- */
.contact-form { background: rgba(39,52,63,0.85); padding: 1.5em; border-radius: .8em; margin-top: 1.5em; font-size: .9em; }
.contact-form .form-control { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.contact-form .form-control:focus { background: rgba(255,255,255,.12); color: #fff; }
.contact-ok, .contact-err { padding: .8em 1.2em; border-radius: .6em; margin-top: 1em; font-size: .9em; }
.contact-ok { background: rgba(25,135,84,.25); border: 1px solid #198754; }
.contact-err { background: rgba(220,53,69,.2); border: 1px solid #dc3545; }
.footer-legal { font-size: .75em; margin-top: -.3em; }

/* ---------- Language switcher ---------- */
.lang-toggle { display: inline-flex; align-items: center; gap: .35em; }
.dropdown-lang { max-height: 70vh; overflow-y: auto; min-width: 15em; }
.dropdown-lang .dropdown-item.active { background: #e4e4e4; color: #000 !important; font-weight: 700; }
/* Hide Google Translate's top bar and tooltips, keep the page where it is */
body { top: 0 !important; position: static !important; }
iframe.skiptranslate, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, .VIpgJd-yAWNEb-L7lbkb { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
font[style] { background-color: transparent !important; box-shadow: none !important; }
