/* ==========================================================================
   Page-Specific Styles
   ========================================================================== */

/* --- wpautop protection ---
   Kill any stray <p> or <br> WordPress might inject inside grid/flex containers
   -------------------------------------------------------------------------- */

.af-hero-grid > p:empty,
.af-hero-actions > p:empty,
.af-hero-meta > p:empty,
.af-hero-badges > p:empty,
.af-hero-form > p:empty,
.af-grid-3 > p:empty,
.af-grid-2 > p:empty,
.af-guide > p:empty,
.af-guide-list > p:empty,
.af-cta-band > p:empty,
.af-cta-band__actions > p:empty,
.af-kontakt-grid > p:empty,
.af-footer-grid > p:empty,
.af-row > p:empty,
.af-panel__body > p:empty,
.af-nav > p:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.af-hero-grid > br,
.af-hero-actions > br,
.af-hero-meta > br,
.af-hero-badges > br,
.af-grid-3 > br,
.af-grid-2 > br,
.af-guide > br,
.af-guide-list > br,
.af-cta-band > br,
.af-row > br,
.af-kontakt-grid > br {
    display: none;
}

/* --- Homepage Hero (demo content) --- */
.af-hero {
    position: relative;
    min-height: calc(92vh - 76px);
    display: flex;
    align-items: flex-end;
    padding: 44px 0 36px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid rgba(248, 248, 248, .08);
}

.af-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 10% 10%, rgba(128, 88, 8, .18), transparent 60%),
        linear-gradient(180deg, rgba(16, 16, 16, .25) 0%, rgba(16, 16, 16, .80) 70%, rgba(16, 16, 16, 1) 100%),
        var(--af-hero-bg, #101010);
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    z-index: -2;
}

.af-hero::after {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(900px 480px at 85% 35%, rgba(248, 248, 248, .06), transparent 60%),
        radial-gradient(700px 400px at 15% 70%, rgba(128, 88, 8, .10), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

.af-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
    align-items: end;
}

.af-hero h1 {
    font-family: var(--af-serif);
    font-weight: 600;
    font-size: clamp(46px, 6vw, 84px);
    line-height: 1.02;
    margin: 16px 0 14px;
    letter-spacing: -.02em;
    max-width: 18ch;
}

.af-hero p {
    margin: 0 0 18px;
    font-size: 18px;
    color: rgba(248, 248, 248, .84);
    max-width: 62ch;
}

.af-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 18px;
}

.af-hero-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: rgba(248, 248, 248, .72);
    font-size: 13px;
}

.af-hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* Hero panel (quick request form) */
.af-hero .af-panel h3 {
    font-family: var(--af-serif);
    font-size: 24px;
    margin: 10px 0 6px;
    letter-spacing: .01em;
}

.af-hero .af-panel p {
    margin: 0;
    color: rgba(248, 248, 248, .78);
    font-size: 14px;
}

.af-hero-form {
    padding: 14px 18px 18px;
    display: grid;
    gap: 10px;
}

/* --- Homepage Sections (demo content) --- */
.af-home-section {
    padding: var(--af-space-large) 0;
    border-bottom: 1px solid rgba(248, 248, 248, .06);
}

/* Light section variant */
.af-home-section--light {
    background: var(--af-ivory);
    color: var(--af-obsidian);
}

.af-home-section--light .af-section-head p {
    color: rgba(16, 16, 16, .65);
}

.af-home-section--light .af-value {
    border-color: rgba(16, 16, 16, .10);
    background: rgba(16, 16, 16, .03);
}

.af-home-section--light .af-value__text {
    color: rgba(16, 16, 16, .65);
}

/* --- Kontakt page --- */
.af-kontakt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--af-space-normal);
    align-items: start;
}

.af-kontakt-info h3 {
    font-family: var(--af-serif);
    font-size: 24px;
    margin-bottom: 16px;
}

.af-kontakt-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(248, 248, 248, .08);
}

.af-kontakt-item:last-child {
    border-bottom: none;
}

/* --- Reisen overview --- */
.af-reisen-intro {
    text-align: center;
    max-width: 680px;
    margin: 0 auto var(--af-space-normal);
}

/* Responsive hero */
@media (max-width: 899px) {
    .af-hero {
        min-height: calc(88vh - 76px);
        padding: 28px 0 28px;
    }
    .af-hero-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .af-hero h1 {
        max-width: 22ch;
    }
    .af-kontakt-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 404 Page --- */
.af-404 {
    min-height: calc(80vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--af-space-large) 0;
}

.af-404-content {
    max-width: 560px;
}

.af-404-content h1 {
    font-family: var(--af-serif);
    font-size: clamp(100px, 20vw, 200px);
    line-height: 1;
    color: var(--af-gold);
    margin: 16px 0 24px;
    letter-spacing: -.04em;
}

.af-404-content p {
    font-size: 18px;
    margin: 0 auto 32px;
    max-width: 40ch;
}

.af-404-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.af-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* --- Search Results --- */
.af-search-results {
    display: grid;
    gap: 2px;
}

.af-search-item {
    padding: 24px 0;
    border-bottom: 1px solid rgba(248, 248, 248, .08);
}

.af-search-item:first-child {
    padding-top: 0;
}

.af-search-item__title {
    font-family: var(--af-serif);
    font-size: 22px;
    margin: 0 0 6px;
}

.af-search-item__title a {
    text-decoration: none;
}

.af-search-item__title a:hover {
    color: var(--af-gold);
}

.af-search-item__meta {
    font-size: 13px;
    margin-bottom: 8px;
}

.af-search-item__excerpt {
    color: rgba(248, 248, 248, .76);
    font-size: 15px;
}

.af-search-item__excerpt p {
    margin: 0;
}

/* Search form styling */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(248, 248, 248, .14);
    background: rgba(248, 248, 248, .06);
    color: var(--af-ivory);
    font-family: var(--af-sans);
    font-size: 14px;
    outline: none;
}

.search-form .search-field:focus {
    border-color: rgba(128, 88, 8, .55);
}

.search-form .search-submit {
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--af-gold);
    color: #0b0b0b;
    font-weight: 600;
    font-family: var(--af-sans);
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    cursor: pointer;
}

.search-form .search-submit:hover {
    filter: brightness(1.04);
}

/* --- Archive / Index page --- */
.af-posts-grid {
    margin-bottom: var(--af-space-normal);
}

.af-archive-desc {
    max-width: 60ch;
    margin: 8px auto 0;
    text-align: center;
}

/* --- Single Post --- */
.af-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--af-space-normal);
    align-items: start;
}

.af-featured-image {
    margin-bottom: var(--af-space-compact);
    border-radius: var(--af-radius);
    overflow: hidden;
}

.af-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.af-entry-header {
    margin-bottom: var(--af-space-compact);
}

.af-entry-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(248, 248, 248, .70);
    margin-bottom: 12px;
}

.af-entry-title {
    font-family: var(--af-serif);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    margin: 0;
}

.af-entry-content {
    font-size: 16px;
    line-height: 1.7;
}

.af-entry-content > *:last-child {
    margin-bottom: 0;
}

.af-entry-content img {
    border-radius: var(--af-radius);
}

.af-entry-footer {
    margin-top: var(--af-space-compact);
    padding-top: var(--af-space-compact);
    border-top: 1px solid rgba(248, 248, 248, .10);
}

.af-entry-tags {
    font-size: 13px;
    color: rgba(248, 248, 248, .70);
}

.af-entry-tags a {
    color: var(--af-gold);
}

.af-entry-tags a:hover {
    text-decoration: underline;
}

/* Post navigation */
.af-post-nav {
    margin-top: var(--af-space-normal);
    padding-top: var(--af-space-compact);
    border-top: 1px solid rgba(248, 248, 248, .10);
}

.af-post-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.af-post-nav .nav-previous,
.af-post-nav .nav-next {
    font-size: 15px;
}

.af-post-nav .nav-next {
    text-align: right;
}

.af-post-nav a {
    text-decoration: none;
    color: var(--af-ivory);
    transition: color .2s;
}

.af-post-nav a:hover {
    color: var(--af-gold);
}

/* Page links (multi-page posts) */
.af-page-links {
    margin-top: var(--af-space-compact);
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.af-page-links .post-page-numbers {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(248, 248, 248, .14);
    text-decoration: none;
}

.af-page-links .post-page-numbers.current {
    background: var(--af-gold);
    color: #0b0b0b;
    border-color: transparent;
}

/* --- Sidebar --- */
.af-sidebar {
    position: sticky;
    top: calc(76px + 24px);
}

.af-sidebar .af-widget {
    padding: 20px;
    border-radius: var(--af-radius);
    border: 1px solid rgba(248, 248, 248, .10);
    background: rgba(248, 248, 248, .03);
}

/* --- Comments --- */
.af-comments {
    margin-top: var(--af-space-normal);
    padding-top: var(--af-space-normal);
    border-top: 1px solid rgba(248, 248, 248, .10);
}

.af-comments-title {
    font-family: var(--af-serif);
    font-size: 28px;
    margin: 0 0 var(--af-space-compact);
}

.af-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.af-comment {
    padding: 20px 0;
    border-bottom: 1px solid rgba(248, 248, 248, .06);
}

.af-comment .comment-author {
    font-weight: 600;
    margin-bottom: 4px;
}

.af-comment .comment-author img {
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.af-comment .comment-metadata {
    font-size: 12px;
    color: rgba(248, 248, 248, .60);
    margin-bottom: 10px;
}

.af-comment .comment-metadata a {
    color: inherit;
}

.af-comment .comment-content p {
    margin: 0 0 8px;
    color: rgba(248, 248, 248, .82);
}

.af-comment .reply a {
    font-size: 13px;
    color: var(--af-gold);
    text-decoration: none;
}

.af-comment .reply a:hover {
    text-decoration: underline;
}

/* Comment form */
.af-comment-form {
    margin-top: var(--af-space-compact);
}

.af-comment-form label {
    display: block;
    font-size: 12px;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(248, 248, 248, .70);
    margin-bottom: 6px;
}

.af-comment-form input[type="text"],
.af-comment-form input[type="email"],
.af-comment-form input[type="url"],
.af-comment-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(248, 248, 248, .14);
    background: rgba(248, 248, 248, .06);
    color: var(--af-ivory);
    font-family: var(--af-sans);
    font-size: 14px;
    outline: none;
    margin-bottom: 16px;
}

.af-comment-form input:focus,
.af-comment-form textarea:focus {
    border-color: rgba(128, 88, 8, .55);
}

.af-comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.af-comment-form .form-submit input[type="submit"] {
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--af-gold);
    color: #0b0b0b;
    font-weight: 600;
    font-family: var(--af-sans);
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    cursor: pointer;
}

.af-comment-form .form-submit input[type="submit"]:hover {
    filter: brightness(1.04);
}

/* Comment navigation */
.af-comment-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--af-space-compact);
    font-size: 14px;
}

.af-comment-navigation a {
    color: var(--af-gold);
    text-decoration: none;
}

/* Comments closed message */
.af-comments-closed {
    padding: 16px 0;
    font-size: 14px;
    color: rgba(248, 248, 248, .60);
    font-style: italic;
}

/* --- Page article (Impressum etc.) --- */
.af-page-article {
    padding: var(--af-space-large) 0 var(--af-space-normal);
}

.af-page-article .af-entry-title {
    text-align: center;
    margin-bottom: var(--af-space-normal);
}

.af-page-article .af-entry-content {
    max-width: 800px;
    margin: 0 auto;
}

/* --- Content None / Empty States --- */
.af-content-none {
    text-align: center;
    padding: var(--af-space-large) 0;
}

.af-content-none h2 {
    font-family: var(--af-serif);
    font-size: 30px;
    margin: 0 0 12px;
}

.af-content-none p {
    color: rgba(248, 248, 248, .76);
    max-width: 50ch;
    margin: 0 auto 24px;
}

.af-content-none .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* --- WordPress Core Styles --- */
.wp-caption {
    max-width: 100%;
    border-radius: var(--af-radius);
    overflow: hidden;
}

.wp-caption-text {
    font-size: 13px;
    color: rgba(248, 248, 248, .60);
    padding: 8px 0;
    text-align: center;
}

.gallery {
    display: grid;
    gap: 8px;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item img {
    border-radius: calc(var(--af-radius) / 2);
}

/* Pagination overrides (WordPress default) */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--af-space-normal);
}

.nav-links .page-numbers {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid rgba(248, 248, 248, .14);
    text-decoration: none;
    color: var(--af-ivory);
    transition: background .2s;
}

.nav-links .page-numbers:hover {
    background: rgba(248, 248, 248, .06);
}

.nav-links .page-numbers.current {
    background: var(--af-gold);
    color: #0b0b0b;
    border-color: transparent;
}

/* --- Responsive overrides for page-specific styles --- */
@media (max-width: 899px) {
    .af-single-layout {
        grid-template-columns: 1fr;
    }

    .af-sidebar {
        position: static;
    }

    .af-post-nav .nav-links {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .af-post-nav .nav-next {
        text-align: left;
    }

    .af-404-content h1 {
        font-size: clamp(80px, 15vw, 140px);
    }

    .af-404-actions {
        flex-direction: column;
        align-items: center;
    }
}
