/* ---------------------------- GLOBAL VARIABLES ----------------------------- */

:root {
    --main-bg-color: #f7ebd6;
    --main-bg-soft-color: #e4d1b9;
    --main-bg-tan-color: #c1a57d;
    --main-tan-overlay-color: rgba(228, 209, 185, 0.5);
    --brown-tint-90: #210c03;
    --brown-tint-70: #351306;
    --brown-tint-50: #5a240a;
    --brown-tint-40: #713800;
    --highlight-color: #dc0023;
    --info-color: #fc9f2f;
    --decor-color: #ffaf3b;
    --decor-darken-color: rgba(252, 159, 47, 0.7);
    --block-gap-wide: 26px;
    --block-gap-narrow: 20px;
}

/* ------------------ MOBILE TAPPED ELEMENT BACKGROUND COLOR ---------------- */
a, button, [role="button"], input[type="submit"], input[type="button"] {
    -webkit-tap-highlight-color: var(--main-tan-overlay-color);
}

/* ---------------------------- ACCESSIBILITY ------------------------------- */

/* Screen reader only text */
.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;
}

/* ---------------------------- GLOBAL TYPOGRAPHY ---------------------------- */

body {
    font-family: "Times New Roman", Times, serif !important;
}

body p,
body table,
body ul {
    font-size: clamp(0.938rem, 0.833vw + 0.625rem, 1.25rem);
    line-height: clamp(1.5rem, 0.333vw + 1.375rem, 1.625rem);
    hyphens: auto;
}

h3,
h2,
h1 {
    font-family: "LobsterTwo", serif;
    color: var(--highlight-color);
}

#main-content h4,
#main-content h3,
#main-content h2 {
    margin-top: 1.3em;
    margin-bottom: .8em;
}

#articles-list h4,
#articles-list h3,
#articles-list h2 {
    margin: 0;
}

h1, h2, h3, h4 {
    line-height: clamp(2.1rem, 0.45vw + 1.931rem, 2.269rem);
}

h1 {
    font-size: clamp(2.0rem, 1.5vw + 1.125rem, 2.25rem);
}

h2 {
    font-size: clamp(1.688rem, 1vw + 1.313rem, 2.063rem);
}

h3 {
    font-size: clamp(1.5rem, 0.833vw + 1.188rem, 1.813rem);
}

h4 {
    font-size: clamp(1.125rem, 0.667vw + 0.875rem, 1.375rem);
}

h1.text-center {
    border-bottom: 2px solid var(--info-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

header#headline,
header#headline h1 {
    font-family: 'DosisLight', sans-serif;
    font-size: clamp(1.3rem, 4.138vw + 0.172rem, 2.5rem);
    line-height: clamp(1rem, 4.138vw + 0.172rem, 2.5rem);
    color: var(--brown-tint-70);
}

@media (max-width: 700px) {
    header#headline,
    header#headline h1 {
        font-family: 'DosisSemiBold', sans-serif;
    }
}

footer {
    color: white;
}

/* ---------------------------- GLOBAL UTILITIES ----------------------------- */

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

.img-fluid {
    max-width: 100%;
    height: auto;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Video pair container for responsive layout */
.video-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem; /* Gap between videos */
    width: 100%;
}

/* Desktop: videos side by side, each taking half width minus gap */
.video-pair .video-container {
    flex: 0 0 calc(50% - 0.5rem); /* Don't grow/shrink, fixed basis for aspect ratio */
    position: relative;
    width: calc(50% - 0.5rem); /* Explicit width for aspect ratio calculation */
    height: 0;
    padding-bottom: calc((50% - 0.5rem) * 0.5625); /* 16:9 aspect ratio: width * 9/16 */
}

/* Mobile: videos stack vertically, each taking full width */
@media (max-width: 768px) {
    .video-pair .video-container {
        flex: 0 0 100%; /* Full width on mobile */
        width: 100%;
        padding-bottom: 56.25%; /* 16:9 aspect ratio: 100% * 9/16 */
    }
}

/* Single video: always full width with proper aspect ratio */
.video-pair .video-container:only-child {
    flex: 0 0 100%; /* Full width when only one video */
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio: 100% * 9/16 */
}


/* ---------------------------- GLOBAL ICONS --------------------------------- */

/* Base icon class - REQUIRED */
.icon {
    font-family: fontello;
    font-style: normal;
    font-weight: normal;
    speak: never;
    speak: none;
    display: inline-block;
    text-decoration: inherit;
    width: 1em;
    text-align: center;
    font-variant: normal;
    text-transform: none;
    line-height: 1em;
}

/* Your existing icon classes with code points */
.icon-location::before {
    content: '\e800';
}

.icon-phone::before {
    content: '\e801';
}

.icon-printer::before {
    content: '\e802';
}

.icon-mobile::before {
    content: '\f10b';
}

.icon-letter::before {
    content: '\f0e0';
}

.icon-doc::before {
    content: '\f15c';
}

.icon-pdf::before {
    content: '\f1c1';
}

/* Size classes */
.file-icon {
    font-size: 20px;
}

.footer-icon {
    font-size: inherit;
}

/* ---------------------------- GLOBAL BUTTONS ------------------------------- */

button, input, select, textarea {
    font-family: "Times New Roman", Times, serif !important;
}

button {
    display: inline-block;
    outline: 0;
    border: 0;
    cursor: pointer;
    background-color: #432b06;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 26px;
}

button:hover {
    background-color: #2b1200;
    color: white;
}

/* ---------------------------- GLOBAL GALLERY ------------------------------- */

/* CSS for the gallery - responsive grid with consistent image heights and gaps */
.gallery {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: grid;
    /* Desktop: 5 columns, each column takes equal space */
    grid-template-columns: repeat(5, 1fr);
    gap: 16px; /* Fixed gap maintained across all breakpoints */
}

.gallery li {
    margin: 0;
    /* Ensures images are cropped to fit their container */
    overflow: hidden;
}

.gallery img {
    width: 100%;
    aspect-ratio: 4 / 3; /* Maintains consistent aspect ratio */
    height: 160px; /* Fixed height for uniformity - kept from original */
    object-fit: cover; /* Crops and centers the image to fit - kept from original */
    display: block; /* Removes inline gap below images - kept from original */
    border-radius: 8px;
}

/* Tablet: 4 columns */
@media (max-width: 1100px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
        /* gap: 16px; - inherited from base rule */
    }
}

/* Small tablet: 3 columns */
@media (max-width: 700px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        /* gap: 16px; - inherited from base rule */
    }
}

/* Mobile: 2 columns */
@media (max-width: 500px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Slightly smaller gap only on mobile for better space usage */
    }
}

/* ---------------------------- GLOBAL PAGINATOR ----------------------------- */

.paginator {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    width: 100%;
}

.paginator .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    background-color: var(--main-tan-overlay-color);
    padding: 0.5rem 0.75rem;
    border-radius: 25px;
    border: 1px solid var(--main-bg-tan-color);
    box-shadow: 0 2px 8px rgba(53, 19, 6, 0.1);
}

.paginator .pagination li {
    list-style-type: none;
    display: inline-flex;
}

.paginator .pagination li a {
    position: relative;
    padding: 0.4rem 0.6rem;
    text-decoration: none;
    color: var(--brown-tint-50);
    font-weight: 500;
    font-family: "DosisMedium", sans-serif;
    border-radius: 20px; /* Oval shape for hover states */
    transition: all 0.3s ease;
    min-width: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Hover state for pagination links - oval background */
.paginator .pagination li a:hover {
    background-color: var(--brown-tint-40);
    color: var(--main-bg-color);
    transform: translateY(-1px);
}

/* Active/current page styling - oval background with decor-darken-color */
.paginator .pagination li span.current {
    background-color: var(--decor-darken-color); /* Using decor-darken-color as requested */
    color: var(--main-bg-color);
    font-weight: 600;
    padding: 0.4rem 0.6rem; /* Same padding as links */
    border-radius: 20px; /* Oval shape matching hover states */
    min-width: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DosisMedium", sans-serif;
    font-size: 0.9rem;
}

/* Previous/Next button styling */
.paginator .pagination li a[href*="page"]:first-child,
.paginator .pagination li a[href*="page"]:last-child {
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}

/* Ellipsis styling for "…" */
.paginator .pagination li:not(:has(a)):not(:has(span.current)) {
    padding: 0.4rem 0.2rem;
    color: var(--brown-tint-50);
    font-family: "DosisMedium", sans-serif;
    font-size: 0.9rem;
}

/** ---------------------------- GLOBAL BACK BUTTON ------------------------------- */

.back-navigation.breadcrumb-style {
    border-bottom: 2px solid var(--info-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.back-button.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brown-tint-50);
    text-decoration: none;
    font-family: "DosisMedium", sans-serif;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.back-button.breadcrumb-back:hover {
    color: var(--brown-tint-40);
}

.back-arrow {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.back-button.breadcrumb-back:hover .back-arrow {
    transform: translateX(-2px); /* Subtle left movement on hover */
}

/* ---------------------------- RESPONSIVE TABLES ---------------------------- */

/* Base table styling - works for all screen sizes */
.table__wrap {
    overflow-x: auto; /* Fallback for very small screens */
    margin: 1rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(53, 19, 6, 0.1);
}

.table__cell {
    padding: 1rem;
    border-bottom: 1px solid var(--main-bg-soft-color);
    vertical-align: top;
}

.table__header .table__cell {
    background-color: var(--main-bg-tan-color);
    font-weight: 600;
    font-family: "DosisSemiBold", sans-serif;
    color: var(--brown-tint-50);
}

/* FIX: Remove the base styling for table__column-1 - content should stay normal */
/* .table__column-1 styling removed */

/* Utility class to hide table headers on mobile but keep for screen readers */
@media only screen and (max-width: 622px) {
    .u-visually-hidden--mobile {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Hide table header completely on mobile */
    .table__header {
        display: none;
    }

    /* Round the top corners of the table body on mobile */
    .table tbody tr:first-child td:first-child {
        border-top-left-radius: 8px;
    }

    .table tbody tr:first-child td:last-child {
        border-top-right-radius: 8px;
    }

    /* Ensure no border on the first row after hiding header */
    .table tbody tr:first-child .table__cell {
        border-top: none;
    }
}

/* Contact table responsive layout */
@media only screen and (max-width: 622px) {
    .table--contact .table__row {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-row-gap: 0.5rem;
        align-items: start;
        padding: 1rem;
        border-bottom: 2px solid var(--main-bg-soft-color);
    }

    .table--contact .table__contact-name {
        grid-column: 1;
        grid-row: 1;
        border-bottom: none;
        padding: 0;
    }

    .table--contact .table__contact-email {
        grid-column: 1;
        grid-row: 2;
        border-bottom: none;
        padding: 0;
    }

    .table--contact .table__contact-phone {
        grid-column: 1;
        grid-row: 3;
        border-bottom: none;
        padding: 0;
    }

    /* FIX: Labels are bold and colored, content stays normal */
    .table--contact .table__contact-name::before {
        content: "Név: ";
        font-weight: 600;
        color: var(--brown-tint-50);
    }

    .table--contact .table__contact-email::before {
        content: "Email: ";
        font-weight: 600;
        color: var(--brown-tint-50);
    }

    .table--contact .table__contact-phone::before {
        content: "Telefon: ";
        font-weight: 600;
        color: var(--brown-tint-50);
    }
}

/* Two-column table responsive layout */
@media only screen and (max-width: 622px) {
    .table--two-column .table__row {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        grid-row-gap: 0.5rem;
        align-items: start;
        padding: 1rem;
        border-bottom: 2px solid var(--main-bg-soft-color);
    }

    .table--two-column .table__column-1 {
        grid-column: 1;
        grid-row: 1;
        border-bottom: none;
        padding: 0 0 0.25rem 0;
        /* FIX: Content stays normal weight and color */
        font-weight: normal;
        color: inherit;
    }

    .table--two-column .table__column-2 {
        grid-column: 1;
        grid-row: 2;
        border-bottom: none;
        padding: 0;
        /* FIX: Content stays normal weight and color */
        font-weight: normal;
        color: inherit;
    }

    /* FIX: Only the labels (::before content) are bold and colored */
    .table--two-column .table__column-1::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--brown-tint-50);
    }

    .table--two-column .table__column-2::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--brown-tint-50);
    }
}

/* Contact content stacking */
.table__contact-content {
    display: flex;
    flex-direction: column;
}

.table__contact-secondary {
    font-size: 0.875rem;
    color: var(--brown-tint-40);
    /*margin-top: 0.25rem;*/
}

/* Phone numbers stacking */
.table__contact-phones {
    display: flex;
    flex-direction: column;
}

/* Text alignment utilities */
.u-text-left {
    text-align: left;
}

.u-text-right {
    text-align: right;
}

.u-text-center {
    text-align: center;
}

/* ---------------------------- 404 PAGE STYLES ------------------------------ */

.error-404-container {
    text-align: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(228, 209, 185, 0.3) 0%, rgba(193, 165, 125, 0.3) 100%);
    border-radius: 12px;
    margin: 10px 0;
}

.error-404-content {
    padding: 3rem 1rem;
    border-radius: 8px;
}

.error-404-title {
    font-family: 'LobsterTwo', serif;
    color: var(--highlight-color);
    font-size: 4rem;
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-404-decorator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.error-404-decorator-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--highlight-color), transparent);
}

.error-404-decorator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--highlight-color);
}

.error-404-subtitle {
    font-family: 'LobsterTwo', serif;
    color: var(--brown-tint-50);
    font-size: 1.8rem;
    margin: 0 0 1rem 0;
}

.error-404-description {
    font-size: 1.2rem;
    color: var(--brown-tint-70);
    line-height: 1.4;
    margin: 1.5rem 0;
    font-style: italic;
}

.error-404-buttons {
    margin-top: 2rem;
}

.error-404-btn-primary {
    display: inline-block;
    background-color: var(--brown-tint-50);
    color: var(--main-bg-color);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
    margin-right: 1rem;
}

.error-404-btn-primary:hover {
    background-color: var(--brown-tint-40);
    color: var(--main-bg-color);
}

.error-404-btn-secondary {
    display: inline-block;
    background-color: var(--main-bg-tan-color);
    color: var(--brown-tint-70);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.error-404-btn-secondary:hover {
    background-color: var(--brown-tint-40);
    color: var(--main-bg-color);
}

/* Responsive adjustments for 404 page */
@media (max-width: 768px) {
    .error-404-title {
        font-size: 3rem;
    }

    .error-404-subtitle {
        font-size: 1.5rem;
    }

    .error-404-description {
        font-size: 1.1rem;
    }

    .error-404-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .error-404-btn-primary,
    .error-404-btn-secondary {
        margin-right: 0;
        min-width: 200px;
        text-align: center;
    }

    .error-404-decorator-line {
        width: 40px;
    }
}

@media (max-width: 480px) {
    .error-404-container {
        padding: 1rem 0;
        margin: 1rem 0;
    }

    .error-404-content {
        padding: 2rem 0.5rem;
    }

    .error-404-title {
        font-size: 2.5rem;
    }

    .error-404-subtitle {
        font-size: 1.3rem;
    }
}

/* ---------------------------- DOWNLOADS LIST STYLING ------------------------ */

/* Downloads list - styled similar to responsive tables */
.downloads-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(53, 19, 6, 0.1);
    margin: 1rem 0;
}

.downloads-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.downloads-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--main-bg-soft-color);
    transition: background-color 0.2s ease;
}

.downloads-list li:last-child {
    border-bottom: none;
}

.downloads-list li:hover {
    background-color: var(--main-tan-overlay-color);
}

/* File icon styling within downloads */
.downloads-list .file-icon {
    color: var(--brown-tint-50);
    font-size: 1.5rem;
    min-width: 1.5rem;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Download link styling */
.downloads-list a {
    color: var(--brown-tint-70);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.downloads-list a:hover {
    color: var(--brown-tint-50);
    text-decoration: underline;
}

/* Mobile responsive adjustments */
@media (max-width: 622px) {
    .downloads-list li {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .downloads-list .file-icon {
        font-size: 1.3rem;
        min-width: 1.3rem;
    }

    .downloads-list a {
        font-size: 1rem;
    }
}

/* ---------------------------- ALERT BOXES ---------------------------------- */

/* Soft-toned alert box for empty states and notifications */
.alert-box {
    background: linear-gradient(135deg, var(--main-bg-soft-color) 0%, var(--main-tan-overlay-color) 100%);
    border: 1px solid var(--main-bg-tan-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(53, 19, 6, 0.08); /* Very subtle shadow */
}

.alert-box p {
    color: var(--brown-tint-50);
    font-style: italic;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 622px) {
    .alert-box {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    .alert-box p {
        font-size: 1rem;
    }
}