/* ---------------------------------------------------
   RESET / PODSTAWA
--------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #e9e9e9;   /* ściana galerii */
    color: #181818;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #222;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a:hover {
    color: #000;
}

/* ---------------------------------------------------
   GŁÓWNA POWIERZCHNIA STRONY
--------------------------------------------------- */
.wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px 40px;
}

/* ---------------------------------------------------
   NAGŁÓWEK / MENU
--------------------------------------------------- */
header {
    border-bottom: 1px solid #dadada;
    padding-bottom: 16px;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

/* Tytuł i sentencja – domyślnie też wyśrodkowane */
.site-title {
    font-family: "Playfair Display", serif;
    font-size: 30px;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0;
    color: #111;
    text-align: center;
}

.site-subtitle {
    margin: 3px 0 0;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #777;
    text-align: center;
}

/* MENU */
nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center; /* menu wyśrodkowane */
}

nav a {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    color: #555;
}

nav a.active {
    border-bottom-color: #111;
    color: #111;
}

nav a:hover {
    border-bottom-color: #888;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 160px;        /* BYŁO 260px → teraz krótsze o 100px */
    max-width: 100%;
    padding: 10px;
    margin: 8px 0 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* ---------------------------------------------------
   TYPOGRAFIA / BLOKI TEKSTU
--------------------------------------------------- */
main {
    font-size: 15px;
    line-height: 1.7;
}

/* nagłówki */
h1, h2, h3 {
    font-family: "Playfair Display", serif;
    font-weight: 500;
    color: #111;
    margin-top: 0;
}

h1 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 14px;
}

h2 {
    font-size: 22px;
    margin-top: 26px;
    margin-bottom: 10px;
}

h3 {
    font-size: 18px;
    margin-top: 18px;
    margin-bottom: 6px;
}

/* Blok nagłówkowy (np. tytuł wystawy) */
.detail-header {
    max-width: 780px;
    margin: 0 auto 18px;
}

.detail-header p {
    margin: 0 0 4px;
    text-align: center;
}

/* tekstowe akapity na środku, wyjustowane */
.text-block,
.intro p,
main p {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    text-align: justify;
    margin-bottom: 16px;
    color: #222;
}

/* ---------------------------------------------------
   ZAJĘCIA – KARTY (zajecia.php)
--------------------------------------------------- */

.body-classes {
    background: #e9e9e9;
}

.intro {
    margin-bottom: 34px;
}

.classes-grid {
    max-width: 1040px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 26px;
}

.class-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    padding: 18px 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.class-card-image-wrap {
    margin: -18px -18px 14px -18px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.class-card-image {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.class-card-title {
    font-family: "Playfair Display", serif;
    font-size: 20px;
    margin: 4px 0 10px;
    text-align: center;
}

.class-card-text {
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

/* ---------------------------------------------------
   WYSTAWY – LISTA (wystawy.php)
   używa tej samej siatki co zajęcia
--------------------------------------------------- */

.vote-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 999px;
    border: 1px solid #222;
    background: #fff;
    color: #222;
}

.vote-btn:hover {
    background: #222;
    color: #fff;
}

/* ---------------------------------------------------
   WYSTAWA – POJEDYNCZA (wystawa.php)
--------------------------------------------------- */

.works-list {
    display: flex;
    flex-direction: column;
    gap: 56px;
    margin-top: 40px;
}

.work-card {
    max-width: 840px;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* MINIATURA PRACY – kontrolujemy szerokość na stronie */
.work-thumb {
    display: block;
    width: 100%;
    max-width: 720px;    /* docelowa szerokość zdjęcia na stronie */
    height: auto;
    margin: 0 auto 18px;
    border-radius: 6px;
}

.work-title {
    font-family: "Playfair Display", serif;
    font-size: 24px;
    text-align: center;
    margin: 10px 0 6px;
}

.work-meta {
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 14px;
}

.work-desc {
    font-size: 15px;
    line-height: 1.65;
    text-align: justify;
    margin-bottom: 18px;
}

.vote-area {
    text-align: center;
    margin-top: 10px;
}

.votes-info {
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}

/* ---------------------------------------------------
   KARTY / LISTY OGÓLNE (np. na index.php)
--------------------------------------------------- */

.section-heading {
    max-width: 1040px;
    margin: 0 auto 18px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #777;
}

.card-list {
    max-width: 1040px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    background:#ffffff;
    border-radius:8px;
    border:1px solid #dcdcdc;
    padding:16px 16px 18px;
    box-shadow:0 1px 4px rgba(0,0,0,0.04);
}

.card img {
    width:100%;
    height:180px;
    object-fit:cover;
    border-radius:4px;
    margin-bottom:10px;
}

.card-title {
    font-family:"Playfair Display", serif;
    font-size:17px;
    margin:0 0 4px;
}

.card-meta {
    font-size:13px;
    color:#777;
    margin-bottom:6px;
}

.card-text {
    font-size:14px;
    text-align:justify;
}

/* ---------------------------------------------------
   STOPKA
--------------------------------------------------- */
footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid #dadada;
    font-size: 12px;
    text-align: center;
    color: #777;
}

/* ---------------------------------------------------
   RESPONSYWNOŚĆ
--------------------------------------------------- */

/* tablety / mniejsze ekrany */
@media (max-width: 820px) {
    .wrapper {
        padding: 24px 16px 32px;
    }

    .header-top {
        flex-direction: column;
        align-items: center;   /* wyrównanie środka na telefonie */
        text-align: center;
        gap: 10px;
    }

    nav ul {
        justify-content: center;  /* menu na środku */
    }

    .site-title {
        font-size: 26px;
        text-align: center;
    }

    .site-subtitle {
        text-align: center;
    }

    .works-list {
        gap: 40px;
    }

    .work-card {
        padding: 18px;
    }

    .work-thumb {
        max-width: 100%;
    }
}

/* bardzo małe telefony */
@media (max-width: 540px) {
    nav ul {
        gap: 12px;
    }

    h1 {
        font-size: 24px;
    }

    .class-card-title {
        font-size: 18px;
    }

    .work-title {
        font-size: 21px;
    }
}

/* ---------------------------------------------------
   FADE-IN CAŁEJ STRONY
--------------------------------------------------- */

body.page-fade {
    opacity: 0;
    transition: opacity 2s ease;
}

body.page-fade.page-visible {
    opacity: 1;
}