/* ===========================================================
   Carnivellos CMS — base theme (structure only)
   Colors and fonts come from theme/themes/{name}.css, picked in
   Settings. This file is meant to be edited per client for layout
   changes; for a quick rebrand, try a different starter theme first.
   =========================================================== */

* { box-sizing: border-box; }

/* Skip-to-content link — invisible until a keyboard user tabs to it,
   letting them jump past the header/nav straight to the main content. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-accent);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 2000;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}
.skip-link:focus {
    left: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 17px;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

a { color: var(--color-accent); text-decoration: underline; }
a:hover { opacity: 0.8; }

/* --heading-color / --heading-weight / --h1-size / --h2-size / --h3-size
   are optional (see THEMES.md) — themes that don't set them get exactly
   the previous look: body text color, bold, 2rem/1.4rem/1.15rem. */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--heading-color, var(--color-text));
    font-weight: var(--heading-weight, 700);
    line-height: 1.25;
    margin: 1.5em 0 0.5em;
}
h1 { font-size: var(--h1-size, 2rem); margin-top: 0.4em; }
h2 { font-size: var(--h2-size, 1.4rem); }
h3 { font-size: var(--h3-size, 1.15rem); }

p { margin: 0 0 1em; }

img { max-width: 100%; height: auto; border-radius: 4px; }

/* Image display sizes, set via the editor's Insert Image options */
img.img-small { max-width: 200px; }
img.img-medium { max-width: 420px; }
img.img-large { max-width: 700px; }
img.img-full { max-width: 100%; }

/* Alignment, set via the editor's Insert Image dialog. Applied to the
   image itself, or to its wrapping link when it opens in a lightbox. */
.align-left { float: left; margin: 0.25rem 1.5rem 1rem 0; }
.align-right { float: right; margin: 0.25rem 0 1rem 1.5rem; }

.content::after { content: ""; display: table; clear: both; }

a.lightbox { display: inline-block; cursor: zoom-in; text-decoration: none; }

/* Lightbox overlay (see theme/lightbox.js) */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
    cursor: zoom-out;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-overlay .lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
}
.lightbox-overlay .lightbox-close:hover { opacity: 1; }

/* Header
   --header-bg / --header-text / --header-accent are optional — themes
   that don't set them fall back to the normal page colors, so existing
   themes look exactly as before. A theme like Midnight sets all three
   for a dark header bar with its own accent color. */
.site-header {
    background: var(--header-bg, transparent);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 0;
}
.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.site-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--header-text, var(--color-text));
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.site-logo-icon { display: block; height: 32px; width: auto; }
.site-nav a {
    margin-left: 1.25rem;
    text-decoration: none;
    color: var(--header-text, var(--color-text));
    font-size: 0.95rem;
}
.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover { color: var(--header-accent, var(--color-accent)); }
.site-nav a.active { color: var(--header-accent, var(--color-accent)); font-weight: 600; }

/* Compact search box in the header, present on every page regardless
   of layout. .site-search-form-large is the bigger variant used at the
   top of the search results page itself. */
.site-search-form { display: flex; gap: 0.35rem; margin-left: 1rem; }
.site-search-form input {
    width: 130px;
    max-width: 40vw;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 0.88rem;
    font-family: inherit;
}
.site-nav-bar .site-search-form input { background: rgba(255,255,255,0.92); }
.site-search-form button {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text);
}
.site-search-form-large { max-width: 480px; margin: 1rem 0 2rem; }
.site-search-form-large input { width: auto; max-width: none; flex: 1; font-size: 1rem; padding: 0.65rem 0.9rem; }
.site-search-form-large button { padding: 0.65rem 1.1rem; background: var(--color-accent); color: #fff; border-color: var(--color-accent); font-weight: 600; }

/* Mobile menu toggle — hidden on desktop, shown only at the mobile
   breakpoint below, where it reveals/hides .site-nav as a dropdown. */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.nav-toggle-bars { position: relative; width: 22px; height: 16px; }
.nav-toggle-bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--header-text, var(--color-text));
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 7px; }
.nav-toggle-bars span:nth-child(3) { top: 14px; }
.nav-toggle.is-open .nav-toggle-bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bars span:nth-child(3) { top: 7px; transform: rotate(-45deg); }
.site-nav-bar .nav-toggle-bars span { background: var(--header-text, #fff); }

/* Optional header banner image, set in Settings → Appearance.
   --banner-height / --banner-bg are optional (set via the "Banner
   size" / "Banner background colour" settings, injected as :root vars
   in theme/header.php) — themes and existing sites that don't set them
   get exactly the previous look: the image just scales to its own
   aspect ratio with no fixed box and no visible background of its own. */
.site-banner {
    width: 80%;
    margin: 0 auto;
    padding: 1.5rem 0;
    background: var(--banner-bg, transparent);
}
.site-banner img {
    width: 100%;
    height: var(--banner-height, auto);
    object-fit: contain;
    display: block;
}

/* "Banner with nav below" header layout: full-bleed banner image with
   no border, followed by its own full-width nav bar. Uses the same
   --header-* theme variables as the classic layout's optional dark
   header, falling back to sensible dark defaults if a theme doesn't
   set them, since this layout is built around contrast with a photo. */
.site-banner-full { width: 100%; background: var(--banner-bg, transparent); }
.site-banner-full a { display: block; }
.site-banner-full img { width: 100%; height: var(--banner-height, auto); object-fit: contain; display: block; }
.site-nav-bar {
    background: var(--header-bg, #1c1c1c);
    border-bottom: 1px solid var(--color-border);
}
.site-nav-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.site-nav-bar .site-nav { display: flex; padding: 0.85rem 0; }
.site-nav-bar .site-nav a {
    color: var(--header-text, #fff);
    margin-left: 0;
    margin-right: 1.5rem;
}
.site-nav-bar .site-nav a:first-child { margin-left: 0; }
.site-nav-bar .site-nav a:hover,
.site-nav-bar .site-nav a.active { color: var(--header-accent, var(--color-accent)); }
.site-nav-bar .nav-toggle { margin-left: auto; }

/* Main */
.site-main { padding: 2.5rem 1.25rem 3rem; }

.post-meta {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-top: -0.5em;
}

.post-summary {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--color-border);
}
.post-summary h2 { margin-top: 0; }
.post-summary h2 a { text-decoration: none; color: var(--color-text); }
.post-summary h2 a:hover { color: var(--color-accent); }

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.archive-heading { margin-bottom: 0.25rem; }

/* Category badges, shown on post summaries and single posts */
.post-categories { margin: 0.25rem 0 1em; }
.post-categories a {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.15rem 0.6rem;
    margin: 0 0.35rem 0.35rem 0;
    border-radius: 999px;
    background: #eef0ee;
    background: color-mix(in srgb, var(--color-accent) 12%, transparent);
    color: var(--color-accent);
    text-decoration: none;
}
.post-categories a:hover { opacity: 0.75; }

/* Footer
   --footer-bg / --footer-text are optional (see THEMES.md); themes that
   don't set them keep the original plain, borderless-background look. */
.site-footer {
    background: var(--footer-bg, transparent);
    border-top: 1px solid var(--footer-bg, var(--color-border));
    padding: 1.5rem 0;
    color: var(--footer-text, var(--color-muted));
    font-size: 0.85rem;
}
.site-footer .fine-print { margin: 0; }
.site-footer a { color: inherit; }

/* Two-column layout for pages/blog with a sidebar */
.layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}
.layout-sidebar-left { flex-direction: row-reverse; }
.layout-content { flex: 1; min-width: 0; }

/* --sidebar-bg / --sidebar-text are optional (see THEMES.md); a little
   padding and rounded corners are always applied so a background color,
   when set, looks intentional rather than a plain color block. */
.layout-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg, transparent);
    color: var(--sidebar-text, var(--color-text));
    padding: 1.25rem;
    border-radius: 8px;
}

.sidebar-widget { margin-bottom: 2rem; }
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sidebar-text, var(--color-muted));
    opacity: 0.75;
    margin: 0 0 0.75rem;
}
.sidebar-widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar-widget li { margin-bottom: 0.5rem; font-size: 0.92rem; }
.sidebar-widget a { text-decoration: none; color: inherit; }
.sidebar-widget a:hover { text-decoration: underline; }
.sidebar-widget .count { opacity: 0.7; font-size: 0.85em; }
.sidebar-widget.custom-html { font-size: 0.92rem; }

/* Contact form (rendered by the [contact-form] shortcode) */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 480px; margin-top: 1.5rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; }
.contact-form input, .contact-form textarea {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: normal;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}
.contact-form button {
    align-self: flex-start;
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.contact-form button:hover { opacity: 0.9; }
.contact-form-trap { position: absolute; left: -9999px; top: -9999px; }
.contact-form-success, .contact-form-error, .contact-form-notice {
    padding: 0.85rem 1.1rem;
    border-radius: 6px;
    margin: 1.25rem 0;
    font-size: 0.92rem;
}
.contact-form-success { background: #dff3e8; color: #1c6b41; }
.contact-form-error { background: #fbe5e3; color: #b3261e; }
.contact-form-notice { background: #fff3cd; color: #8a6d1d; }

/* Hero section — an image with centered text over it. Paste a block
   like this into any page's content (swap the image URL for your own,
   uploaded via Media):

   <div class="hero">
     <img class="hero-bg" src="/uploads/your-image.jpg" alt="">
     <div class="hero-content">
       <h1 class="hero-title">Heading</h1>
       <div class="hero-accent"></div>
       <p class="hero-subtitle">Subtitle text</p>
     </div>
   </div>
*/
.hero { position: relative; text-align: center; padding: 4.5rem 1.5rem; border-radius: 8px; overflow: hidden; margin: 0 0 2.5rem; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; border-radius: 0; }
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.6); z-index: 1; }
.hero-content { position: relative; z-index: 2; }
.hero-title { margin: 0 0 0.5rem; font-size: 2.3rem; }
.hero-accent { width: 56px; height: 4px; background: var(--color-accent); margin: 0.9rem auto 1.1rem; border-radius: 2px; }
.hero-subtitle { margin: 0; font-size: 1.1rem; color: var(--color-muted); }

/* Feature grid — a row of icon + heading + text. Paste a block like
   this into any page's content, repeating .feature-item as needed:

   <div class="feature-grid">
     <div class="feature-item">
       <div class="feature-icon">&#9733;</div>
       <h3>Heading</h3>
       <p>Description text.</p>
     </div>
   </div>
*/
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2rem; margin: 2.5rem 0; text-align: center; }
.feature-item h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.feature-item p { margin: 0; color: var(--color-muted); font-size: 0.92rem; }
.feature-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.85rem; font-size: 1.3rem; color: #fff;
    background: var(--color-accent);
}
.feature-icon.alt { background: var(--header-bg, var(--color-text)); }

/* FAQ / accordion — built on native <details>/<summary>, so it needs no
   JavaScript at all. Paste a block like this into any page's content:

   <div class="faq">
     <details class="faq-item">
       <summary>Question goes here?</summary>
       <div class="faq-answer"><p>Answer text goes here.</p></div>
     </details>
   </div>
*/
.faq { margin: 2rem 0; }
.faq-item {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 2.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--color-accent);
    transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-answer { padding: 0 1.25rem 1.1rem; color: var(--color-muted); }
.faq-answer p:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
    .layout, .layout-sidebar-left { flex-direction: column; }
    .layout-sidebar { width: auto; }

    .nav-toggle { display: flex; }

    .site-search-form { width: 100%; order: 2; margin: 0.5rem 0 0; }
    .site-search-form input { width: auto; flex: 1; max-width: none; }

    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
    }
    .site-nav.is-open { display: flex; padding-top: 0.5rem; }
    .site-header .site-nav a {
        margin: 0;
        padding: 0.7rem 0;
        border-top: 1px solid var(--color-border);
    }
    .site-header .site-nav a:first-child { border-top: none; }

    .site-nav-bar .wrap { padding: 0.6rem 1.25rem; }
    .site-nav-bar .site-nav { padding: 0; }
    .site-nav-bar .site-nav.is-open { padding-bottom: 0.5rem; }
    .site-nav-bar .site-nav a {
        margin: 0;
        padding: 0.7rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    .site-nav-bar .site-nav a:first-child { border-top: none; }
}

/* Maintenance mode page */
.maintenance-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}
.maintenance-box { max-width: 480px; text-align: center; }
.maintenance-image { max-width: 100%; border-radius: 8px; margin-bottom: 1.5rem; }
.maintenance-box h1 { margin-bottom: 0.75rem; }
.maintenance-box p { color: var(--color-muted); font-size: 1.05rem; }

/* Preview-mode banner (only shown to logged-in editors viewing
   unpublished content via a Preview link) */
.preview-banner {
    background: #a33b2e;
    color: #fff;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
}

/* Cookie consent banner */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: var(--header-bg, #1c2438);
    color: var(--header-text, #fff);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.25);
}
.cookie-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner-text { font-size: 0.9rem; line-height: 1.5; flex: 1; min-width: 240px; }
.cookie-banner-text a { color: inherit; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }
.cookie-btn {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
}
.cookie-btn-primary { background: var(--header-accent, var(--color-accent)); color: #fff; }
.cookie-btn-secondary { background: transparent; color: inherit; border-color: currentColor; }
.cookie-btn:hover { opacity: 0.9; }
.cookie-settings-link { color: inherit; }

@media (max-width: 560px) {
    .cookie-banner-actions { width: 100%; }
    .cookie-btn { flex: 1; }
}
