
/* =======================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛОК
   ======================= */

@media (max-width: 1250px) {
    :root {
        --font-size-h1: 1.7rem;
        --font-size-h2: 1.3rem;
        --font-size-body: 1.1rem;
        --image-width: 40vw;
    }

    .header-flex {
        flex-direction: column;
        text-align: center;
    }

    .header-content {
        align-items: center;
        text-align: center;
    }

    .header-links {
        margin-left: 0;
        margin-bottom: 10px;
    }

    nav ul.tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    section {
        width: 95%;
        padding: 20px;
    }

    section#articles img,
    section#referat img,
    section#hobby img,
    section#video video,
    section#referat .math-table {
        width: 90% !important;
    }

    section#hobby .image-text {
        flex-direction: column;
    }
}


@media (max-width: 600px) {
    :root {
        --font-size-h1: 1.5rem;
        --font-size-h2: 1.2rem;
        --font-size-body: 1rem;
        --font-size-header: 0.9rem;
        --image-width: 60vw;
        --text-indent: 1rem;
    }

    body {
        font-size: 14px;
    }

    .header-flex img {
        width: 60vw;
        height: auto;
        border-radius: 10px;
    }

    .header-flex {
        padding: 10px;
    }

    nav ul.tabs {
        flex-direction: column;
        border-bottom: none;
    }

    nav ul.tabs li.tab {
        border-bottom: 1px solid rgba(255,255,255,0.3);
        text-align: center;
    }

    section {
        border-radius: 0;
    }

    section#resume table,
    section#resume th,
    section#resume td {
        font-size: var(--font-size-body);
        display: block;
        border-right: none;
    }

    section#video video {
        width: 90% !important;
    }

    #scrollToTopBtn {
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
    }

    footer {
        font-size: 0.9rem;
    }
}


/* -================================================- */


:root {
  --header-color: #4a90e2;
  --separated-border-color: #4a91e2d7;
  --default-background-color: #f5f7fa;
  --header-text-color: white;
  --body-text-color: #333;
  --box-shadow-color: rgba(0, 0, 0, 0.08);
  --li-tab-hover-color: rgba(255, 255, 255, 0.2);
  --nav-active-color: #ffcc00;
  --default-text-color: #000000;

  --font-size-header: 1rem;
  --font-size-body: 1.2rem;
  --font-size-h1: 2rem;
  --font-size-h2: 1.5rem;
  --font-size-footer: 1rem;
  --text-indent: 1.5rem;
  --font-size-math: 1.4rem;
  --image-width: 25vw;
}

/* Глобальные стили */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--default-background-color);
    color: var(--body-text-color);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html {
    font: sans-serif;
    overflow-x: hidden;
    font-size: 16px;
}

h2 {
    margin: 0;
}

/* Кнопка "Наверх" */

#scrollToTopBtn {
    display: none;
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    padding: 0;
    font-size: var(--font-size-h1);
    border-radius: 50%;
    background: var(--header-color);
    color: var(--header-text-color);
    border: none;
    box-shadow: 0 2px 8px var(--box-shadow-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

#scrollToTopBtn:hover {
    background: var(--nav-active-color);
}

/* Стили для sections */

section {
    padding: 30px;
    margin: 0 auto;
    background: var(--header-text-color);
    border-radius: 10px;
    margin-top: 20px;
    width: 90%;
    box-shadow: 0 4px 12px var(--box-shadow-color);
    flex-grow: 1;
}

/* Стили для статей */

section#articles h1 {
    margin-top: 0;
    font-size: var(--font-size-h1);
}

section#articles h2 {
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

section#articles h3,
section#articles h4 {
    font-size: var(--font-size-body);
}

section#articles .article-link {
    margin-bottom: var(--text-indent);
    text-decoration: underline;
}

section#articles .intro-class li {
    padding: 0;
    list-style-type: none;
}

section#articles .math-class {
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

section#articles .math-table {
    width: 100%;
    border: none !important;
    border-collapse: collapse;
}

section#articles .math-class-number {
    width: 10%;
    text-align: right;
    border: none !important;
}

section#articles .math-class-equation {
    border: none !important;
}

section#articles p {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
    font-family: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-indent: var(--text-indent);
    width: 100%;
    text-align: justify;
}

section#articles a,
section#articles li {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
    text-align: justify;
    text-indent: var(--text-indent);
}

section#articles math {
    font-size: var(--font-size-math);
    color: var(--default-text-color);
}

section#articles img {
    max-width: 60%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

section#articles table {
    justify-self: center;
    color: var(--default-text-color);
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
    border: 1px solid var(--default-text-color);
    border-collapse: collapse;
}

section#articles table th,
section#articles table td {
    padding: 5px;
    border: 1px solid var(--default-text-color);
}

section#articles .image-text {
    margin-bottom: var(--text-indent);
}

section#articles .image-text p {
    text-align: center;
}

section#articles .center-text {
    align-self: center;
    text-align: center;
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
    font-family: inherit;
    
}

section#articles .table-text {
    text-align: right;
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

/* Стили для хобби */

section#hobby h1 {
    margin-top: 0;
    font-size: var(--font-size-h1);
}

section#hobby h2 {
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
    font-size: var(--font-size-h2);
}

section#hobby ul,
section#hobby li {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
}
    
section#hobby a,
section#hobby p {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
    font-family: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-indent: var(--text-indent);
    width: 100%;
    text-align: justify;
}

section#hobby p {
    margin-bottom: var(--text-indent);
}

section#hobby .image-text {
    display: flex;
    align-items: center;
    gap: 15px;
}

section#hobby .image-text img {
    width: var(--image-width);
    height: auto;
    border-radius: 8px; 
}

section#hobby .image-text p {
    margin: 0;
}

/* Стили для реферата */

section#referat h2 {
    margin-top: var(--text-indent);
}

section#referat h3,
section#referat h4 {
    font-size: var(--font-size-body);
}

section#referat .intro-class li {
    padding: 0;
    list-style-type: none;
}

section#referat .math-class {
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

section#referat .math-table {
    width: 100%;
    border: none !important;
    border-collapse: collapse;
}

section#referat .math-class-number {
    width: 10%;
    text-align: right;
    border: none !important;
}

section#referat .math-class-equation {
    border: none !important;
}

section#referat p {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
    font-family: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-indent: var(--text-indent);
    width: 100%;
    text-align: justify;
}

section#referat a,
section#referat li {
    font-size: var(--font-size-body);
    color: var(--default-text-color);
    text-decoration: none;
}

section#referat math {
    font-size: var(--font-size-math);
    color: var(--default-text-color);
}

section#referat img {
    max-width: 60%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

section#referat table {
    justify-self: center;
    color: var(--default-text-color);
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
    border: 1px solid var(--default-text-color);
    border-collapse: collapse;
}

section#referat table th,
section#referat table td {
    padding: 5px;
    border: 1px solid var(--default-text-color);
}

section#referat .image-text {
    margin-bottom: var(--text-indent);
}

section#referat .image-text p {
    text-align: center;
}

section#referat .table-text {
    text-align: right;
    margin-top: var(--text-indent);
    margin-bottom: var(--text-indent);
}

/* Стили для видео */

section#video video {
    width: 35%;
    height: auto;
    margin-top: var(--text-indent);
    border-radius: 10px;
}

/* Стили для резюме */

section#resume table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--header-text-color);
    margin: 0 auto;
    font-size: var(--font-size-body);
}

section#resume th,
section#resume td {
    padding: 12px 18px;
    text-align: left;
    vertical-align: top;
    border-right: 3px outset var(--separated-border-color);
}

section#resume th:last-child,
section#resume td:last-child {
    border-right: none;
}

section#resume ul,
section#resume ol {
    padding: 12px 18px;
    margin: 0;
    padding-top: 0;
}

/* Стили для header*/

header {
    background-color: var(--header-color);
    color: var(--header-text-color);
    padding: 20px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.header-links {
    margin-left: auto;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1%;
    background-color: var(--header-color);
    padding: 20px;
}

header a {
    color: var(--header-text-color);
    text-decoration: none;
    margin: 0;
    font-size: var(--font-size-header);
}

header a:hover {
    text-decoration: underline;
}

header .logo {
    width: 200px;
    height: 100%;
    object-fit: contain;
    background: var(--header-text-color)    ;
    box-shadow: 0 2px 8px var(--box-shadow-color);
    margin-right: 20px;
}

header h1 {
    margin: 0;
    font-size: var(--font-size-h1);
}

header h2 {
    margin: 0;
    font-size: var(--font-size-h2);
}

header p {
    margin: 0;
    font-size: var(--font-size-header);
}

nav {
    width: 100%;
}

nav ul.tabs {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 10px 0 0 0;
    margin: 0;
    border-bottom: 2px solid var(--header-text-color);
}

nav ul.tabs li.tab {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

nav ul.tabs li.tab:hover {
    background: var(--li-tab-hover-color);
}

nav ul.tabs li.tab.active {
    border-bottom: 4px solid var(--nav-active-color);
    font-weight: bold;
}

main {
    flex-grow: 1;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
    display: block;
}

footer {
    text-align: center;
    padding: 20px;
    background: var(--body-text-color);
    color: var(--header-text-color);
    margin-top: 20px;
    font-size: var(--font-size-footer);
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
