/* ==========================================================================
   Page content blocks (CMS → Pages → Page Content editor → "Insert block").
   Everything is scoped to .gc-content, the wrapper the public views put around
   Page.BodyHtml (and the class the CMS editor gives its editing area, so the
   editor looks like the live page).

   Responsive by CONTAINER width, not viewport: columns stack when the content
   column itself is narrow — on phones, and in the editor's "Phone" preview.
   Colours follow the site: hotel-site theme vars when present, else chain vars.
   ========================================================================== */

.gc-content {
    container-type: inline-size;
    --gc-accent: var(--hs-accent, var(--primary-color, #7f1544));
    --gc-accent-hover: var(--hs-accent-hover, var(--primary-hover, #5f0f33));
    --gc-on-accent: var(--hs-on-accent, #fff);
    --gc-ink: var(--hs-ink, var(--text-dark, #2d2d2d));
    --gc-muted: var(--hs-muted, var(--text-gray, #6c757d));
    --gc-soft: var(--hs-cream, #f7f3ef);
    --gc-line: var(--hs-line, #e6e0d8);
    --gc-card-bg: var(--hs-cream, #fff);   /* hotel-site surface (dark on Noir), white on the chain */
    --gc-radius: 10px;
    --gc-gap: clamp(1rem, 3.5cqi, 2rem);
    overflow-wrap: break-word;
}

/* Vertical rhythm between blocks */
.gc-content .gc-section,
.gc-content .gc-cols,
.gc-content .gc-media,
.gc-content .gc-gallery,
.gc-content .gc-banner,
.gc-content .gc-callout,
.gc-content .gc-cards,
.gc-content .gc-table {
    margin-block: clamp(1.5rem, 5cqi, 2.75rem);
}

/* Inside blocks: no stray top/bottom margins (existing free text keeps the site's spacing). */
.gc-content :is(.gc-section, .gc-cols > *, .gc-media > *, .gc-callout, .gc-card__body) > :first-child { margin-top: 0; }
.gc-content :is(.gc-section, .gc-cols > *, .gc-media > *, .gc-callout, .gc-card__body) > :last-child { margin-bottom: 0; }
.gc-content :is(.gc-section, .gc-cols, .gc-media, .gc-callout, .gc-cards) :is(h2, h3) { line-height: 1.3; margin-bottom: .5em; }

.gc-content img {
    max-width: 100%;
    height: auto !important;          /* the editor's image dialog writes fixed px sizes; keep the ratio */
    border-radius: var(--gc-radius);
}

/* Photos inside layout blocks always fill their slot, whatever size the editor stamped on them. */
.gc-content :is(.gc-media > figure, .gc-gallery, .gc-banner, .gc-card) img {
    width: 100% !important;
}

.gc-content figure { margin: 0; }
.gc-content figcaption {
    margin-top: .5rem;
    font-size: .875rem;
    color: var(--gc-muted);
}

/* ── Section (heading + text), optional soft background ───────────────── */
.gc-content .gc-section--soft {
    background: var(--gc-soft);
    border-radius: var(--gc-radius);
    padding: clamp(1.25rem, 5cqi, 2.5rem);
}

/* ── Columns ──────────────────────────────────────────────────────────── */
.gc-content .gc-cols {
    display: grid;
    gap: var(--gc-gap);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gc-content .gc-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Image + text ─────────────────────────────────────────────────────── */
.gc-content .gc-media {
    display: grid;
    gap: var(--gc-gap);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
}
.gc-content .gc-media > figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.gc-content .gc-media--reverse > figure { order: 2; }

/* ── Photo grid ───────────────────────────────────────────────────────── */
.gc-content .gc-gallery {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gc-content .gc-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

/* ── Full-width banner image ──────────────────────────────────────────── */
.gc-content .gc-banner img {
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    display: block;
}

/* ── Highlight box ────────────────────────────────────────────────────── */
.gc-content .gc-callout {
    background: var(--gc-soft);
    border-inline-start: 4px solid var(--gc-accent);
    border-radius: var(--gc-radius);
    padding: clamp(1rem, 4cqi, 1.75rem) clamp(1.25rem, 5cqi, 2rem);
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.gc-content .gc-cards {
    display: grid;
    gap: var(--gc-gap);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gc-content .gc-card {
    border: 1px solid var(--gc-line);
    border-radius: var(--gc-radius);
    overflow: hidden;
    background: var(--gc-card-bg);
    display: flex;
    flex-direction: column;
}
.gc-content .gc-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 0;
    display: block;
}
.gc-content .gc-card__body { padding: 1rem 1.25rem 1.25rem; }
/* Cards inserted from the CMS (rooms, halls, hotels…): linked photo + title, hotel name above. */
.gc-content .gc-card > a { display: block; }
.gc-content .gc-card h3 a { color: inherit; text-decoration: none; }
.gc-content .gc-card h3 a:hover { color: var(--gc-accent); }
.gc-content .gc-card__meta { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gc-muted); margin: 0 0 .35rem; }

/* ── Button (beats the site's ".page-content a" underline/colour) ─────── */
.gc-content a.gc-button,
.gc-content a.gc-button:hover {
    display: inline-block;
    padding: .75em 1.6em;
    border-radius: 999px;
    background: var(--gc-accent);
    color: var(--gc-on-accent);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s ease;
}
.gc-content a.gc-button:hover { background: var(--gc-accent-hover); }
.gc-content .gc-center { text-align: center; }

/* ── Tables (block or plain inserted table) ───────────────────────────── */
.gc-content .gc-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gc-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.gc-content th,
.gc-content td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--gc-line);
    text-align: start;
    vertical-align: top;
}
.gc-content thead th,
.gc-content tr:first-child th {
    background: var(--gc-soft);
    font-weight: 600;
}

/* ── Divider ──────────────────────────────────────────────────────────── */
.gc-content hr.gc-divider {
    border: 0;
    height: 1px;
    background: var(--gc-line);
    margin-block: clamp(1.5rem, 6cqi, 3rem);
    opacity: 1;
}

/* ── Tablet: 3-up grids become 2-up ───────────────────────────────────── */
@container (max-width: 860px) {
    .gc-content .gc-cols-3,
    .gc-content .gc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Phone: everything stacks ─────────────────────────────────────────── */
@container (max-width: 600px) {
    .gc-content .gc-cols,
    .gc-content .gc-cols-3,
    .gc-content .gc-media,
    .gc-content .gc-cards { grid-template-columns: minmax(0, 1fr); }
    .gc-content .gc-media--reverse > figure { order: 0; }
    .gc-content .gc-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gc-content .gc-banner img { aspect-ratio: 4 / 3; }
    /* A plain table that isn't inside .gc-table still scrolls instead of overflowing. */
    .gc-content > table { display: block; overflow-x: auto; }
}

/* ── Editor only: outline the layout so empty columns are findable ─────── */
.gc-editing .gc-cols > *,
.gc-editing .gc-media > *,
.gc-editing .gc-card,
.gc-editing .gc-section {
    outline: 1px dashed rgba(111, 66, 193, .35);
    outline-offset: 4px;
}
.gc-editing img { cursor: pointer; }
