:root {
    --canvas: #f9f7f2;
    --accent: #3c4a57;
    --accent-dark: #29313a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --border: 1px solid rgba(44, 62, 80, 0.12);
    --radius: 18px;
}

/* Modern CSS Reset + Normalization */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Normalize form elements across browsers */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button,
input {
    overflow: visible;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText;
}

textarea {
    overflow: auto;
    resize: vertical;
}

[type="checkbox"],
[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(140deg, #d1c1a2, #f4efdc 45%, #fefefe);
    min-height: 100vh;
    color: var(--accent-dark);
}

#wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

#main-content {
    width: min(980px, 100%);
    background: var(--canvas);
    background-image: url('graphics/big_bkg.jpg');
    background-repeat: no-repeat;
    background-position: top left;
    background-size: auto;
    background-color: #ebe5da;
    border-radius: var(--radius);
    padding: clamp(32px, 3vw, 48px);
    box-shadow: var(--shadow);
    border: var(--border);
}

.page-header {
    margin-top: 0;
    margin-bottom: 30px;
    margin-left: auto;
    text-align: right;
    width: 600px;
}

.page-header h1 {
    font-size: clamp(42px, 5vw, 56px);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 18px;
    line-height: 1.6;
}

.nav-links {
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-links a {
    font-size: 16px;
    padding: 10px 16px;
    background: rgba(44, 62, 80, 0.05);
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--accent);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    border-color: rgba(44, 62, 80, 0.3);
    background: rgba(44, 62, 80, 0.08);
}

.content-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.comment-form-section,
.comments-section {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(44, 62, 80, 0.08);
    padding: 28px;
    box-shadow: 0 10px 25px rgba(23, 28, 33, 0.08);
}
.comment-form-wrapper {
    width: 400px;
    margin-left: auto;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.comment-form label {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form textarea {
    font-family: inherit;
    font-size: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(44, 62, 80, 0.2);
    width: 100%;
    background: #fff9f4;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.comment-form button,
.comment-form input[type="submit"] {
    font-family: inherit;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 14px 24px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    align-self: flex-start;
}

.comment-form button:hover,
.comment-form input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(19, 35, 60, 0.35);
}

.comments-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(44, 62, 80, 0.12);
}

.comment:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-header strong {
    font-size: 20px;
    font-style: normal;
    color: var(--accent-dark);
}

.comment-header em {
    font-size: 15px;
    color: rgba(44, 62, 80, 0.7);
    display: block;
    margin-top: 4px;
}

.comment-text {
    font-size: 16px;
    line-height: 1.8;
    margin-top: 12px;
    color: #222;
    text-align: left;
}

.delete-link {
    font-size: 14px;
    color: rgba(44, 62, 80, 0.6);
    text-decoration: underline;
}

/* Gallery & Album Styles */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    cursor: pointer;
    border: 1px solid rgba(44, 62, 80, 0.08);
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    padding: 1rem;
    transition: opacity 0.2s ease;
}

.lightbox-nav:hover {
    opacity: 0.7;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.album-section {
    margin-bottom: 3rem;
}

.album-section-title {
    color: var(--accent-dark);
    font-size: clamp(24px, 3vw, 32px);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(44, 62, 80, 0.2);
    text-transform: lowercase;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.album-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(44, 62, 80, 0.08);
}

.album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.album-cover {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #d1c1a2 0%, #c4b5a0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    font-size: 3rem;
    font-weight: 300;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info {
    display: none;
}

@media (max-width: 640px) {
    #wrap {
        padding: 20px 12px;
    }

    #main-content {
        padding: 20px 16px;
        background-size: 35%;
    }

    .page-header {
        width: 60%;
        text-align: right;
    }

    .page-header h1 {
        font-size: clamp(28px, 7vw, 38px);
    }

    .page-header p {
        font-size: 15px;
    }

    .comment-form-wrapper {
        width: 100%;
        margin-left: 0;
    }

    .comment-form-section {
        padding: 20px 16px;
    }

    .nav-links {
        gap: 8px;
        flex-direction: column;
    }

    .comment-form-section,
    .comments-section {
        padding: 20px;
    }

    .albums-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .photo-item img {
        height: 350px;
    }

    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    .lightbox-nav {
        font-size: 30px;
        padding: 0.5rem;
    }
}

@media (max-width: 980px) and (min-width: 641px) {
    #main-content {
        background-size: 40%;
        padding: 32px 24px;
    }

    .page-header {
        width: 55%;
    }

    .comment-form-wrapper {
        width: 55%;
    }
}

@media (max-width: 480px) {
    #main-content {
        padding: 20px 12px;
        border-radius: 12px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .comment-form-section {
        padding: 16px 12px;
    }

    .content-panel {
        gap: 20px;
    }
}
