/* SebaDW.pl — responsywny layout (mobile-first) */

:root {
    --sebadw-blue: rgb(29, 110, 240);
    --sebadw-blue-hover: rgb(20, 90, 210);
    --sebadw-header-bg: rgb(35, 39, 42);
    --sebadw-footer-bg: #333;
    --bg-color: #ffffff;
    --text-color: #333333;
    --btn-bg: #f0f0f0;
    --btn-border: #cccccc;
    --box-bg: #ffffff;
    --box-border: rgba(0, 0, 0, 0.1);
    --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    --page-gutter: clamp(1rem, 4vw, 7.5rem);
    --header-height: clamp(4.5rem, 12vw, 6.25rem);
    --card-img-width: clamp(7.5rem, 28vw, 12.5rem);
    --card-img-height: clamp(5rem, 18vw, 7.5rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme,
body.sebadw-dark {
    --bg-color: #121212;
    --text-color: #ffffff;
    --btn-bg: #333333;
    --btn-border: #555555;
    --box-bg: #1e1e1e;
    --box-border: rgba(255, 255, 255, 0.1);
    --box-shadow: 0 0.5rem 1rem rgba(255, 255, 255, 0.1);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a,
a:visited,
a:hover,
a:active,
a:focus {
    color: inherit;
    text-decoration: none;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* ===== HEADER ===== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--header-height);
    padding: 0.5rem clamp(0.75rem, 3vw, 2rem);
    background-color: var(--sebadw-header-bg);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

.dark-theme .site-header {
    background-color: #1a1a1a;
}

.site-header__theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.75rem, 10vw, 4.5rem);
    height: clamp(2.5rem, 8vw, 3.25rem);
    flex-shrink: 0;
}

#themeToggle {
    font-size: clamp(1.75rem, 5vw, 3rem);
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
}

#themeToggle:hover,
#themeToggle:focus-visible {
    transform: scale(1.08);
}

#themeToggle.fa-toggle-on {
    color: #ffffff;
}

#menu {
    display: none !important;
}

.site-header__brand {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.site-header__brand span {
    display: block;
    color: var(--sebadw-blue);
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(1.75rem, 6vw, 4rem);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark-theme .site-header__brand span {
    color: rgb(100, 149, 237);
}

.site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-login-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem clamp(0.85rem, 2.5vw, 1.4rem);
    background: var(--sebadw-blue);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    font-weight: 600;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-login-header:hover,
.btn-login-header:focus-visible {
    background: var(--sebadw-blue-hover);
    transform: translateY(-1px);
    color: #fff !important;
}

@media (max-width: 380px) {
    .site-header {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .site-header__brand {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .site-header__theme {
        grid-row: 2;
    }

    .site-header__actions {
        grid-row: 2;
        justify-self: end;
    }
}

/* ===== AKTUALNOŚCI (KOMPUTER ŚWIAT) ===== */

.news-section {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2rem) var(--page-gutter) 0;
}

.news-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.news-section__title {
    margin: 0;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    font-weight: 700;
}

.news-section__source {
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
    color: var(--sebadw-blue);
    text-decoration: underline;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.sebadw-news-slider {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.sebadw-news-slider .carousel-item {
    height: auto;
    min-height: clamp(18rem, 50vw, 26rem);
}

.news-slide {
    position: relative;
    min-height: clamp(18rem, 50vw, 26rem);
    background: linear-gradient(135deg, #1a5de2 0%, #0d3171 100%);
    background-image: var(--news-slide-image);
    background-size: cover;
    background-position: center;
}

.news-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.78) 100%);
}

.news-slide__overlay {
    position: relative;
    z-index: 1;
    min-height: clamp(18rem, 50vw, 26rem);
    display: flex;
    align-items: flex-end;
    padding: clamp(1rem, 4vw, 2rem);
}

.news-slide__content {
    width: 100%;
    max-width: 48rem;
    color: #fff;
}

.news-slide__date {
    display: block;
    margin-bottom: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    opacity: 0.9;
}

.news-slide__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.1rem, 3.5vw, 1.85rem);
    line-height: 1.25;
}

.news-slide__title a {
    color: #fff;
    text-decoration: none;
}

.news-slide__title a:hover,
.news-slide__title a:focus-visible {
    text-decoration: underline;
}

.news-slide__excerpt {
    margin: 0 0 1rem;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    line-height: 1.55;
    opacity: 0.95;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-slide__btn {
    min-height: 44px;
}

.sebadw-news-slider .carousel-control-prev,
.sebadw-news-slider .carousel-control-next {
    width: 44px;
    height: 44px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.45);
    opacity: 0.9;
}

.sebadw-news-slider .carousel-control-prev {
    left: clamp(0.35rem, 2vw, 1rem);
}

.sebadw-news-slider .carousel-control-next {
    right: clamp(0.35rem, 2vw, 1rem);
}

.sebadw-news-slider .carousel-control-prev:hover,
.sebadw-news-slider .carousel-control-next:hover,
.sebadw-news-slider .carousel-control-prev:focus-visible,
.sebadw-news-slider .carousel-control-next:focus-visible {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.6);
}

.sebadw-news-slider .carousel-indicators {
    margin-bottom: 0.75rem;
}

.sebadw-news-slider .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dark-theme .news-section__source {
    color: rgb(130, 170, 255);
}

/* ===== SEKCJA KART (PROJEKTY) ===== */

.marketing-section {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: var(--page-gutter);
}

.marketing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: clamp(1.25rem, 4vw, 2.5rem);
    width: 100%;
}

.marketing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: 12px;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    box-shadow: var(--box-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.marketing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.marketing-card__image-link {
    display: block;
    margin-bottom: 1rem;
}

.marketing-card__image {
    width: var(--card-img-width);
    height: var(--card-img-height);
    object-fit: cover;
    border-radius: 15px;
    margin: 0 auto;
}

.dark-theme .marketing-card__image {
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.marketing-card h2 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin: 0 0 0.75rem;
    font-weight: bold;
}

.marketing-card .btn {
    min-height: 44px;
    min-width: 10rem;
    max-width: 100%;
}

.dark-theme .btn-secondary {
    background-color: #444;
    border-color: #555;
    color: #fff;
}

.dark-theme .btn-secondary:hover {
    background-color: #555;
    border-color: #666;
}

.dark-theme .btn-primary {
    background-color: var(--sebadw-blue);
    border-color: var(--sebadw-blue);
}

/* ===== STOPKA ===== */

.site-footer {
    flex-shrink: 0;
    width: 100%;
    padding: clamp(1rem, 3vw, 1.5rem) var(--page-gutter);
    text-align: center;
    background-color: var(--sebadw-footer-bg);
    color: #fff;
}

.site-footer__title {
    margin: 0;
    color: #fff;
    font-size: clamp(0.85rem, 2.8vw, 1.5rem);
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.site-footer__title img {
    width: clamp(1rem, 3vw, 2rem);
    height: clamp(1rem, 3vw, 2rem);
    display: inline-block;
}

.site-footer__links {
    margin: 0.75rem 0 0;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    line-height: 1.6;
}

.site-footer__links a {
    color: #ccc;
    text-decoration: none;
    padding: 0.25rem 0.35rem;
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

/* ===== POPUP KONTAKTOWY ===== */

.contact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 9998;
}

.contact-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contact-container {
    width: min(92vw, 35rem);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    background-color: rgba(255, 255, 255, 0.96);
    opacity: 0;
    visibility: hidden;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    z-index: 9999;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.dark-theme .contact-container {
    background-color: rgba(18, 18, 18, 0.97);
}

.contact-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.contact-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.contact-header {
    padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.5rem) 0.65rem;
    text-align: center;
}

.contact-header h2 {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2rem);
}

.contact-header p {
    margin: 0.85rem auto 0;
    max-width: 90%;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.6;
    opacity: 0.8;
}

.contact-form {
    padding: 0 clamp(1rem, 4vw, 1.5rem) clamp(1rem, 4vw, 1.5rem);
    display: flex;
    flex-direction: column;
}

.contact-box {
    width: 100%;
    margin-bottom: 0.9rem;
}

.contact-box .inp {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark-theme .contact-box .inp {
    background-color: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.12);
}

.contact-box .inp:focus {
    outline: none;
    border-color: var(--sebadw-blue);
    box-shadow: 0 0 0 6px rgba(29, 110, 240, 0.12);
}

.contact-box.captcha-box {
    text-align: center;
    overflow-x: auto;
}

.contact-box.captcha-box .g-recaptcha {
    display: inline-block;
    transform-origin: center top;
}

.contact-submit {
    width: 100%;
    min-height: 44px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--sebadw-blue);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.contact-submit:hover {
    background: var(--sebadw-blue-hover);
    transform: translateY(-1px);
}

.contact-container .exit {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.6rem;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.dark-theme .contact-container .exit {
    background: rgba(255, 255, 255, 0.1);
}

.contact-container textarea.inp {
    min-height: 7rem;
    max-height: 14rem;
    resize: vertical;
    font-family: inherit;
}

.recaptcha-error {
    color: #c0392b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

@media (max-width: 400px) {
    .contact-box.captcha-box .g-recaptcha {
        transform: scale(0.85);
    }
}

/* ===== LOADING SPINNER ===== */

.loading-spinner {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10002;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
}

.loading-spinner .spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--sebadw-blue);
    border-radius: 50%;
    animation: sebadw-spin 0.8s linear infinite;
}

@keyframes sebadw-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== UKRYTE / POMOCNICZE ===== */

.nav {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
