/*
Theme Name: Redcastle
Author: OpenClaw
Description: WordPress rebuild of cerveny-hradek.cz based on the recovered static Drupal export.
Version: 0.1.0
Text Domain: redcastle
*/

.redcastle-event-list {
    display: grid;
    gap: 15px;
    margin-top: 1.5rem;
}

.redcastle-news-content {
    max-width: 960px;
    margin: 0 auto;
    text-align: left;
}

#aktuality-newsletter {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px;
    max-width: 960px;
    margin: 20px auto 36px !important;
}

.aktuality-newsletter-form {
    flex: 1 1 auto;
}

.aktuality-newsletter-rss {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.aktuality-newsletter-rss .rss-subscribe-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    line-height: 1;
    white-space: nowrap;
}

.rss-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    vertical-align: middle;
}

.news-grid.news-grid--archive {
    grid-template-columns: 1fr;
}

.news-grid.news-grid--archive .news-card {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

.news-body {
    margin-top: 1rem;
    text-align: left;
}

.news-body a {
    color: #900;
    font-weight: 500;
    text-decoration: none;
}

.news-body a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.news-body .news-link {
    display: inline-flex;
    margin-top: .5rem;
}

.redcastle-news-detail h1 {
    margin-bottom: 1.25rem !important;
    text-align: left !important;
}

.redcastle-news-detail .news-date {
    margin-bottom: 1.2rem;
}

.redcastle-news-detail a,
.entry-content a {
    color: #a50000;
    font-weight: 600;
    text-decoration: none;
}

.redcastle-news-detail a:hover,
.entry-content a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.redcastle-backlink {
    margin-bottom: 1.75rem !important;
    font-size: .96rem;
}

.redcastle-backlink a {
    color: #333;
    font-weight: 500;
}

.redcastle-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .82);
}

.redcastle-lightbox.is-open {
    display: flex;
}

.redcastle-lightbox img {
    max-width: 96vw;
    max-height: 86vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.redcastle-lightbox button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #a31d1d;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.redcastle-lightbox-close {
    top: 18px;
    right: 18px;
}

.redcastle-lightbox-prev,
.redcastle-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px !important;
    font-size: 40px !important;
}

.redcastle-lightbox-prev {
    left: 18px;
    right: auto !important;
}

.redcastle-lightbox-next {
    right: 18px;
}

.redcastle-lightbox-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
}

.gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px !important;
    margin: 24px 0 36px !important;
}

.gallery br {
    display: none;
}

.gallery .gallery-item {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
}

.gallery .gallery-icon {
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 4 / 3;
    background: #f2f2f2;
}

.gallery a {
    display: block;
    height: 100%;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0 !important;
    transition: transform .18s ease, opacity .18s ease;
}

.gallery a:hover img {
    transform: scale(1.04);
    opacity: .92;
}

.gallery .gallery-caption {
    margin: 6px 0 0 !important;
    color: #666;
    font-size: 14px;
    line-height: 1.35;
}

.event-cal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 18px;
}

.event-cal-label {
    color: #444;
    font-weight: 700;
}

.event-cal-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-cal-button {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #b61b1b;
    border-radius: 4px;
    color: #a50000 !important;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    background: #fff;
}

.event-cal-button:hover {
    color: #fff !important;
    text-decoration: none;
    background: #a50000;
}

.redcastle-contact-form-wrap {
    max-width: 760px;
    margin: 46px auto 0;
}

.redcastle-contact-form-wrap .cs-contact-us-form {
    margin: 0;
}

.redcastle-contact-form-wrap .form-item {
    margin-bottom: 18px;
}

.redcastle-form-note {
    margin-top: 16px;
    color: #666;
    font-size: .95rem;
    line-height: 1.45;
}

.redcastle-gallery-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 28px auto 42px;
    max-width: 1120px;
}

.redcastle-gallery-overview--home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
}

.redcastle-gallery-card {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    transition: transform .16s ease, box-shadow .16s ease;
}

.redcastle-gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
    text-decoration: none;
}

.redcastle-gallery-card .gallery-image-wrapper {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #ececec;
}

.redcastle-gallery-card .gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}

.redcastle-gallery-card:hover .gallery-image {
    transform: scale(1.04);
}

.redcastle-gallery-card .gallery-content {
    padding: 15px 16px 17px;
}

.redcastle-gallery-card .gallery-date {
    display: block;
    margin-bottom: 6px;
    color: #777;
    font-size: .9rem;
}

.redcastle-gallery-card .gallery-title {
    margin: 0 0 10px;
    color: #252525;
    font-size: 1.05rem;
    line-height: 1.3;
}

.redcastle-gallery-card .gallery-count {
    color: #a31d1d;
    font-size: .9rem;
    font-weight: 700;
}

.redcastle-home-gallery-section {
    margin-top: 18px;
}

.main-footer a[href*="wp-admin"] {
    opacity: .75;
}

.event-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.event-meta-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #a31d1d;
}

.event-meta-icon--date {
    border: 2px solid currentColor;
    border-radius: 3px;
}

.event-meta-icon--date::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: 4px;
    border-top: 2px solid currentColor;
}

.event-meta-icon--time {
    border: 2px solid currentColor;
    border-radius: 50%;
}

.event-meta-icon--time::before,
.event-meta-icon--time::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 2px;
    height: 6px;
    background: currentColor;
    transform-origin: bottom center;
}

.event-meta-icon--time::after {
    top: 8px;
    height: 5px;
    transform: rotate(90deg);
}

.event-meta-icon--place::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 1px;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.event-meta-icon--place::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 5px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.redcastle-related-events ul {
    display: grid;
    gap: 6px;
    margin: 1rem 0 0;
    padding-left: 26px;
}

.redcastle-related-events li {
    list-style: none;
}

.redcastle-related-events a {
    color: #a50000;
    text-decoration: none;
}

.redcastle-related-events a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.redcastle-calendar-widget {
    margin: 1rem 0 3rem;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.redcastle-calendar-toolbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.redcastle-calendar-toolbar button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: #2d2d2d;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.redcastle-calendar-title {
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
    color: #2d2d2d;
}

.redcastle-calendar-weekdays,
.redcastle-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.redcastle-calendar-weekdays span {
    padding: 8px;
    color: #666;
    font-weight: 700;
    text-align: center;
}

.redcastle-calendar-day {
    min-height: 118px;
    padding: 8px;
    border: 1px solid #ececec;
    background: #fafafa;
}

.redcastle-calendar-day.is-outside {
    background: #f1f1f1;
    color: #999;
}

.redcastle-calendar-day-number {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.redcastle-calendar-event {
    display: block;
    margin-top: 5px;
    padding: 5px 6px;
    border-radius: 4px;
    background: #a31d1d;
    color: #fff !important;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.redcastle-calendar-event.is-past {
    background: #666;
}

.redcastle-calendar-event small {
    display: block;
    font-size: .72rem;
    font-weight: 500;
    opacity: .9;
}

.redcastle-calendar-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 14px;
    color: #666;
    font-size: .9rem;
}

.redcastle-calendar-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 3px;
    background: #a31d1d;
}

.redcastle-calendar-legend i.is-past {
    background: #666;
}

@media (max-width: 760px) {
    #aktuality-newsletter {
        align-items: stretch !important;
        flex-direction: column;
        max-width: 100%;
        padding: 0 16px;
    }

    .aktuality-newsletter-rss {
        align-self: center;
    }

    .redcastle-calendar-widget {
        padding: 14px;
    }

    .redcastle-calendar-weekdays {
        display: none;
    }

    .redcastle-calendar-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .redcastle-calendar-day {
        min-height: auto;
    }

    .redcastle-calendar-day.is-outside {
        display: none;
    }

    .redcastle-gallery-overview,
    .redcastle-gallery-overview--home {
        grid-template-columns: 1fr;
    }
}
