/*
 * Shared components of the approved design (assets/source/01-home and 02-ficha-de-viaje,
 * base.css + mobile.css): buttons and their core/button block styles, links, curves,
 * textile band, «Ruta Nº» plate, trip card, contact band and the two editor text formats.
 * Eyebrows and section heads are in base.css.
 *
 * Specificity notes (GeneratePress rules that these components have to beat):
 * - GP paints core buttons with a.wp-block-button__link:not(.has-background) (0,2,1) and
 *   its :hover/:focus/:active (0,3,1). The button rule below weighs the same (0,2,1 and
 *   0,3,1 with states) and loads later, so it wins without !important.
 * - GP colours every link on hover (a:hover, a:focus, a:active → 0,1,1). Component links
 *   repeat their colour for those states.
 * - Sizes and colours of buttons are custom properties (--btn-*), so a section can resize
 *   or recolour a button from home.css / trip.css with a single class, e.g.
 *   .trip-panel__btn{--btn-bg:var(--color-terracotta-dark);--btn-bg-h:var(--color-rust)}.
 */

/* ==========================================================================
   Buttons: .btn classes (GenerateBlocks links) and core/button block styles
   ========================================================================== */

/* Variants: colours (idle and hover) */
.btn--primary,
.wp-block-button:not([class*="is-style-"]),
.wp-block-button.is-style-btn-primary,
.wp-block-button.is-style-btn-primary-arrow{
  --btn-bg:var(--color-terracotta);--btn-fg:var(--color-white);--btn-bd:transparent;
  --btn-bg-h:var(--color-terracotta-dark);--btn-fg-h:var(--color-white);--btn-bd-h:transparent;
}
.btn--outline,
.wp-block-button.is-style-btn-outline{
  --btn-bg:transparent;--btn-fg:var(--color-night);--btn-bd:var(--color-night);
  --btn-bg-h:var(--color-night);--btn-fg-h:var(--color-sand);--btn-bd-h:var(--color-night);
}
.btn--light,
.wp-block-button.is-style-btn-light-arrow{
  --btn-bg:var(--color-ochre);--btn-fg:var(--color-night);--btn-bd:transparent;
  --btn-bg-h:var(--color-sand);--btn-fg-h:var(--color-night);--btn-bd-h:transparent;
}

/*
 * Sizes. The filled block styles are always large, as every filled button of the approved
 * design (hero, contact band, trip hero): the client only picks a style. «Contorno» keeps
 * the standard 48px. The btn--lg / btn--sm classes also work on a core/button.
 */
.btn--lg,
.wp-block-button.btn--lg,
.wp-block-button:not([class*="is-style-"]),
.wp-block-button.is-style-btn-primary,
.wp-block-button.is-style-btn-primary-arrow,
.wp-block-button.is-style-btn-light-arrow{
  --btn-h:56px;--btn-pad:0 var(--space-xl) 0 calc(var(--space-xl) + 4px);--btn-fs:var(--fs-btn);
}
.btn--sm,
.wp-block-button.btn--sm{
  --btn-h:44px;--btn-pad:0 var(--space-lg);--btn-fs:var(--fs-xs);
}

/* Painter: Russo One poster lettering in a pill. :is(a,div) also matches the editor's RichText div. */
:is(.btn, .wp-block-button:where(:not(.is-style-link-light,.is-style-link-arrow)) > .wp-block-button__link:is(a,div)){
  display:inline-flex;align-items:center;justify-content:center;gap:var(--space-xs);
  box-sizing:border-box;min-height:var(--btn-h,48px);padding:var(--btn-pad,0 var(--space-xl));
  font-family:var(--font-accent);font-weight:400;font-size:var(--btn-fs,var(--fs-btn));line-height:1.6;
  letter-spacing:.08em;text-transform:uppercase;text-decoration:none;text-align:center;
  border:2px solid var(--btn-bd,transparent);border-radius:var(--radius-pill);box-shadow:none;
  transition:background-color .2s,color .2s,border-color .2s;
}
:is(.btn, .wp-block-button:where(:not(.is-style-link-light,.is-style-link-arrow)) > .wp-block-button__link:is(a,div)),
:is(.btn, .wp-block-button:where(:not(.is-style-link-light,.is-style-link-arrow)) > .wp-block-button__link:is(a,div)):is(:link,:visited,:focus,:active){
  background-color:var(--btn-bg,var(--color-terracotta));color:var(--btn-fg,var(--color-white));border-color:var(--btn-bd,transparent);
}
:is(.btn, .wp-block-button:where(:not(.is-style-link-light,.is-style-link-arrow)) > .wp-block-button__link:is(a,div)):hover{
  background-color:var(--btn-bg-h,var(--color-terracotta-dark));color:var(--btn-fg-h,var(--color-white));border-color:var(--btn-bd-h,transparent);
}

/* Arrow of «Ver viajes» / «Escríbenos» (approved 20×20 SVG), drawn by CSS so it cannot be deleted */
:is(.btn--arrow, .wp-block-button:is(.is-style-btn-primary-arrow,.is-style-btn-light-arrow) > .wp-block-button__link)::after{
  content:"";flex:none;width:20px;height:20px;background-color:currentColor;
  -webkit-mask:var(--icon-arrow) center / contain no-repeat;mask:var(--icon-arrow) center / contain no-repeat;
}

/* Light link over a photo («Hablar con un experto», «Ver todos los viajes» in the trip close) */
:is(.link-light, .wp-block-button.is-style-link-light > .wp-block-button__link:is(a,div)){
  display:inline-flex;align-items:center;min-height:44px;padding:0;
  font-family:var(--font-body);font-weight:500;font-size:inherit;line-height:inherit;letter-spacing:normal;text-transform:none;
  text-decoration:underline;text-decoration-color:var(--color-ochre);text-decoration-thickness:2px;text-underline-offset:6px;
  background:none;border:0;border-radius:0;box-shadow:none;
}
:is(.link-light, .wp-block-button.is-style-link-light > .wp-block-button__link:is(a,div)),
:is(.link-light, .wp-block-button.is-style-link-light > .wp-block-button__link:is(a,div)):is(:link,:visited,:hover,:focus,:active){
  color:var(--color-sand);background:none;
}

/* Arrow link («Conoce al equipo →»). In a GenerateBlocks link the arrow is part of the text; the block style adds it */
:is(.link-arrow, .wp-block-button.is-style-link-arrow > .wp-block-button__link:is(a,div)){
  display:inline-flex;align-items:center;gap:var(--space-xs);min-height:44px;padding:0;
  font-family:var(--font-body);font-weight:700;font-size:inherit;line-height:inherit;letter-spacing:normal;text-transform:none;
  text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px;
  background:none;border:0;border-radius:0;box-shadow:none;
}
:is(.link-arrow, .wp-block-button.is-style-link-arrow > .wp-block-button__link:is(a,div)),
:is(.link-arrow, .wp-block-button.is-style-link-arrow > .wp-block-button__link:is(a,div)):is(:link,:visited,:hover,:focus,:active){
  color:var(--color-terracotta-dark);background:none;
}
/*
 * Text arrow «→» of «Conoce al equipo», «Ver viaje» and «Ver viajes». The Google Fonts «latin» subset of
 * DM Sans (Font Library) lacks U+2192, so a typed «→» falls back to a system font with another shape.
 * It is drawn as a mask in the text colour, sized in em like the approved DM Sans Bold glyph, and it is
 * decoration only (empty alternative text). .vac-text-arrow lets any other component reuse it.
 */
:is(.wp-block-button.is-style-link-arrow > .wp-block-button__link, .trip-card__more, .dest-card__more, .vac-text-arrow)::after{
  content:"";content:"" / "";display:inline-block;flex:none;width:.82em;height:.82em;margin-left:.3em;vertical-align:-.08em;background-color:currentColor;
  -webkit-mask:var(--icon-arrow-text) center / contain no-repeat;mask:var(--icon-arrow-text) center / contain no-repeat;
}
/* In the inline-flex link the gap already separates the arrow */
.wp-block-button.is-style-link-arrow > .wp-block-button__link::after{margin-left:0}

/* ==========================================================================
   Text formats of the editor (editor-formats.js)
   ========================================================================== */

/* «Texto destacado»: second voice inside one heading */
.title-accent{color:var(--color-ochre)}
.trip-hero__title .title-accent,
.site-footer__tagline .title-accent{display:block}
/* Contact band: the second line in Russo One, smaller than the Fraunces line (approved .contact-band__title-accent) */
:is(.contact-band__title .title-accent, .contact-band__title-accent){display:block;margin-top:var(--space-sm);font-family:var(--font-accent);font-weight:400;font-size:var(--fs-contact-accent);line-height:1.1;letter-spacing:var(--ls-accent-title);color:var(--color-ochre)}

/* «Solo en pantallas grandes»: hidden on mobile (approved .hero__lead-extra) */
@media (max-width:767px){
  .hide-mobile,.hero__lead-extra{display:none}
}

/* ==========================================================================
   Curves between sections (decorative; the client cannot delete them)
   Approved inline SVGs with preserveAspectRatio="none", here as CSS masks painted with
   the Global Color, on ::after (bottom) or ::before (top) of the section.
   Home shapes by default; .curve--wave switches to the trip page shapes.
   ========================================================================== */
:root{
  --icon-arrow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10h12M11 5l5 5-5 5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Same arrow cropped to its own box, for the arrow that follows a text (bold stroke) */
  --icon-arrow-text:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2.9 3.9 14.2 12.2'%3E%3Cpath d='M4 10h12M11 5l5 5-5 5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --curve-shape-hero:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120C420 120 1000 72 1440 0V120Z'/%3E%3C/svg%3E");
  --curve-shape-destinations:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 0C440 0 1040 52 1440 120H0Z'/%3E%3C/svg%3E");
  --curve-shape-contact:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440C1020 36 440 120 0 120Z'/%3E%3C/svg%3E");
  --curve-shape-trip-hero:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0 110V58C180 92 420 104 720 70S1220 18 1440 46V110Z'/%3E%3C/svg%3E");
  --curve-shape-includes:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V52C1240 88 1000 96 720 62S200 12 0 44Z'/%3E%3C/svg%3E");
  --curve-shape-trip-contact:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V40C1180 84 900 100 640 66S180 20 0 58Z'/%3E%3C/svg%3E");
}

:where(.curve-bottom--to-sand,.curve-bottom--to-ochre,.curve-top--from-ochre,.curve-top--to-sand){position:relative}

.curve-bottom--to-sand::after,
.curve-bottom--to-ochre::after{
  content:"";position:absolute;left:0;bottom:-1px;width:100%;height:var(--curve);z-index:3;pointer-events:none;
  background-color:var(--curve-bottom-color);
  -webkit-mask:var(--curve-bottom-shape) 0 0 / 100% 100% no-repeat;mask:var(--curve-bottom-shape) 0 0 / 100% 100% no-repeat;
}
.curve-top--from-ochre::before,
.curve-top--to-sand::before{
  content:"";position:absolute;left:0;top:-1px;width:100%;height:var(--curve);z-index:3;pointer-events:none;
  background-color:var(--curve-top-color);
  -webkit-mask:var(--curve-top-shape) 0 0 / 100% 100% no-repeat;mask:var(--curve-top-shape) 0 0 / 100% 100% no-repeat;
}

.curve-bottom--to-sand{--curve-bottom-color:var(--color-sand);--curve-bottom-shape:var(--curve-shape-hero)}
.curve-bottom--to-ochre{--curve-bottom-color:var(--color-ochre-light);--curve-bottom-shape:var(--curve-shape-destinations)}
.curve-top--from-ochre{--curve-top-color:var(--color-ochre-light);--curve-top-shape:var(--curve-shape-contact)}
.curve-top--to-sand{--curve-top-color:var(--color-sand);--curve-top-shape:var(--curve-shape-includes)}
.curve--wave.curve-bottom--to-sand{--curve-bottom-shape:var(--curve-shape-trip-hero)}
.curve--wave.curve-top--from-ochre{--curve-top-shape:var(--curve-shape-trip-contact)}

/* ==========================================================================
   Textile band «Ruta de la Seda» (home, before the itinerary and above the footer)
   ========================================================================== */
.textile-band{display:block;height:var(--band-h);background:
  var(--pattern-mosaic) 0 0 / auto var(--ribbon-h) repeat-x,
  var(--pattern-mosaic) 8px 100% / auto var(--ribbon-h) repeat-x,
  var(--pattern-textile) center / auto var(--textile-h) repeat-x,
  var(--color-terracotta)}

/* ==========================================================================
   «Ruta Nº» plate: trip hero (.plate) and trip card (.trip-card__route)
   ========================================================================== */
.plate,
.trip-card__route{background:var(--color-ochre);color:var(--color-night);font-family:var(--font-accent);font-weight:400;letter-spacing:.04em;line-height:1;border-radius:var(--radius-sm);box-shadow:inset 0 -3px 0 var(--color-night)}

.plate{display:inline-flex;align-items:baseline;gap:var(--space-xs);font-size:var(--fs-plate);padding:10px var(--space-md) 13px;margin-bottom:var(--space-lg)}
.plate__label{font-size:12px;letter-spacing:var(--ls-accent);text-transform:uppercase}

.trip-card__route{position:absolute;z-index:2;top:var(--space-md);left:var(--space-md);display:flex;align-items:baseline;gap:6px;font-size:var(--fs-route);padding:var(--space-xs) var(--space-md) 11px}
.trip-card__route-label{font-family:var(--font-accent);font-size:11px;letter-spacing:var(--ls-accent);text-transform:uppercase}

/* ==========================================================================
   Trip card (GenerateBlocks loop item). The whole card is clickable via ::after on the title link
   ========================================================================== */
.trip-card{position:relative;display:flex;flex-direction:column;background:var(--color-sand-light);border:1px solid var(--color-line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-card);transition:transform .25s,box-shadow .25s}
.trip-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-card-hover)}
.trip-card__media{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--color-night)}
.trip-card__media .photo{transition:transform .4s}
.trip-card:hover .trip-card__media .photo{transform:scale(1.03)}
.trip-card__body{display:flex;flex-direction:column;flex:1;padding:var(--space-lg)}
.trip-card__country{font-weight:700;font-size:var(--fs-xs);line-height:1.6;letter-spacing:.18em;text-transform:uppercase;color:var(--color-terracotta-dark);margin-bottom:var(--space-xs)}
/* Russo One title: real 400 weight (no synthetic bold), two lines at most */
.trip-card__title{font-family:var(--font-accent);font-weight:400;font-size:var(--fs-trip);line-height:1.3;letter-spacing:var(--ls-accent-title);color:var(--color-night);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:calc(2 * 1.3em);margin-bottom:var(--space-lg)}
.trip-card__title a,
.trip-card__title a:is(:hover,:focus,:active,:visited){color:inherit;text-decoration:none}
.trip-card__title a::after{content:"";position:absolute;inset:0;z-index:3}
.trip-card__footer{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:var(--space-md);padding-top:var(--space-md);border-top:1px dashed rgba(31,26,21,.3)}
.trip-card__meta{display:flex;align-items:baseline;gap:var(--space-md);font-size:var(--fs-small);line-height:1.6;color:var(--color-ink-muted)}
.trip-card__price strong{font-weight:700;color:var(--color-ink);font-size:var(--fs-body)}
.trip-card__more{font-weight:700;font-size:var(--fs-small);line-height:1.6;color:var(--color-terracotta-dark);white-space:nowrap}

/* ==========================================================================
   Contact band (home pattern and trip Hook Element). The photo is a core/image .photo
   inside .contact-band__media; the legibility veil is its ::after (no extra block).
   ========================================================================== */
.contact-band{position:relative;color:var(--color-sand);padding:calc(var(--curve) + var(--space-4xl)) 0 var(--space-4xl);background:var(--color-night);overflow:hidden}
.contact-band__media{position:absolute;inset:0}
.contact-band__media::after{content:"";position:absolute;inset:0;background:var(--color-veil)}
.contact-band__photo{object-position:50% 45%}
.contact-band__inner{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:var(--space-3xl)}
.contact-band__text{max-width:640px}
.contact-band__title{color:var(--color-white);font-size:var(--fs-contact);margin-bottom:var(--space-lg)}
.contact-band__lead{font-size:var(--fs-lead);color:rgba(244,236,221,.9)}
.contact-band__actions{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-md);flex:none;padding:var(--space-xl);background:rgba(12,21,38,.55);border:1px solid var(--color-line-light);border-radius:var(--radius)}
/* core/buttons wrapper of «Escríbenos»: the actions box sets the spacing, not the core 0.5em gap or margins */
.contact-band__actions > .wp-block-buttons{display:flex;gap:0;margin:0}
.contact-band__actions .wp-block-button{margin:0}

/*
 * Contact links. The icon follows the link itself (mailto: / tel:), so the client only
 * fills in the data. The --email / --phone classes give the same icon in the editor,
 * where the href is still the dynamic tag.
 */
:root{
  --icon-phone:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-email:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='14' rx='2' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='m4 7 8 6 8-6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.contact-list{display:flex;flex-direction:column;gap:var(--space-2xs)}
.contact-list__link{display:inline-flex;align-items:center;gap:var(--space-sm);min-height:44px;text-decoration:none;font-weight:500}
.contact-list__link,
.contact-list__link:is(:link,:visited,:hover,:focus,:active){color:var(--color-sand)}
.contact-list__link:hover{text-decoration:underline;text-underline-offset:4px}
.contact-list__link:is([href^="mailto:"],.contact-list__link--email,[href^="tel:"],.contact-list__link--phone)::before{
  content:"";flex:none;width:20px;height:20px;background-color:var(--color-ochre);
  -webkit-mask:var(--contact-icon) center / contain no-repeat;mask:var(--contact-icon) center / contain no-repeat;
}
.contact-list__link:is([href^="mailto:"],.contact-list__link--email){--contact-icon:var(--icon-email)}
.contact-list__link:is([href^="tel:"],.contact-list__link--phone){--contact-icon:var(--icon-phone)}

/* ==========================================================================
   Tablet and mobile
   ========================================================================== */
@media (max-width:767px){
  .plate{margin-bottom:var(--space-md);padding:8px var(--space-sm) 11px}
  .plate__label{font-size:10px}

  .trip-card__media{aspect-ratio:16/10}
  .trip-card__route{top:var(--space-sm);left:var(--space-sm)}
  .trip-card__route-label{font-size:10px}
  .trip-card__body{padding:var(--space-md)}
  .trip-card__title{min-height:0;line-height:1.28;margin-bottom:var(--space-md)}
  .trip-card__meta{gap:var(--space-sm)}

  .textile-band{background:
    var(--pattern-mosaic) 0 0 / auto var(--ribbon-h) repeat-x,
    var(--pattern-mosaic) 6px 100% / auto var(--ribbon-h) repeat-x,
    var(--pattern-textile) center / auto var(--textile-h) repeat-x,
    var(--color-terracotta)}

  /* Full-width buttons under a section and in the contact band (52px in the section foot) */
  .section-foot :is(.btn, .wp-block-button){--btn-h:52px}
  .section-foot .wp-block-button,
  .contact-band__actions .wp-block-button{width:100%}
  .section-foot :is(.btn, .wp-block-button > .wp-block-button__link),
  .contact-band__actions :is(.btn, .wp-block-button > .wp-block-button__link){width:100%}
  .link-arrow,
  .wp-block-button.is-style-link-arrow,
  .wp-block-button.is-style-link-arrow > .wp-block-button__link{width:100%;justify-content:flex-start}

  .contact-band{padding:calc(var(--curve) + var(--space-2xl)) 0 var(--space-3xl)}
  .contact-band__inner{flex-direction:column;align-items:stretch;gap:var(--space-xl)}
  .contact-band__title{margin-bottom:var(--space-md)}
  :is(.contact-band__title .title-accent, .contact-band__title-accent){margin-top:var(--space-xs);letter-spacing:0}
  .contact-band__actions{align-items:stretch;padding:var(--space-md)}
  .contact-band__actions .link-light{justify-content:center}
  /* Trip close band: 52px button (approved 02 mobile.css) */
  .single-trip .contact-band__actions :is(.btn, .wp-block-button){--btn-h:52px}
  .contact-list__link{min-height:48px;width:100%;border-bottom:1px solid var(--color-line-light)}
  .contact-list > :last-child .contact-list__link{border-bottom:none}
}

@media (prefers-reduced-motion:reduce){
  .trip-card:hover{transform:none}
  .trip-card:hover .trip-card__media .photo{transform:none}
}
