:root {
  --red: #b40000;
  --red-dark: #8a0000;
  --red-light: #e23b3b;
  --ink: #121212;
  --ink-soft: #2a2a2a;
  --paper: #fff;
  --bg: #f6f5f3;
  --line: #e3e0dc;
  --muted: #6b6b6b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(17,17,17,.06);
  --shadow-md: 0 10px 26px rgba(17,17,17,.10);
  --shadow-lg: 0 18px 44px rgba(17,17,17,.16);
  --ease: cubic-bezier(.2,.7,.2,1);
  --header-h: 0px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 108px; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1160px; margin: auto; }

a { color: inherit; }

img { max-width: 100%; }

/* Skip link */
.skipLink {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top .18s var(--ease);
  text-decoration: none;
  font-weight: bold;
}
.skipLink:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--red-light);
  outline-offset: 2px;
}

/* Topbar */
.topbar {
  background: var(--ink);
  color: #cfcfcf;
  font-size: 12.5px;
  letter-spacing: .2px;
}
.topbar .wrap {
  display: flex;
  gap: 24px;
  padding: 8px 12px;
  align-items: center;
}
.topbar a {
  color: #cfcfcf;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar a:hover { color: #fff; }
.topbar .topbarSpacer { flex: 1; }
.topbar .topbarSocial { display: flex; gap: 12px; }
.topbar .topbarSocial a {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}
.topbar .topbarSocial a:hover { background: var(--red); color: #fff; }

/* Header */
.header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.head {
  padding: 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logoBox { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  display: block;
  border: 5px solid var(--ink);
  flex: none;
}
.header h1 {
  margin: 0;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: .2px;
}
.header p {
  margin: 4px 0 0;
  color: var(--red);
  font-weight: bold;
  font-size: 13.5px;
}
.headerCta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff !important;
  text-decoration: none;
  font-weight: bold;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: background .16s var(--ease), transform .16s var(--ease);
  white-space: nowrap;
  flex: none;
}
.headerCta:hover { background: var(--red-dark); transform: translateY(-1px); }
.headerCta .ctaShort { display: none; }

/* Nav */
.mainnav {
  background: var(--red);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 200;
  transition: box-shadow .2s var(--ease);
}
.mainnav.isScrolled { box-shadow: var(--shadow-md); }
.navWrap { display: flex; align-items: center; }
.navMenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.mainnav a, .mainnav button.dropbtn {
  color: #fff;
  text-decoration: none;
  padding: 14px 17px;
  display: block;
  font-weight: bold;
  font-size: 14px;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.mainnav > .wrap > .navMenu > a:hover,
.mainnav .active,
.mainnav button.dropbtn:hover {
  background: var(--ink);
}
.dropdown { position: relative; }
.dropdown > .dropbtn { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.dropdown > .dropbtn::after {
  content: "\25BE";
  font-size: 11px;
  opacity: .9;
  transition: transform .16s var(--ease);
}
.dropdown.open > .dropbtn::after { transform: rotate(180deg); }
.dropdown.open > .dropbtn, .dropdown > .dropbtn.active { background: var(--ink); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  z-index: 20;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s var(--ease), transform .15s var(--ease), visibility .15s;
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-menu a {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  font-weight: 600;
}
.dropdown-menu a:hover { background: var(--red); color: #fff; }
.dropdown-menu a:last-child { border-bottom: 0; }

.navToggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 6px 12px 6px 0;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: none;
}
.navToggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.navToggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navToggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navToggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.srOnly {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 30px;
  padding: 32px 12px 44px;
}
.content h2 {
  font-size: 27px;
  color: var(--ink);
  border-bottom: 3px solid var(--red);
  padding-bottom: 12px;
  margin-top: 0;
  overflow-wrap: break-word;
}
.lede { color: var(--muted); font-size: 15.5px; line-height: 1.65; margin-top: -6px; }

/* Hero / slider */
.slider {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 20px 0 26px;
  background: var(--ink);
}
.slide {
  position: absolute;
  inset: 0;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  font-size: 24px;
  font-weight: bold;
  background-size: cover;
  background-position: center;
  background-color: #111;
  opacity: 0;
  transition: opacity .7s var(--ease);
  z-index: 0;
}
.slide.isActive { opacity: 1; z-index: 1; }
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.62) 100%);
  z-index: 0;
}
.slide > span { position: relative; z-index: 1; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.slide.photo1 { background-image: url('https://test.ckg.pt/img/banner/estagio_shishikan.jpeg?1780668856532'); }
.slide.photo2 { background-image: url('https://test.ckg.pt/img/fotos/IMG_0512.JPG'); }
.slide.photo3 { background-image: url('https://test.ckg.pt/img/banner/WhatsApp Image 2026-06-02 at 16.50.16.jpeg'); }
.sliderDots {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.sliderDots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255,255,255,.25);
  padding: 0;
  cursor: pointer;
}
.sliderDots button.isActive { background: #fff; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.inview { opacity: 1; transform: translateY(0); }

/* Boxes */
.box {
  border: 1px solid var(--line);
  background: #fff;
  margin: 18px 0;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.box h3 {
  margin-top: 0;
  color: var(--red);
  font-size: 20px;
}
.box p { line-height: 1.65; }
.news { padding-left: 18px; line-height: 1.9; }
.event {
  display: flex;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.event:first-of-type { border-top: 0; }
.date {
  background: var(--red);
  color: white;
  font-weight: bold;
  padding: 10px 12px;
  min-width: 60px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.3;
}

/* Sidebar */
.sidebar { padding-top: 0; }
.sidebox {
  border: 1px solid var(--line);
  margin-bottom: 20px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sidebox h3 {
  background: var(--ink);
  color: white;
  margin: 0;
  padding: 13px 16px;
  font-size: 15px;
  letter-spacing: .2px;
}
.sidebox a {
  display: block;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .12s, color .12s, padding-left .12s;
}
.sidebox a:last-child { border-bottom: 0; }
.sidebox a:hover { background: var(--red); color: white; padding-left: 20px; }
.sidebox p { padding: 0 16px 14px; line-height: 1.6; }
.sidebox p:first-of-type { padding-top: 4px; }

/* Partners */
.partners { padding: 8px 12px 40px; }
.partners h3 { color: var(--red); font-size: 20px; }
.partnerRow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.partnerCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
  min-height: 112px;
  border-radius: var(--radius);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.partnerLogo { max-width: 100%; max-height: 72px; object-fit: contain; display: block; }
.partnerLabel { margin-top: 10px; font-size: 12.5px; font-weight: bold; color: var(--ink); text-align: center; line-height: 1.3; }
.partnerCard:hover { box-shadow: var(--shadow-md); border-color: var(--red); transform: translateY(-3px); }

/* Product / literature cards */
.productsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 18px 0;
}
.productCard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.productCard:hover, .literatureCard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.productCard img, .literatureCard img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}
.productInfo h3 { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.productInfo p { margin: 0 0 10px; line-height: 1.55; color: #444; }
.price { display: inline-block; font-weight: bold; color: var(--red); font-size: 18px; margin-bottom: 8px; }
.ghostLink, .literatureCard a {
  color: var(--red);
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ghostLink:hover, .literatureCard a:hover { text-decoration: underline; }
.literatureList { display: grid; gap: 16px; }
.literatureCard {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.literatureCard h4 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.literatureCard p { margin: 0 0 8px; color: #555; }

/* Link cards */
.linkList { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.linkItem { margin: 0; }
.linkCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.linkCard:hover { box-shadow: var(--shadow-md); border-color: var(--red); transform: translateY(-2px); }
.linkThumb {
  width: 34px; height: 34px; max-width: 34px; max-height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: block;
}
.linkText { font-weight: bold; line-height: 1.4; }
.linkText:hover { text-decoration: underline; }

/* Back to top */
.backToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s, background .16s;
  z-index: 300;
}
.backToTop.isVisible { opacity: 1; visibility: visible; transform: translateY(0); }
.backToTop:hover { background: var(--red); }

/* Footer */
footer.siteFooter {
  background: var(--ink);
  color: #cfcfcf;
  padding: 44px 12px 0;
  font-size: 13.5px;
  margin-top: 20px;
}
.footerGrid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footerCol h4 {
  color: #fff;
  font-size: 14px;
  letter-spacing: .3px;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.footerCol p { line-height: 1.7; margin: 0 0 10px; color: #b8b8b8; }
.footerLinks { display: flex; flex-direction: column; gap: 9px; }
.footerLinks a { color: #cfcfcf; text-decoration: none; }
.footerLinks a:hover { color: #fff; text-decoration: underline; }
.footerBottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0;
  color: #9a9a9a;
  font-size: 12.5px;
}
.footerBottom a { color: #9a9a9a; text-decoration: none; }
.footerBottom a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 960px) {
  .footerGrid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { padding-top: 0; }
  .partnerRow { grid-template-columns: repeat(2, 1fr); }
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 12px; }
  .topbar .topbarSpacer { display: none; }
  .header h1 { font-size: 19px; }
  .logo { width: 66px; height: 66px; border-width: 4px; }
  .headerCta .ctaLong { display: none; }
  .headerCta .ctaShort { display: inline; }
  .linkCard { align-items: flex-start; }
  .literatureCard { grid-template-columns: 90px 1fr; }

  .navToggle { display: flex; }
  .navMenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--red);
    border-top: 2px solid var(--ink);
    max-height: 0;
    overflow: hidden;
    transition: max-height .22s var(--ease);
  }
  .navMenu.isOpen { max-height: 80vh; overflow-y: auto; }
  .mainnav a, .mainnav button.dropbtn { padding: 14px 20px; width: 100%; text-align: left; }
  .dropdown > .dropbtn { width: 100%; justify-content: space-between; }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(0,0,0,.12);
    min-width: 0;
    transform: none;
    max-height: 0;
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: none;
    overflow: hidden;
    transition: max-height .2s var(--ease);
  }
  .dropdown.open .dropdown-menu { max-height: 600px; pointer-events: auto; }
  .dropdown-menu a { color: #fff; background: none; padding-left: 30px; }
  .dropdown-menu a:hover { background: rgba(0,0,0,.25); }
  .footerGrid { grid-template-columns: 1fr; gap: 26px; }
}
