:root { --primary-color: #2c3e50; --secondary-color: #3498db; --accent-color: #e74c3c; --dark-color: #2c3e50; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { font-family: "Poppins", sans-serif; color: #333; line-height: 1.6; }

.navbar { background-color: var(--primary-color); padding: 12px 0; }
.navbar-nav { gap: 6px; align-items: center; }
.navbar-dark .navbar-nav .nav-link.nav-box, .nav-cv-box { display: inline-block; padding: 4px 12px; border: 2px solid rgba(255,255,255,.85); border-radius: 4px; color: #fff; font-size: .9rem; font-weight: 600; line-height: 1.4; text-decoration: none; transition: all .25s ease; }
.navbar-dark .navbar-nav .nav-link.nav-box:hover, .navbar-dark .navbar-nav .nav-link.nav-box:focus-visible, .nav-cv-box:hover, .nav-cv-box:focus-visible { background-color: #fff; color: var(--primary-color); transform: translateY(-2px); }
.navbar-dark .navbar-nav .nav-link.nav-box.active { background-color: var(--secondary-color); border-color: var(--secondary-color); color: #fff; }
@media (max-width: 991.98px) {
  .navbar-nav { padding-top: 12px; align-items: stretch; }
  .navbar-dark .navbar-nav .nav-link.nav-box { display: block; text-align: center; margin-bottom: 4px; }
}

.hero-section { position: relative; overflow: hidden; color: #fff; padding: 60px 0; text-align: center; }
.hero-small { padding: 48px 0; }
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; }
.hero-slide.active { opacity: 1; }
.hero-overlay { position: absolute; inset: 0; z-index: 1; opacity: .82; background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); }
.hero-content { position: relative; z-index: 2; }

.section-title { position: relative; margin-bottom: 35px; padding-bottom: 16px; font-weight: 700; font-size: 1.85rem; letter-spacing: .3px; color: var(--primary-color); }
.section-title::after { content: ""; position: absolute; bottom: 0; left: 0; width: 60px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--secondary-color), var(--accent-color)); }
.card { border: none; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); transition: transform .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }

footer { background-color: var(--dark-color); color: #fff; padding: 30px 0; }
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 46px; height: 46px; background-color: var(--secondary-color); color: #fff; border-radius: 50%; text-align: center; line-height: 46px; font-size: 20px; text-decoration: none; display: none; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.back-to-top:hover { color: #fff; background-color: var(--primary-color); }

/* Gallery */
#search { max-width: 260px; }
.chip { cursor: pointer; padding: 5px 16px; border: 2px solid var(--primary-color); border-radius: 4px; background: #fff; color: var(--primary-color); font-size: .9rem; font-weight: 600; transition: all .25s ease; }
.chip:hover { background: var(--primary-color); color: #fff; }
.chip[aria-pressed="true"] { background: var(--secondary-color); border-color: var(--secondary-color); color: #fff; }

.gcard { width: 100%; padding: 0; text-align: left; overflow: hidden; cursor: pointer; background: #fff; font: inherit; color: inherit; }
.frame { display: block; aspect-ratio: 4 / 3; background: #e9ecef; position: relative; overflow: hidden; }
.frame.doc { background: #fff; border-bottom: 1px solid #eee; }
.frame img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .4s; }
.frame.doc img { object-fit: contain; }
.frame img.in { opacity: 1; }
.gcard:hover .frame img { transform: scale(1.03); }
.frame.missing::after { content: "Image not found"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; color: #6c757d; }
.meta { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 14px 16px; }
.cap-title { font-size: .95rem; font-weight: 600; line-height: 1.35; color: var(--primary-color); }
.cap-desc { font-size: .82rem; color: #6c757d; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cap-date { margin-top: auto; padding-top: 10px; border-top: 1px solid #eee; font-size: .8rem; font-weight: 500; color: var(--secondary-color); }
.cap-desc + .cap-date { margin-top: 8px; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: #e8f3fc; color: var(--secondary-color); margin-bottom: 6px; }
:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 3px; }

/* Viewer */
dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; }
dialog::backdrop { background: rgba(20,30,40,.94); }
dialog[open] { display: flex; align-items: center; justify-content: center; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
dialog figure { max-width: min(92vw, 1100px); text-align: center; color: #fff; margin: 0; }
dialog img { max-width: 100%; max-height: 74vh; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
dialog figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
dialog figcaption span { color: #c9d3dc; font-size: .95rem; }
dialog figcaption small { color: #9aa8b4; margin-top: 4px; }
.vbtn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.vbtn:hover { background: var(--secondary-color); }
.vbtn[hidden] { display: none; }
.close { top: 16px; right: 16px; }
.prev { left: 16px; top: 50%; translate: 0 -50%; }
.next { right: 16px; top: 50%; translate: 0 -50%; }

/* Floating side navigation */
.side-nav { position: fixed; top: 50%; right: 12px; transform: translateY(-50%); z-index: 1000; display: flex; flex-direction: column; padding: 6px; background: #fff; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.side-nav a { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--secondary-color); font-size: 1.05rem; border-radius: 4px; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.side-nav a:hover, .side-nav a:focus-visible, .side-nav a.active { background-color: var(--secondary-color); color: #fff; }
.side-nav a::after { content: attr(data-label); position: absolute; right: 52px; top: 50%; transform: translateY(-50%); padding: 4px 10px; background: var(--primary-color); color: #fff; font-size: .78rem; white-space: nowrap; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.side-nav a:hover::after, .side-nav a:focus-visible::after { opacity: 1; }

@media (max-width: 575.98px) {
  .side-nav { right: 6px; padding: 4px; }
  .side-nav a { width: 34px; height: 34px; font-size: .95rem; }
  .side-nav a::after { display: none; }
  .back-to-top { right: 56px; }
}
@media (max-width: 560px) { #search { max-width: 100%; } .prev, .next { top: auto; bottom: 16px; translate: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
