/* ==============================================================
   KRYSTALSPACE BLOG – style.css
   ============================================================== */

/* ---- KS Design Tokens ---- */
:root {
  --ks-font-main: "DM Sans", "Rubik", sans-serif;
  --ks-font-heading: "Archivo", sans-serif;
  --ks-navy: #1e293b;
  --ks-dark: #0f172a;
  --ks-indigo: #6366f1;
  --ks-accent: #ec8088;
  --ks-green: #22c55e;
  --ks-white: #ffffff;
  --ks-bg: #fbfbfd;
  --ks-bg-light: #f8fafc;
  --ks-border: #e2e8f0;
  --ks-slate: #64748b;
  --ks-slate-light: #94a3b8;
  --ks-glass: rgba(255,255,255,0.75);
  --ks-gradient: linear-gradient(135deg, #ec8088, #6366f1);
  --ks-shadow: 0 15px 35px rgba(59,130,246,.08);
  --ks-shadow-lg: 0 20px 50px rgba(15,23,42,.12);
  --ks-transition: all .3s cubic-bezier(.165,.84,.44,1);
  --ks-z-header: 1000;
  /* Blog dark theme tokens */
  --bg: #0f172a;
  --surface: #16213d;
  --surface-soft: #1e293b;
  --text: #edf2ff;
  --muted: #a8b3cf;
  --primary: #ec8088;
  --indigo: #6366f1;
  --border: #334266;
  --shadow: rgba(8,15,33,0.35);
  --content-top-gap: 2rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ks-font-main);
  color: var(--text);
  background: radial-gradient(circle at top right,#1f2a4f 0%,var(--bg) 42%), var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
main.container { padding-top: var(--content-top-gap); }
.container { width: min(1100px, 92vw); margin: 0 auto; }

/* ==============================================================
   HEADER – krystalspace.pl
   ============================================================== */
.site-header {
  position: sticky; top: 0; z-index: var(--ks-z-header);
  background: #ec8088; border-bottom: 1px solid rgba(0,0,0,.05);
  transition: var(--ks-transition);
}
.site-header-inner {
  display: flex; align-items: center; height: 80px;
  padding: 0 24px; max-width: 1440px; margin: 0 auto;
}
.site-logo { display: flex; align-items: center; flex-shrink: 0; z-index: 1001; transition: var(--ks-transition); }
.custom-logo-link { display: block; line-height: 0; transition: var(--ks-transition); }
.custom-logo { height: auto; width: auto; max-height: 50px; object-fit: contain; transition: all .5s cubic-bezier(.2,1,.3,1); }
.custom-logo-link:hover .custom-logo { transform: scale(1.05); filter: brightness(1.05); }

/* Hamburger */
.menu-toggle {
  display: block; background: transparent; border: none; padding: 10px;
  cursor: pointer; z-index: 2100; margin-right: 15px; box-shadow: none;
}
@media (min-width: 1100px) { .menu-toggle { display: none; } }
.hamburger-box { width: 24px; height: 18px; display: inline-block; position: relative; }
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after { width: 100%; height: 2px; background-color: var(--ks-dark); position: absolute; transition: var(--ks-transition); }
.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { content: ""; top: -8px; left: 0; }
.hamburger-inner::after  { content: ""; bottom: -8px; left: 0; }
body.menu-open .hamburger-inner { background-color: transparent; }
body.menu-open .hamburger-inner::before { transform: translateY(8px) rotate(45deg); }
body.menu-open .hamburger-inner::after  { transform: translateY(-8px) rotate(-45deg); }

/* Desktop nav */
.main-navigation-desktop { display: none; margin-left: 60px; }
.main-menu-list, .sub-menu, .main-menu-list li { list-style: none !important; }

@media (min-width: 1100px) {
  .main-navigation-desktop { display: block; }
  .main-menu-list { display: flex; gap: 35px; margin: 0; padding: 0; }
  .main-menu-list a {
    text-decoration: none; color: var(--ks-dark); font-family: var(--ks-font-main);
    font-weight: 500; font-size: .95rem; transition: var(--ks-transition); position: relative;
  }
  .main-menu-list a:hover { color: var(--ks-indigo); }
  .main-menu-list .menu-item-has-children { position: relative; }
  .main-menu-list .menu-item-has-children > a { display: inline-flex !important; align-items: center !important; gap: 8px; white-space: nowrap; }
  .main-menu-list .menu-item-has-children > a::after {
    content: ''; width: 5px; height: 5px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); transition: transform .3s ease; opacity: .7; margin-top: -3px; display: inline-block;
  }
  .main-menu-list .menu-item-has-children:hover > a::after { transform: rotate(-135deg); margin-top: 3px; color: var(--ks-indigo); }
  .main-menu-list .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 220px; background: #ffffff;
    margin: 0; padding: 15px 0; border-radius: 10px; box-shadow: var(--ks-shadow-lg);
    border: 1px solid rgba(0,0,0,.05);
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: var(--ks-transition); z-index: 1200;
  }
  .main-menu-list .menu-item-has-children:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-menu-list .sub-menu li { width: 100%; margin: 0; padding: 0; }
  .main-menu-list .sub-menu a { display: block !important; padding: 10px 20px !important; font-size: 14px !important; color: var(--ks-dark) !important; font-weight: 500; }
  .main-menu-list .sub-menu a:hover { background-color: var(--ks-bg-light); color: var(--ks-indigo) !important; padding-left: 25px !important; }
  .main-menu-list .sub-menu a::after { display: none !important; }
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.action-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: var(--ks-transition); color: var(--ks-dark);
  text-decoration: none; position: relative; background: transparent; border: none; cursor: pointer; box-shadow: none;
}
.action-btn:hover { background: var(--ks-bg-light); color: var(--ks-indigo); transform: translateY(-2px); }
.action-btn i { font-size: 1.15rem; }

@media (max-width: 768px) {
  .site-header-inner { height: 68px; display: grid; grid-template-columns: auto 1fr auto; }
  .menu-toggle { margin-right: 0; }
  .site-logo { justify-content: center; }
  .header-actions { gap: 4px; }
}

/* ==============================================================
   MOBILE DRAWER
   ============================================================== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: all .4s ease; z-index: 2400;
}
body.menu-open .drawer-overlay { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

.mobile-drawer {
  position: fixed; top: 0; left: -100%; width: 100%; max-width: 320px; height: 100vh;
  background: var(--ks-gradient); z-index: 2500; transition: var(--ks-transition);
  box-shadow: 20px 0 80px rgba(15,23,42,.15); display: flex; flex-direction: column;
}
.mobile-drawer.is-active { left: 0; }
.drawer-header { padding: 20px 25px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; }
.close-drawer {
  background: #ffffff; border: none; width: 38px; height: 38px; border-radius: 50%;
  color: var(--ks-accent); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: var(--ks-transition);
}
.close-drawer:hover { transform: rotate(90deg); color: var(--ks-indigo); }
.drawer-content { flex-grow: 1; padding: 30px 25px; overflow-y: auto; }

.mobile-menu-list { list-style: none !important; padding: 0; margin: 0; }
.mobile-menu-list li { margin-bottom: 20px; list-style: none !important; position: relative; transform: translateX(-20px); opacity: 0; transition: all .4s ease; }
.mobile-drawer.is-active li { transform: translateX(0); opacity: 1; }
.mobile-menu-list a { font-family: var(--ks-font-heading); font-size: 1.2rem; font-weight: 700; color: #ffffff; text-decoration: none; display: block; transition: transform .25s ease, opacity .25s ease; }
.mobile-menu-list a:hover { opacity: .85; transform: translateX(4px); }
.mobile-menu-list .menu-item-has-children > a { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu-list .menu-item-has-children > a::after { content: '+'; font-size: 1.4rem; font-weight: 400; transition: transform .3s ease; }
.mobile-menu-list .sub-menu { list-style: none !important; padding: 10px 0 0 20px; margin: 0; display: none; }
.mobile-menu-list .menu-item-has-children.is-open > .sub-menu { display: block; }
.mobile-menu-list .menu-item-has-children.is-open > a::after { content: '-'; transform: rotate(180deg); }
.mobile-menu-list .sub-menu li { margin-bottom: 12px; }
.mobile-menu-list .sub-menu a { font-size: 1rem; font-weight: 500; opacity: .9; }

.drawer-footer { padding: 30px 25px; background: rgba(0,0,0,.05); border-top: 1px solid rgba(255,255,255,.1); }
.drawer-socials { display: flex; gap: 12px; }
.drawer-socials a {
  width: 38px; height: 38px; background: #ffffff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ks-accent); text-decoration: none; transition: transform .3s ease;
}
.drawer-socials a:hover { transform: translateY(-3px); }

/* ==============================================================
   MOBILE BOTTOM NAV
   ============================================================== */
.mobile-bottom-nav {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
  background: var(--ks-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 1000; border-top: 1px solid rgba(0,0,0,.05); box-shadow: 0 -5px 25px rgba(0,0,0,.05);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1100px) { .mobile-bottom-nav { display: none; } }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--ks-slate); flex: 1; height: 100%; transition: var(--ks-transition); }
.mobile-nav-item i { font-size: 1.2rem; margin-bottom: 4px; transition: var(--ks-transition); }
.mobile-nav-item span { font-family: var(--ks-font-main); font-size: 11px; color: var(--ks-navy); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.mobile-nav-item:hover { color: var(--ks-indigo); }
.mobile-nav-item:active i { transform: translateY(-3px); }

/* ==============================================================
   FOOTER – krystalspace.pl
   ============================================================== */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  margin-top: 3rem;
  border-top: 1px solid rgba(236, 128, 136, 0.5);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.28);
}
.site-footer a { color: inherit; text-decoration: none; transition: color .25s ease; }
.site-footer a:hover { color: #38bdf8; }
.footer-widgets { padding: 70px 0 50px; border-bottom: 1px solid rgba(255,255,255,.06); }
.footer-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 40px; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.footer-column { display: flex; flex-direction: column; gap: 12px; list-style: none !important; }
.footer-column h2, .footer-column .widgettitle { font-size: 16px; font-weight: 800; color: #ffffff; margin: 0 0 15px; }
.footer-column p, .footer-column li, .footer-column .textwidget { font-size: 14px; color: #94a3b8; }
.footer-column ul { list-style: none !important; padding: 0; margin: 0; }
.footer-column ul li { margin-bottom: 8px; }
.footer-bottom { padding: 22px 0; background: rgba(2,6,23,.85); backdrop-filter: blur(8px); }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 25px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.copyright p { margin: 0; font-size: 13px; color: #94a3b8; }
.copyright strong { color: #ffffff; }
.footer-payments { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.payment-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; }
.payment-icons img { height: auto; max-width: 100%; width: 250px; object-fit: contain; }

@media (max-width: 768px) {
  .footer-widgets { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 35px; padding: 0 25px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; padding-bottom: 80px; }
  .footer-payments { justify-content: center; }
  .payment-icons img { width: 200px; }
}

/* ==============================================================
   BLOG – content styles (dark theme)
   ============================================================== */
.filters { margin: 0 0 1.4rem; }
.posts-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); }

.post-card, .post-full, .error-page {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border); border-radius: 1rem; overflow: hidden;
  box-shadow: 0 16px 32px var(--shadow);
}
.post-card { position: relative; transition: transform .18s ease, border-color .18s ease; }
.post-card:hover { transform: translateY(-3px); border-color: rgba(236,128,136,.55); }
.post-card-content, .post-full, .error-page { padding: 1rem; }

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-decoration: none;
}

.post-card .tags,
.post-card .tags a {
  position: relative;
  z-index: 3;
}

.post-cover, .post-cover-large { width: 100%; display: block; object-fit: cover; }
.post-cover { height: 180px; }
.post-cover-large { max-height: 420px; }
.post-date, .post-meta { color: var(--muted); font-size: .9rem; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--primary); }
.post-content a { color: #b8c2ff; }
.post-full h1 { margin-top: .6rem; margin-bottom: .4rem; }
.post-content { margin-top: 1rem; }
.related-posts { margin-top: 1.5rem; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag { padding: .2rem .55rem; border-radius: 999px; border: 1px solid rgba(236,128,136,.45); background: rgba(236,128,136,.14); color: #ffd8dc; text-decoration: none; font-size: .85rem; }
.tag.active, .page-link.active { background: linear-gradient(135deg,var(--primary),var(--indigo)); color: #fff; }

.pagination { display: flex; gap: .4rem; justify-content: center; margin: 1.5rem 0 2rem; }
.page-link { text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 2rem; text-align: center; border-radius: .5rem; padding: .3rem .6rem; }

.button {
  border: 0; border-radius: .6rem;
  background: linear-gradient(135deg,var(--primary),var(--indigo));
  color: #fff; padding: .65rem 1rem; text-decoration: none;
  display: inline-block; cursor: pointer;
  box-shadow: 0 10px 24px rgba(99,102,241,.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(236,128,136,.4); }
